Search found 223 matches

by DenDev
Fri Feb 06, 2015 7:52 pm
Forum: C++ Development
Topic: wxPanel in wxDialog - EVT_PAINT for panel only once
Replies: 21
Views: 2595

Re: wxPanel in wxDialog - EVT_PAINT for panel only once

What updates made to the panel are not causing the paint event to get fired?

EDIT: "Unhiding" might cause a buffered image of the dialog to be displayed. You could try to place a "panel->Refresh(false)" statement in the OnShow event handler (using the "wxEVT_SHOW" event) of the dialog.
by DenDev
Fri Feb 06, 2015 6:28 pm
Forum: C++ Development
Topic: wxPanel in wxDialog - EVT_PAINT for panel only once
Replies: 21
Views: 2595

Re: wxPanel in wxDialog - EVT_PAINT for panel only once

Dunno if it is relevant but if you need to continuosly update the panel (animate) you could bind a wxEVT_IDLE event to the parent window and then call the panels Refresh method. MyFrame::MyFrame() { //Constructor stuff Connect(wxID_ANY, wxEVT_IDLE, (wxObjectEventFunction)&MyFrame::OnIdle); } MyFrame...
by DenDev
Tue Feb 03, 2015 3:02 pm
Forum: C++ Development
Topic: wxFFile::ReadAll() is not Reading All
Replies: 10
Views: 1820

Re: wxFFile::ReadAll() is not Reading All

In my toolbox i have the following function which can be used to loop through multiple lines of text loaded in binary mode from a file: wxString GetSubLine(wxString &from, size_t &offset) { //Coded by Torben Bruchhaus @ 2014 //Copies whatever content starts at "offset" and stops //at first encounter...
by DenDev
Tue Feb 03, 2015 1:14 pm
Forum: C++ Development
Topic: wxFFile::ReadAll() is not Reading All
Replies: 10
Views: 1820

Re: wxFFile::ReadAll() is not Reading All

Sorry, did not see that. I have testet the snippet with wxFFile, and ReadAll stops at the substitute character. Changing the open mode to "rb" as suggested by doublemax solves this :-)
by DenDev
Tue Feb 03, 2015 12:36 pm
Forum: C++ Development
Topic: wxFFile::ReadAll() is not Reading All
Replies: 10
Views: 1820

Re: wxFFile::ReadAll() is not Reading All

I've made this snippet: wxString Test_wxFile_ReadAll() { wxString fn = "D:\\test_file.txt"; wxString test = "This is a test that\x1A includes a substitute character"; std::ofstream ofs(fn.c_str(), std::fstream::out | std::fstream::binary); if (!ofs.good()) return "Create file error"; ofs.write(test....
by DenDev
Mon Feb 02, 2015 6:24 pm
Forum: C++ Development
Topic: wxFFile::ReadAll() is not Reading All
Replies: 10
Views: 1820

Re: wxFFile::ReadAll() is not Reading All

The 1A character is most likely the culprit, it is named the substitute character which is basicly an "errorneous character". I believe that ReadAll does read the entire file but the conversion (done by wxString(char, encoding)) stops at the substitute character since it signals an error. http://en....
by DenDev
Sat Jan 31, 2015 12:20 pm
Forum: C++ Development
Topic: How to make wxTextCtrl transparent
Replies: 2
Views: 690

Re: How to make wxTextCtrl transparent

What about using the style wxNO_BORDER and set the background color of the control to the same color as the parent window?
by DenDev
Wed Jan 28, 2015 1:46 pm
Forum: C++ Development
Topic: wxBitmapToggleButton images
Replies: 2
Views: 506

Re: wxBitmapToggleButton images

It should be straght forward to write you own control that reacts to wxEVT_SET_FOCUS, wxEVT_KILL_FOCUS , wxEVT_ENTER_WINDOW and wxEVT_LEAVE_WINDOW. You could also just bind the events to the parent window and adjust the bitmap in the event handlers.
by DenDev
Mon Jan 26, 2015 12:49 pm
Forum: C++ Development
Topic: wxThread run and pause and exit application
Replies: 4
Views: 726

Re: wxThread run and pause and exit application

Threads are not supposed to be suspended and resumed - this feature is intended for debuggers and nothing good comes from using it in an application (dunno why wxWidgets supports it at all). You can create your own pause-loop: void MyThread::Run() { while (IsAlive()) if (IsSecurilyPaused()) Yield();...
by DenDev
Thu Jan 22, 2015 1:55 pm
Forum: C++ Development
Topic: Irradic AppCrash with wxChoice
Replies: 5
Views: 894

Re: Irradic AppCrash with wxChoice

It is not possible completely to avoid (string) pointers since my application uses them as client data for list items etc. which again can be used as items for choices. I could use a wxArrayString *sl = new wxArrayString() as item data instead but this would in the end being "same soup different cup...
by DenDev
Thu Jan 22, 2015 12:31 pm
Forum: C++ Development
Topic: Irradic AppCrash with wxChoice
Replies: 5
Views: 894

Re: Irradic AppCrash with wxChoice

So I've adjusted my code and given the application some testing time and it seems like the missing [] was the culprit, dunno how I could have slipped those :oops: wxString *s = new wxString(); wxString *a = new wxString[5]; //.. delete s; delete a; Different constructors but equal destructors and si...
by DenDev
Mon Jan 19, 2015 4:36 pm
Forum: C++ Development
Topic: Irradic AppCrash with wxChoice
Replies: 5
Views: 894

Re: Irradic AppCrash with wxChoice

Thank you for your suggestions! I will experiment with those and reply back! :D
by DenDev
Mon Jan 19, 2015 2:41 pm
Forum: C++ Development
Topic: Irradic AppCrash with wxChoice
Replies: 5
Views: 894

Irradic AppCrash with wxChoice

I have an issue that might be related to my code, to Windows or to wxWidgets. I'm coding on Win7 64bit HP with Code::Blocks 12.13 using MinGW 32bit 4.8.1 and wxWidgets 3.0.0 (I'm planning to update when time is available). Here is my issue: The following code "works" but will lead to irradic (and ha...