Index: trunk/settings.cpp
===================================================================
--- trunk/settings.cpp	(revision 11)
+++ trunk/settings.cpp	(revision 27)
@@ -27,4 +27,5 @@
     // FIXME nls*/
 
+bool saveum = FALSE;
 SWP swpDef = { 0,0,0, 98,66, 0,0,0,0 };
 SWP swpDefSSW = { 0,0,0, 10,10, 0,0,0,0 };
@@ -32,39 +33,18 @@
 USHORT ausDefSSW[7] = { 0 };
 
-#if 0
 ImageFormatInfo Settings::ifi[BMF_INVALID] =
 {
-    { TRUE,  BMF_12,   0L, "Bitmap 1.2 (Saved using Gotcha! internal routine)", "bmp", "Bitmap" },
-    { TRUE,  BMF_16,   0L, "Bitmap 1.6 (Saved using Gotcha! internal routine)", "bmp", "Bitmap" },
-    { TRUE,  BMF_20,   0L, "Bitmap 2.0 (Saved using Gotcha! internal routine)", "bmp", "Bitmap" },
-    { FALSE, BMF_OS13, mmioFOURCC( 'O','S','1','3' ), "Bitmap 1.3 (Saved using OS/2 Multimedia)", "bmp", "Bitmap" },
-    { FALSE, BMF_OS20, mmioFOURCC( 'O','S','2','0' ), "Bitmap 2.0 (Saved using OS/2 Multimedia)", "bmp", "Bitmap" },
-    { FALSE, BMF_TIF,  mmioFOURCC( 'T','F','M','C' ), "TIFF compressed", "tif", "TIFF" },
-    { FALSE, BMF_TIFU, mmioFOURCC( 'T','F','M','U' ), "TIFF uncompressed", "tif", "TIFF" },
-    { FALSE, BMF_TGA,  mmioFOURCC( 'T','G','A','C' ), "TGA", "tga", "Targa" },
-    { FALSE, BMF_PCX,  mmioFOURCC( 'P','C','X','C' ), "PCX", "pcx", "PCX" },
-    { FALSE, BMF_GIF,  mmioFOURCC( 'G','I','F','C' ), "GIF", "gif", "GIF" },
-    { FALSE, BMF_JPG,  mmioFOURCC( 'J','P','E','G' ), "Jpeg (Probably won't work, reason unknown)", "jpg", "JPG" },
-    { FALSE, BMF_DIB,  mmioFOURCC( 'R','D','I','B' ), "DIB (Device Independent Bitmap)", "dib", "DIB" }
+    { TRUE, BMF_JPG,   "JPEG Interchange File Format (jpg)", "jpg", "JPG" },
+    { TRUE, BMF_PNG,   "Portable Network Graphics (png)", "png", "PNG" },
+    { TRUE, BMF_OS20,  "OS/2 Bitmap 2.0 (bmp)", "bmp", "Bitmap" },
+    { TRUE, BMF_TIF,   "Microsoft/Aldus Tagged Image File Format (tif)", "tif", "TIFF" },
+    { TRUE, BMF_TGA,   "Truevision Targa/Vista (tga)", "tga", "Targa" },
+    { TRUE, BMF_PCX,   "ZSoft PC Paintbrush Image Format (pcx)", "pcx", "PCX" },
+    { TRUE, BMF_GIF,   "Portable Anymap (pnm)", "pnm", "PNM" },
+    { TRUE, BMF_PBM,   "Portable Pixel-map (ppm)", "ppm", "PPM" },
+    { TRUE, BMF_JP2,   "Jpeg 2000 (provided by the Open Source OpenJPEG library) (jp2)", "jp2", "JP2" },
+    { TRUE, BMF_DIB,   "Device Independent Bitmap (dib)", "dib", "DIB" }
 };
 
-#else
-// pbm and gif don't save anything
-ImageFormatInfo Settings::ifi[BMF_INVALID] =
-{
-    { TRUE, BMF_JPG,  0L, "JPEG Interchange File Format (jpg)", "jpg", "JPG" },
-    { TRUE, BMF_PNG,  0L, "Portable Network Graphics (png)", "png", "PNG" },
-    { TRUE, BMF_OS20, 0L, "OS/2 Bitmap 2.0 (bmp)", "bmp", "Bitmap" },
-    { TRUE, BMF_TIF,  0L, "Microsoft/Aldus Tagged Image File Format (tif)", "tif", "TIFF" },
-    { TRUE, BMF_TGA,  0L, "Truevision Targa/Vista (tga)", "tga", "Targa" },
-    { TRUE, BMF_PCX,  0L, "ZSoft PC Paintbrush Image Format (pcx)", "pcx", "PCX" },
-    { TRUE, BMF_GIF,  0L, "Portable Anymap (pnm)", "pnm", "PNM" },
-    { TRUE, BMF_PBM,  0L, "Portable Pixel-map (ppm)", "ppm", "PPM" },
-    { TRUE, BMF_JP2,  0L, "Jpeg 2000 (provided by the Open Source OpenJPEG library) (jp2)", "jp2", "JP2" },
-    { TRUE, BMF_JBG,  0L, "JBIG Joint Bi-level Image experts Group (jbg)", "jbg", "JBG" },
-    { TRUE, BMF_RAW,  0L, "Camera RAW Image Format (raw)", "raw", "RAW" },
-    { TRUE, BMF_DIB,  0L, "Device Independent Bitmap (dib)", "dib", "DIB" }
-};
-#endif
 
 PTHTH_SE apse[] =
@@ -101,5 +81,5 @@
     new THTH_SEB (SEI_USSSW, "Snapshot", "US", &ausDefSSW, sizeof (ausDefSSW)),
 
-    new THTH_SES (SEI_LANGUAGE,     "Language", "Program", PSZ_DEFAULTLANGUAGE),
+    new THTH_SES (SEI_LANGUAGE,     "Language", "Program", PSZ_DEFAULTLANGUAGEMOD),
     new THTH_SES (SEI_LANGUAGEHELP, "Language", "Help", PSZ_DEFAULTLANGUAGEHELP),
 
@@ -135,44 +115,4 @@
         ReloadResources (QueryString(SEI_LANGUAGE));
     }
-
-    // See if we can use OS/2 Multimedia:
-    mmio = new thth_MMIO();
-    if( ! mmio->IsValid() ) {
-        delete mmio;
-        mmio = NULL;
-        if( mmio->step > 0 )
-            DisplayError( "MMIO-Error",
-                          "Could not load Multimedia IO extension. (rc=%d, step=%d)", mmio->rc, mmio->step );
-    } else {
-        MMFORMATINFO  mmfi;
-        ULONG lNumFormats = 30;
-        LONG lReturned;
-        PMMFORMATINFO pv = PMMFORMATINFO( malloc( sizeof( MMFORMATINFO ) * lNumFormats ) );
-        memset( &mmfi, 0, sizeof( MMFORMATINFO ) );
-        mmfi.ulMediaType = MMIO_MEDIATYPE_IMAGE;
-
-        if( pv ) {
-            if( mmioGetFormats( &mmfi, lNumFormats, pv, &lReturned, 0, 0 )
-                != MMIO_SUCCESS ) {
-                DisplayError( "MMIO-Error",
-                              "Could not get Multimedia-IO-Format information." );
-            } else {
-                /*            DisplayError( "MMIO-Error",
-                 "'%d' formats returned", lReturned ); */
-                for( int i = 0; i < lReturned; i++ ) {
-                    for( int j = 0; j < BMF_INVALID; j++ ) {
-                        if( ifi[j].fourcc == pv[i].fccIOProc )
-                        {
-                            ifi[j].available = TRUE;
-                            break;
-                        }
-                    }
-                }
-            }
-        } else {
-            DisplayError( "MMIO-Error",
-                          "Could not get Multimedia-IO-Format information (no memory)." );
-        }
-    }
 }
 
@@ -201,4 +141,5 @@
 // FIXME YUKKI! YUKKI!! YUKKI!!! But I'm too lazy to do it better now :-)
 HWND g_hwndSettingsDialog = NULL;
+HWND g_hwndPage0 = NULL;
 
 BOOL SETTINGS :: Dialog (BOOL fOnlyLanguage)
@@ -272,9 +213,10 @@
                         MPFROMLONG (idPage[i]), MPFROMP (pszPageTab[i]));
         }
-
+//#ifndef _QUIET_
+#if 0
         // open and assign dialogs to pages
         hwndPage[0] = WinLoadDlg (hwndNB, hwndNB, (PFNWP) Page1Procedure,
                                   GETMODULE, ID_DLG_SETTINGSPAGE1, this);
-        hwndPage[1] = WinLoadDlg (hwndNB, hwndNB, (PFNWP) Page2Procedure,
+        hwndPage[1] = WinLoadDlg (hwndNB, hwndNB, (PFNWP) WindowProcedure, //Page2Procedure,
                                   GETMODULE, ID_DLG_SETTINGSPAGE2, this);
         hwndPage[2] = WinLoadDlg (hwndNB, hwndNB, (PFNWP) Page3Procedure,
@@ -282,4 +224,18 @@
         hwndPage[3] = WinLoadDlg (hwndNB, hwndNB, (PFNWP) Page4Procedure,
                                   GETMODULE, ID_DLG_SETTINGSPAGE4, this);
+#else
+        hwndPage[0] = WinLoadDlg (hwndNB, hwndNB, (PFNWP) WindowProcedure,
+                                  GETMODULE, ID_DLG_SETTINGSPAGE0, this);
+        hwndPage[1] = WinLoadDlg (hwndNB, hwndNB, (PFNWP) Page1Procedure,
+                                  GETMODULE, ID_DLG_SETTINGSPAGE1, this);
+        hwndPage[2] = WinLoadDlg (hwndNB, hwndNB, (PFNWP) Page2Procedure,
+                                  GETMODULE, ID_DLG_SETTINGSPAGE2, this);
+        hwndPage[3] = WinLoadDlg (hwndNB, hwndNB, (PFNWP) Page4Procedure,
+                                  GETMODULE, ID_DLG_SETTINGSPAGE4, this);
+        _PmpfF(( "hwndpage 0 %i FID_CLIENT %i", hwndPage[0],
+               WinWindowFromID( hwndPage[0], WID_RB_CLIPBOARD)));
+        g_hwndPage0 = hwndPage[0];
+        
+#endif
     }
 #ifdef _DOLOGDEBUG_
@@ -302,5 +258,8 @@
     LogDebug( "Dialog: checkpoint 6" );
 #endif
-
+    WinSendDlgItemMsg (g_hwndPage0, WID_RB_FILE, BM_CLICK,
+                       MPFROMSHORT (TRUE), 0);
+    WinSendDlgItemMsg (g_hwndPage0, WID_CB_HIDEWINDOW, BM_SETCHECK,
+                       MPFROMLONG (TRUE), MPFROMLONG (0));
     //WinSetFocus (WinWindowFromID (hwndDlg, WID_PB_OK), TRUE);
     //WinSetFocus( hwndPage[0], TRUE );
@@ -362,4 +321,5 @@
             LogDebug( "DialogProcedure: start WID_PB_OK" );
 #endif
+            saveum = TRUE;
             WinSendMsg (hwnd, WM_CLOSE, 0,0);
 #ifdef _DOLOGDEBUG_
@@ -380,4 +340,5 @@
                                            BKM_QUERYPAGEWINDOWHWND,
                                            MPFROMLONG (id), 0);
+                // Make mp1 1 for default use it to select setting on pages
                     WinSendMsg (hwndPage, UM_SETTINGS2DIALOG, 0,0);
                 }
@@ -533,5 +494,10 @@
             WinSendDlgItemMsg( hwnd, WID_LB_FILEFORMAT, LM_SELECTITEM,
                                MPFROMSHORT(0), MPFROMSHORT(TRUE) );
-
+//#ifdef _QUIET_
+#if 1
+        // set play sound button
+        pset->AdjustButton (hwnd, WID_CB_DOSOUND,
+                            pset->DoSound ());
+#endif
         // Select appropriate radiobutton for save style.
         switch (pset->QueryFileSaveStyle ())
@@ -575,4 +541,9 @@
             else
                 pset->SetFileSaveStyle (FSS_PROMPT);
+//#ifdef _QUIET_
+#if 1
+            pset->DoSound(WinQueryButtonCheckstate
+                          (hwnd, WID_CB_DOSOUND));
+#endif
 #ifdef _DOLOGDEBUG_
             LogDebug( "Page1Procedure: checkpoint 1" );
@@ -606,4 +577,10 @@
             AdjustSaveTypeButtons
                 (BOOL (pset->QueryFileSaveStyle () == FSS_FORCEFILE));
+            pset->saveStyle = pset->QuerySaveStyle ();
+            pset->pNumSaveDir = pset->QueryNumSaveDir ();
+            pset->pForceSaveFile = pset->QueryForceSaveFile();
+
+            if (saveum)
+                pset->Save ();
 #ifdef _DOLOGDEBUG_
             LogDebug( "Page1Procedure: end UM_ADJUST" );
@@ -630,5 +607,5 @@
 }
 
-// ** Page2Procedure ****************************************************** /*fold00*/
+// ** Page2Procedure ****************************************************** /*FOLD00*/
 
 MRESULT EXPENTRY
@@ -665,5 +642,23 @@
         pset->AdjustButton (hwnd, WID_CB_SSWALWAYSONTOP,
                             pset->SSWAlwaysOnTop ());
-
+//#ifdef _QUIET_
+#if 1
+        pset->AdjustButton (hwnd, WID_CB_SERIALCAPTURE,
+                            pset->SerialCapture ());
+        pset->AdjustButton (hwnd, WID_CB_DELAYCOUNTDOWN,
+                            pset->DelayCountdown ());
+
+        // init delay time sb
+        WinSendDlgItemMsg (hwnd, WID_SB_DELAYTIME, SPBM_SETLIMITS,
+                           MPFROMLONG (65536), MPFROMLONG (1));
+        WinSendDlgItemMsg (hwnd, WID_SB_DELAYTIME, SPBM_SETCURRENTVALUE,
+                           MPFROMLONG (pset->QueryDelayTime ()), 0);
+
+        // init serial time sb
+        WinSendDlgItemMsg (hwnd, WID_SB_SERIALTIME, SPBM_SETLIMITS,
+                           MPFROMLONG (65536), MPFROMLONG (1));
+        WinSendDlgItemMsg (hwnd, WID_SB_SERIALTIME, SPBM_SETCURRENTVALUE,
+                           MPFROMLONG (pset->QuerySerialTime ()), 0);
+#endif
         switch (pset->QuerySSWCaptureType ())
         {
@@ -702,4 +697,6 @@
             LogDebug( "Page2Procedure: start UM_ADJUST" );
 #endif
+//#ifndef _QUIET_
+#if 0
         // query state of checkbuttons and set flags
         pset->SSWHide(WinQueryButtonCheckstate(hwnd, WID_CB_SSWHIDE));
@@ -713,5 +710,14 @@
             LogDebug( "Page2Procedure: checkpoint 2" );
 #endif
-
+#else
+            // query state of checkbuttons and set flags
+            pset->SerialCapture(WinQueryButtonCheckstate
+                                (hwnd, WID_CB_SERIALCAPTURE));
+#ifdef _DOLOGDEBUG_
+            LogDebug( "Page3Procedure: checkpoint 1" );
+#endif
+            pset->DelayCountdown(WinQueryButtonCheckstate
+                                 (hwnd, WID_CB_DELAYCOUNTDOWN));
+#endif
         // get ssw capture type
         if (WinSendMsg (WinWindowFromID (hwnd, WID_SSWSCREENREGION),
@@ -726,4 +732,29 @@
         else
             pset->SetSSWCaptureType (CAP_SCREEN);
+//#ifdef _QUITE_
+#if 1
+        // delay time
+        ULONG   ul;
+        if (! BOOL (WinSendDlgItemMsg (hwnd, WID_SB_DELAYTIME,
+                                       SPBM_QUERYVALUE,
+                                       MPFROMP (&ul),
+                                       MPFROM2SHORT (0, 0))))
+            ul = 5L;
+        pset->SetDelayTime (ul);
+#ifdef _DOLOGDEBUG_
+        LogDebug( "Page3Procedure: checkpoint 3" );
+#endif
+
+        // serial time
+        if (! BOOL (WinSendDlgItemMsg (hwnd, WID_SB_SERIALTIME,
+                                       SPBM_QUERYVALUE,
+                                       MPFROMP (&ul),
+                                       MPFROM2SHORT (0, 0))))
+            ul = 10L;
+        pset->SetSerialTime (ul);
+        pset->bSerialCapture = pset->SerialCapture ();
+#endif
+        if (saveum)
+            pset->Save ();
 #ifdef _DOLOGDEBUG_
         LogDebug( "Page2Procedure: end UM_ADJUST" );
@@ -842,4 +873,9 @@
                 ul = 10L;
             pset->SetSerialTime (ul);
+            pset->bSerialCapture = pset->SerialCapture ();
+            pset->idleSetInIni = pset->QueryFlag(SEI_IDLEPRIORITY);
+
+            if (saveum)
+                pset->Save ();
 #ifdef _DOLOGDEBUG_
             LogDebug( "Page3Procedure: end UM_ADJUST" );
@@ -1019,4 +1055,7 @@
                                MPFROM2SHORT (ul, sizeof (ach)), MPFROMP (ach));
             pset->SetString (SEI_LANGUAGEHELP, ach);
+
+            if (saveum)
+                pset->Save ();
         }
         return MRESULT (FALSE);
@@ -1026,5 +1065,5 @@
 }
 
-// ** AdjustSaveTypeButtons *********************************************** /*fold00*/
+// ** AdjustSaveTypeButtons *********************************************** /*FOLD00*/
 
 VOID AdjustSaveTypeButtons (BOOL f)
@@ -1079,5 +1118,5 @@
     APIRET  rc;
 
-    if ((rc = DosLoadModule(PSZ(NULL), 0, "gotresen.dll", &g_hmod)))
+    if ((rc = DosLoadModule(PSZ(NULL), 0, psz, &g_hmod)))
     {
         DisplayError("ERROR", "Could not (re)load Gotcha! resource module "
@@ -1089,10 +1128,16 @@
 
     ResourceString::Module(g_hmod);
-
+//#ifdef _QUIET_
+#if 1
+    pszPageTab[0] = RSTR (IDS_MAINWIN);
+    pszPageTab[1] = RSTR (IDS_PAGESAVE);
+    pszPageTab[2] = RSTR (IDS_PAGEMISC);
+    pszPageTab[3] = RSTR (IDS_PAGELANGUAGE);
+#else
     pszPageTab[0] = RSTR (IDS_PAGESAVE);
     pszPageTab[1] = RSTR (IDS_PAGESNAPSHOT);
     pszPageTab[2] = RSTR (IDS_PAGEMISC);
     pszPageTab[3] = RSTR (IDS_PAGELANGUAGE);
-
+#endif
     for( int i = 0; i < BMF_INVALID; i++ ) {
         ifi[ i ].label = RSTR ( IDS_BMF_JPG+i ); }
@@ -1101,5 +1146,5 @@
 }
 
-// ** SelectLanguage ****************************************************** /*fold00*/
+// ** SelectLanguage ****************************************************** /*FOLD00*/
 
 VOID Settings :: SelectLanguage (VOID)
@@ -1107,9 +1152,16 @@
     // set this to some default, as we must open the settings dialog for
     // selecting a language
+//#ifdef _QUIET_
+#if 1
+    pszPageTab[0] = RSTR (IDS_MAINWIN);
+    pszPageTab[1] = RSTR (IDS_PAGESAVE);
+    pszPageTab[2] = RSTR (IDS_PAGEMISC);
+    pszPageTab[3] = RSTR (IDS_PAGELANGUAGE);
+#else
     pszPageTab[0] = RSTR (IDS_PAGESAVE);
     pszPageTab[1] = RSTR (IDS_PAGESNAPSHOT);
     pszPageTab[2] = RSTR (IDS_PAGEMISC);
     pszPageTab[3] = RSTR (IDS_PAGELANGUAGE);
-
+#endif
     // bring up the "select language" settings page
     Dialog (TRUE);
@@ -1171,4 +1223,5 @@
 }
 
+#if 0
 // ** GetFOURCC *********************************************************** /*FOLD00*/
 
@@ -1181,5 +1234,5 @@
     return 0L;
 }
-
+#endif
 // ** GetFileEAType ******************************************************* /*FOLD00*/
 
