Search found 66 matches
- Mon Aug 18, 2014 3:43 pm
- Forum: C++ Development
- Topic: Composition with wxGraphicsContext
- Replies: 0
- Views: 1150
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...
- Wed Nov 14, 2012 6:18 pm
- Forum: C++ Development
- Topic: wxGraphicsContext not working right
- Replies: 3
- Views: 2862
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
- Wed Nov 14, 2012 6:14 pm
- Forum: C++ Development
- Topic: wxGraphicsContext not working right
- Replies: 3
- Views: 2862
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 = wxGraphi...
- Wed Nov 14, 2012 1:32 pm
- Forum: C++ Development
- Topic: wxGraphicsContext not working right
- Replies: 3
- Views: 2862
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...
- Wed Nov 14, 2012 1:23 pm
- Forum: C++ Development
- Topic: Threads
- Replies: 6
- Views: 2324
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!
- Wed Nov 14, 2012 1:20 pm
- Forum: C++ Development
- Topic: Application freeze while long operation takes place
- Replies: 3
- Views: 1882
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 !
This should flush the event loop and will keep your log window up to date.
Call it after each wxLogMessage call.
Good luck !
- Thu Mar 01, 2012 7:46 am
- Forum: C++ Development
- Topic: Parameterize a func in wxCommandEventHandler
- Replies: 5
- Views: 2371
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.
You can use a "switch ( evt.GetId() ) { ... }" to change behaviour depending on the ID.
- Wed Feb 29, 2012 5:12 pm
- Forum: C++ Development
- Topic: ShowModal() and background of wxTextCtrl
- Replies: 8
- Views: 3516
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...
- Tue Feb 14, 2012 1:42 pm
- Forum: C++ Development
- Topic: EVT_CLOSE of wxDialog
- Replies: 11
- Views: 13415
Re: EVT_CLOSE of wxDialog
You should use :
And not create your own buttons.
Also you should call EndModal with an appropriate value in OnClose :
Code: Select all
wxDialog::CreateStdDialogButtonSizer ( wxOK | wxCANCEL )
Also you should call EndModal with an appropriate value in OnClose :
Code: Select all
void TestDlg::OnClose(wxCloseEvent& event)
{
wxDialog::EndModal( wxID_CANCEL );
}
- 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: 2081
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 ?
Is it joinable or detached ?
Do you create it on the stack or on the pile ?
- Mon Feb 13, 2012 2:10 pm
- Forum: C++ Development
- Topic: "Connecting"-animation with wxAnimation
- Replies: 3
- Views: 1517
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 !
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 !
- Mon Feb 13, 2012 1:48 pm
- Forum: C++ Development
- Topic: "Connecting"-animation with wxAnimation
- Replies: 3
- Views: 1517
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...
- Mon Feb 13, 2012 9:26 am
- Forum: C++ Development
- Topic: How to insert an item in between wxListCtrl
- Replies: 5
- Views: 2071
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...
- 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: 2707
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); // ...
- Fri Feb 10, 2012 1:12 pm
- Forum: Compiler / Linking / IDE Related
- Topic: GNU Make issue
- Replies: 3
- Views: 1701
Re: GNU Make issue
You need to run :
again.
Code: Select all
export MAKE=gmake; ./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared