Search found 13581 matches

by doublemax
Mon Jun 24, 2019 1:28 pm
Forum: C++ Development
Topic: events, secondary threads & app remote control
Replies: 8
Views: 68

Re: events, secondary threads & app remote control

EVT_THREAD( wxEVT_GalleryInitEvent, CX_GalleryPanel::OnInitialize) wxEVT_GalleryInitEvent is an event type. But the first position in the macro is an ID. This ID must match the ID in the event, otherwise the handler will not be called. But the id you set in the event is le->SetId(DataBaseUpdateThre...
by doublemax
Mon Jun 24, 2019 11:56 am
Forum: C++ Development
Topic: Char Array Is Getting Corrupted
Replies: 12
Views: 113

Re: Char Array Is Getting Corrupted

So, does everything work now?
by doublemax
Mon Jun 24, 2019 10:00 am
Forum: C++ Development
Topic: Char Array Is Getting Corrupted
Replies: 12
Views: 113

Re: Char Array Is Getting Corrupted

unsigned int getSize() { return sizeof(objectData); } This won't work. You need to store the size of the data. // correct? delete[] objectData; No. This should happen in the destructor of that class. BTW: Unless you intent to add more functionality to the ResourceObject class, a wxMemoryBuffer woul...
by doublemax
Mon Jun 24, 2019 5:06 am
Forum: C++ Development
Topic: Char Array Is Getting Corrupted
Replies: 12
Views: 113

Re: Char Array Is Getting Corrupted

Please show more code in context. What you're trying to do is a trivial thing, there must be a simple mistake somewhere.
by doublemax
Mon Jun 24, 2019 5:04 am
Forum: C++ Development
Topic: Event Handler with a Returning int
Replies: 5
Views: 36

Re: Event Handler with a Returning int

Please explain what you're trying to achieve.
by doublemax
Sun Jun 23, 2019 9:49 pm
Forum: C++ Development
Topic: How to handle wxEVT_TEXT before is happens?
Replies: 4
Views: 47

Re: How to handle wxEVT_TEXT before is happens?

I want to handle it when I use wxTextEntry::SetValue() , so it get gets validated. Because I am already using a validator, but when using wxTextEntry::SetValue() , no validation occurs. So I need a way to handle it before it occurs. In that case you could call the validator manually: https://docs.w...
by doublemax
Sun Jun 23, 2019 6:30 pm
Forum: C++ Development
Topic: [wxwidgets3.1.2, opengl] A hen and egg problem
Replies: 12
Views: 210

Re: [wxwidgets3.1.2, opengl] A hen and egg problem

I assume the unmodified pyramid sample works for you? If i use your initialization code, including the same wxGLAttributes and wxGLContextAttrs into the pyramid sample, it still works for me. Either try to create a complete, compilable sample that produces the assert, or try to move your code over t...
by doublemax
Sun Jun 23, 2019 6:28 pm
Forum: C++ Development
Topic: Event Handler with a Returning int
Replies: 5
Views: 36

Re: Event Handler with a Returning int

What are the changes for making a return value of int, I got an error when trying. You can't. And even if you could, where do you think you could access that value? What are you trying to do? If you intent to re-use the event handler and call it from somewhere else: Don't. Instead put the actual bo...
by doublemax
Sun Jun 23, 2019 3:44 pm
Forum: C++ Development
Topic: Processing a paste event with a SpinCtrl
Replies: 1
Views: 35

Re: Processing a paste event with a SpinCtrl

You could catch the wxEVT_CHAR event and check for CTRL-V. But this would not be triggered if someone uses the "paste" entry in the context menu. void MyFrame::OnChar(wxKeyEvent &event) { wxLogDebug( wxT("onchar %d"), event.GetKeyCode() ); bool processed = false; if( event.GetKeyCode() == WXK_CONTRO...
by doublemax
Sun Jun 23, 2019 7:40 am
Forum: C++ Development
Topic: How to handle wxEVT_TEXT before is happens?
Replies: 4
Views: 47

Re: How to handle wxEVT_TEXT before is happens?

There is nothing like wxEVT_TEXT_CHANGING. You could catch every single keystroke with wxEVT_CHAR, but you'd need to consider insertion point and possible selection in the text control to predict what it would contain after the key had been processed.
by doublemax
Sun Jun 23, 2019 7:32 am
Forum: C++ Development
Topic: Char Array Is Getting Corrupted
Replies: 12
Views: 113

Re: Char Array Is Getting Corrupted

You must store the size of the array separately. sizeof() will only work for a static array. If you just have a pointer to the array, there is no way to know how much data it contains. And for binary data you can't check for a 0-byte like in strings.
by doublemax
Sat Jun 22, 2019 6:26 pm
Forum: C++ Development
Topic: How to wxIsKindOf class check for a wxTextEntry derived classes?
Replies: 8
Views: 88

Re: How to wxIsKindOf class check for a wxTextEntry derived classes?

I can't think of any elegant way using wxWidgets' RTTI. I would just write a small helper function that checks for all eight classes that derive from wxTextEntry. And if it's a match, cast the object to wxTextEntry.
by doublemax
Sat Jun 22, 2019 8:37 am
Forum: C++ Development
Topic: How to attach some user data to wxWindow?
Replies: 4
Views: 37

Re: How to attach some user data to wxWindow?

The cleanest way would be to add a small mixin class to all windows where you need it. This would also give you the option to have methods with meaningful names which would make the code more readable.

As a quick-and-dirty and limited alternative you could (ab-)use wxWindow::SetName( wxString ).
by doublemax
Sat Jun 22, 2019 7:48 am
Forum: wx.NET
Topic: How to compilation with wxWidgets 2.5.3
Replies: 1
Views: 23

Re: How to compilation with wxWidgets 2.5.3

Are you use you need wx 2.5.3? That's from 2004 while the last change of wx.NET was from 2010.

In any case, you should be able to get all old versions from here:
https://sourceforge.net/projects/wxwindows/files/
by doublemax
Sat Jun 22, 2019 7:25 am
Forum: C++ Development
Topic: events, secondary threads & app remote control
Replies: 8
Views: 68

Re: events, secondary threads & app remote control

a) there is nothing wrong with using static event tables b) if you use the combination wxThreadEvent *and* QueueEvent(), there is no need to clone anything yourself. It will happen internally. The most likely reason why you didn't receive the event is this: EVT_THREAD(wxEVT_GalleryInitEvent, CX_Gall...