From: andrew7 <bd...@us...> - 2006-08-21 12:57:05
|
Update of /cvsroot/smartwin/SmartWin/tests/WidgetModalDialog In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27211/tests/WidgetModalDialog Modified Files: NumDialog.h Log Message: Uncomment use of InDialog class which tests ModalDialogs in ModalDialogs. Index: NumDialog.h =================================================================== RCS file: /cvsroot/smartwin/SmartWin/tests/WidgetModalDialog/NumDialog.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- NumDialog.h 6 Aug 2006 01:05:43 -0000 1.9 +++ NumDialog.h 21 Aug 2006 12:57:01 -0000 1.10 @@ -4,8 +4,8 @@ #include "SmartWin.h" -//#define BUG -#ifdef BUG +#define SHOW_INDIALOG +#ifdef SHOW_INDIALOG #include "io/InDialog.h" // Input some integers, strings, and booleans. #endif @@ -211,9 +211,9 @@ itsCancelButton->setText( _T( "Cancel" ) ); itsCancelButton->onClicked( & PureNumDialog::cancel_clicked ); -#ifdef BUG +#ifdef SHOW_INDIALOG itsAnotherModalButton= createButton(); - itsAnotherModalButton->setText( _T( "Causes crash" ) ); + itsAnotherModalButton->setText( _T( "Use InDialog" ) ); itsAnotherModalButton->onClicked( & PureNumDialog::modalFromModalDialog ); #endif @@ -260,10 +260,14 @@ endDialog( IDCANCEL ); // IDOK or IDCANCEL or any other value. } - + // Tests use of ModalDialog from another ModalDialog and + // demonstrates the general purpose dialog class InDialog. + // which can build a dialog at runtime with variable types. + // This may be easier than creating many single purpose dialogs. + // void modalFromModalDialog( WidgetButtonPtr btn ) { -#ifdef BUG +#ifdef SHOW_INDIALOG int int1 = - 8; float float1 = ( float ) 98.6; SmartUtil::tstring str1 = "hello"; @@ -274,6 +278,8 @@ .add( _T( "Average temperature:" ), & float1 ) .add( _T( "Say:" ), & str1 ) .createDialog(); + + // Now int1, float1 and str1 have the values set by the user #endif } |