wxTextCtrl: block a subset of possible chars to be entered Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
triangulum
Earned a small fee
Earned a small fee
Posts: 13
Joined: Mon Jun 04, 2007 8:17 am

wxTextCtrl: block a subset of possible chars to be entered

Post by triangulum »

Hi all,

like said in my previous post, I have some edit fields used for hex representation.

That is, these edit fields shall contain hex digits only (0...9, a..f, A...F).

I already have a function that returns true for a hex digit and false otherwise.

But I wish to directly block non-hex digits from being entered into the edit field (an event handler is fired upon all user entry into the field).

What's the best solution here? I tried to save the "last valid" entry and restore that after an invalid keystroke, but it's not too elegant.
triangulum
Earned a small fee
Earned a small fee
Posts: 13
Joined: Mon Jun 04, 2007 8:17 am

Post by triangulum »

Solved it using wxTextCtrl's "Remove" method for invalid entries
Post Reply