saran73 has asked for the wisdom of the Perl Monks concerning the following question:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WxPerl Next button
by jmlynesjr (Deacon) on Jan 04, 2013 at 20:00 UTC | |
Refer to More wxPerl Examples now on Github. Specifically the CppTrial-pg086.pl and CppTrial-pg225.pl examples. You may need to create a custom dialog similar to pg225 that uses radio buttons rather than a list box. Look these examples over and post your code if you can. James There's never enough time to do it right, but always enough time to do it over... | [reply] |
by saran73 (Initiate) on Jan 04, 2013 at 20:44 UTC | |
| [reply] [d/l] |
by stefbv (Priest) on Jan 05, 2013 at 12:14 UTC | |
I second the use of Wx::SingleChoiceDialog or Wx::MultiChoiceDialog like jmlynesjr sugested. Parsing XML like you do is not a good choice, use a dedicated module, something like this:
Notice that a valid XML must have a root tag. I also changed a little the structure... Regards, Stefan | [reply] [d/l] |
|
Re: WxPerl Next button
by jmlynesjr (Deacon) on Jan 05, 2013 at 14:20 UTC | |
After reviewing and running your code, and having read a zillion of theses posts now, I knew that a more learned Monk would suggest using one of the CPAN XML parsers. Thanks stefbz. I have not gotten into XML at all yet. I do think that you should be using a dialog(modal) rather than individual controls. I would start with the wxSingleChoiceDialog and use it to get my application logic correct. Build and popup the dialog, extract your answer, destroy the popup, then repeat for all of your questions. Then if you still want a different look and feel you could implement a custom dialog like the wxSingleChoiceDialog, but using radio boxes instead of a list. See CppTrial-pg225.pl for the wxSingleChoiceDialog example and CppTrial-pg245.pl for the PersonalRecordDialog custom dialog example. The next more complicated option would be to create a wxWizard. Unfortunately I haven't yet implemented the wxWizard example from the "wxBook" in my github examples. See also the wxDemo wxWizard and wxSingleChoiceDialog examples. I run Citrus Perl 5.16 and on my system these can be found at home/CitrusPerl/perl/vendor/bin/wxperl_demo.pl. Look under the Managed Windows and Dialogs sections. Please repost your working application to add to the example base. Update1:See if the following code can be integrated with your XML code. Read more... (3 kB)
Update2:Just for completeness a wxWizard example follows. Read more... (4 kB)
James There's never enough time to do it right, but always enough time to do it over... | [reply] [d/l] [select] |
by saran73 (Initiate) on Jan 06, 2013 at 08:49 UTC | |
| [reply] |