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