A wizard with menus

1 view
Skip to first unread message

Jon Kilvington

unread,
Nov 4, 2008, 6:15:17 AM11/4/08
to wx-u...@lists.wxwidgets.org
Hi there,
 
I'm trying to port an MFC application to wxWidgets. This is going
pleasingly well so far, but I've run into a problem.
 
One mode of the application is to run as a wizard which has menus and I
can't see an easy way of duplicating this in wxWidgets. I've got my
own classes derived from wxWizard and wxWizardPageSimple which are
created from xrc files and do all the wizardy type things they should, but
adding a menu is proving problematic.
 
As far as I can see, my options are:
 
1) Have my own wxFrame derived class which duplicates a lot of the code
in wxWizard.
2) Try and embed the wizard in a panel in a frame. I'm not sure if this
can work though - I've tried a few things, but the wizard always ends up
not embedded.
3) Try and add the menus to my wizard and hook up the events.
 
I know that menus on a wizard is unusual, but I've just been told to get
the application working in wxWidgets and looking like it does now.
 
Any advice would be greatly appreciated...
 
Jon

Vadim Zeitlin

unread,
Nov 4, 2008, 7:05:54 AM11/4/08
to wx-u...@lists.wxwidgets.org
On Tue, 4 Nov 2008 11:15:17 -0000 Jon Kilvington <j...@delcam.com> wrote:

JK> One mode of the application is to run as a wizard which has menus and I
JK> can't see an easy way of duplicating this in wxWidgets. I've got my
JK> own classes derived from wxWizard and wxWizardPageSimple which are
JK> created from xrc files and do all the wizardy type things they should, but
JK> adding a menu is proving problematic.

I'm afraid there is no nice solution to this. wxWizard is a wxDialog and
menus are only supported by wxFrames. So currently you have no choice but
to duplicate wxWizard functionality in your own frame.

All I can suggest is that you try to refactor wxWizard code to make it
reusable inside any parent window (e.g. a panel) and submit us the patch
doing it -- we'd be glad to integrate it. Please ask about more details
if you think about following this route.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Jon Kilvington

unread,
Nov 4, 2008, 7:11:26 AM11/4/08
to wx-u...@lists.wxwidgets.org
Ok, thanks. I was afraid there wouldn't be a quick and easy solution
Reply all
Reply to author
Forward
0 new messages