Search found 143 matches

by gtafan
Thu Jan 24, 2019 1:27 pm
Forum: C++ Development
Topic: problem geting values from TextCtrl
Replies: 5
Views: 332

Re: problem geting values from TextCtrl

I am using wxSmith for creating my wxWidget projects, as doing it manually is a huge pain in the as. That huge "pain" will teach you how to do things, and so how wxSmith works. Get rid of "automagic" tools unless you understand the underlaying "magic". MyPanel is the control I am using to get float...
by gtafan
Wed Jan 23, 2019 3:03 pm
Forum: C++ Development
Topic: problem geting values from TextCtrl
Replies: 5
Views: 332

Re: problem geting values from TextCtrl

Hi Sorry, your code is too obfuscated. You don't show how the frame is created, why it contains several wxPanel/MyPanel, etc. If using Connect() or better Bind() , you don't need BEGIN_EVENT_TABLE macros The textctrl with parent=Panel1 seems not to be bound to any message handler. If you want a wxT...
by gtafan
Tue Jan 22, 2019 3:40 pm
Forum: C++ Development
Topic: problem geting values from TextCtrl
Replies: 5
Views: 332

problem geting values from TextCtrl

So here my main code from cpp files: MyPanel implementation //(*IdInit(MyPanel) const long MyPanel::ID_STATICTEXT1 = wxNewId(); const long MyPanel::ID_TEXTCTRL1 = wxNewId(); //*) BEGIN_EVENT_TABLE(MyPanel,wxPanel) //(*EventTable(MyPanel) //*) END_EVENT_TABLE() MyPanel::MyPanel(wxWindow* parent, cons...
by gtafan
Fri Jan 18, 2019 11:56 am
Forum: C++ Development
Topic: Lose focus event for wxTextCtrl?
Replies: 16
Views: 1547

Re: Lose focus event for wxTextCtrl?

[quote="PB"][/quote] Sorry a misunderstanding, the problem with tab has nothing to do with my previous one. When I am presing tab on any textCtrl the cursor goes to the next textCtrl and Lose focus event is generated, but on the last textCtrl it´s not worcking, the cursor is not going to the first o...
by gtafan
Wed Jan 16, 2019 2:13 pm
Forum: C++ Development
Topic: Lose focus event for wxTextCtrl?
Replies: 16
Views: 1547

Re: Lose focus event for wxTextCtrl?

What do you mean by "problems to acces the textCtrl"? Do you mean that the user cannot set focus to the control with keyboard and/or mouse? Do you call event.Skip() in the wxEVT_KILL_FOCUS handler (see my previous code)? Can you reproduce the issue with the MyDialog code below? #include <wx/wx.h> c...
by gtafan
Tue Jan 15, 2019 3:26 pm
Forum: C++ Development
Topic: Lose focus event for wxTextCtrl?
Replies: 16
Views: 1547

Re: Lose focus event for wxTextCtrl?

Since I have more then 1 textCtrl, I am geting problems to acces the textCtrl again once it lost focus. After comenting out this line:

Code: Select all

textCtrl->Bind(wxEVT_KILL_FOCUS, &MyDialog::OnKillFocus, this);
everithing worcks fine again.
by gtafan
Mon Jan 07, 2019 2:32 pm
Forum: C++ Development
Topic: Lose focus event for wxTextCtrl?
Replies: 16
Views: 1547

Re: Re:

So it was really Connect(), that cased the problem? No, the problem was as both David and me wrote: You changed the control on which the method (Connect) is called, from wxTextCtrl to (probably) its parent. If you did the same to Bind(), it would be wrong as well. OK, now I see, normaly wxSmith doe...
by gtafan
Mon Jan 07, 2019 1:28 pm
Forum: C++ Development
Topic: Lose focus event for wxTextCtrl?
Replies: 16
Views: 1547

Re: Re:

Seems not to worck for me, the only diference I am using Connect instead of Bind: Connect(ID_TEXTCTRL1,wxEVT_KILL_FOCUS,(wxObjectEventFunction)&MyFrame::OnKillFocus); Actually, it seems you made another important change, which broke the code. You now call Connect() on MyFrame, not on the wxTextCtrl...
by gtafan
Mon Jan 07, 2019 11:17 am
Forum: C++ Development
Topic: Lose focus event for wxTextCtrl?
Replies: 16
Views: 1547

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: 1547

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: 2450

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: 2450

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: 2450

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: 429

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: 429

Re: wxWidgets v3.1.2 release is out ;)

But is it a stable version?