wxCOMMAND_BUTTON_CLICKED vetoing

11 views
Skip to first unread message

Igor Korot

unread,
Oct 7, 2012, 10:41:54 PM10/7/12
to wx-u...@googlegroups.com
Hi, ALL,
How do I veto the button click event?

I have a wizard with the notebook. So when I hit the last notebook page
and click "Finish" I need to validate user input on every page and if there
is an error report it to the user and go back to the page that generated an
error and there will not be a program continuation unil the user fixes
the error.

It looks like button click event cannot be vetoed...

Thank you.

Gadget/Steve

unread,
Oct 8, 2012, 1:00:13 AM10/8/12
to wx-u...@googlegroups.com
Just declare a button handler on the last page that runs the checks and
either changes the page/sets the focus or proceeds onward to save the
data or whatever. Personally I get really frustrated by this sort of
behaviour - I click finish and it takes me several pages back and then
says something is wrong - if at all possible I always try to:
a) Group related data together on the same page and
b) Validate as the user populates the page.
Then I can disable the Next button until the data on the page is all
valid, highlight say in Red any invalid data and tell the user what is
wrong as they go. That way you can not get the situation where there
are errors on several pages and you have to, say, go to the first, click
next 5 times to get to the end, go to the second problem, etc.

Gadget/Steve

Eran Ifrah

unread,
Oct 8, 2012, 3:12:26 AM10/8/12
to wx-u...@googlegroups.com

are you using wxwizard?
if this is the case then why not using EVT_WIZARD_PAGE_CHANGING event which can be vetoed

Reply all
Reply to author
Forward
0 new messages