Discussion:
wxWizard button update
Patrick Steele
2014-04-07 10:10:21 UTC
Permalink
wxWidgets = 3.0
OS = Windows 7
IDE = Visual Studio 2012

Hi,
I am creating a wxWizard instance which contains a number of
wxWizardPage's. Depending on a wxRadioBox selection on a certain page, the
"Next" button at the bottom of the wizard should change to say "Finish". At
the end of my OnRadioBox() function, I tried adding a Refresh() call to
update the button but that did not work. How should I go about achieving
this goal please?
Thanks,
Patrick
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-04-07 19:27:06 UTC
Permalink
On Mon, 7 Apr 2014 11:10:21 +0100 Patrick Steele wrote:

PS> I am creating a wxWizard instance which contains a number of
PS> wxWizardPage's. Depending on a wxRadioBox selection on a certain page, the
PS> "Next" button at the bottom of the wizard should change to say "Finish". At
PS> the end of my OnRadioBox() function, I tried adding a Refresh() call to
PS> update the button but that did not work. How should I go about achieving
PS> this goal please?

There is no support for dynamically updating the button label in wxWizard
itself, so you need to do it yourself, either by calling SetLabel() on
FindWindow(wxID_FORWARD) explicitly or defining wxEVT_UPDATE_UI handler for
it.

FWIW I think it would be nice to have support for this in wxWizard so if
you (or anybody else) is interested in adding it, I'd be glad to discuss
this further.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Igor Korot
2014-04-07 19:58:38 UTC
Permalink
Hi, Patrick,
Post by Vadim Zeitlin
PS> I am creating a wxWizard instance which contains a number of
PS> wxWizardPage's. Depending on a wxRadioBox selection on a certain page, the
PS> "Next" button at the bottom of the wizard should change to say "Finish". At
PS> the end of my OnRadioBox() function, I tried adding a Refresh() call to
PS> update the button but that did not work. How should I go about achieving
PS> this goal please?
Please someone correct me if I'm wrong but I think at least on Windows
the "Finish"
button should always be present, albeit disabled until it is
appropriate to end the wizard.
If there is no "Finish" it is assumed that the last page will end the wizard.

Thank you.
Post by Vadim Zeitlin
There is no support for dynamically updating the button label in wxWizard
itself, so you need to do it yourself, either by calling SetLabel() on
FindWindow(wxID_FORWARD) explicitly or defining wxEVT_UPDATE_UI handler for
it.
FWIW I think it would be nice to have support for this in wxWizard so if
you (or anybody else) is interested in adding it, I'd be glad to discuss
this further.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
David Connet
2014-04-07 20:22:08 UTC
Permalink
Sent: Monday, April 7, 2014 12:58 PM
Subject: Re: wxWizard button update
Hi, Patrick,
Post by Vadim Zeitlin
PS> I am creating a wxWizard instance which contains a number of
PS> wxWizardPage's. Depending on a wxRadioBox selection on a certain page, the
PS> "Next" button at the bottom of the wizard should change to say "Finish". At
PS> the end of my OnRadioBox() function, I tried adding a Refresh() call to
PS> update the button but that did not work. How should I go about achieving
PS> this goal please?
Please someone correct me if I'm wrong but I think at least on Windows
the "Finish"
button should always be present, albeit disabled until it is
appropriate to end the wizard.
If there is no "Finish" it is assumed that the last page will end the wizard.
No, Finish is only present if it's appropriate. In many cases, Next does change to Finish (in other cases, it's present). I haven't used the apis for a while, but I remember there being a message you would send to the parent wizard from the page that would do this.

Dave
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Patrick Steele
2014-04-08 13:44:50 UTC
Permalink
I may have misunderstood you David but I checked through the wxWidgets
source code and didn't see anywhere that a wxWizardPage would send a
message to its wxWizard parent to update buttons. I have rejigged the logic
flow to be a bit more future proof and this eliminates the need to me to
set the buttons dynamically.
Thanks,
Patrick
Post by Patrick Steele
Sent: Monday, April 7, 2014 12:58 PM
Subject: Re: wxWizard button update
Hi, Patrick,
Post by Vadim Zeitlin
PS> I am creating a wxWizard instance which contains a number of
PS> wxWizardPage's. Depending on a wxRadioBox selection on a certain
page, the
Post by Vadim Zeitlin
PS> "Next" button at the bottom of the wizard should change to say
"Finish". At
Post by Vadim Zeitlin
PS> the end of my OnRadioBox() function, I tried adding a Refresh()
call to
Post by Vadim Zeitlin
PS> update the button but that did not work. How should I go about
achieving
Post by Vadim Zeitlin
PS> this goal please?
Please someone correct me if I'm wrong but I think at least on Windows
the "Finish"
button should always be present, albeit disabled until it is
appropriate to end the wizard.
If there is no "Finish" it is assumed that the last page will end the
wizard.
No, Finish is only present if it's appropriate. In many cases, Next does
change to Finish (in other cases, it's present). I haven't used the apis
for a while, but I remember there being a message you would send to the
parent wizard from the page that would do this.
Dave
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
or visit http://groups.google.com/group/wx-users
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
David Connet
2014-04-08 13:54:18 UTC
Permalink
Post by Patrick Steele
I may have misunderstood you David but I checked through the wxWidgets
source code and didn't see anywhere that a wxWizardPage would send a
message to its wxWizard parent to update buttons. I have rejigged the
logic flow to be a bit more future proof and this eliminates the need to
me to set the buttons dynamically.
Thanks,
Patrick
Sorry, I was talking about how native Windows wizards work.

Dave
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...