Search found 66 matches

by catalyn269
Mon Aug 18, 2014 3:43 pm
Forum: C++ Development
Topic: Composition with wxGraphicsContext
Replies: 0
Views: 852

Composition with wxGraphicsContext

Hello, I've run into quite a bit of hassle trying to composite images using wxGraphicsContext and I hope someone can shed some light into this. What I want to do is animate some text on the screen. The text should be drawn with a gradient brush onto a white surface. I found a way to do this, the res...
by catalyn269
Wed Nov 14, 2012 6:18 pm
Forum: C++ Development
Topic: wxGraphicsContext not working right
Replies: 3
Views: 2085

Re: wxGraphicsContext not working right

Actually using a wxPaintDC instead of the wxBufferedPaintDC works just as well and I no longer need to clear the background
by catalyn269
Wed Nov 14, 2012 6:14 pm
Forum: C++ Development
Topic: wxGraphicsContext not working right
Replies: 3
Views: 2085

Re: wxGraphicsContext not working right

Thanks doublemax ! I figured it out. I needed to clean the buffer and then do the drawing. Also, the crashes stopped when I removed the wxLogMessage. Here's the new code : void SliderPnl::OnPaint( wxPaintEvent& evt ) { wxStopWatch sw; wxBufferedPaintDC pdc(this); wxGraphicsContext* gc = wxGraphicsCo...
by catalyn269
Wed Nov 14, 2012 1:32 pm
Forum: C++ Development
Topic: wxGraphicsContext not working right
Replies: 3
Views: 2085

wxGraphicsContext not working right

Hello, I'm trying to use wxGraphicsContext to draw some lines on screen and it doesn't seem to be working right. Here's the OnPaint handler : void SliderPnl::OnPaint( wxPaintEvent& evt ) { wxStopWatch sw; wxBufferedPaintDC pdc(this); wxGraphicsContext* gc = wxGraphicsContext::Create(pdc); wxSize cls...
by catalyn269
Wed Nov 14, 2012 1:23 pm
Forum: C++ Development
Topic: Threads
Replies: 6
Views: 1793

Re: Threads

If you plan on using the text control to log the threads activity/status, you should use the wxLogMessage functions and set you log target to be your text control. Works like a charm!
by catalyn269
Wed Nov 14, 2012 1:20 pm
Forum: C++ Development
Topic: Application freeze while long operation takes place
Replies: 3
Views: 1300

Re: Application freeze while long operation takes place

What you need if wxApp::wxYield() or wxApp::wxSafeYield() from <wx/app.h>
This should flush the event loop and will keep your log window up to date.
Call it after each wxLogMessage call.

Good luck !
by catalyn269
Thu Mar 01, 2012 7:46 am
Forum: C++ Development
Topic: Parameterize a func in wxCommandEventHandler
Replies: 5
Views: 1593

Re: Parameterize a func in wxCommandEventHandler

In your OnAbout( wxCommandEvent& evt ) the "evt" parameter has the ID of the button that generated the event.
You can use a "switch ( evt.GetId() ) { ... }" to change behaviour depending on the ID.
by catalyn269
Wed Feb 29, 2012 5:12 pm
Forum: C++ Development
Topic: ShowModal() and background of wxTextCtrl
Replies: 8
Views: 2467

Re: ShowModal() and background of wxTextCtrl

Try these code bits : topLevelWindow->Freeze(); // prevent the top level window from updating dlg.ShowModal(); // pop the dialog topLevelWindow->Thaw(); // let the window update itself. or topLevelWindow->SetBackgroundColour( *wxWHITE ); topLevelWindow->SetThemeEnabled(false); dlg.ShowModal(); topLe...
by catalyn269
Tue Feb 14, 2012 1:42 pm
Forum: C++ Development
Topic: EVT_CLOSE of wxDialog
Replies: 11
Views: 10356

Re: EVT_CLOSE of wxDialog

You should use :

Code: Select all

wxDialog::CreateStdDialogButtonSizer  ( wxOK | wxCANCEL ) 
And not create your own buttons.

Also you should call EndModal with an appropriate value in OnClose :

Code: Select all

void TestDlg::OnClose(wxCloseEvent& event)
{
   wxDialog::EndModal( wxID_CANCEL );
}
by catalyn269
Tue Feb 14, 2012 1:21 pm
Forum: Platform Related Issues
Topic: wxThread::Kill() results a crash on Linux for 2.8.12
Replies: 6
Views: 1561

Re: wxThread::Kill() results a crash on Linux for 2.8.12

You have to be a little bit more explicit about how you use the thread :

Is it joinable or detached ?
Do you create it on the stack or on the pile ?
by catalyn269
Mon Feb 13, 2012 2:10 pm
Forum: C++ Development
Topic: "Connecting"-animation with wxAnimation
Replies: 3
Views: 1094

Re: "Connecting"-animation with wxAnimation

I don't know what your need are exactly, but you should look into wxThreadHelper to ease information sharing.
Also the wxThread has quite a good example of how to handle threads ending either because of their finishing processing or because the user requests the app to close !
by catalyn269
Mon Feb 13, 2012 1:48 pm
Forum: C++ Development
Topic: "Connecting"-animation with wxAnimation
Replies: 3
Views: 1094

Re: "Connecting"-animation with wxAnimation

I don't think this is the best solution, but here's what I did to help pass time during a long processing job : 1. I used wxThread and wxThread::Entry() for the long task, 2. The user clicked a button which started the long task, I caught the event in the GUI event loop, - I disabled the controls in...
by catalyn269
Mon Feb 13, 2012 9:26 am
Forum: C++ Development
Topic: How to insert an item in between wxListCtrl
Replies: 5
Views: 1366

Re: How to insert an item in between wxListCtrl

I tested it in 2.9.3, works like a charm : SweepFile* entry = gWorkspace->GetFile(i); wxListItem item; item.SetId(i); item.SetData( entry ); if( entry->IsSelected() ) item.SetState( wxLIST_STATE_SELECTED ); listCtrl->InsertItem( item ); listCtrl->SetItem( i, 0, entry->GetEntryName() ); listCtrl->Set...
by catalyn269
Mon Feb 13, 2012 7:56 am
Forum: Platform Related Issues
Topic: Problems with mnemonic keys and set default key on Windows
Replies: 3
Views: 2270

Re: Problems with mnemonic keys and set default key on Windo

In Windows, frames don't have any background => there is a solid dark gray colour behind your controls. To fix that you can : void DTCSettingsDialog::CreateControls() { wxPanel* topPnl = new wxPanel( this, wxID_ANY ); wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL); topPnl->SetSizer(topSizer); // ...
by catalyn269
Fri Feb 10, 2012 1:12 pm
Forum: Compiler / Linking / IDE Related
Topic: GNU Make issue
Replies: 3
Views: 1244

Re: GNU Make issue

You need to run :

Code: Select all

export MAKE=gmake; ./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared
again.