Search found 165 matches

by gtafan
Mon Jan 07, 2019 11:17 am
Forum: C++ Development
Topic: Lose focus event for wxTextCtrl?
Replies: 16
Views: 2219

Re: Re:

Is there no other way to get the event when textctrl looses focus? I really want to use wxTextCtrl and not some other custom class. I may be missing something but using wxEVT_KILL_FOCUS seems to work just fine? #include <wx/wx.h> class MyDialog : public wxDialog { public: MyDialog () : wxDialog(NUL...
by gtafan
Fri Jan 04, 2019 11:57 am
Forum: C++ Development
Topic: Lose focus event for wxTextCtrl?
Replies: 16
Views: 2219

Re:

What I would do is, subclass wxTextCtrl, then override wxWindow::SetFocus(). SetFocus is called when focus is set and "killed". It is virtual so it is "override-ready". http://docs.wxwidgets.org/stable/wx_wxwindow.html#wxwindowsetfocus Then use wxWindow::FindFocus() within the method to see if your...
by gtafan
Thu Dec 13, 2018 2:26 pm
Forum: C++ Development
Topic: Full Working Example of a wxGrid
Replies: 15
Views: 3548

Re: Full Working Example of a wxGrid

but something like sscanf is unfortunately mising, at least I have not found it. Well, I have never used but it there is (undocumented, used in wxWidgets codebase itself) wxSscanf(). However, I believe that using that family of C functions (wrapped by wxWidgets in those wxCRT_* functions) in C++ fe...
by gtafan
Wed Dec 12, 2018 2:46 pm
Forum: C++ Development
Topic: Full Working Example of a wxGrid
Replies: 15
Views: 3548

Re: Full Working Example of a wxGrid

That "3.1415" is just a string, so you have to convert it to float, which is really a big pain in the as in wxWidgets, since it has no simple convertion function. While you may be right about other things, I am not sure about lacking a simple conversion function. To convert a number to wxString, yo...
by gtafan
Wed Dec 12, 2018 12:26 pm
Forum: C++ Development
Topic: Full Working Example of a wxGrid
Replies: 15
Views: 3548

Re: Full Working Example of a wxGrid

I mean for example that SetColFormatFloat, it does nothing really usefull and since it is not posible to get and set float values to a cell of the grid it apears complete useless to me. Can somebody posibly explain why such functions exist at all? So to make clear what I would like wxGrid to use fo...
by gtafan
Tue Dec 11, 2018 4:09 pm
Forum: Announcements and Discoveries
Topic: wxWidgets v3.1.2 release is out ;)
Replies: 4
Views: 955

Re: wxWidgets v3.1.2 release is out ;)

Technically only even minor version numbers indicate a "stable" version (2.6.x, 2.8.x, 3.0.x, 3.2.x etc) Therefore 3.1.2 is a "development" version. But "stable" only means that the API is stable, it doesn't mean that it crashes less. IMHO 3.1.2 is safe to use, even for production. OK, so stay with...
by gtafan
Tue Dec 11, 2018 1:59 pm
Forum: Announcements and Discoveries
Topic: wxWidgets v3.1.2 release is out ;)
Replies: 4
Views: 955

Re: wxWidgets v3.1.2 release is out ;)

But is it a stable version?
by gtafan
Tue Dec 11, 2018 1:31 pm
Forum: C++ Development
Topic: Full Working Example of a wxGrid
Replies: 15
Views: 3548

Re: Full Working Example of a wxGrid

That wiki stuff seems to be really interesting, specialy since it shows how useles some wxGrid functions are. I mean for example that SetColFormatFloat, it does nothing really usefull and since it is not posible to get and set float values to a cell of the grid it apears complete useless to me. Can ...
by gtafan
Mon Dec 03, 2018 2:58 pm
Forum: C++ Development
Topic: wxThread and OpengL
Replies: 7
Views: 493

Re: wxThread and OpengL

Hi, Accessing ANY GUI IN THE SECONDARY THREAD IS NOT SAFE AND WILL LEAD TO CRASJES!!!! It might work in one OS, or maybe 2 (if you are lucky), but generally in a cross-platform environment it is considered a VERY BAD PRACTICE!!! Thank you. What you mean by NOT SAFE? Not thread safe? Why should it b...
by gtafan
Wed Nov 28, 2018 2:56 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2547

Re: wxThread Kill()

doublemax wrote:You can probably achieve the same with wxSemaphore, but as wxCondition already has sample code that does exactly what you want, i'd go with that.
But wxCondition needs a mutex, that is not necesary for semaphor, but posibly I just understood everything wrong.
by gtafan
Tue Nov 27, 2018 2:49 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2547

Re: wxThread Kill()

If you want to get fancy, you can use wxCondition to wait for the thread to end. This will still block the execution of the main thread, but it won't be a busy loop that uses CPU. https://docs.wxwidgets.org/trunk/classwx_condition.html Thanks, will take a look at that wxCondition. What about wxSema...
by gtafan
Fri Nov 23, 2018 12:22 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2547

Re: wxThread Kill()

But that´s still buisy waiting. I mean it´s defenetly better then endles loop, but I am wondering why there is no good mechanism in C++ to manage something like that. I mean in Java something like that could be done very easy. Well, as DoubleMax already said: At some point the code is waiting, in t...
by gtafan
Thu Nov 22, 2018 3:21 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2547

Re: wxThread Kill()

Using an endless loop to wait for the end of thread and after that leaving it with breack is a really ugly solution in my opinion. I mean while(m_pThread); would be a bit better, but still a waste of resorces. I thought Delete waits for thread to call TestDestroy() and only after that the main appl...
by gtafan
Thu Nov 22, 2018 2:39 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2547

Re: wxThread Kill()

You can only Wait() for joined threads. Detached threads are "fire and forget" as they destroy themselves. You can: 1) just ignore it and terminate the application after calling Destroy() (not recommended) 2) wait a fixed amount of time (e.g. 1 second) after calling Destroy(). If the thread calls T...
by gtafan
Wed Nov 21, 2018 2:59 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 2547

Re: wxThread Kill()

I am calling TestDestroy() and the thread terminates, but the main thread is not waiting for it to terminate.