| 1 | /* $Id: conprop.cpp,v 1.1 1999-09-15 23:32:50 sandervl Exp $ */ | 
|---|
| 2 |  | 
|---|
| 3 | /* | 
|---|
| 4 | * Win32 Console API Translation for OS/2 | 
|---|
| 5 | * | 
|---|
| 6 | * 1998/03/06 Patrick Haller (haller@zebra.fh-weingarten.de) | 
|---|
| 7 | * | 
|---|
| 8 | * @(#) conprop.cpp             1.0.0   1998/03/06 PH Start from scratch | 
|---|
| 9 | */ | 
|---|
| 10 |  | 
|---|
| 11 |  | 
|---|
| 12 | /***************************************************************************** | 
|---|
| 13 | * Remark                                                                    * | 
|---|
| 14 | ***************************************************************************** | 
|---|
| 15 |  | 
|---|
| 16 | - save / load properties from EAs | 
|---|
| 17 |  | 
|---|
| 18 | */ | 
|---|
| 19 |  | 
|---|
| 20 |  | 
|---|
| 21 | /***************************************************************************** | 
|---|
| 22 | * Includes                                                                  * | 
|---|
| 23 | *****************************************************************************/ | 
|---|
| 24 |  | 
|---|
| 25 | #define  INCL_GPI | 
|---|
| 26 | #define  INCL_WIN | 
|---|
| 27 | #define  INCL_DOSMEMMGR | 
|---|
| 28 | #define  INCL_DOSSEMAPHORES | 
|---|
| 29 | #define  INCL_DOSERRORS | 
|---|
| 30 | #define  INCL_DOSPROCESS | 
|---|
| 31 | #define  INCL_DOSMODULEMGR | 
|---|
| 32 | #define  INCL_VIO | 
|---|
| 33 | #define  INCL_AVIO | 
|---|
| 34 | #include <os2wrap.h>    //Odin32 OS/2 api wrappers | 
|---|
| 35 | #include <builtin.h> | 
|---|
| 36 |  | 
|---|
| 37 | #include <stdlib.h> | 
|---|
| 38 | #include <string.h> | 
|---|
| 39 | #include <stdarg.h> | 
|---|
| 40 | #include <stdio.h> | 
|---|
| 41 |  | 
|---|
| 42 | #include <odin.h> | 
|---|
| 43 | #include "win32type.h" | 
|---|
| 44 | #include "misc.h" | 
|---|
| 45 |  | 
|---|
| 46 | #include "conwin.h"          // Windows Header for console only | 
|---|
| 47 | #include "console.h" | 
|---|
| 48 | #include "console2.h" | 
|---|
| 49 | #include "conprop.h" | 
|---|
| 50 |  | 
|---|
| 51 |  | 
|---|
| 52 | /***************************************************************************** | 
|---|
| 53 | * Defines                                                                   * | 
|---|
| 54 | *****************************************************************************/ | 
|---|
| 55 |  | 
|---|
| 56 |  | 
|---|
| 57 |  | 
|---|
| 58 | #define HWNDERR( hwnd )         \ | 
|---|
| 59 | (ERRORIDERROR( WinGetLastError( WinQueryAnchorBlock( hwnd ) ) )) | 
|---|
| 60 |  | 
|---|
| 61 |  | 
|---|
| 62 | /***************************************************************************** | 
|---|
| 63 | * Structures                                                                * | 
|---|
| 64 | *****************************************************************************/ | 
|---|
| 65 |  | 
|---|
| 66 | typedef struct                     // VARIABLES USED FOR A NOTEBOOK PAGE | 
|---|
| 67 | { | 
|---|
| 68 | ULONG     ulID;                  // Resource ID for dialog page | 
|---|
| 69 | PFNWP     wpDlgProc;             // dialog window procedure | 
|---|
| 70 | PSZ       szStatusLineText;      // Text to go on status line | 
|---|
| 71 | PSZ       szTabText;             // Text to go on major tab | 
|---|
| 72 | ULONG     idFocus;               // ID of the control to get the focus first | 
|---|
| 73 | BOOL      fParent;               // Is this a Parent page with minor pages | 
|---|
| 74 | USHORT    usTabType;             // BKA_MAJOR or BKA_MINOR | 
|---|
| 75 | USHORT    fsPageStyles;          // BKA_ styles for the page | 
|---|
| 76 | } NBPAGE, *PNBPAGE; | 
|---|
| 77 |  | 
|---|
| 78 | #define TAB_WIDTH_MARGIN      10   // Padding for the width of a notebook tab | 
|---|
| 79 | #define TAB_HEIGHT_MARGIN     6    // Padding for the height of a notebook tab | 
|---|
| 80 | #define DEFAULT_NB_TAB_HEIGHT 16   // Default if Gpi calls fail | 
|---|
| 81 |  | 
|---|
| 82 | #define PAGE_COUNT(a) (sizeof( a ) / sizeof( NBPAGE )) | 
|---|
| 83 | #define SPEAKERFREQ_LOW  200 | 
|---|
| 84 | #define SPEAKERFREQ_HIGH 2000 | 
|---|
| 85 | #define SPEAKERDUR_LOW 10 | 
|---|
| 86 | #define SPEAKERDUR_HIGH 2000 | 
|---|
| 87 |  | 
|---|
| 88 | /**********************************************************************/ | 
|---|
| 89 | /*----------------------- FUNCTION PROTOTYPES ------------------------*/ | 
|---|
| 90 | /**********************************************************************/ | 
|---|
| 91 |  | 
|---|
| 92 | static VOID ErrorMsg( PSZ szFormat, | 
|---|
| 93 | ... ); | 
|---|
| 94 |  | 
|---|
| 95 |  | 
|---|
| 96 | static HWND NBCreateNotebook(HWND    hwndClient, | 
|---|
| 97 | ULONG   id, | 
|---|
| 98 | HMODULE hModule, | 
|---|
| 99 | PNBPAGE pPage , | 
|---|
| 100 | ULONG   ulPages, | 
|---|
| 101 | PVOID   pCreationParameters); | 
|---|
| 102 |  | 
|---|
| 103 | static BOOL NBSetUpPage( HWND    hwndClient, | 
|---|
| 104 | HWND    hwndNB, | 
|---|
| 105 | HMODULE hModule, | 
|---|
| 106 | PNBPAGE pPage, | 
|---|
| 107 | PHWND   phwnd, | 
|---|
| 108 | PVOID   pCreationParameters); | 
|---|
| 109 |  | 
|---|
| 110 | static BOOL NBSetFramePos( HWND hwndFrame ); | 
|---|
| 111 |  | 
|---|
| 112 | static BOOL NBTurnToFirstPage( HWND hwndNB ); | 
|---|
| 113 |  | 
|---|
| 114 | static BOOL NBSetTabDimensions(HWND hwndNB); | 
|---|
| 115 |  | 
|---|
| 116 | static VOID NBSetNBPage(HWND              hwndClient, | 
|---|
| 117 | HMODULE           hModule, | 
|---|
| 118 | PPAGESELECTNOTIFY ppsn, | 
|---|
| 119 | PVOID             pCreationParameters); | 
|---|
| 120 |  | 
|---|
| 121 | static HWND NBCreateDialogPage(HWND    hwndParent, | 
|---|
| 122 | HWND    hwndNB, | 
|---|
| 123 | HMODULE hModule, | 
|---|
| 124 | ULONG   ulPageID, | 
|---|
| 125 | ULONG   idDlg, | 
|---|
| 126 | FNWP    fpDlg, | 
|---|
| 127 | PVOID   pCreationParameters); | 
|---|
| 128 |  | 
|---|
| 129 | static MRESULT EXPENTRY wpDlgProcPage1(HWND   hwnd, | 
|---|
| 130 | ULONG  ulMessage, | 
|---|
| 131 | MPARAM mp1, | 
|---|
| 132 | MPARAM mp2); | 
|---|
| 133 |  | 
|---|
| 134 | static MRESULT EXPENTRY wpDlgProcPage2(HWND   hwnd, | 
|---|
| 135 | ULONG  ulMessage, | 
|---|
| 136 | MPARAM mp1, | 
|---|
| 137 | MPARAM mp2); | 
|---|
| 138 |  | 
|---|
| 139 | static MRESULT EXPENTRY wpDlgProcPage3(HWND   hwnd, | 
|---|
| 140 | ULONG  ulMessage, | 
|---|
| 141 | MPARAM mp1, | 
|---|
| 142 | MPARAM mp2); | 
|---|
| 143 |  | 
|---|
| 144 | static MRESULT EXPENTRY wpDlgProcPage4(HWND   hwnd, | 
|---|
| 145 | ULONG  ulMessage, | 
|---|
| 146 | MPARAM mp1, | 
|---|
| 147 | MPARAM mp2); | 
|---|
| 148 |  | 
|---|
| 149 | static MRESULT EXPENTRY wpDlgProcPage5(HWND   hwnd, | 
|---|
| 150 | ULONG  ulMessage, | 
|---|
| 151 | MPARAM mp1, | 
|---|
| 152 | MPARAM mp2); | 
|---|
| 153 |  | 
|---|
| 154 | static MRESULT EXPENTRY wpDlgProcPage6(HWND   hwnd, | 
|---|
| 155 | ULONG  ulMessage, | 
|---|
| 156 | MPARAM mp1, | 
|---|
| 157 | MPARAM mp2); | 
|---|
| 158 |  | 
|---|
| 159 | static INT WinGetStringSize(HPS hps, | 
|---|
| 160 | PSZ szString ); | 
|---|
| 161 |  | 
|---|
| 162 |  | 
|---|
| 163 | static APIRET ConPropPage1Set(HWND            hwndDlg, | 
|---|
| 164 | PICONSOLEOPTIONS pConsoleOptions); | 
|---|
| 165 |  | 
|---|
| 166 | static APIRET ConPropPage2Set(HWND            hwndDlg, | 
|---|
| 167 | PICONSOLEOPTIONS pConsoleOptions); | 
|---|
| 168 |  | 
|---|
| 169 | static APIRET ConPropPage3Set(HWND            hwndDlg, | 
|---|
| 170 | PICONSOLEOPTIONS pConsoleOptions); | 
|---|
| 171 |  | 
|---|
| 172 | static APIRET ConPropPage4Set(HWND            hwndDlg, | 
|---|
| 173 | PICONSOLEOPTIONS pConsoleOptions); | 
|---|
| 174 |  | 
|---|
| 175 | static APIRET ConPropPage5Set(HWND            hwndDlg, | 
|---|
| 176 | PICONSOLEOPTIONS pConsoleOptions); | 
|---|
| 177 |  | 
|---|
| 178 | /**************************************************************************** | 
|---|
| 179 | * Module Global Variables                                                  * | 
|---|
| 180 | ****************************************************************************/ | 
|---|
| 181 |  | 
|---|
| 182 | #define __PAGE__ 0, FALSE, BKA_MAJOR, BKA_AUTOPAGESIZE | BKA_STATUSTEXTON | 
|---|
| 183 |  | 
|---|
| 184 | /* pfncreate, szStatusLineText, szTabText, idFocus, fParent, usTabType, fsPageStyles */ | 
|---|
| 185 | static NBPAGE nbpage[] = | 
|---|
| 186 | { | 
|---|
| 187 | {DLG_CONSOLE_PAGE1, wpDlgProcPage1, "General settings",         "~Settings", __PAGE__ }, | 
|---|
| 188 | {DLG_CONSOLE_PAGE2, wpDlgProcPage2, "Speaker settings",         "S~peaker",  __PAGE__ }, | 
|---|
| 189 | {DLG_CONSOLE_PAGE3, wpDlgProcPage3, "Window position and size", "~Window",   __PAGE__ }, | 
|---|
| 190 | {DLG_CONSOLE_PAGE4, wpDlgProcPage4, "Colors",                   "C~olors",   __PAGE__ }, | 
|---|
| 191 | {DLG_CONSOLE_PAGE5, wpDlgProcPage5, "Priorities",               "P~riority", __PAGE__ }, | 
|---|
| 192 | {DLG_CONSOLE_PAGE6, wpDlgProcPage6, "About ...",                "~About",    __PAGE__ } | 
|---|
| 193 | }; | 
|---|
| 194 |  | 
|---|
| 195 | static PSZ priorities[] = {"idle", "normal", "critical", "server"}; | 
|---|
| 196 | #define NUMPRIORITIES 4 | 
|---|
| 197 |  | 
|---|
| 198 | /**********************************************************************/ | 
|---|
| 199 | /*------------------------------- Msg --------------------------------*/ | 
|---|
| 200 | /*                                                                    */ | 
|---|
| 201 | /*  DISPLAY A MESSAGE TO THE USER.                                    */ | 
|---|
| 202 | /*                                                                    */ | 
|---|
| 203 | /*  INPUT: a message in printf format with its parms                  */ | 
|---|
| 204 | /*                                                                    */ | 
|---|
| 205 | /*  1. Format the message using vsprintf.                             */ | 
|---|
| 206 | /*  2. Sound a warning sound.                                         */ | 
|---|
| 207 | /*  3. Display the message in a message box.                          */ | 
|---|
| 208 | /*                                                                    */ | 
|---|
| 209 | /*  OUTPUT: nothing                                                   */ | 
|---|
| 210 | /*                                                                    */ | 
|---|
| 211 | /*--------------------------------------------------------------------*/ | 
|---|
| 212 | /**********************************************************************/ | 
|---|
| 213 |  | 
|---|
| 214 | #define MESSAGE_SIZE 1024 | 
|---|
| 215 |  | 
|---|
| 216 | static VOID ErrorMsg( PSZ szFormat, | 
|---|
| 217 | ... ) | 
|---|
| 218 | { | 
|---|
| 219 | PSZ     szMsg; | 
|---|
| 220 | va_list argptr; | 
|---|
| 221 |  | 
|---|
| 222 | if( (szMsg = (PSZ)malloc( MESSAGE_SIZE )) == NULL ) | 
|---|
| 223 | return; | 
|---|
| 224 |  | 
|---|
| 225 | va_start( argptr, szFormat ); | 
|---|
| 226 | vsprintf( szMsg, szFormat, argptr ); | 
|---|
| 227 | va_end( argptr ); | 
|---|
| 228 |  | 
|---|
| 229 | szMsg[ MESSAGE_SIZE - 1 ] = 0; | 
|---|
| 230 |  | 
|---|
| 231 | (void) WinMessageBox( HWND_DESKTOP, | 
|---|
| 232 | HWND_DESKTOP, | 
|---|
| 233 | szMsg, | 
|---|
| 234 | "Error ...", | 
|---|
| 235 | 1, | 
|---|
| 236 | MB_OK | MB_MOVEABLE ); | 
|---|
| 237 | free( szMsg ); | 
|---|
| 238 | return; | 
|---|
| 239 | } | 
|---|
| 240 |  | 
|---|
| 241 |  | 
|---|
| 242 | /***************************************************************************** | 
|---|
| 243 | * Name      : static MRESULT ConsolePropertyDlgProc | 
|---|
| 244 | * Purpose   : window procedure for the console property dialog | 
|---|
| 245 | * Parameters: HWND   hwndDialog | 
|---|
| 246 | *             ULONG  ulMessage | 
|---|
| 247 | *             MPARAM mp1 | 
|---|
| 248 | *             MPARAM mp2 | 
|---|
| 249 | * Variables : | 
|---|
| 250 | * Result    : | 
|---|
| 251 | * Remark    : | 
|---|
| 252 | * Status    : UNTESTED | 
|---|
| 253 | * | 
|---|
| 254 | * Autor     : Patrick Haller [Wed, 1998/02/16 11:46] | 
|---|
| 255 | *****************************************************************************/ | 
|---|
| 256 |  | 
|---|
| 257 | MRESULT EXPENTRY ConsolePropertyDlgProc(HWND   hwnd, | 
|---|
| 258 | ULONG  ulMessage, | 
|---|
| 259 | MPARAM mp1, | 
|---|
| 260 | MPARAM mp2) | 
|---|
| 261 | { | 
|---|
| 262 | switch (ulMessage) | 
|---|
| 263 | { | 
|---|
| 264 | /************************************************************************* | 
|---|
| 265 | * initialize the dialog                                                 * | 
|---|
| 266 | *************************************************************************/ | 
|---|
| 267 | case WM_INITDLG: | 
|---|
| 268 | { | 
|---|
| 269 | PICONSOLEOPTIONS pConsoleOptions = (PICONSOLEOPTIONS)mp2;    /* save ptr */ | 
|---|
| 270 | HWND            hwndNotebook;                /* notebook window handle */ | 
|---|
| 271 |  | 
|---|
| 272 |  | 
|---|
| 273 | /* @@@PH we should work on a copy of the console options for */ | 
|---|
| 274 | /* UNDO and APPLY to work properly */ | 
|---|
| 275 |  | 
|---|
| 276 | WinSetWindowULong (hwnd,            /* store the data pointer in local */ | 
|---|
| 277 | QWL_USER,        /* variable storage attached to the*/ | 
|---|
| 278 | (ULONG)pConsoleOptions); /* window itself.          */ | 
|---|
| 279 |  | 
|---|
| 280 | hwndNotebook = NBCreateNotebook(hwnd,      /* fill notebook with pages */ | 
|---|
| 281 | NB_CONSOLE_NOTEBOOK, | 
|---|
| 282 | pConsoleOptions->hmodResources, | 
|---|
| 283 | nbpage, | 
|---|
| 284 | PAGE_COUNT(nbpage), | 
|---|
| 285 | (PVOID)NULL); | 
|---|
| 286 |  | 
|---|
| 287 | /* this message makes the client pages to write new values into their  */ | 
|---|
| 288 | /* controls.                                                           */ | 
|---|
| 289 | WinBroadcastMsg(hwnd,                      /* broadcast to all dialogs */ | 
|---|
| 290 | UM_PROPERTY_UNDO, | 
|---|
| 291 | (MPARAM)pConsoleOptions, | 
|---|
| 292 | (MPARAM)NULL, | 
|---|
| 293 | BMSG_SEND | | 
|---|
| 294 | BMSG_DESCENDANTS); | 
|---|
| 295 |  | 
|---|
| 296 | return ((MPARAM)FALSE); | 
|---|
| 297 | } | 
|---|
| 298 |  | 
|---|
| 299 |  | 
|---|
| 300 | /************************************************************************* | 
|---|
| 301 | * control command messages                                              * | 
|---|
| 302 | *************************************************************************/ | 
|---|
| 303 |  | 
|---|
| 304 | case WM_COMMAND: | 
|---|
| 305 | { | 
|---|
| 306 | PICONSOLEOPTIONS pConsoleOptions;      /* the console options structure */ | 
|---|
| 307 |  | 
|---|
| 308 | pConsoleOptions = (PICONSOLEOPTIONS) | 
|---|
| 309 | WinQueryWindowULong(hwnd,  /* query pointer from wnd */ | 
|---|
| 310 | QWL_USER); | 
|---|
| 311 |  | 
|---|
| 312 | switch (SHORT1FROMMP(mp1)) | 
|---|
| 313 | { | 
|---|
| 314 | case ID_BTN_UNDO: | 
|---|
| 315 | /* broadcast user message UM_PROPERTY_UNDO */ | 
|---|
| 316 | WinBroadcastMsg(hwnd,                  /* broadcast to all dialogs */ | 
|---|
| 317 | UM_PROPERTY_UNDO, | 
|---|
| 318 | (MPARAM)pConsoleOptions, | 
|---|
| 319 | (MPARAM)NULL, | 
|---|
| 320 | BMSG_SEND | | 
|---|
| 321 | BMSG_DESCENDANTS); | 
|---|
| 322 | return ( (MPARAM) FALSE); | 
|---|
| 323 |  | 
|---|
| 324 | case ID_BTN_SAVE: | 
|---|
| 325 | /* @@@PH save console option work buffer */ | 
|---|
| 326 | /* @@@PH ConsolePropertyWrite(pConsoleOptions) */ | 
|---|
| 327 | WinDismissDlg(hwnd, | 
|---|
| 328 | ID_BTN_SAVE); | 
|---|
| 329 | return ( (MPARAM) FALSE); | 
|---|
| 330 |  | 
|---|
| 331 | case ID_BTN_APPLY: | 
|---|
| 332 | /* @@@PH save console option work buffer */ | 
|---|
| 333 | WinDismissDlg(hwnd, | 
|---|
| 334 | ID_BTN_APPLY); | 
|---|
| 335 | return ( (MPARAM) FALSE); | 
|---|
| 336 |  | 
|---|
| 337 | case BS_HELP: | 
|---|
| 338 | return ( (MPARAM) FALSE); | 
|---|
| 339 | } | 
|---|
| 340 | } | 
|---|
| 341 | } | 
|---|
| 342 |  | 
|---|
| 343 | return WinDefDlgProc(hwnd,                   /* default message processing */ | 
|---|
| 344 | ulMessage, | 
|---|
| 345 | mp1, | 
|---|
| 346 | mp2); | 
|---|
| 347 | } | 
|---|
| 348 |  | 
|---|
| 349 |  | 
|---|
| 350 | /***************************************************************************** | 
|---|
| 351 | * Name      : | 
|---|
| 352 | * Purpose   : | 
|---|
| 353 | * Parameters: | 
|---|
| 354 | * Variables : | 
|---|
| 355 | * Result    : | 
|---|
| 356 | * Remark    : | 
|---|
| 357 | * Status    : UNTESTED | 
|---|
| 358 | * | 
|---|
| 359 | * Autor     : Patrick Haller [Wed, 1998/03/07 11:46] | 
|---|
| 360 | *****************************************************************************/ | 
|---|
| 361 |  | 
|---|
| 362 | static HWND NBCreateNotebook(HWND    hwndClient, | 
|---|
| 363 | ULONG   id, | 
|---|
| 364 | HMODULE hModule, | 
|---|
| 365 | PNBPAGE pPage , | 
|---|
| 366 | ULONG   ulPages, | 
|---|
| 367 | PVOID   pCreationParameters) | 
|---|
| 368 | { | 
|---|
| 369 | BOOL      fSuccess = TRUE; | 
|---|
| 370 | HWND      hwndNB; | 
|---|
| 371 | INT       i; | 
|---|
| 372 | PNBPAGE   pP;                      /* Zeiger auf die Seiten des Notebookes */ | 
|---|
| 373 |  | 
|---|
| 374 |  | 
|---|
| 375 | if (pPage == NULL)                                 /* Parameterberprfung */ | 
|---|
| 376 | return ( NULLHANDLE ); | 
|---|
| 377 |  | 
|---|
| 378 | hwndNB = WinWindowFromID(hwndClient,         /* get notebook window handle */ | 
|---|
| 379 | id); | 
|---|
| 380 |  | 
|---|
| 381 | if( hwndNB ) | 
|---|
| 382 | { | 
|---|
| 383 | // Set the page background color to grey so it is the same as a dlg box. | 
|---|
| 384 | if( !WinSendMsg(hwndNB, | 
|---|
| 385 | BKM_SETNOTEBOOKCOLORS, | 
|---|
| 386 | MPFROMLONG( SYSCLR_FIELDBACKGROUND ), | 
|---|
| 387 | MPFROMSHORT( BKA_BACKGROUNDPAGECOLORINDEX ) ) ) | 
|---|
| 388 | ErrorMsg("BKM_SETNOTEBOOKCOLORS failed! RC(%X)", | 
|---|
| 389 | HWNDERR( hwndClient )); | 
|---|
| 390 |  | 
|---|
| 391 | // Insert all the pages into the notebook and configure them. The dialog | 
|---|
| 392 | // boxes are not going to be loaded and associated with those pages yet. | 
|---|
| 393 |  | 
|---|
| 394 | for(i = 0, | 
|---|
| 395 | pP = pPage; | 
|---|
| 396 |  | 
|---|
| 397 | (i < ulPages) && | 
|---|
| 398 | (fSuccess == TRUE); | 
|---|
| 399 |  | 
|---|
| 400 | i++, | 
|---|
| 401 | pP++ ) | 
|---|
| 402 |  | 
|---|
| 403 | if (NBSetUpPage(hwndClient, | 
|---|
| 404 | hwndNB, | 
|---|
| 405 | hModule, | 
|---|
| 406 | pP, | 
|---|
| 407 | NULL, | 
|---|
| 408 | pCreationParameters) == NULLHANDLE) | 
|---|
| 409 | fSuccess = FALSE; | 
|---|
| 410 | } | 
|---|
| 411 | else | 
|---|
| 412 | { | 
|---|
| 413 | fSuccess = FALSE; | 
|---|
| 414 | ErrorMsg("Notebook creation failed! RC(%X)", | 
|---|
| 415 | HWNDERR( hwndClient ) ); | 
|---|
| 416 | } | 
|---|
| 417 |  | 
|---|
| 418 | if (fSuccess == TRUE)                       /* set notebook tab dimensions */ | 
|---|
| 419 | if( !NBSetTabDimensions(hwndNB)) | 
|---|
| 420 | fSuccess = FALSE; | 
|---|
| 421 |  | 
|---|
| 422 |  | 
|---|
| 423 | if (fSuccess == TRUE)                         /* Haben wir Erfolg gehabt ? */ | 
|---|
| 424 | return (hwndNB);                                                   /* Ja */ | 
|---|
| 425 | else | 
|---|
| 426 | return ( NULLHANDLE );                                           /* Nein */ | 
|---|
| 427 | } | 
|---|
| 428 |  | 
|---|
| 429 |  | 
|---|
| 430 |  | 
|---|
| 431 | /***************************************************************************** | 
|---|
| 432 | *----------------------------- SetUpPage ---------------------------- | 
|---|
| 433 | * | 
|---|
| 434 | *  SET UP A NOTEBOOK PAGE. | 
|---|
| 435 | * | 
|---|
| 436 | *  INPUT: window handle of notebook control, | 
|---|
| 437 | *         index into nbpage array | 
|---|
| 438 | * | 
|---|
| 439 | *  1. | 
|---|
| 440 | * | 
|---|
| 441 | *  OUTPUT: TRUE or FALSE if successful or not | 
|---|
| 442 | * | 
|---|
| 443 | *****************************************************************************/ | 
|---|
| 444 |  | 
|---|
| 445 | static BOOL NBSetUpPage( HWND    hwndClient, | 
|---|
| 446 | HWND    hwndNB, | 
|---|
| 447 | HMODULE hModule, | 
|---|
| 448 | PNBPAGE pPage, | 
|---|
| 449 | PHWND   phwnd, | 
|---|
| 450 | PVOID   pCreationParameters) | 
|---|
| 451 | { | 
|---|
| 452 | ULONG ulPageId; | 
|---|
| 453 | BOOL  fSuccess = TRUE; | 
|---|
| 454 | HWND  hwndPage = NULLHANDLE; | 
|---|
| 455 |  | 
|---|
| 456 |  | 
|---|
| 457 | if (pPage == NULL)                                 /* Parameterberprfung */ | 
|---|
| 458 | return (hwndPage);                                            /* failed !*/ | 
|---|
| 459 |  | 
|---|
| 460 | /* Insert a page into the notebook and store it in the array of page data. */ | 
|---|
| 461 | /* Specify that it is to have status text and the window associated with   */ | 
|---|
| 462 | /* each page will be automatically sized by the notebook according to the  */ | 
|---|
| 463 | /* size of the page.                                                       */ | 
|---|
| 464 |  | 
|---|
| 465 | ulPageId = (ULONG) WinSendMsg( hwndNB, | 
|---|
| 466 | BKM_INSERTPAGE, | 
|---|
| 467 | NULL, | 
|---|
| 468 | MPFROM2SHORT( pPage->usTabType | | 
|---|
| 469 | pPage->fsPageStyles, | 
|---|
| 470 | BKA_LAST ) ); | 
|---|
| 471 |  | 
|---|
| 472 | if( ulPageId ) | 
|---|
| 473 | { | 
|---|
| 474 | /* Insert a pointer to this page's info into the space available     */ | 
|---|
| 475 | /* in each page (its PAGE DATA that is available to the application).*/ | 
|---|
| 476 | fSuccess = (BOOL) WinSendMsg( hwndNB, BKM_SETPAGEDATA, | 
|---|
| 477 | MPFROMLONG( ulPageId ), | 
|---|
| 478 | MPFROMP( pPage ) ); | 
|---|
| 479 |  | 
|---|
| 480 | /* Set the text into the status line. */ | 
|---|
| 481 | if( fSuccess ) | 
|---|
| 482 | { | 
|---|
| 483 | if( pPage->fsPageStyles & BKA_STATUSTEXTON ) | 
|---|
| 484 | { | 
|---|
| 485 | fSuccess = (BOOL) WinSendMsg( hwndNB, BKM_SETSTATUSLINETEXT, | 
|---|
| 486 | MPFROMP( ulPageId ), | 
|---|
| 487 | MPFROMP( pPage->szStatusLineText ) ); | 
|---|
| 488 | if( !fSuccess )                              /* check errors */ | 
|---|
| 489 | ErrorMsg("BKM_SETSTATUSLINETEXT RC(%X)", | 
|---|
| 490 | HWNDERR(hwndNB) ); | 
|---|
| 491 |  | 
|---|
| 492 | } | 
|---|
| 493 | } | 
|---|
| 494 | else | 
|---|
| 495 | ErrorMsg("BKM_SETPAGEDATA RC(%X)", | 
|---|
| 496 | HWNDERR(hwndNB) ); | 
|---|
| 497 |  | 
|---|
| 498 | // Set the text into the tab for this page. | 
|---|
| 499 | if( fSuccess ) | 
|---|
| 500 | { | 
|---|
| 501 | fSuccess = (BOOL) WinSendMsg(hwndNB, | 
|---|
| 502 | BKM_SETTABTEXT, | 
|---|
| 503 | MPFROMP(ulPageId), | 
|---|
| 504 | MPFROMP(pPage->szTabText) ); | 
|---|
| 505 | if(!fSuccess)                                    /* check errors */ | 
|---|
| 506 | ErrorMsg("BKM_SETTABTEXT RC(%X)", | 
|---|
| 507 | HWNDERR( hwndNB ) ); | 
|---|
| 508 | } | 
|---|
| 509 |  | 
|---|
| 510 |  | 
|---|
| 511 | // Create the dialog | 
|---|
| 512 | if (fSuccess) | 
|---|
| 513 | { | 
|---|
| 514 | hwndPage = (HWND) WinSendMsg( hwndNB, BKM_QUERYPAGEWINDOWHWND, | 
|---|
| 515 | MPFROMLONG( ulPageId ), NULL ); | 
|---|
| 516 | if( hwndPage == (HWND) BOOKERR_INVALID_PARAMETERS ) | 
|---|
| 517 | { | 
|---|
| 518 | hwndPage = NULLHANDLE; | 
|---|
| 519 | ErrorMsg( "NBSetUpPage BKM_QUERYPAGEWINDOWHWND Invalid page specified" ); | 
|---|
| 520 | } | 
|---|
| 521 | else | 
|---|
| 522 | if( !hwndPage ) | 
|---|
| 523 | { | 
|---|
| 524 | /* load dialog from resource */ | 
|---|
| 525 | hwndPage = NBCreateDialogPage(hwndClient, | 
|---|
| 526 | hwndNB, | 
|---|
| 527 | hModule, | 
|---|
| 528 | ulPageId, | 
|---|
| 529 | pPage->ulID, | 
|---|
| 530 | pPage->wpDlgProc, | 
|---|
| 531 | pCreationParameters); | 
|---|
| 532 | if (phwnd != NULL) | 
|---|
| 533 | *phwnd = hwndPage;            /* RckgabeHWND liefern */ | 
|---|
| 534 |  | 
|---|
| 535 | if (hwndPage == NULLHANDLE) | 
|---|
| 536 | { | 
|---|
| 537 | fSuccess = FALSE; | 
|---|
| 538 | ErrorMsg( "pPage-pfncreate failed. RC(%X)", HWNDERR( hwndNB ) ); | 
|---|
| 539 | } | 
|---|
| 540 | } | 
|---|
| 541 | } | 
|---|
| 542 |  | 
|---|
| 543 | } | 
|---|
| 544 | else | 
|---|
| 545 | ErrorMsg( "BKM_INSERTPAGE RC(%X)", HWNDERR( hwndNB ) ); | 
|---|
| 546 |  | 
|---|
| 547 | return (fSuccess); | 
|---|
| 548 | } | 
|---|
| 549 |  | 
|---|
| 550 |  | 
|---|
| 551 | /**********************************************************************/ | 
|---|
| 552 | /*---------------------------- SetFramePos ---------------------------*/ | 
|---|
| 553 | /*                                                                    */ | 
|---|
| 554 | /*  SET THE FRAME ORIGIN AND SIZE.                                    */ | 
|---|
| 555 | /*                                                                    */ | 
|---|
| 556 | /*  INPUT: frame window handle                                        */ | 
|---|
| 557 | /*                                                                    */ | 
|---|
| 558 | /*  1.                                                                */ | 
|---|
| 559 | /*                                                                    */ | 
|---|
| 560 | /*  OUTPUT: TRUE or FALSE if successful or not                        */ | 
|---|
| 561 | /*                                                                    */ | 
|---|
| 562 | /*--------------------------------------------------------------------*/ | 
|---|
| 563 | /**********************************************************************/ | 
|---|
| 564 |  | 
|---|
| 565 | static BOOL NBSetFramePos( HWND hwndFrame ) | 
|---|
| 566 | { | 
|---|
| 567 | BOOL   fSuccess; | 
|---|
| 568 | POINTL aptl[ 2 ]; | 
|---|
| 569 |  | 
|---|
| 570 | // Convert origin and size from dialog units to pixels. We need to do this | 
|---|
| 571 | // because dialog boxes are automatically sized to the display. Since the | 
|---|
| 572 | // notebook contains these dialogs it must size itself accordingly so the | 
|---|
| 573 | // dialogs fit in the notebook. | 
|---|
| 574 |  | 
|---|
| 575 | /* @@@PH ??? */ | 
|---|
| 576 | #define FRAME_X               4    // In dialog units! | 
|---|
| 577 | #define FRAME_Y               4    // In dialog units! | 
|---|
| 578 | #define FRAME_CX              275  // In dialog units! | 
|---|
| 579 | #define FRAME_CY              210  // In dialog units! | 
|---|
| 580 |  | 
|---|
| 581 | aptl[ 0 ].x = FRAME_X; | 
|---|
| 582 | aptl[ 0 ].y = FRAME_Y; | 
|---|
| 583 | aptl[ 1 ].x = FRAME_CX; | 
|---|
| 584 | aptl[ 1 ].y = FRAME_CY; | 
|---|
| 585 |  | 
|---|
| 586 | fSuccess = WinMapDlgPoints(HWND_DESKTOP, | 
|---|
| 587 | aptl, | 
|---|
| 588 | 2, | 
|---|
| 589 | TRUE ); | 
|---|
| 590 | if( fSuccess ) | 
|---|
| 591 | { | 
|---|
| 592 | fSuccess = WinSetWindowPos(hwndFrame, | 
|---|
| 593 | NULLHANDLE, | 
|---|
| 594 | aptl[ 0 ].x, | 
|---|
| 595 | aptl[ 0 ].y, | 
|---|
| 596 | aptl[ 1 ].x, | 
|---|
| 597 | aptl[ 1 ].y, | 
|---|
| 598 | SWP_SIZE | | 
|---|
| 599 | SWP_MOVE | | 
|---|
| 600 | SWP_SHOW | | 
|---|
| 601 | SWP_ACTIVATE ); | 
|---|
| 602 | if( !fSuccess ) | 
|---|
| 603 | ErrorMsg( "SetFramePos WinSetWindowPos RC(%X)", | 
|---|
| 604 | HWNDERR( hwndFrame ) ); | 
|---|
| 605 | } | 
|---|
| 606 | else | 
|---|
| 607 | ErrorMsg( "WinMapDlgPoints RC(%X)", | 
|---|
| 608 | HWNDERR( hwndFrame ) ); | 
|---|
| 609 |  | 
|---|
| 610 | return fSuccess; | 
|---|
| 611 | } | 
|---|
| 612 |  | 
|---|
| 613 |  | 
|---|
| 614 | /**********************************************************************/ | 
|---|
| 615 | /*------------------------- TurnToFirstPage --------------------------*/ | 
|---|
| 616 | /*                                                                    */ | 
|---|
| 617 | /*  TURN TO THE FIRST PAGE IN THE NOTEBOOK.                           */ | 
|---|
| 618 | /*                                                                    */ | 
|---|
| 619 | /*  INPUT: notebook window handle                                     */ | 
|---|
| 620 | /*                                                                    */ | 
|---|
| 621 | /*  1.                                                                */ | 
|---|
| 622 | /*                                                                    */ | 
|---|
| 623 | /*  OUTPUT: TRUE or FALSE if successful or not                        */ | 
|---|
| 624 | /*                                                                    */ | 
|---|
| 625 | /*--------------------------------------------------------------------*/ | 
|---|
| 626 | /**********************************************************************/ | 
|---|
| 627 |  | 
|---|
| 628 | static BOOL NBTurnToFirstPage( HWND hwndNB ) | 
|---|
| 629 | { | 
|---|
| 630 | ULONG ulFirstPage = 0; | 
|---|
| 631 | BOOL  fSuccess    = TRUE; | 
|---|
| 632 |  | 
|---|
| 633 | ulFirstPage = (ULONG) WinSendMsg( hwndNB, | 
|---|
| 634 | BKM_QUERYPAGEID, | 
|---|
| 635 | NULL, | 
|---|
| 636 | (MPARAM)BKA_FIRST ); | 
|---|
| 637 | if( ulFirstPage ) | 
|---|
| 638 | { | 
|---|
| 639 | fSuccess = (ULONG) WinSendMsg(hwndNB, | 
|---|
| 640 | BKM_TURNTOPAGE, | 
|---|
| 641 | MPFROMLONG(ulFirstPage ), | 
|---|
| 642 | NULL ); | 
|---|
| 643 | if( !fSuccess ) | 
|---|
| 644 | ErrorMsg( "TurnToFirstPage BKM_TURNTOPAGE RC(%X)", HWNDERR( hwndNB ) ); | 
|---|
| 645 |  | 
|---|
| 646 | } | 
|---|
| 647 | else | 
|---|
| 648 | { | 
|---|
| 649 | fSuccess = FALSE; | 
|---|
| 650 | ErrorMsg( "TurnToFirstPage BKM_QUERYPAGEID RC(%X)", HWNDERR( hwndNB ) ); | 
|---|
| 651 | } | 
|---|
| 652 |  | 
|---|
| 653 | return fSuccess; | 
|---|
| 654 | } | 
|---|
| 655 |  | 
|---|
| 656 |  | 
|---|
| 657 | /**********************************************************************/ | 
|---|
| 658 | /*-------------------------- SetTabDimensions ------------------------*/ | 
|---|
| 659 | /*                                                                    */ | 
|---|
| 660 | /*  SET THE DIMENSIONS OF THE NOTEBOOK TABS.                          */ | 
|---|
| 661 | /*                                                                    */ | 
|---|
| 662 | /*  INPUT: window handle of notebook control                          */ | 
|---|
| 663 | /*                                                                    */ | 
|---|
| 664 | /*  1.                                                                */ | 
|---|
| 665 | /*                                                                    */ | 
|---|
| 666 | /*  OUTPUT: TRUE or FALSE if successful or not                        */ | 
|---|
| 667 | /*                                                                    */ | 
|---|
| 668 | /*--------------------------------------------------------------------*/ | 
|---|
| 669 | /**********************************************************************/ | 
|---|
| 670 |  | 
|---|
| 671 | static BOOL NBSetTabDimensions(HWND hwndNB) | 
|---|
| 672 | { | 
|---|
| 673 | BOOL         fSuccess = TRUE;           /* success status of this function */ | 
|---|
| 674 | HPS          hps      = WinGetPS( hwndNB );   /* presentation space handle */ | 
|---|
| 675 | FONTMETRICS  fm;                                /* data about current font */ | 
|---|
| 676 | INT          iSize,                                   /* width of tab text */ | 
|---|
| 677 | iLongestText = 0; | 
|---|
| 678 | BOOKTEXT     Booktext;                  /* booktext structure for tab text */ | 
|---|
| 679 | ULONG        ulPageId;                              /* id of notebook page */ | 
|---|
| 680 |  | 
|---|
| 681 | if( !hps ) | 
|---|
| 682 | { | 
|---|
| 683 | ErrorMsg( "SetTabDimensions WinGetPS RC(%X)", | 
|---|
| 684 | HWNDERR( hwndNB ) ); | 
|---|
| 685 | return FALSE; | 
|---|
| 686 | } | 
|---|
| 687 |  | 
|---|
| 688 | (void) memset( &fm, 0, sizeof( FONTMETRICS ) ); | 
|---|
| 689 |  | 
|---|
| 690 | // Calculate the height of a tab as the height of an average font character | 
|---|
| 691 | // plus a margin value. | 
|---|
| 692 |  | 
|---|
| 693 | if( GpiQueryFontMetrics( hps, sizeof( FONTMETRICS ), &fm ) ) | 
|---|
| 694 | fm.lMaxBaselineExt += (TAB_HEIGHT_MARGIN * 2); | 
|---|
| 695 | else | 
|---|
| 696 | { | 
|---|
| 697 | fm.lMaxBaselineExt = DEFAULT_NB_TAB_HEIGHT + (TAB_HEIGHT_MARGIN * 2); | 
|---|
| 698 |  | 
|---|
| 699 | ErrorMsg( "SetTabDimensions GpiQueryFontMetrics RC(%X)", HWNDERR( hwndNB ) ); | 
|---|
| 700 | } | 
|---|
| 701 |  | 
|---|
| 702 | // First setup the BOOKTEXT structure | 
|---|
| 703 | Booktext.pString = (PSZ)malloc(256); | 
|---|
| 704 | Booktext.textLen = 256; | 
|---|
| 705 |  | 
|---|
| 706 | // disable window update | 
|---|
| 707 | WinEnableWindowUpdate (hwndNB, | 
|---|
| 708 | FALSE); | 
|---|
| 709 |  | 
|---|
| 710 | // Calculate the longest tab text for both the MAJOR and MINOR pages | 
|---|
| 711 | // this means to browse through all pages in the notebook and check | 
|---|
| 712 | // out the largest tab text size. | 
|---|
| 713 | ulPageId = (ULONG) WinSendMsg (hwndNB, | 
|---|
| 714 | BKM_QUERYPAGEID, | 
|---|
| 715 | NULL, | 
|---|
| 716 | (MPARAM)BKA_FIRST); | 
|---|
| 717 | while ( (ulPageId != NULLHANDLE) && | 
|---|
| 718 | (ulPageId != (ULONG)BOOKERR_INVALID_PARAMETERS) ) | 
|---|
| 719 | { | 
|---|
| 720 | // query pointer to tab text data | 
|---|
| 721 | WinSendMsg (hwndNB, | 
|---|
| 722 | BKM_QUERYTABTEXT, | 
|---|
| 723 | (MPARAM)ulPageId, | 
|---|
| 724 | (MPARAM)&Booktext); | 
|---|
| 725 |  | 
|---|
| 726 | // determine largest tab text size | 
|---|
| 727 | iSize = WinGetStringSize(hps, | 
|---|
| 728 | Booktext.pString ); | 
|---|
| 729 | if( iSize > iLongestText ) | 
|---|
| 730 | iLongestText = iSize; | 
|---|
| 731 |  | 
|---|
| 732 | ulPageId = (ULONG) WinSendMsg (hwndNB,  /* query the handle for the next */ | 
|---|
| 733 | BKM_QUERYPAGEID,         /* notebook page */ | 
|---|
| 734 | MPFROMLONG( ulPageId ), | 
|---|
| 735 | (MPARAM)BKA_NEXT); | 
|---|
| 736 | } | 
|---|
| 737 |  | 
|---|
| 738 |  | 
|---|
| 739 | free (Booktext.pString);                       /* free allocated resources */ | 
|---|
| 740 | WinReleasePS( hps ); | 
|---|
| 741 |  | 
|---|
| 742 | // Add a margin amount to the longest tab text | 
|---|
| 743 |  | 
|---|
| 744 | if( iLongestText ) | 
|---|
| 745 | iLongestText += TAB_WIDTH_MARGIN; | 
|---|
| 746 |  | 
|---|
| 747 | // Set the tab dimensions for the MAJOR and MINOR pages. Note that the | 
|---|
| 748 | // docs as of this writing say to use BKA_MAJOR and BKA_MINOR in mp2 but | 
|---|
| 749 | // you really need BKA_MAJORTAB and BKA_MINORTAB. | 
|---|
| 750 |  | 
|---|
| 751 | if( iLongestText ) | 
|---|
| 752 | { | 
|---|
| 753 | fSuccess = (BOOL) WinSendMsg(hwndNB, | 
|---|
| 754 | BKM_SETDIMENSIONS, | 
|---|
| 755 | MPFROM2SHORT(iLongestText, | 
|---|
| 756 | (SHORT)fm.lMaxBaselineExt ), | 
|---|
| 757 | MPFROMSHORT( BKA_MAJORTAB ) ); | 
|---|
| 758 | if( !fSuccess ) | 
|---|
| 759 | ErrorMsg("BKM_SETDIMENSIONS(MAJOR) RC(%X)", | 
|---|
| 760 | HWNDERR( hwndNB ) ); | 
|---|
| 761 | } | 
|---|
| 762 |  | 
|---|
| 763 | // enable window update | 
|---|
| 764 | WinEnableWindowUpdate (hwndNB, | 
|---|
| 765 | TRUE); | 
|---|
| 766 |  | 
|---|
| 767 | return fSuccess; | 
|---|
| 768 | } | 
|---|
| 769 |  | 
|---|
| 770 |  | 
|---|
| 771 | /**********************************************************************/ | 
|---|
| 772 | /*---------------------------- SetNBPage -----------------------------*/ | 
|---|
| 773 | /*                                                                    */ | 
|---|
| 774 | /*  SET THE TOP PAGE IN THE NOTEBOOK CONTROL.                         */ | 
|---|
| 775 | /*                                                                    */ | 
|---|
| 776 | /*  INPUT: client window handle,                                      */ | 
|---|
| 777 | /*         pointer to the PAGESELECTNOTIFY struct                     */ | 
|---|
| 778 | /*                                                                    */ | 
|---|
| 779 | /*  1.                                                                */ | 
|---|
| 780 | /*                                                                    */ | 
|---|
| 781 | /*  OUTPUT: nothing                                                   */ | 
|---|
| 782 | /*                                                                    */ | 
|---|
| 783 | /*--------------------------------------------------------------------*/ | 
|---|
| 784 | /**********************************************************************/ | 
|---|
| 785 |  | 
|---|
| 786 | static VOID NBSetNBPage(HWND              hwndClient, | 
|---|
| 787 | HMODULE           hModule, | 
|---|
| 788 | PPAGESELECTNOTIFY ppsn, | 
|---|
| 789 | PVOID             pCreationParameters) | 
|---|
| 790 | { | 
|---|
| 791 | HWND hwndPage; | 
|---|
| 792 |  | 
|---|
| 793 | // Get a pointer to the page information that is associated with this page. | 
|---|
| 794 | // It was stored in the page's PAGE DATA in the SetUpPage function. | 
|---|
| 795 | PNBPAGE pnbp = (PNBPAGE) WinSendMsg(ppsn->hwndBook, | 
|---|
| 796 | BKM_QUERYPAGEDATA, | 
|---|
| 797 | MPFROMLONG(ppsn->ulPageIdNew ), | 
|---|
| 798 | NULL ); | 
|---|
| 799 |  | 
|---|
| 800 | if( !pnbp ) | 
|---|
| 801 | return; | 
|---|
| 802 | else | 
|---|
| 803 | if( (MRESULT)pnbp == (MRESULT)BOOKERR_INVALID_PARAMETERS ) | 
|---|
| 804 | { | 
|---|
| 805 | ErrorMsg( "SetNBPage BKM_QUERYPAGEDATA Invalid page id" ); | 
|---|
| 806 | return; | 
|---|
| 807 | } | 
|---|
| 808 |  | 
|---|
| 809 | // If this is a BKA_MAJOR page and it is what this app terms a 'parent' | 
|---|
| 810 | // page, that means when the user selects this page we actually want to go | 
|---|
| 811 | // to its first MINOR page. So in effect the MAJOR page is just a dummy page | 
|---|
| 812 | // that has a tab that acts as a placeholder for its MINOR pages. If the | 
|---|
| 813 | // user is using the left arrow to scroll thru the pages and they hit this | 
|---|
| 814 | // dummy MAJOR page, that means they have already been to its MINOR pages in | 
|---|
| 815 | // reverse order. They would now expect to see the page before the dummy | 
|---|
| 816 | // MAJOR page, so we skip the dummy page. Otherwise the user is going the | 
|---|
| 817 | // other way and wants to see the first MINOR page associated with this | 
|---|
| 818 | // 'parent' page so we skip the dummy page and show its first MINOR page. | 
|---|
| 819 |  | 
|---|
| 820 | if( pnbp->fParent ) | 
|---|
| 821 | { | 
|---|
| 822 | ULONG ulPageFwd, ulPageNew; | 
|---|
| 823 |  | 
|---|
| 824 | ulPageFwd = (ULONG) WinSendMsg(ppsn->hwndBook, | 
|---|
| 825 | BKM_QUERYPAGEID, | 
|---|
| 826 | MPFROMLONG( ppsn->ulPageIdNew ), | 
|---|
| 827 | MPFROM2SHORT(BKA_NEXT, | 
|---|
| 828 | BKA_MINOR ) ); | 
|---|
| 829 |  | 
|---|
| 830 | // If this is true, the user is going in reverse order | 
|---|
| 831 | if( ulPageFwd == ppsn->ulPageIdCur ) | 
|---|
| 832 | ulPageNew = (ULONG) WinSendMsg(ppsn->hwndBook, | 
|---|
| 833 | BKM_QUERYPAGEID, | 
|---|
| 834 | MPFROMLONG(ppsn->ulPageIdNew ), | 
|---|
| 835 | MPFROM2SHORT(BKA_PREV, | 
|---|
| 836 | BKA_MAJOR) ); | 
|---|
| 837 | else | 
|---|
| 838 | ulPageNew = ulPageFwd; | 
|---|
| 839 | if( ulPageNew == (ULONG) BOOKERR_INVALID_PARAMETERS ) | 
|---|
| 840 | ErrorMsg( "SetNBPage BKM_QUERYPAGEID Invalid page specified" ); | 
|---|
| 841 | else | 
|---|
| 842 | if( ulPageNew ) | 
|---|
| 843 | if( !WinSendMsg(ppsn->hwndBook, | 
|---|
| 844 | BKM_TURNTOPAGE, | 
|---|
| 845 | MPFROMLONG( ulPageNew ), | 
|---|
| 846 | NULL ) ) | 
|---|
| 847 | ErrorMsg("BKM_TURNTOPAGE RC(%X)", | 
|---|
| 848 | HWNDERR( ppsn->hwndBook ) ); | 
|---|
| 849 | } | 
|---|
| 850 | else | 
|---|
| 851 | { | 
|---|
| 852 | hwndPage = (HWND) WinSendMsg(ppsn->hwndBook, | 
|---|
| 853 | BKM_QUERYPAGEWINDOWHWND, | 
|---|
| 854 | MPFROMLONG(ppsn->ulPageIdNew ), | 
|---|
| 855 | NULL ); | 
|---|
| 856 | if( hwndPage == (HWND) BOOKERR_INVALID_PARAMETERS ) | 
|---|
| 857 | { | 
|---|
| 858 | hwndPage = NULLHANDLE; | 
|---|
| 859 | ErrorMsg( "SetNBPage BKM_QUERYPAGEWINDOWHWND Invalid page specified" ); | 
|---|
| 860 | } | 
|---|
| 861 | else | 
|---|
| 862 | if( !hwndPage ) | 
|---|
| 863 |  | 
|---|
| 864 | // It is time to load this dialog because the user has flipped pages | 
|---|
| 865 | // to a page that hasn't yet had the dialog associated with it. | 
|---|
| 866 | hwndPage = NBCreateDialogPage(hwndClient, | 
|---|
| 867 | ppsn->hwndBook, | 
|---|
| 868 | hModule, | 
|---|
| 869 | ppsn->ulPageIdNew, | 
|---|
| 870 | pnbp->ulID, | 
|---|
| 871 | pnbp->wpDlgProc, | 
|---|
| 872 | pCreationParameters); | 
|---|
| 873 | } | 
|---|
| 874 |  | 
|---|
| 875 | // Set focus to the first control in the dialog. This is not automatically | 
|---|
| 876 | // done by the notebook. | 
|---|
| 877 | if( !pnbp->fParent && hwndPage ) | 
|---|
| 878 | if(!WinSetFocus(HWND_DESKTOP, | 
|---|
| 879 | pnbp->idFocus ? | 
|---|
| 880 | WinWindowFromID(hwndPage, | 
|---|
| 881 | pnbp->idFocus ) : hwndPage ) ) | 
|---|
| 882 | { | 
|---|
| 883 | // Bug in 2.0! Developers left some debug code in there! | 
|---|
| 884 | USHORT usErr = HWNDERR( ppsn->hwndBook ); | 
|---|
| 885 | ErrorMsg("SetNBPage WinSetFocus RC(%X)", | 
|---|
| 886 | usErr ); | 
|---|
| 887 | } | 
|---|
| 888 |  | 
|---|
| 889 | return; | 
|---|
| 890 | } | 
|---|
| 891 |  | 
|---|
| 892 |  | 
|---|
| 893 | /**********************************************************************/ | 
|---|
| 894 | /*------------------------ CreateDialogPage --------------------------*/ | 
|---|
| 895 | /*                                                                    */ | 
|---|
| 896 | /*  LOAD DIALOG AND ASSOCIATE IT WITH A NOTEBOOK PAGE                 */ | 
|---|
| 897 | /*                                                                    */ | 
|---|
| 898 | /*  INPUT: window handle of parent and owner,                         */ | 
|---|
| 899 | /*         notebook window handle,                                    */ | 
|---|
| 900 | /*         notebook page ID                                           */ | 
|---|
| 901 | /*         dialog resource ID                                         */ | 
|---|
| 902 | /*         dialog window procedure                                    */ | 
|---|
| 903 | /*                                                                    */ | 
|---|
| 904 | /*  1.                                                                */ | 
|---|
| 905 | /*                                                                    */ | 
|---|
| 906 | /*  OUTPUT: client window handle                                      */ | 
|---|
| 907 | /*                                                                    */ | 
|---|
| 908 | /*--------------------------------------------------------------------*/ | 
|---|
| 909 | /**********************************************************************/ | 
|---|
| 910 |  | 
|---|
| 911 | static HWND NBCreateDialogPage(HWND    hwndParent, | 
|---|
| 912 | HWND    hwndNB, | 
|---|
| 913 | HMODULE hModule, | 
|---|
| 914 | ULONG   ulPageID, | 
|---|
| 915 | ULONG   idDlg, | 
|---|
| 916 | FNWP    fpDlg, | 
|---|
| 917 | PVOID   pCreationParameters) | 
|---|
| 918 | { | 
|---|
| 919 | HWND hwndDlg; | 
|---|
| 920 |  | 
|---|
| 921 |  | 
|---|
| 922 | if (fpDlg == NULL)                        /* Parameterberprfung */ | 
|---|
| 923 | return (NULLHANDLE);                   /* Fehler signalisieren */ | 
|---|
| 924 |  | 
|---|
| 925 | hwndDlg = WinLoadDlg( hwndParent, | 
|---|
| 926 | hwndParent, | 
|---|
| 927 | fpDlg, | 
|---|
| 928 | hModule, | 
|---|
| 929 | idDlg, | 
|---|
| 930 | pCreationParameters); | 
|---|
| 931 |  | 
|---|
| 932 | if( hwndDlg )                           /* check for valid window handle */ | 
|---|
| 933 | { | 
|---|
| 934 | if( !WinSendMsg(hwndNB,                         /* attach hwnd to page */ | 
|---|
| 935 | BKM_SETPAGEWINDOWHWND, | 
|---|
| 936 | MPFROMLONG( ulPageID ), | 
|---|
| 937 | MPFROMLONG( hwndDlg ) ) ) | 
|---|
| 938 | { | 
|---|
| 939 | WinDestroyWindow( hwndDlg );         /* destroy if attach failed */ | 
|---|
| 940 | hwndDlg = NULLHANDLE; | 
|---|
| 941 | ErrorMsg( "NBCreateDialogPage SETPAGEWINDOWHWND RC(%X)", | 
|---|
| 942 | HWNDERR( hwndNB ) ); | 
|---|
| 943 | } | 
|---|
| 944 | } | 
|---|
| 945 | else | 
|---|
| 946 | ErrorMsg( "NBCreateDialogPage WinLoadDlg RC(%X)", HWNDERR( hwndNB ) ); | 
|---|
| 947 |  | 
|---|
| 948 | return hwndDlg; | 
|---|
| 949 | } | 
|---|
| 950 |  | 
|---|
| 951 |  | 
|---|
| 952 | /***************************************************************************** | 
|---|
| 953 | * Name      : BOOL NBSetTabText | 
|---|
| 954 | * Funktion  : Setzt Tabtext einer Seite. | 
|---|
| 955 | * Parameter : HWND hwndNB, ULONG ulPageId, PSZ pszTabtext | 
|---|
| 956 | * Variablen : | 
|---|
| 957 | * Ergebnis  : Erfolgscode | 
|---|
| 958 | * Bemerkung : | 
|---|
| 959 | * | 
|---|
| 960 | * Autor     : Patrick Haller [, 24.09.1995 02.57.00] | 
|---|
| 961 | *****************************************************************************/ | 
|---|
| 962 |  | 
|---|
| 963 | static BOOL NBSetTabText (HWND  hwndNB, | 
|---|
| 964 | ULONG ulPageId, | 
|---|
| 965 | PSZ   pszTabtext) | 
|---|
| 966 | { | 
|---|
| 967 | BOOL fSuccess; | 
|---|
| 968 |  | 
|---|
| 969 | if (pszTabtext == NULL)                            /* Parameterberprfung */ | 
|---|
| 970 | return (FALSE); | 
|---|
| 971 |  | 
|---|
| 972 | fSuccess = (BOOL) WinSendMsg(hwndNB, | 
|---|
| 973 | BKM_SETTABTEXT, | 
|---|
| 974 | MPFROMP( ulPageId ), | 
|---|
| 975 | MPFROMP( pszTabtext ) ); | 
|---|
| 976 | if( !fSuccess ) | 
|---|
| 977 | ErrorMsg("NBSetTabText::BKM_SETTABTEXT RC(%X)", | 
|---|
| 978 | HWNDERR( hwndNB ) ); | 
|---|
| 979 |  | 
|---|
| 980 | return (fSuccess);                           /* Rckgabewert liefern */ | 
|---|
| 981 | } /* BOOL NBSetTabText */ | 
|---|
| 982 |  | 
|---|
| 983 |  | 
|---|
| 984 | /*********************************************************************** | 
|---|
| 985 | * Name      : BOOL NBSetStatuslineText | 
|---|
| 986 | * Funktion  : Setzt Statuslinetext einer Seite. | 
|---|
| 987 | * Parameter : HWND hwndNB, ULONG ulPageId, PSZ pszStatuslinetext | 
|---|
| 988 | * Variablen : | 
|---|
| 989 | * Ergebnis  : Erfolgscode | 
|---|
| 990 | * Bemerkung : | 
|---|
| 991 | * | 
|---|
| 992 | * Autor     : Patrick Haller [, 24.09.1995 02.57.00] | 
|---|
| 993 | ***********************************************************************/ | 
|---|
| 994 |  | 
|---|
| 995 | static BOOL NBSetStatuslineText (HWND  hwndNB, | 
|---|
| 996 | ULONG ulPageId, | 
|---|
| 997 | PSZ   pszStatuslinetext) | 
|---|
| 998 | { | 
|---|
| 999 | BOOL fSuccess; | 
|---|
| 1000 |  | 
|---|
| 1001 | if (pszStatuslinetext == NULL)               /* Parameterberprfung */ | 
|---|
| 1002 | return (FALSE); | 
|---|
| 1003 |  | 
|---|
| 1004 | fSuccess = (BOOL) WinSendMsg( hwndNB, BKM_SETSTATUSLINETEXT, | 
|---|
| 1005 | MPFROMP( ulPageId ), | 
|---|
| 1006 | MPFROMP( pszStatuslinetext ) ); | 
|---|
| 1007 | if( !fSuccess ) | 
|---|
| 1008 | ErrorMsg( "BKM_SETSTATUSLINETEXT RC(%X)", HWNDERR( hwndNB ) ); | 
|---|
| 1009 | return (fSuccess);                           /* Rckgabewert liefern */ | 
|---|
| 1010 | } /* BOOL NBSetStatuslineText */ | 
|---|
| 1011 |  | 
|---|
| 1012 |  | 
|---|
| 1013 | /*********************************************************************** | 
|---|
| 1014 | * Name      : status MRESULT EXPENTRY wpDlgProcPage1 | 
|---|
| 1015 | * Funktion  : dialog window procedure | 
|---|
| 1016 | * Parameter : HWND   hwnd | 
|---|
| 1017 | *             ULONG  ulMessage | 
|---|
| 1018 | *             MPARAM mp1 | 
|---|
| 1019 | *             MPARAM mp2 | 
|---|
| 1020 | * Variablen : | 
|---|
| 1021 | * Ergebnis  : MRESULT | 
|---|
| 1022 | * Bemerkung : | 
|---|
| 1023 | * | 
|---|
| 1024 | * Autor     : Patrick Haller [, 24.09.1995 02.57.00] | 
|---|
| 1025 | ***********************************************************************/ | 
|---|
| 1026 |  | 
|---|
| 1027 | static MRESULT EXPENTRY wpDlgProcPage1(HWND   hwnd, | 
|---|
| 1028 | ULONG  ulMessage, | 
|---|
| 1029 | MPARAM mp1, | 
|---|
| 1030 | MPARAM mp2) | 
|---|
| 1031 | { | 
|---|
| 1032 | switch (ulMessage) | 
|---|
| 1033 | { | 
|---|
| 1034 | /************************************************************************* | 
|---|
| 1035 | * user messages                                                         * | 
|---|
| 1036 | *************************************************************************/ | 
|---|
| 1037 |  | 
|---|
| 1038 | case UM_PROPERTY_UNDO: | 
|---|
| 1039 | { | 
|---|
| 1040 | PICONSOLEOPTIONS pOpt = (PICONSOLEOPTIONS)mp1;            /* get pointer */ | 
|---|
| 1041 |  | 
|---|
| 1042 | ConPropPage1Set(hwnd,                                    /* set values */ | 
|---|
| 1043 | pOpt); | 
|---|
| 1044 |  | 
|---|
| 1045 | return ( (MPARAM) FALSE); | 
|---|
| 1046 | } | 
|---|
| 1047 |  | 
|---|
| 1048 |  | 
|---|
| 1049 | case UM_PROPERTY_APPLY: | 
|---|
| 1050 | { | 
|---|
| 1051 | PICONSOLEOPTIONS pOpt = (PICONSOLEOPTIONS)mp1;            /* get pointer */ | 
|---|
| 1052 |  | 
|---|
| 1053 | pOpt->fTerminateAutomatically = WinQueryButtonCheckstate(hwnd, | 
|---|
| 1054 | CB_CONSOLE_CLOSEWINDOWONEXIT); | 
|---|
| 1055 | pOpt->fInsertMode             = WinQueryButtonCheckstate(hwnd, | 
|---|
| 1056 | CB_CONSOLE_INSERTMODE); | 
|---|
| 1057 | pOpt->fQuickInsert            = WinQueryButtonCheckstate(hwnd, | 
|---|
| 1058 | CB_CONSOLE_QUICKINSERT); | 
|---|
| 1059 | pOpt->fToolbarActive          = WinQueryButtonCheckstate(hwnd, | 
|---|
| 1060 | CB_CONSOLE_TOOLBAR); | 
|---|
| 1061 |  | 
|---|
| 1062 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1063 | SPN_CONSOLE_TAB, | 
|---|
| 1064 | SPBM_QUERYVALUE, | 
|---|
| 1065 | MPFROMP(&pOpt->ulTabSize), | 
|---|
| 1066 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE) | 
|---|
| 1067 | ); | 
|---|
| 1068 |  | 
|---|
| 1069 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1070 | SPN_CONSOLE_CURSORBLINK, | 
|---|
| 1071 | SPBM_QUERYVALUE, | 
|---|
| 1072 | MPFROMP(&pOpt->ucCursorDivisor), | 
|---|
| 1073 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE) | 
|---|
| 1074 | ); | 
|---|
| 1075 |  | 
|---|
| 1076 | return ( (MPARAM) FALSE); | 
|---|
| 1077 | } | 
|---|
| 1078 | } | 
|---|
| 1079 |  | 
|---|
| 1080 |  | 
|---|
| 1081 | return WinDefDlgProc(hwnd,                   /* default message processing */ | 
|---|
| 1082 | ulMessage, | 
|---|
| 1083 | mp1, | 
|---|
| 1084 | mp2); | 
|---|
| 1085 | } | 
|---|
| 1086 |  | 
|---|
| 1087 |  | 
|---|
| 1088 | /*********************************************************************** | 
|---|
| 1089 | * Name      : status MRESULT EXPENTRY wpDlgProcPage2 | 
|---|
| 1090 | * Funktion  : dialog window procedure | 
|---|
| 1091 | * Parameter : HWND   hwnd | 
|---|
| 1092 | *             ULONG  ulMessage | 
|---|
| 1093 | *             MPARAM mp1 | 
|---|
| 1094 | *             MPARAM mp2 | 
|---|
| 1095 | * Variablen : | 
|---|
| 1096 | * Ergebnis  : MRESULT | 
|---|
| 1097 | * Bemerkung : | 
|---|
| 1098 | * | 
|---|
| 1099 | * Autor     : Patrick Haller [, 24.09.1995 02.57.00] | 
|---|
| 1100 | ***********************************************************************/ | 
|---|
| 1101 |  | 
|---|
| 1102 | static MRESULT EXPENTRY wpDlgProcPage2(HWND   hwnd, | 
|---|
| 1103 | ULONG  ulMessage, | 
|---|
| 1104 | MPARAM mp1, | 
|---|
| 1105 | MPARAM mp2) | 
|---|
| 1106 | { | 
|---|
| 1107 | switch (ulMessage) | 
|---|
| 1108 | { | 
|---|
| 1109 | case WM_COMMAND: | 
|---|
| 1110 | { | 
|---|
| 1111 | PICONSOLEOPTIONS pConsoleOptions;      /* the console options structure */ | 
|---|
| 1112 | HWND            hwndNotebook = WinQueryWindow(WinQueryWindow(hwnd, | 
|---|
| 1113 | QW_PARENT), | 
|---|
| 1114 | QW_PARENT); | 
|---|
| 1115 |  | 
|---|
| 1116 | pConsoleOptions = (PICONSOLEOPTIONS)          /* query pointer from wnd */ | 
|---|
| 1117 | WinQueryWindowULong(hwndNotebook, | 
|---|
| 1118 | QWL_USER); | 
|---|
| 1119 |  | 
|---|
| 1120 | switch (SHORT1FROMMP(mp1)) | 
|---|
| 1121 | { | 
|---|
| 1122 | case ID_BTN_SPEAKERTEST: | 
|---|
| 1123 | /* test speaker */ | 
|---|
| 1124 | DosBeep(pConsoleOptions->ulSpeakerFrequency, | 
|---|
| 1125 | pConsoleOptions->ulSpeakerDuration); | 
|---|
| 1126 |  | 
|---|
| 1127 | return ( (MPARAM) FALSE); | 
|---|
| 1128 | } | 
|---|
| 1129 | } | 
|---|
| 1130 |  | 
|---|
| 1131 |  | 
|---|
| 1132 | /************************************************************************* | 
|---|
| 1133 | * user messages                                                         * | 
|---|
| 1134 | *************************************************************************/ | 
|---|
| 1135 |  | 
|---|
| 1136 | case UM_PROPERTY_UNDO: | 
|---|
| 1137 | { | 
|---|
| 1138 | PICONSOLEOPTIONS pOpt = (PICONSOLEOPTIONS)mp1;            /* get pointer */ | 
|---|
| 1139 |  | 
|---|
| 1140 | ConPropPage2Set(hwnd,                                    /* set values */ | 
|---|
| 1141 | pOpt); | 
|---|
| 1142 |  | 
|---|
| 1143 | return ( (MPARAM) FALSE); | 
|---|
| 1144 | } | 
|---|
| 1145 |  | 
|---|
| 1146 |  | 
|---|
| 1147 | case UM_PROPERTY_APPLY: | 
|---|
| 1148 | { | 
|---|
| 1149 | PICONSOLEOPTIONS pOpt = (PICONSOLEOPTIONS)mp1;            /* get pointer */ | 
|---|
| 1150 |  | 
|---|
| 1151 | pOpt->fSpeakerEnabled    = WinQueryButtonCheckstate(hwnd, | 
|---|
| 1152 | CB_CONSOLE_SPEAKERENABLE); | 
|---|
| 1153 | pOpt->ulSpeakerDuration  = (ULONG)WinSendDlgItemMsg(hwnd, | 
|---|
| 1154 | SLB_CONSOLE_SPEAKERDURATION, | 
|---|
| 1155 | SLM_QUERYSLIDERINFO, | 
|---|
| 1156 | MPFROM2SHORT(SMA_SLIDERARMPOSITION, | 
|---|
| 1157 | SMA_INCREMENTVALUE), | 
|---|
| 1158 | NULL); | 
|---|
| 1159 |  | 
|---|
| 1160 | pOpt->ulSpeakerFrequency = (ULONG)WinSendDlgItemMsg(hwnd, | 
|---|
| 1161 | SLB_CONSOLE_SPEAKERFREQUENCY, | 
|---|
| 1162 | SLM_QUERYSLIDERINFO, | 
|---|
| 1163 | MPFROM2SHORT(SMA_SLIDERARMPOSITION, | 
|---|
| 1164 | SMA_INCREMENTVALUE), | 
|---|
| 1165 | NULL); | 
|---|
| 1166 |  | 
|---|
| 1167 | return ( (MPARAM) FALSE); | 
|---|
| 1168 | } | 
|---|
| 1169 | } | 
|---|
| 1170 |  | 
|---|
| 1171 |  | 
|---|
| 1172 | return WinDefDlgProc(hwnd,                   /* default message processing */ | 
|---|
| 1173 | ulMessage, | 
|---|
| 1174 | mp1, | 
|---|
| 1175 | mp2); | 
|---|
| 1176 | } | 
|---|
| 1177 |  | 
|---|
| 1178 |  | 
|---|
| 1179 | /*********************************************************************** | 
|---|
| 1180 | * Name      : status MRESULT EXPENTRY wpDlgProcPage3 | 
|---|
| 1181 | * Funktion  : dialog window procedure | 
|---|
| 1182 | * Parameter : HWND   hwnd | 
|---|
| 1183 | *             ULONG  ulMessage | 
|---|
| 1184 | *             MPARAM mp1 | 
|---|
| 1185 | *             MPARAM mp2 | 
|---|
| 1186 | * Variablen : | 
|---|
| 1187 | * Ergebnis  : MRESULT | 
|---|
| 1188 | * Bemerkung : | 
|---|
| 1189 | * | 
|---|
| 1190 | * Autor     : Patrick Haller [, 24.09.1995 02.57.00] | 
|---|
| 1191 | ***********************************************************************/ | 
|---|
| 1192 |  | 
|---|
| 1193 | static MRESULT EXPENTRY wpDlgProcPage3(HWND   hwnd, | 
|---|
| 1194 | ULONG  ulMessage, | 
|---|
| 1195 | MPARAM mp1, | 
|---|
| 1196 | MPARAM mp2) | 
|---|
| 1197 | { | 
|---|
| 1198 | switch (ulMessage) | 
|---|
| 1199 | { | 
|---|
| 1200 | /************************************************************************* | 
|---|
| 1201 | * user messages                                                         * | 
|---|
| 1202 | *************************************************************************/ | 
|---|
| 1203 |  | 
|---|
| 1204 | case UM_PROPERTY_UNDO: | 
|---|
| 1205 | { | 
|---|
| 1206 | PICONSOLEOPTIONS pOpt = (PICONSOLEOPTIONS)mp1;            /* get pointer */ | 
|---|
| 1207 |  | 
|---|
| 1208 | ConPropPage3Set(hwnd,                                    /* set values */ | 
|---|
| 1209 | pOpt); | 
|---|
| 1210 |  | 
|---|
| 1211 | return ( (MPARAM) FALSE); | 
|---|
| 1212 | } | 
|---|
| 1213 |  | 
|---|
| 1214 |  | 
|---|
| 1215 | case UM_PROPERTY_APPLY: | 
|---|
| 1216 | { | 
|---|
| 1217 | PICONSOLEOPTIONS pOpt = (PICONSOLEOPTIONS)mp1;            /* get pointer */ | 
|---|
| 1218 |  | 
|---|
| 1219 | //      pOpt->fTerminateAutomatically = WinQueryButtonCheckstate(hwnd, | 
|---|
| 1220 | //                                                 CB_CONSOLE_CLOSEWINDOWONEXIT); | 
|---|
| 1221 |  | 
|---|
| 1222 | return ( (MPARAM) FALSE); | 
|---|
| 1223 | } | 
|---|
| 1224 | } | 
|---|
| 1225 |  | 
|---|
| 1226 |  | 
|---|
| 1227 | return WinDefDlgProc(hwnd,                   /* default message processing */ | 
|---|
| 1228 | ulMessage, | 
|---|
| 1229 | mp1, | 
|---|
| 1230 | mp2); | 
|---|
| 1231 | } | 
|---|
| 1232 |  | 
|---|
| 1233 |  | 
|---|
| 1234 | /*********************************************************************** | 
|---|
| 1235 | * Name      : status MRESULT EXPENTRY wpDlgProcPage4 | 
|---|
| 1236 | * Funktion  : dialog window procedure | 
|---|
| 1237 | * Parameter : HWND   hwnd | 
|---|
| 1238 | *             ULONG  ulMessage | 
|---|
| 1239 | *             MPARAM mp1 | 
|---|
| 1240 | *             MPARAM mp2 | 
|---|
| 1241 | * Variablen : | 
|---|
| 1242 | * Ergebnis  : MRESULT | 
|---|
| 1243 | * Bemerkung : | 
|---|
| 1244 | * | 
|---|
| 1245 | * Autor     : Patrick Haller [, 24.09.1995 02.57.00] | 
|---|
| 1246 | ***********************************************************************/ | 
|---|
| 1247 |  | 
|---|
| 1248 | static MRESULT EXPENTRY wpDlgProcPage4(HWND   hwnd, | 
|---|
| 1249 | ULONG  ulMessage, | 
|---|
| 1250 | MPARAM mp1, | 
|---|
| 1251 | MPARAM mp2) | 
|---|
| 1252 | { | 
|---|
| 1253 | switch (ulMessage) | 
|---|
| 1254 | { | 
|---|
| 1255 | /************************************************************************* | 
|---|
| 1256 | * user messages                                                         * | 
|---|
| 1257 | *************************************************************************/ | 
|---|
| 1258 |  | 
|---|
| 1259 | case UM_PROPERTY_UNDO: | 
|---|
| 1260 | { | 
|---|
| 1261 | PICONSOLEOPTIONS pOpt = (PICONSOLEOPTIONS)mp1;            /* get pointer */ | 
|---|
| 1262 |  | 
|---|
| 1263 | ConPropPage4Set(hwnd,                                    /* set values */ | 
|---|
| 1264 | pOpt); | 
|---|
| 1265 |  | 
|---|
| 1266 | return ( (MPARAM) FALSE); | 
|---|
| 1267 | } | 
|---|
| 1268 |  | 
|---|
| 1269 |  | 
|---|
| 1270 | case UM_PROPERTY_APPLY: | 
|---|
| 1271 | { | 
|---|
| 1272 | PICONSOLEOPTIONS pOpt = (PICONSOLEOPTIONS)mp1;            /* get pointer */ | 
|---|
| 1273 |  | 
|---|
| 1274 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1275 | SPN_CONSOLE_X, | 
|---|
| 1276 | SPBM_QUERYVALUE, | 
|---|
| 1277 | MPFROMP(&pOpt->coordDefaultPosition.X), | 
|---|
| 1278 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)); | 
|---|
| 1279 |  | 
|---|
| 1280 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1281 | SPN_CONSOLE_Y, | 
|---|
| 1282 | SPBM_QUERYVALUE, | 
|---|
| 1283 | MPFROMP(&pOpt->coordDefaultPosition.Y), | 
|---|
| 1284 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)); | 
|---|
| 1285 |  | 
|---|
| 1286 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1287 | SPN_CONSOLE_DEFAULTWIDTH, | 
|---|
| 1288 | SPBM_QUERYVALUE, | 
|---|
| 1289 | MPFROMP(&pOpt->coordDefaultSize.X), | 
|---|
| 1290 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)); | 
|---|
| 1291 |  | 
|---|
| 1292 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1293 | SPN_CONSOLE_DEFAULTHEIGHT, | 
|---|
| 1294 | SPBM_QUERYVALUE, | 
|---|
| 1295 | MPFROMP(&pOpt->coordDefaultSize.Y), | 
|---|
| 1296 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)); | 
|---|
| 1297 |  | 
|---|
| 1298 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1299 | SPN_CONSOLE_BUFFERWIDTH, | 
|---|
| 1300 | SPBM_QUERYVALUE, | 
|---|
| 1301 | MPFROMP(&pOpt->coordBufferSize.X), | 
|---|
| 1302 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)); | 
|---|
| 1303 |  | 
|---|
| 1304 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1305 | SPN_CONSOLE_BUFFERHEIGHT, | 
|---|
| 1306 | SPBM_QUERYVALUE, | 
|---|
| 1307 | MPFROMP(&pOpt->coordBufferSize.Y), | 
|---|
| 1308 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)); | 
|---|
| 1309 |  | 
|---|
| 1310 | return ( (MPARAM) FALSE); | 
|---|
| 1311 | } | 
|---|
| 1312 | } | 
|---|
| 1313 |  | 
|---|
| 1314 |  | 
|---|
| 1315 | return WinDefDlgProc(hwnd,                   /* default message processing */ | 
|---|
| 1316 | ulMessage, | 
|---|
| 1317 | mp1, | 
|---|
| 1318 | mp2); | 
|---|
| 1319 | } | 
|---|
| 1320 |  | 
|---|
| 1321 |  | 
|---|
| 1322 | /*********************************************************************** | 
|---|
| 1323 | * Name      : status MRESULT EXPENTRY wpDlgProcPage5 | 
|---|
| 1324 | * Funktion  : dialog window procedure | 
|---|
| 1325 | * Parameter : HWND   hwnd | 
|---|
| 1326 | *             ULONG  ulMessage | 
|---|
| 1327 | *             MPARAM mp1 | 
|---|
| 1328 | *             MPARAM mp2 | 
|---|
| 1329 | * Variablen : | 
|---|
| 1330 | * Ergebnis  : MRESULT | 
|---|
| 1331 | * Bemerkung : | 
|---|
| 1332 | * | 
|---|
| 1333 | * Autor     : Patrick Haller [, 24.09.1995 02.57.00] | 
|---|
| 1334 | ***********************************************************************/ | 
|---|
| 1335 |  | 
|---|
| 1336 | static MRESULT EXPENTRY wpDlgProcPage5(HWND   hwnd, | 
|---|
| 1337 | ULONG  ulMessage, | 
|---|
| 1338 | MPARAM mp1, | 
|---|
| 1339 | MPARAM mp2) | 
|---|
| 1340 | { | 
|---|
| 1341 | switch (ulMessage) | 
|---|
| 1342 | { | 
|---|
| 1343 | /************************************************************************* | 
|---|
| 1344 | * user messages                                                         * | 
|---|
| 1345 | *************************************************************************/ | 
|---|
| 1346 |  | 
|---|
| 1347 | case UM_PROPERTY_UNDO: | 
|---|
| 1348 | { | 
|---|
| 1349 | PICONSOLEOPTIONS pOpt = (PICONSOLEOPTIONS)mp1;            /* get pointer */ | 
|---|
| 1350 |  | 
|---|
| 1351 | ConPropPage5Set(hwnd,                                    /* set values */ | 
|---|
| 1352 | pOpt); | 
|---|
| 1353 |  | 
|---|
| 1354 | return ( (MPARAM) FALSE); | 
|---|
| 1355 | } | 
|---|
| 1356 |  | 
|---|
| 1357 |  | 
|---|
| 1358 | case UM_PROPERTY_APPLY: | 
|---|
| 1359 | { | 
|---|
| 1360 | PICONSOLEOPTIONS pOpt = (PICONSOLEOPTIONS)mp1;            /* get pointer */ | 
|---|
| 1361 |  | 
|---|
| 1362 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1363 | SPN_CONSOLE_UPDATELIMIT, | 
|---|
| 1364 | SPBM_QUERYVALUE, | 
|---|
| 1365 | MPFROMP(&pOpt->ulUpdateLimit), | 
|---|
| 1366 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)); | 
|---|
| 1367 |  | 
|---|
| 1368 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1369 | SPN_CONSOLE_CONSOLEPRIORITY, | 
|---|
| 1370 | SPBM_QUERYVALUE, | 
|---|
| 1371 | MPFROMP(&pOpt->ulConsoleThreadPriorityClass), | 
|---|
| 1372 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)); | 
|---|
| 1373 |  | 
|---|
| 1374 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1375 | SPN_CONSOLE_CONSOLEPRIODELTA, | 
|---|
| 1376 | SPBM_QUERYVALUE, | 
|---|
| 1377 | MPFROMP(&pOpt->ulConsoleThreadPriorityDelta), | 
|---|
| 1378 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)); | 
|---|
| 1379 |  | 
|---|
| 1380 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1381 | SPN_CONSOLE_APPPRIORITY, | 
|---|
| 1382 | SPBM_QUERYVALUE, | 
|---|
| 1383 | MPFROMP(&pOpt->ulAppThreadPriorityClass), | 
|---|
| 1384 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)); | 
|---|
| 1385 |  | 
|---|
| 1386 | WinSendDlgItemMsg(hwnd,                             /* query the value */ | 
|---|
| 1387 | SPN_CONSOLE_APPPRIODELTA, | 
|---|
| 1388 | SPBM_QUERYVALUE, | 
|---|
| 1389 | MPFROMP(&pOpt->ulAppThreadPriorityDelta), | 
|---|
| 1390 | MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)); | 
|---|
| 1391 |  | 
|---|
| 1392 | return ( (MPARAM) FALSE); | 
|---|
| 1393 | } | 
|---|
| 1394 | } | 
|---|
| 1395 |  | 
|---|
| 1396 |  | 
|---|
| 1397 | return WinDefDlgProc(hwnd,                   /* default message processing */ | 
|---|
| 1398 | ulMessage, | 
|---|
| 1399 | mp1, | 
|---|
| 1400 | mp2); | 
|---|
| 1401 | } | 
|---|
| 1402 |  | 
|---|
| 1403 |  | 
|---|
| 1404 | /*********************************************************************** | 
|---|
| 1405 | * Name      : status MRESULT EXPENTRY wpDlgProcPage6 | 
|---|
| 1406 | * Funktion  : dialog window procedure | 
|---|
| 1407 | * Parameter : HWND   hwnd | 
|---|
| 1408 | *             ULONG  ulMessage | 
|---|
| 1409 | *             MPARAM mp1 | 
|---|
| 1410 | *             MPARAM mp2 | 
|---|
| 1411 | * Variablen : | 
|---|
| 1412 | * Ergebnis  : MRESULT | 
|---|
| 1413 | * Bemerkung : | 
|---|
| 1414 | * | 
|---|
| 1415 | * Autor     : Patrick Haller [, 24.09.1995 02.57.00] | 
|---|
| 1416 | ***********************************************************************/ | 
|---|
| 1417 |  | 
|---|
| 1418 | static MRESULT EXPENTRY wpDlgProcPage6(HWND   hwnd, | 
|---|
| 1419 | ULONG  ulMessage, | 
|---|
| 1420 | MPARAM mp1, | 
|---|
| 1421 | MPARAM mp2) | 
|---|
| 1422 | { | 
|---|
| 1423 | /* since this dialog has no options, we're running the default message */ | 
|---|
| 1424 | /* processing only                                                     */ | 
|---|
| 1425 | /* we'll display a logo bitmap here shortly @@@PH                      */ | 
|---|
| 1426 |  | 
|---|
| 1427 | return WinDefDlgProc(hwnd,                   /* default message processing */ | 
|---|
| 1428 | ulMessage, | 
|---|
| 1429 | mp1, | 
|---|
| 1430 | mp2); | 
|---|
| 1431 | } | 
|---|
| 1432 |  | 
|---|
| 1433 |  | 
|---|
| 1434 | /**********************************************************************/ | 
|---|
| 1435 | /*-------------------------- GetStringSize ---------------------------*/ | 
|---|
| 1436 | /*                                                                    */ | 
|---|
| 1437 | /*  GET THE SIZE IN PIXELS OF A STRING.                               */ | 
|---|
| 1438 | /*                                                                    */ | 
|---|
| 1439 | /*  INPUT: presentation space handle,                                 */ | 
|---|
| 1440 | /*         notebook window handle,                                    */ | 
|---|
| 1441 | /*         pointer to string                                          */ | 
|---|
| 1442 | /*                                                                    */ | 
|---|
| 1443 | /*  1.                                                                */ | 
|---|
| 1444 | /*                                                                    */ | 
|---|
| 1445 | /*  OUTPUT: nothing                                                   */ | 
|---|
| 1446 | /*                                                                    */ | 
|---|
| 1447 | /*--------------------------------------------------------------------*/ | 
|---|
| 1448 | /**********************************************************************/ | 
|---|
| 1449 |  | 
|---|
| 1450 | static INT WinGetStringSize(HPS hps, | 
|---|
| 1451 | PSZ szString ) | 
|---|
| 1452 | { | 
|---|
| 1453 | POINTL aptl[ TXTBOX_COUNT ]; | 
|---|
| 1454 |  | 
|---|
| 1455 | if (szString == NULL)                              /* Parameterberprfung */ | 
|---|
| 1456 | return 0;                          /* Im Fehlerfall wird 0 zurckgegeben */ | 
|---|
| 1457 |  | 
|---|
| 1458 |  | 
|---|
| 1459 | /* Get the size, in pixels, of the string passed. */ | 
|---|
| 1460 | if( !GpiQueryTextBox( hps, | 
|---|
| 1461 | strlen( szString ), | 
|---|
| 1462 | szString, | 
|---|
| 1463 | TXTBOX_COUNT, | 
|---|
| 1464 | aptl ) ) | 
|---|
| 1465 | return 0;                          /* Im Fehlerfall wird 0 zurckgegeben */ | 
|---|
| 1466 | else | 
|---|
| 1467 | return aptl[ TXTBOX_CONCAT ].x; | 
|---|
| 1468 | } | 
|---|
| 1469 |  | 
|---|
| 1470 |  | 
|---|
| 1471 | /***************************************************************************** | 
|---|
| 1472 | * Name      : static APIRET ConPropPage1Set | 
|---|
| 1473 | * Funktion  : setup dialog elements for page 1 | 
|---|
| 1474 | * Parameter : | 
|---|
| 1475 | * Variablen : | 
|---|
| 1476 | * Ergebnis  : MRESULT | 
|---|
| 1477 | * Bemerkung : | 
|---|
| 1478 | * | 
|---|
| 1479 | * Autor     : Patrick Haller [1998/04/02 19:00] | 
|---|
| 1480 | *****************************************************************************/ | 
|---|
| 1481 |  | 
|---|
| 1482 | static APIRET ConPropPage1Set(HWND            hwndDlg, | 
|---|
| 1483 | PICONSOLEOPTIONS pConsoleOptions) | 
|---|
| 1484 | { | 
|---|
| 1485 | if (pConsoleOptions == NULL)                           /* check parameters */ | 
|---|
| 1486 | return (ERROR_INVALID_PARAMETER);               /* raise error condition */ | 
|---|
| 1487 |  | 
|---|
| 1488 | WinCheckButton(hwndDlg,                                /* auto-termination */ | 
|---|
| 1489 | CB_CONSOLE_CLOSEWINDOWONEXIT, | 
|---|
| 1490 | pConsoleOptions->fTerminateAutomatically); | 
|---|
| 1491 |  | 
|---|
| 1492 | WinCheckButton(hwndDlg,                                     /* insert mode */ | 
|---|
| 1493 | CB_CONSOLE_INSERTMODE, | 
|---|
| 1494 | pConsoleOptions->fInsertMode); | 
|---|
| 1495 |  | 
|---|
| 1496 | WinCheckButton(hwndDlg,                               /* quick insert mode */ | 
|---|
| 1497 | CB_CONSOLE_QUICKINSERT, | 
|---|
| 1498 | pConsoleOptions->fQuickInsert); | 
|---|
| 1499 |  | 
|---|
| 1500 | WinCheckButton(hwndDlg,                                 /* console toolbar */ | 
|---|
| 1501 | CB_CONSOLE_TOOLBAR, | 
|---|
| 1502 | pConsoleOptions->fToolbarActive); | 
|---|
| 1503 |  | 
|---|
| 1504 | /* set spin limits for the SPN_CONSOLE_TAB spinbutton */ | 
|---|
| 1505 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1506 | SPN_CONSOLE_TAB, | 
|---|
| 1507 | SPBM_SETLIMITS, | 
|---|
| 1508 | MPFROMSHORT(80), | 
|---|
| 1509 | MPFROMSHORT(0)); | 
|---|
| 1510 |  | 
|---|
| 1511 | WinSendDlgItemMsg (hwndDlg,                           /* set current value */ | 
|---|
| 1512 | SPN_CONSOLE_TAB, | 
|---|
| 1513 | SPBM_SETCURRENTVALUE, | 
|---|
| 1514 | MPFROMLONG(pConsoleOptions->ulTabSize), | 
|---|
| 1515 | 0); | 
|---|
| 1516 |  | 
|---|
| 1517 | /* set spin limits for the SPN_CONSOLE_CURSORBLINK spinbutton */ | 
|---|
| 1518 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1519 | SPN_CONSOLE_CURSORBLINK, | 
|---|
| 1520 | SPBM_SETLIMITS, | 
|---|
| 1521 | MPFROMSHORT(100), | 
|---|
| 1522 | MPFROMSHORT(1)); | 
|---|
| 1523 |  | 
|---|
| 1524 | WinSendDlgItemMsg (hwndDlg,                           /* set current value */ | 
|---|
| 1525 | SPN_CONSOLE_CURSORBLINK, | 
|---|
| 1526 | SPBM_SETCURRENTVALUE, | 
|---|
| 1527 | MPFROMLONG(pConsoleOptions->ucCursorDivisor), | 
|---|
| 1528 | 0); | 
|---|
| 1529 |  | 
|---|
| 1530 | return (NO_ERROR);                                                   /* OK */ | 
|---|
| 1531 | } | 
|---|
| 1532 |  | 
|---|
| 1533 | /***************************************************************************** | 
|---|
| 1534 | * Name      : static APIRET ConPropPage2Set | 
|---|
| 1535 | * Funktion  : setup dialog elements for page 2 | 
|---|
| 1536 | * Parameter : | 
|---|
| 1537 | * Variablen : | 
|---|
| 1538 | * Ergebnis  : MRESULT | 
|---|
| 1539 | * Bemerkung : | 
|---|
| 1540 | * | 
|---|
| 1541 | * Autor     : Jochen Schaeuble [1998/04/29 23:20] | 
|---|
| 1542 | *****************************************************************************/ | 
|---|
| 1543 |  | 
|---|
| 1544 | static APIRET ConPropPage2Set(HWND            hwndDlg, | 
|---|
| 1545 | PICONSOLEOPTIONS pConsoleOptions) | 
|---|
| 1546 | { | 
|---|
| 1547 | int       i; | 
|---|
| 1548 | WNDPARAMS wp; | 
|---|
| 1549 | SLDCDATA  slcd; | 
|---|
| 1550 |  | 
|---|
| 1551 | if (pConsoleOptions == NULL)                           /* check parameters */ | 
|---|
| 1552 | return (ERROR_INVALID_PARAMETER);               /* raise error condition */ | 
|---|
| 1553 |  | 
|---|
| 1554 | WinCheckButton(hwndDlg,                                /* Enable speaker */ | 
|---|
| 1555 | CB_CONSOLE_SPEAKERENABLE, | 
|---|
| 1556 | pConsoleOptions->fSpeakerEnabled); | 
|---|
| 1557 |  | 
|---|
| 1558 | /* frequency slider */ | 
|---|
| 1559 | slcd.cbSize = sizeof(SLDCDATA); | 
|---|
| 1560 | wp.pCtlData = &slcd; | 
|---|
| 1561 |  | 
|---|
| 1562 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1563 | SLB_CONSOLE_SPEAKERFREQUENCY, | 
|---|
| 1564 | WM_QUERYWINDOWPARAMS, | 
|---|
| 1565 | (MPARAM)&wp, | 
|---|
| 1566 | NULL); | 
|---|
| 1567 |  | 
|---|
| 1568 | slcd.usScale1Increments=9; | 
|---|
| 1569 | slcd.usScale1Spacing=0; | 
|---|
| 1570 |  | 
|---|
| 1571 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1572 | SLB_CONSOLE_SPEAKERFREQUENCY, | 
|---|
| 1573 | WM_SETWINDOWPARAMS, | 
|---|
| 1574 | (MPARAM)&wp, | 
|---|
| 1575 | NULL); | 
|---|
| 1576 |  | 
|---|
| 1577 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1578 | SLB_CONSOLE_SPEAKERFREQUENCY, | 
|---|
| 1579 | SLM_SETTICKSIZE, | 
|---|
| 1580 | MPFROM2SHORT(SMA_SETALLTICKS, 40), | 
|---|
| 1581 | NULL); | 
|---|
| 1582 |  | 
|---|
| 1583 | /* duration slider */ | 
|---|
| 1584 | slcd.cbSize = sizeof(SLDCDATA); | 
|---|
| 1585 | wp.pCtlData = &slcd; | 
|---|
| 1586 |  | 
|---|
| 1587 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1588 | SLB_CONSOLE_SPEAKERDURATION, | 
|---|
| 1589 | WM_QUERYWINDOWPARAMS, | 
|---|
| 1590 | (MPARAM)&wp, | 
|---|
| 1591 | NULL); | 
|---|
| 1592 |  | 
|---|
| 1593 | slcd.usScale1Increments=9; | 
|---|
| 1594 | slcd.usScale1Spacing=0; | 
|---|
| 1595 |  | 
|---|
| 1596 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1597 | SLB_CONSOLE_SPEAKERDURATION, | 
|---|
| 1598 | WM_SETWINDOWPARAMS, | 
|---|
| 1599 | (MPARAM)&wp, | 
|---|
| 1600 | NULL); | 
|---|
| 1601 |  | 
|---|
| 1602 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1603 | SLB_CONSOLE_SPEAKERDURATION, | 
|---|
| 1604 | SLM_SETTICKSIZE, | 
|---|
| 1605 | MPFROM2SHORT(SMA_SETALLTICKS, 40), | 
|---|
| 1606 | NULL); | 
|---|
| 1607 |  | 
|---|
| 1608 |  | 
|---|
| 1609 | return (NO_ERROR);                                                   /* OK */ | 
|---|
| 1610 | } | 
|---|
| 1611 |  | 
|---|
| 1612 | /***************************************************************************** | 
|---|
| 1613 | * Name      : static APIRET ConPropPage3Set | 
|---|
| 1614 | * Funktion  : setup dialog elements for page 3 | 
|---|
| 1615 | * Parameter : | 
|---|
| 1616 | * Variablen : | 
|---|
| 1617 | * Ergebnis  : MRESULT | 
|---|
| 1618 | * Bemerkung : | 
|---|
| 1619 | * | 
|---|
| 1620 | * Autor     : Jochen Schaeuble [1998/04/29 23:20] | 
|---|
| 1621 | *****************************************************************************/ | 
|---|
| 1622 |  | 
|---|
| 1623 | static APIRET ConPropPage3Set(HWND            hwndDlg, | 
|---|
| 1624 | PICONSOLEOPTIONS pConsoleOptions) | 
|---|
| 1625 | { | 
|---|
| 1626 | if (pConsoleOptions == NULL)                           /* check parameters */ | 
|---|
| 1627 | return (ERROR_INVALID_PARAMETER);               /* raise error condition */ | 
|---|
| 1628 |  | 
|---|
| 1629 | /* setup check-button */ | 
|---|
| 1630 |  | 
|---|
| 1631 |  | 
|---|
| 1632 | WinCheckButton(hwndDlg,                                /* Override default */ | 
|---|
| 1633 | CB_CONSOLE_WINDOWPOSITION, | 
|---|
| 1634 | pConsoleOptions->fSetWindowPosition); | 
|---|
| 1635 |  | 
|---|
| 1636 | /* setup limits for spin-buttons */ | 
|---|
| 1637 |  | 
|---|
| 1638 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1639 | SPN_CONSOLE_X, | 
|---|
| 1640 | SPBM_SETLIMITS, | 
|---|
| 1641 | MPFROMSHORT(WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN)-1), | 
|---|
| 1642 | MPFROMSHORT(0)); | 
|---|
| 1643 |  | 
|---|
| 1644 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1645 | SPN_CONSOLE_Y, | 
|---|
| 1646 | SPBM_SETLIMITS, | 
|---|
| 1647 | MPFROMSHORT(WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN)-1), | 
|---|
| 1648 | MPFROMSHORT(0)); | 
|---|
| 1649 |  | 
|---|
| 1650 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1651 | SPN_CONSOLE_DEFAULTWIDTH, | 
|---|
| 1652 | SPBM_SETLIMITS, | 
|---|
| 1653 | MPFROMSHORT(WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN)-1), | 
|---|
| 1654 | MPFROMSHORT(0)); | 
|---|
| 1655 |  | 
|---|
| 1656 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1657 | SPN_CONSOLE_DEFAULTHEIGHT, | 
|---|
| 1658 | SPBM_SETLIMITS, | 
|---|
| 1659 | MPFROMSHORT(WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN)-1), | 
|---|
| 1660 | MPFROMSHORT(0)); | 
|---|
| 1661 |  | 
|---|
| 1662 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1663 | SPN_CONSOLE_BUFFERWIDTH, | 
|---|
| 1664 | SPBM_SETLIMITS, | 
|---|
| 1665 | MPFROMSHORT(9999), | 
|---|
| 1666 | MPFROMSHORT(0)); | 
|---|
| 1667 |  | 
|---|
| 1668 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1669 | SPN_CONSOLE_BUFFERHEIGHT, | 
|---|
| 1670 | SPBM_SETLIMITS, | 
|---|
| 1671 | MPFROMSHORT(9999), | 
|---|
| 1672 | MPFROMSHORT(0)); | 
|---|
| 1673 |  | 
|---|
| 1674 |  | 
|---|
| 1675 | /* setup active values */ | 
|---|
| 1676 |  | 
|---|
| 1677 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1678 | SPN_CONSOLE_X, | 
|---|
| 1679 | SPBM_SETCURRENTVALUE, | 
|---|
| 1680 | MPFROMLONG(pConsoleOptions->coordDefaultPosition.X), | 
|---|
| 1681 | 0); | 
|---|
| 1682 |  | 
|---|
| 1683 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1684 | SPN_CONSOLE_Y, | 
|---|
| 1685 | SPBM_SETCURRENTVALUE, | 
|---|
| 1686 | MPFROMLONG(pConsoleOptions->coordDefaultPosition.Y), | 
|---|
| 1687 | 0); | 
|---|
| 1688 |  | 
|---|
| 1689 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1690 | SPN_CONSOLE_DEFAULTWIDTH, | 
|---|
| 1691 | SPBM_SETCURRENTVALUE, | 
|---|
| 1692 | MPFROMLONG(pConsoleOptions->coordDefaultSize.X), | 
|---|
| 1693 | 0); | 
|---|
| 1694 |  | 
|---|
| 1695 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1696 | SPN_CONSOLE_DEFAULTHEIGHT, | 
|---|
| 1697 | SPBM_SETCURRENTVALUE, | 
|---|
| 1698 | MPFROMLONG(pConsoleOptions->coordDefaultSize.Y), | 
|---|
| 1699 | 0); | 
|---|
| 1700 |  | 
|---|
| 1701 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1702 | SPN_CONSOLE_BUFFERWIDTH, | 
|---|
| 1703 | SPBM_SETCURRENTVALUE, | 
|---|
| 1704 | MPFROMLONG(pConsoleOptions->coordBufferSize.X), | 
|---|
| 1705 | 0); | 
|---|
| 1706 |  | 
|---|
| 1707 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1708 | SPN_CONSOLE_BUFFERHEIGHT, | 
|---|
| 1709 | SPBM_SETCURRENTVALUE, | 
|---|
| 1710 | MPFROMLONG(pConsoleOptions->coordBufferSize.Y), | 
|---|
| 1711 | 0); | 
|---|
| 1712 |  | 
|---|
| 1713 |  | 
|---|
| 1714 | return (NO_ERROR);                                                   /* OK */ | 
|---|
| 1715 | } | 
|---|
| 1716 |  | 
|---|
| 1717 |  | 
|---|
| 1718 | /***************************************************************************** | 
|---|
| 1719 | * Name      : static APIRET ConPropPage4Set | 
|---|
| 1720 | * Funktion  : setup dialog elements for page 4 | 
|---|
| 1721 | * Parameter : | 
|---|
| 1722 | * Variablen : | 
|---|
| 1723 | * Ergebnis  : MRESULT | 
|---|
| 1724 | * Bemerkung : | 
|---|
| 1725 | * | 
|---|
| 1726 | * Autor     : Patrick Haller [1998/06/13 23:20] | 
|---|
| 1727 | *****************************************************************************/ | 
|---|
| 1728 |  | 
|---|
| 1729 | static APIRET ConPropPage4Set(HWND            hwndDlg, | 
|---|
| 1730 | PICONSOLEOPTIONS pConsoleOptions) | 
|---|
| 1731 | { | 
|---|
| 1732 | ULONG ulColor;                              /* loop counter for the colors */ | 
|---|
| 1733 | ULONG ulRow; | 
|---|
| 1734 | ULONG ulColumn; | 
|---|
| 1735 |  | 
|---|
| 1736 | #define MAX_TRANSCOLORS 16 | 
|---|
| 1737 | static const ULONG TabColorTranslation[MAX_TRANSCOLORS] = | 
|---|
| 1738 | {          /*  RRGGBB */ | 
|---|
| 1739 | /* 1  */ 0x00000000, | 
|---|
| 1740 | /* 2  */ 0x0000007f, | 
|---|
| 1741 | /* 3  */ 0x00007f00, | 
|---|
| 1742 | /* 4  */ 0x007f0000, | 
|---|
| 1743 | /* 5  */ 0x00007f7f, | 
|---|
| 1744 | /* 6  */ 0x007f007f, | 
|---|
| 1745 | /* 7  */ 0x007f7f00, | 
|---|
| 1746 | /* 8  */ 0x007f7f7f, | 
|---|
| 1747 | /* 9  */ 0x00808080, | 
|---|
| 1748 | /* 10 */ 0x008080ff, | 
|---|
| 1749 | /* 11 */ 0x0080ff80, | 
|---|
| 1750 | /* 12 */ 0x00ff8080, | 
|---|
| 1751 | /* 13 */ 0x0080ffff, | 
|---|
| 1752 | /* 14 */ 0x00ff80ff, | 
|---|
| 1753 | /* 15 */ 0x00ffff80, | 
|---|
| 1754 | /* 16 */ 0x00ffffff | 
|---|
| 1755 | }; | 
|---|
| 1756 |  | 
|---|
| 1757 |  | 
|---|
| 1758 | if (pConsoleOptions == NULL)                           /* check parameters */ | 
|---|
| 1759 | return (ERROR_INVALID_PARAMETER);               /* raise error condition */ | 
|---|
| 1760 |  | 
|---|
| 1761 | /* setup the value sets */ | 
|---|
| 1762 | for (ulColor = 0; | 
|---|
| 1763 | ulColor < MAX_TRANSCOLORS; | 
|---|
| 1764 | ulColor++) | 
|---|
| 1765 | { | 
|---|
| 1766 | ulRow    = 1 + (ulColor & 0x01);                /* calculate field index */ | 
|---|
| 1767 | ulColumn = 1 + (ulColor >> 1); | 
|---|
| 1768 |  | 
|---|
| 1769 | /* foreground */ | 
|---|
| 1770 | WinSendDlgItemMsg (hwndDlg, | 
|---|
| 1771 | VS_CONSOLE_FOREGROUND, | 
|---|
| 1772 | VM_SETITEMATTR, | 
|---|
| 1773 | MPFROM2SHORT(ulRow, ulColumn), | 
|---|
| 1774 | MPFROM2SHORT(VIA_RGB, TRUE) ); | 
|---|
| 1775 |  | 
|---|
| 1776 | WinSendDlgItemMsg (hwndDlg, | 
|---|
| 1777 | VS_CONSOLE_FOREGROUND, | 
|---|
| 1778 | VM_SETITEM, | 
|---|
| 1779 | MPFROM2SHORT(ulRow, ulColumn), | 
|---|
| 1780 | (MPARAM) TabColorTranslation[ulColor] ); | 
|---|
| 1781 |  | 
|---|
| 1782 | /* background */ | 
|---|
| 1783 | WinSendDlgItemMsg (hwndDlg, | 
|---|
| 1784 | VS_CONSOLE_BACKGROUND, | 
|---|
| 1785 | VM_SETITEMATTR, | 
|---|
| 1786 | MPFROM2SHORT(ulRow, ulColumn), | 
|---|
| 1787 | MPFROM2SHORT(VIA_RGB, TRUE) ); | 
|---|
| 1788 |  | 
|---|
| 1789 | WinSendDlgItemMsg (hwndDlg, | 
|---|
| 1790 | VS_CONSOLE_BACKGROUND, | 
|---|
| 1791 | VM_SETITEM, | 
|---|
| 1792 | MPFROM2SHORT(ulRow, ulColumn), | 
|---|
| 1793 | (MPARAM) TabColorTranslation[ulColor] ); | 
|---|
| 1794 | } | 
|---|
| 1795 |  | 
|---|
| 1796 |  | 
|---|
| 1797 | /* @@@PH fonts */ | 
|---|
| 1798 |  | 
|---|
| 1799 | return (NO_ERROR);                                                   /* OK */ | 
|---|
| 1800 | } | 
|---|
| 1801 |  | 
|---|
| 1802 |  | 
|---|
| 1803 | /***************************************************************************** | 
|---|
| 1804 | * Name      : static APIRET ConPropPage5Set | 
|---|
| 1805 | * Funktion  : setup dialog elements for page 5 | 
|---|
| 1806 | * Parameter : | 
|---|
| 1807 | * Variablen : | 
|---|
| 1808 | * Ergebnis  : MRESULT | 
|---|
| 1809 | * Bemerkung : | 
|---|
| 1810 | * | 
|---|
| 1811 | * Autor     : Jochen Schaeuble [1998/04/29 23:20] | 
|---|
| 1812 | *****************************************************************************/ | 
|---|
| 1813 |  | 
|---|
| 1814 | static APIRET ConPropPage5Set(HWND             hwndDlg, | 
|---|
| 1815 | PICONSOLEOPTIONS pConsoleOptions) | 
|---|
| 1816 | { | 
|---|
| 1817 | if (pConsoleOptions == NULL)                           /* check parameters */ | 
|---|
| 1818 | return (ERROR_INVALID_PARAMETER);               /* raise error condition */ | 
|---|
| 1819 | //   #define PRTYC_NOCHANGE     0 | 
|---|
| 1820 | //   #define PRTYC_IDLETIME     1 | 
|---|
| 1821 | //   #define PRTYC_REGULAR      2 | 
|---|
| 1822 | //   #define PRTYC_TIMECRITICAL 3 | 
|---|
| 1823 | //   #define PRTYC_FOREGROUNDSERVER 4 | 
|---|
| 1824 |  | 
|---|
| 1825 | //   /* Priority deltas */ | 
|---|
| 1826 |  | 
|---|
| 1827 | //   #define PRTYD_MINIMUM     -31 | 
|---|
| 1828 | //   #define PRTYD_MAXIMUM      31 | 
|---|
| 1829 | /* setup application-priorities */ | 
|---|
| 1830 |  | 
|---|
| 1831 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1832 | SPN_CONSOLE_APPPRIORITY, | 
|---|
| 1833 | SPBM_SETARRAY, | 
|---|
| 1834 | priorities, | 
|---|
| 1835 | MPFROMLONG(NUMPRIORITIES)); | 
|---|
| 1836 |  | 
|---|
| 1837 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1838 | SPN_CONSOLE_APPPRIORITY, | 
|---|
| 1839 | SPBM_SETCURRENTVALUE, | 
|---|
| 1840 | MPFROMLONG(pConsoleOptions->ulConsoleThreadPriorityClass-1), | 
|---|
| 1841 | NULL); | 
|---|
| 1842 |  | 
|---|
| 1843 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1844 | SPN_CONSOLE_APPPRIODELTA, | 
|---|
| 1845 | SPBM_SETLIMITS, | 
|---|
| 1846 | MPFROMSHORT(PRTYD_MAXIMUM), | 
|---|
| 1847 | MPFROMSHORT(0)); | 
|---|
| 1848 |  | 
|---|
| 1849 |  | 
|---|
| 1850 | WinSendDlgItemMsg(hwndDlg,                           /* set current value */ | 
|---|
| 1851 | SPN_CONSOLE_APPPRIODELTA, | 
|---|
| 1852 | SPBM_SETCURRENTVALUE, | 
|---|
| 1853 | MPFROMLONG(0), | 
|---|
| 1854 | 0); | 
|---|
| 1855 |  | 
|---|
| 1856 | /* setup console-priorities */ | 
|---|
| 1857 |  | 
|---|
| 1858 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1859 | SPN_CONSOLE_CONSOLEPRIORITY, | 
|---|
| 1860 | SPBM_SETARRAY, | 
|---|
| 1861 | priorities, | 
|---|
| 1862 | MPFROMLONG(NUMPRIORITIES)); | 
|---|
| 1863 |  | 
|---|
| 1864 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1865 | SPN_CONSOLE_CONSOLEPRIORITY, | 
|---|
| 1866 | SPBM_SETCURRENTVALUE, | 
|---|
| 1867 | MPFROMLONG(pConsoleOptions->ulConsoleThreadPriorityClass-1), | 
|---|
| 1868 | NULL); | 
|---|
| 1869 |  | 
|---|
| 1870 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1871 | SPN_CONSOLE_CONSOLEPRIODELTA, | 
|---|
| 1872 | SPBM_SETLIMITS, | 
|---|
| 1873 | MPFROMSHORT(PRTYD_MAXIMUM), | 
|---|
| 1874 | MPFROMSHORT(0)); | 
|---|
| 1875 |  | 
|---|
| 1876 |  | 
|---|
| 1877 | WinSendDlgItemMsg(hwndDlg,                           /* set current value */ | 
|---|
| 1878 | SPN_CONSOLE_CONSOLEPRIODELTA, | 
|---|
| 1879 | SPBM_SETCURRENTVALUE, | 
|---|
| 1880 | MPFROMLONG(0), | 
|---|
| 1881 | 0); | 
|---|
| 1882 |  | 
|---|
| 1883 | WinSendDlgItemMsg(hwndDlg, | 
|---|
| 1884 | SPN_CONSOLE_UPDATELIMIT, | 
|---|
| 1885 | SPBM_SETLIMITS, | 
|---|
| 1886 | MPFROMSHORT(50), | 
|---|
| 1887 | MPFROMSHORT(0)); | 
|---|
| 1888 |  | 
|---|
| 1889 | return (NO_ERROR);                                                   /* OK */ | 
|---|
| 1890 | } | 
|---|
| 1891 |  | 
|---|
| 1892 |  | 
|---|
| 1893 |  | 
|---|
| 1894 |  | 
|---|
| 1895 |  | 
|---|
| 1896 | /***************************************************************************** | 
|---|
| 1897 | * Name      : APIRET EXPENTRY ConsolePropertyLoad | 
|---|
| 1898 | * Funktion  : load properties from registry | 
|---|
| 1899 | * Parameter : PICONSOLEOPTIONS pConsoleOptions | 
|---|
| 1900 | * Variablen : | 
|---|
| 1901 | * Ergebnis  : APIRET | 
|---|
| 1902 | * Bemerkung : | 
|---|
| 1903 | * | 
|---|
| 1904 | * Autor     : Patrick Haller [1998/06/13 23:20] | 
|---|
| 1905 | *****************************************************************************/ | 
|---|
| 1906 |  | 
|---|
| 1907 | APIRET EXPENTRY ConsolePropertyLoad(PICONSOLEOPTIONS pConsoleOptions) | 
|---|
| 1908 | { | 
|---|
| 1909 | dprintf (("KERNEL32: Console:ConsolePropertyLoad(%08xh) not implemented.\n", | 
|---|
| 1910 | pConsoleOptions)); | 
|---|
| 1911 |  | 
|---|
| 1912 | // HKEY_CURRENT_USER/SOFTWARE/ODIN/<process name>/<option name> | 
|---|
| 1913 |  | 
|---|
| 1914 | return (NO_ERROR); | 
|---|
| 1915 | } | 
|---|
| 1916 |  | 
|---|
| 1917 |  | 
|---|
| 1918 |  | 
|---|
| 1919 | /***************************************************************************** | 
|---|
| 1920 | * Name      : APIRET EXPENTRY ConsolePropertySave | 
|---|
| 1921 | * Funktion  : save properties from registry | 
|---|
| 1922 | * Parameter : PICONSOLEOPTIONS pConsoleOptions | 
|---|
| 1923 | * Variablen : | 
|---|
| 1924 | * Ergebnis  : APIRET | 
|---|
| 1925 | * Bemerkung : | 
|---|
| 1926 | * | 
|---|
| 1927 | * Autor     : Patrick Haller [1998/06/13 23:20] | 
|---|
| 1928 | *****************************************************************************/ | 
|---|
| 1929 |  | 
|---|
| 1930 | APIRET EXPENTRY ConsolePropertySave(PICONSOLEOPTIONS pConsoleOptions) | 
|---|
| 1931 | { | 
|---|
| 1932 | dprintf (("KERNEL32: Console:ConsolePropertySave(%08xh) not implemented.\n", | 
|---|
| 1933 | pConsoleOptions)); | 
|---|
| 1934 |  | 
|---|
| 1935 | return (NO_ERROR); | 
|---|
| 1936 | } | 
|---|
| 1937 |  | 
|---|
| 1938 |  | 
|---|
| 1939 | /***************************************************************************** | 
|---|
| 1940 | * Name      : APIRET EXPENTRY ConsolePropertyApply | 
|---|
| 1941 | * Funktion  : apply properties in memory to the console window | 
|---|
| 1942 | * Parameter : PICONSOLEOPTIONS pConsoleOptions | 
|---|
| 1943 | * Variablen : | 
|---|
| 1944 | * Ergebnis  : APIRET | 
|---|
| 1945 | * Bemerkung : | 
|---|
| 1946 | * | 
|---|
| 1947 | * Autor     : Patrick Haller [1998/06/13 23:20] | 
|---|
| 1948 | *****************************************************************************/ | 
|---|
| 1949 |  | 
|---|
| 1950 | APIRET EXPENTRY ConsolePropertyApply(PICONSOLEOPTIONS pConsoleOptions) | 
|---|
| 1951 | { | 
|---|
| 1952 | dprintf (("KERNEL32: Console:ConsolePropertyApply(%08xh) not implemented.\n", | 
|---|
| 1953 | pConsoleOptions)); | 
|---|
| 1954 |  | 
|---|
| 1955 | return (NO_ERROR); | 
|---|
| 1956 | } | 
|---|
| 1957 |  | 
|---|
| 1958 |  | 
|---|
| 1959 |  | 
|---|
| 1960 |  | 
|---|
| 1961 |  | 
|---|
| 1962 |  | 
|---|
| 1963 | #if 0 | 
|---|
| 1964 | DLGTEMPLATE DLG_CONSOLE_PAGE3 | 
|---|
| 1965 | CONTROL "Sample", SPN_CONSOLE_X, 49, 60, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1966 | CONTROL "Sample", SPN_CONSOLE_Y, 49, 45, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1967 | CONTROL "Sample", SPN_CONSOLE_DEFAULTWIDTH, 155, 60, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1968 | CONTROL "Sample", SPN_CONSOLE_DEFAULTHEIGHT, 155, 45, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1969 | CONTROL "~Override default position and size", CB_CONSOLE_WINDOWPOSITION, 8, 80, 155, 10, WC_BUTTON, BS_AUTOCHECKBOX | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1970 | CONTROL "Sample", SPN_CONSOLE_BUFFERWIDTH, 49, 19, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1971 | CONTROL "Sample", SPN_CONSOLE_BUFFERHEIGHT, 155, 19, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1972 | CONTROL "Buffer allocates .. MB memory.", ST_CONSOLE_BUFFERMEMORY, 8, 6, 194, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP | 
|---|
| 1973 |  | 
|---|
| 1974 | DLGTEMPLATE DLG_CONSOLE_PAGE5 | 
|---|
| 1975 | CONTROL "Sample", SPN_CONSOLE_APPPRIORITY, 46, 52, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_READONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1976 | CONTROL "Sample", SPN_CONSOLE_APPPRIODELTA, 154, 52, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1977 | CONTROL "Sample", SPN_CONSOLE_CONSOLEPRIORITY, 46, 20, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1978 | CONTROL "Sample", SPN_CONSOLE_CONSOLEPRIODELTA, 154, 20, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1979 | CONTROL "Sample", SPN_CONSOLE_UPDATELIMIT, 113, 5, 89, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1980 |  | 
|---|
| 1981 | DLGTEMPLATE DLG_CONSOLE_PAGE4 | 
|---|
| 1982 | CONTROL "...", VS_CONSOLE_FOREGROUND, 6, 56, 95, 34, WC_VALUESET, VS_RGB | VS_BORDER | VS_ITEMBORDER | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1983 | CONTROL "...", VS_CONSOLE_BACKGROUND, 103, 56, 99, 34, WC_VALUESET, VS_RGB | VS_BORDER | VS_ITEMBORDER | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1984 | CONTROL "Sample", LB_CONSOLE_FONTS, 6, 4, 95, 36, WC_LISTBOX, WS_VISIBLE | WS_GROUP | WS_TABSTOP | 
|---|
| 1985 | CONTROL "00 x 00", ST_CONSOLE_WINDOWSIZE, 156, 16, 47, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP | 
|---|
| 1986 | CONTROL "00 x 00", ST_CONSOLE_SCREENSIZE, 156, 4, 47, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP | 
|---|
| 1987 |  | 
|---|
| 1988 | #endif | 
|---|
| 1989 |  | 
|---|