Search found 143 matches

by gtafan
Sun Nov 04, 2018 1:45 pm
Forum: C++ Development
Topic: wxSpinCtrl problem wxSpinEvent is handled twice
Replies: 18
Views: 787

Re: wxSpinCtrl problem wxSpinEvent is handled twice

Please don`t get it wrong, but your example uses 2 handler functions, which I defenetly don`t want to have. I am quite sure that the code I suggested you try, from Oct 26, does use just a single function handling wxEVT_SPINCTRL? I just need to know when the Value of SpinCtrl was updated.Is there po...
by gtafan
Fri Nov 02, 2018 2:23 pm
Forum: C++ Development
Topic: Internationalisation
Replies: 22
Views: 1351

Re: Internationalisation

xaviou wrote:
gtafan wrote: What default wxTranslationsLoader can't do?
Using a "mo" file placed in the same folder than the executable itself.
It was possible with wx-2.8.x, but not since wx-3.0.x (as I remember...)
Xav'
OK, than I can place the mo file in some subfolder, so it maches.
by gtafan
Fri Nov 02, 2018 2:07 pm
Forum: C++ Development
Topic: wxSpinCtrl problem wxSpinEvent is handled twice
Replies: 18
Views: 787

Re: wxSpinCtrl problem wxSpinEvent is handled twice

wxEVT_SPINCTRL is old (and seems now even undocumented) alias for wxEVT_SPINCTRL. The Connect() call seems, AFAICT, allright. Did you try to run the exact code from my Oct 26 post to see if the behaviour on your configuration is the same? It the minimal example behaves correctly, the issue must be ...
by gtafan
Thu Nov 01, 2018 4:27 pm
Forum: C++ Development
Topic: Internationalisation
Replies: 22
Views: 1351

Re: Internationalisation

Hi. Do to this, you'll have to write your own wxTranslationsLoader as the default one can't do this. You can have a look at this application as this is what it does : it looks in the same folder as the executable to see if a file named "language.mo" is present, and use it if it is the case. Regards...
by gtafan
Thu Nov 01, 2018 4:21 pm
Forum: C++ Development
Topic: wxSpinCtrl problem wxSpinEvent is handled twice
Replies: 18
Views: 787

Re: wxSpinCtrl problem wxSpinEvent is handled twice

1. At least on MSW, when you use wxMessageBox directly in the handler, you definitely get two events, for reasons explained by doublemax. 2. If you modifiy the value by typing it and not using arrows, you do not get wxEVT_SPINCTRL event until the control loses focus. You get wxEVT_TEXT as the chara...
by gtafan
Wed Oct 31, 2018 11:50 am
Forum: C++ Development
Topic: Internationalisation
Replies: 22
Views: 1351

Internationalisation

I took a look at the internationalisation sample, but it´s a bit complicated and confusing. I have mo file in the same directory as the applicaton, how can I tell the application to use that mo file?
by gtafan
Wed Oct 31, 2018 11:44 am
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1802

Re: wxThread Kill()

OK, took an other look at the sample, but still have some problems to understand how that Wait stuff worcks. Wait() is executed on some semaphor, but how that semaphor is conected to the threads is not really clear.
by gtafan
Mon Oct 29, 2018 12:56 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1802

Re: wxThread Kill()

As ONEEYEMAN said, the wx'doc is clear about using Kill(): dangerous . This is due to it's a direct call to OS to "murder" the process, instead of let it die on its own. Think of it like finishing an app with the MSW Task Manager or Linux "kill" command. A short description on wxThread: Two types: ...
by gtafan
Mon Oct 29, 2018 12:52 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1802

Re: wxThread Kill()

Hi, What is it that you do not understand? One thread can kill itself and it should be created on the heap. The other you as a developer should kill and it should be created on the stack. Is it something I missed? Thank you.' For example that heap thing, not really understanding what that should be...
by gtafan
Sat Oct 27, 2018 3:04 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1802

Re: wxThread Kill()

ONEEYEMAN wrote:Hi,
I presume you read the documentation, the part about "Types of wxThreads"?

Thank you.
I have alredy read it, but not really understanding that types.
by gtafan
Sat Oct 27, 2018 3:03 pm
Forum: C++ Development
Topic: wxSpinCtrl problem wxSpinEvent is handled twice
Replies: 18
Views: 787

Re: wxSpinCtrl problem wxSpinEvent is handled twice

Sorry people, looks like I was misunderstood, that behavior is corect it´s described in the documentation, 2 events are trigered arow and up or dow events. It defenetly has nothing to do with mesageBox, as when I am entering the value directlly the mesageBox apers only 1 time.
by gtafan
Fri Oct 26, 2018 3:19 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1802

Re: wxThread Kill()

Hi, How do you instantiate the object of this class? Thank you. P.S.: Please use "code" tags around the code snippet you post. class MyFrame: public wxFrame { ... MyThread thread; }; In the costructor of MyFrame I am doing thread.Run() and in the destructor thread.Kill(). Like mentioned Have not ru...
by gtafan
Fri Oct 26, 2018 3:12 pm
Forum: C++ Development
Topic: wxSpinCtrl problem wxSpinEvent is handled twice
Replies: 18
Views: 787

Re: wxSpinCtrl problem wxSpinEvent is handled twice

Hi, Are you using static event table or you are binding the event? Are you able to see the double event in the sample? Also - what is you OS and wx version? Thank you. Sorry, my OS is Win7 and wx version 3.0.4. WxSmith using Connect, so it should be binding, but not 100% shure about that. Have not ...
by gtafan
Fri Oct 26, 2018 2:51 pm
Forum: C++ Development
Topic: wxSpinCtrl problem wxSpinEvent is handled twice
Replies: 18
Views: 787

Re: wxSpinCtrl problem wxSpinEvent is handled twice

Hi, Can you show some code? Are you able to reproduce it inside the widgets sample? Thank you. So this is how the event is handled in the code: void MyFrame::OnSpinCtrl1Change(wxSpinEvent& event) { wxMessageBox(wxString::Format("%i", event.GetPosition())); } If I pres any arrow buttont of SpinCtrl1...
by gtafan
Fri Oct 26, 2018 2:46 pm
Forum: C++ Development
Topic: wxThread Kill()
Replies: 48
Views: 1802

Re: wxThread Kill()

Hi, What type of thread do you have? Thank you. I am not really familiar with wxThread, just have a class derived from wxThread. Something like this: class MyThread: public wxThread { protected: ExitCode Entry() { while(1) { //do some worck Sleep(1000); } } }; I have not tried to execute this code.