Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv26017/src/gui

Modified Files:
        wxOptionsDlg.cpp 
Log Message:
added test page; replaced run-time asserts with compile-time ones

Index: wxOptionsDlg.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxOptionsDlg.cpp,v
retrieving revision 1.377
retrieving revision 1.378
diff -b -u -2 -r1.377 -r1.378
--- wxOptionsDlg.cpp    30 Jul 2003 00:03:23 -0000      1.377
+++ wxOptionsDlg.cpp    22 Aug 2003 22:12:23 -0000      1.378
@@ -519,6 +519,16 @@
    ConfigField_HelpersLast = ConfigField_PGPGetPubKey,
 
-   // other options
+#ifdef USE_TEST_PAGE
+   ConfigField_TestFirst = ConfigField_HelpersLast,
+   ConfigField_TestMessage,
+   ConfigField_TestFolder,
+   ConfigField_TestLast = ConfigField_TestFolder,
+
+   ConfigField_OthersFirst = ConfigField_TestLast,
+#else // !USE_TEST_PAGE
    ConfigField_OthersFirst = ConfigField_HelpersLast,
+#endif // USE_TEST_PAGE/!USE_TEST_PAGE
+
+   // other options
    ConfigField_LogHelp,
    ConfigField_ShowLog,
@@ -1591,4 +1601,11 @@
    { gettext_noop("Get GPG key &from server"),    Field_Bool,    -1                   
   },
 
+   // test page
+#ifdef USE_TEST_PAGE
+   { _T("This is a test page used only for debugging.\n")
+     _T("Normally you shouldn't see it at all."), Field_Message, -1 },
+   { _T("Test folder entry"), Field_Folder, -1 },
+#endif // USE_TEST_PAGE
+
    // other options
    { gettext_noop("Mahogany may log everything into the log window, a file\n"
@@ -2033,4 +2050,9 @@
    CONFIG_ENTRY(MP_PGP_GET_PUBKEY),
 
+#ifdef USE_TEST_PAGE
+   CONFIG_NONE(),
+   CONFIG_NONE(),
+#endif // USE_TEST_PAGE
+
    // other
    CONFIG_NONE(),
@@ -2081,4 +2103,15 @@
 #undef CONFIG_NONE
 
+// check that we didn't forget to update one of the arrays...
+wxCOMPILE_TIME_ASSERT(
+      WXSIZEOF(wxOptionsPageStandard::ms_aConfigDefaults) == ConfigField_Max,
+      MismatchFieldDefaults
+   );
+
+wxCOMPILE_TIME_ASSERT(
+      WXSIZEOF(wxOptionsPageStandard::ms_aFields) == ConfigField_Max,
+      MismatchFieldDescs
+   );
+
 // ============================================================================
 // implementation
@@ -2996,10 +3029,4 @@
    // nFirst + 1 really must be unsigned
    ASSERT_MSG( nFirst >= -1, _T("bad parameret in wxOptionsPageStandard ctor") );
-
-   // check that we didn't forget to update one of the arrays...
-   ASSERT_MSG( WXSIZEOF(ms_aConfigDefaults) == ConfigField_Max,
-               _T("defaults array size mismatch") );
-   ASSERT_MSG( WXSIZEOF(ms_aFields) == ConfigField_Max,
-               _T("fields array size mismatch") );
 }
 
@@ -3843,4 +3870,22 @@
 
 // ----------------------------------------------------------------------------
+// wxOptionsPageTest
+// ----------------------------------------------------------------------------
+
+#ifdef USE_TEST_PAGE
+
+wxOptionsPageTest::wxOptionsPageTest(wxNotebook *parent,
+                                     Profile *profile)
+                 : wxOptionsPageStandard(parent,
+                                         _T("Test page"),
+                                         profile,
+                                         ConfigField_TestFirst,
+                                         ConfigField_TestLast)
+{
+}
+
+#endif // USE_TEST_PAGE
+
+// ----------------------------------------------------------------------------
 // wxOptionsPageOthers
 // ----------------------------------------------------------------------------
@@ -4187,15 +4232,22 @@
    "helpers",
    "sync",
+#ifdef USE_TEST_PAGE
+   "unknown",
+#endif // USE_TEST_PAGE
    "miscopt",
    NULL
 };
 
+// don't forget to update both the array above and the enum when modifying
+// either of them!
+wxCOMPILE_TIME_ASSERT(
+      WXSIZEOF(wxOptionsNotebook::ms_aszImages) == OptionsPage_Max + 1,
+      MismatchImagesAndPages
+   );
+
 // create the control and add pages too
 wxOptionsNotebook::wxOptionsNotebook(wxWindow *parent)
                  : wxNotebookWithImages("OptionsNotebook", parent, ms_aszImages)
 {
-   // don't forget to update both the array above and the enum!
-   wxASSERT( WXSIZEOF(ms_aszImages) == OptionsPage_Max + 1);
-
    Profile *profile = GetProfile();
 
@@ -4215,4 +4267,7 @@
    new wxOptionsPageHelpers(this, profile);
    new wxOptionsPageSync(this, profile);
+#ifdef USE_TEST_PAGE
+   new wxOptionsPageTest(this, profile);
+#endif // USE_TEST_PAGE
    new wxOptionsPageOthers(this, profile);
 



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to