Search found 132 matches

by tomay3000
Sun Jun 23, 2019 9:44 pm
Forum: C++ Development
Topic: How to handle wxEVT_TEXT before is happens?
Replies: 4
Views: 56

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.
by tomay3000
Sun Jun 23, 2019 2:16 am
Forum: C++ Development
Topic: How to handle wxEVT_TEXT before is happens?
Replies: 4
Views: 56

How to handle wxEVT_TEXT before is happens?

Hello,
I would like to handle wxEVT_TEXT before it happens, so I can validate the text or veto it, because wxEVT_TEXT is too late.
I need something like wxEVT_TEXT_CHANGING.
is it possible?

TIA.
by tomay3000
Sat Jun 22, 2019 8:44 pm
Forum: C++ Development
Topic: How to wxIsKindOf class check for a wxTextEntry derived classes?
Replies: 8
Views: 101

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

Actually the code won't compile at all using wxDynamicCast() ||=== Build: Static Debug in S-SMS (compiler: GNU GCC Compiler) ===| C:\Users\Tomay\Desktop\Projects\S-SMS\S_SMSMain.cpp||In member function 'virtual void S_SMSFrame::m_pBtn_VK_Clear_OnButtonClick(wxCommandEvent&)':| C:\devel\wxWidgets\inc...
by tomay3000
Sat Jun 22, 2019 8:05 pm
Forum: C++ Development
Topic: How to wxIsKindOf class check for a wxTextEntry derived classes?
Replies: 8
Views: 101

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

I can see from this post: https://stackoverflow.com/questions/159 ... d-of-macro,
Vadim Zeitlin is advising the use of wxDynamicCast() instead of wxIS_KIND_OF or wxIsKindOf.
by tomay3000
Sat Jun 22, 2019 7:12 pm
Forum: C++ Development
Topic: How to wxIsKindOf class check for a wxTextEntry derived classes?
Replies: 8
Views: 101

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. That is exactly what came to my mind, using like: bool wxHasTextEntry(const wxWindo...
by tomay3000
Sat Jun 22, 2019 5:37 pm
Forum: C++ Development
Topic: How to wxIsKindOf class check for a wxTextEntry derived classes?
Replies: 8
Views: 101

How to wxIsKindOf class check for a wxTextEntry derived classes?

Hello, I know that doing it for a wxTextCtrl should work, but I want to make it work for all wxTextEntry derivatives as well, so I can call wxTextEntry::Clear() Here is my code that worked for wxTextCtrl , and I want to make it work for wxTextEntry once for all its derivatives: void MyFrame::Btn_VK_...
by tomay3000
Sun Jun 16, 2019 4:50 pm
Forum: C++ Development
Topic: How to call a wxTextCtrl default wxEVT_KILL_FOCUS event handler (not the one with a validator)?
Replies: 6
Views: 76

Re: How to call a wxTextCtrl default wxEVT_KILL_FOCUS event handler (not the one with a validator)?

doublemax wrote:
Sun Jun 16, 2019 3:58 pm
For what purpose do you use the validator, if you don't want it to validate?
The validator is working fine except that part of OnKillFocus which is undesirable for my case.
by tomay3000
Sun Jun 16, 2019 3:18 pm
Forum: C++ Development
Topic: How to call a wxTextCtrl default wxEVT_KILL_FOCUS event handler (not the one with a validator)?
Replies: 6
Views: 76

Re: How to call a wxTextCtrl default wxEVT_KILL_FOCUS event handler (not the one with a validator)?

If i understand you correctly, just an empty wxEVT_KILL_FOCUS event handler should do it. Don't call event.Skip(). Doing what you suggested broke it completely, the focus was never killed from that text control, but found the origin of the problem from here: https://github.com/wxWidgets/wxWidgets/b...
by tomay3000
Sun Jun 16, 2019 2:17 pm
Forum: C++ Development
Topic: How to call a wxTextCtrl default wxEVT_KILL_FOCUS event handler (not the one with a validator)?
Replies: 6
Views: 76

Re: How to call a wxTextCtrl default wxEVT_KILL_FOCUS event handler (not the one with a validator)?

what do you expect to happen? My wxTextCtrl has a wxIntegerValidator associated to it, so when wxEVT_KILL_FOCUS is invoked, it will do some extra processing by deleting any leading zeros , I want to keep the validator and suppress only that extra processing when wxEVT_KILL_FOCUS is invoked.
by tomay3000
Sun Jun 16, 2019 12:54 pm
Forum: C++ Development
Topic: How to call a wxTextCtrl default wxEVT_KILL_FOCUS event handler (not the one with a validator)?
Replies: 6
Views: 76

How to call a wxTextCtrl default wxEVT_KILL_FOCUS event handler (not the one with a validator)?

Hello, I need to call a wxTextCtrl default wxEVT_KILL_FOCUS event handler (not the one with a validator). because when calling event.Skip(); it will call the validator event handler. I want to suppress that wxEVT_KILL_FOCUS event handling for the associated validator and simulate a regular wxTextCtr...
by tomay3000
Thu May 30, 2019 4:08 am
Forum: C++ Development
Topic: How to add a wxCheckBox to a wxStaticBoxSizer?
Replies: 1
Views: 55

How to add a wxCheckBox to a wxStaticBoxSizer?

Hello,
I was wondering, how to add a wxCheckBox to a wxStaticBoxSizer, so I can disable the whole wxStaticBox.

TIA.
by tomay3000
Sat May 18, 2019 8:38 pm
Forum: C++ Development
Topic: What is the proper way to cast (void *) to (wxString *)?
Replies: 1
Views: 82

What is the proper way to cast (void *) to (wxString *)?

Hello, I was wondering what to use to cast (void *) to (wxString *)! Suppose I have the following function: namespace util { size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userdata) { reinterpret_cast<wxString *>(userdata)->Append(ptr, size * nmemb); // <--- Cast (1): Should I use...
by tomay3000
Fri May 10, 2019 11:51 pm
Forum: C++ Development
Topic: How to call a function in a new thread as std::thread does using wxWidgets?
Replies: 8
Views: 165

Re: How to call a function in a new thread as std::thread does using wxWidgets?

Interesting std::thread simulation.
I will give it a try.

Thank you.
by tomay3000
Fri May 10, 2019 9:03 pm
Forum: C++ Development
Topic: How to call a function in a new thread as std::thread does using wxWidgets?
Replies: 8
Views: 165

Re: How to call a function in a new thread as std::thread does using wxWidgets?

I just thought, it may exist in the toolkit and just not documented, and I am not seeing it.
Since I am using wxWidgets, why not using such a function (if it exists) as for example I am using wxString all the time instead of std::string.