1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682
|
/*
* Notepad (dialog.c)
*
* Copyright 1998,99 Marcel Baur <mbaur@g26.ethz.ch>
* To be distributed under the Wine License
*/
#include <stdio.h>
#include <windows.h>
#include <commdlg.h>
#include <winerror.h>
#ifdef WINELIB
#include "shell.h"
#include "options.h"
#endif
#include "main.h"
#include "license.h"
#include "language.h"
#include "dialog.h"
#ifdef LCC
#define LCC_HASASSERT
#include "lcc.h"
#else
#include "version.h"
#include "winnls.h"
#endif
static LRESULT DIALOG_PAGESETUP_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
int AlertIDS(UINT ids_message, UINT ids_caption, WORD type) {
/*
* Given some ids strings, this acts as a language-aware wrapper for
* "MessageBox"
*/
CHAR szMessage[MAX_STRING_LEN];
CHAR szCaption[MAX_STRING_LEN];
LoadString(Globals.hInstance, ids_message, szMessage, sizeof(szMessage));
LoadString(Globals.hInstance, ids_caption, szCaption, sizeof(szCaption));
return (MessageBox(Globals.hMainWnd, szMessage, szCaption, type));
}
void AlertFileNotFound(LPCSTR szFileName) {
int nResult;
CHAR szMessage[MAX_STRING_LEN];
CHAR szRessource[MAX_STRING_LEN];
/* Load and format szMessage */
LoadString(Globals.hInstance, IDS_NOTFOUND, szRessource, sizeof(szRessource));
wvsprintf(szMessage, szRessource, szFileName);
/* Load szCaption */
LoadString(Globals.hInstance, IDS_ERROR, szRessource, sizeof(szRessource));
/* Display Modal Dialog */
nResult = MessageBox(Globals.hMainWnd, szMessage, szRessource, MB_ICONEXCLAMATION);
}
int AlertFileNotSaved(LPCSTR szFileName) {
int nResult;
CHAR szMessage[MAX_STRING_LEN];
CHAR szRessource[MAX_STRING_LEN];
/* Load and format Message */
LoadString(Globals.hInstance, IDS_NOTSAVED, szRessource, sizeof(szRessource));
wvsprintf(szMessage, szRessource, szFileName);
/* Load Caption */
LoadString(Globals.hInstance, IDS_ERROR, szRessource, sizeof(szRessource));
/* Display modal */
nResult = MessageBox(Globals.hMainWnd, szMessage, szRessource, MB_ICONEXCLAMATION + MB_YESNOCANCEL);
return(nResult);
}
VOID AlertOutOfMemory(void) {
int nResult;
nResult = AlertIDS(IDS_OUT_OF_MEMORY, IDS_ERROR, MB_ICONEXCLAMATION);
PostQuitMessage(1);
}
BOOL ExistFile(LPCSTR szFilename) {
/*
* Returns: TRUE - if "szFileName" exists
* FALSE - if it does not
*/
WIN32_FIND_DATA entry;
HANDLE hFile;
hFile = FindFirstFile(szFilename, &entry);
return (hFile!=INVALID_HANDLE_VALUE);
}
VOID DoSaveFile(VOID) {
/* FIXME: Really Save the file */
/* ... (Globals.szFileName); */
}
BOOL DoCloseFile(void) {
/* Return value: TRUE - User agreed to close (both save/don't save) */
/* FALSE - User cancelled close by selecting "Cancel" */
int nResult;
if (strlen(Globals.szFileName)>0) {
/* prompt user to save changes */
nResult = AlertFileNotSaved(Globals.szFileName);
switch (nResult) {
case IDYES: DoSaveFile();
break;
case IDNO: break;
case IDCANCEL: return(FALSE);
break;
default: return(FALSE);
break;
} /* switch */
} /* if */
/* Forget file name */
lstrcpy(Globals.szFileName, "");
LANGUAGE_UpdateWindowCaption();
return(TRUE);
}
void DoOpenFile(LPCSTR szFileName) {
int hFile;
WORD nResult;
/* Close any files and prompt to save changes */
if (DoCloseFile) {
GetFileTitle(szFileName, Globals.szFileName, sizeof(Globals.szFileName));
LANGUAGE_UpdateWindowCaption();
hFile = _lopen(szFileName, OF_READ);
nResult = _lread(hFile, Globals.Buffer, sizeof(Globals.Buffer));
_lclose(hFile);
/* FIXME: Append time/date if first line contains LOGPREFIX */
/* (Globals.Buffer, ) */
}
}
VOID DIALOG_FileNew(VOID)
{
/* Close any files and promt to save changes */
if (DoCloseFile()) {
/* do nothing yet */
}
}
VOID DIALOG_FileOpen(VOID)
{
OPENFILENAME openfilename;
CHAR szPath[MAX_PATHNAME_LEN];
CHAR szDir[MAX_PATHNAME_LEN];
CHAR szzFilter[2 * MAX_STRING_LEN + 100];
CHAR szDefaultExt[4];
LPSTR p = szzFilter;
lstrcpy(szDefaultExt, "txt");
LoadString(Globals.hInstance, IDS_TEXT_FILES_TXT, p, MAX_STRING_LEN);
p += strlen(p) + 1;
lstrcpy(p, "*.txt");
p += strlen(p) + 1;
LoadString(Globals.hInstance, IDS_ALL_FILES, p, MAX_STRING_LEN);
p += strlen(p) + 1;
lstrcpy(p, "*.*");
p += strlen(p) + 1;
*p = '\0';
GetCurrentDirectory(sizeof(szDir), szDir);
lstrcpy(szPath,"*.txt");
openfilename.lStructSize = sizeof(OPENFILENAME);
openfilename.hwndOwner = Globals.hMainWnd;
openfilename.hInstance = Globals.hInstance;
openfilename.lpstrFilter = szzFilter;
openfilename.lpstrCustomFilter = 0;
openfilename.nMaxCustFilter = 0;
openfilename.nFilterIndex = 0;
openfilename.lpstrFile = szPath;
openfilename.nMaxFile = sizeof(szPath);
openfilename.lpstrFileTitle = 0;
openfilename.nMaxFileTitle = 0;
openfilename.lpstrInitialDir = szDir;
openfilename.lpstrTitle = 0;
openfilename.Flags = OFN_FILEMUSTEXIST + OFN_PATHMUSTEXIST;
openfilename.nFileOffset = 0;
openfilename.nFileExtension = 0;
openfilename.lpstrDefExt = szDefaultExt;
openfilename.lCustData = 0;
openfilename.lpfnHook = 0;
openfilename.lpTemplateName = 0;
if (GetOpenFileName(&openfilename)) {
if (ExistFile(openfilename.lpstrFile))
DoOpenFile(openfilename.lpstrFile);
else
AlertFileNotFound(openfilename.lpstrFile);
}
}
VOID DIALOG_FileSave(VOID)
{
/* FIXME: Save File */
DIALOG_FileSaveAs();
}
VOID DIALOG_FileSaveAs(VOID)
{
OPENFILENAME saveas;
CHAR szPath[MAX_PATHNAME_LEN];
CHAR szDir[MAX_PATHNAME_LEN];
CHAR szDefaultExt[4];
CHAR szzFilter[2 * MAX_STRING_LEN + 100];
LPSTR p = szzFilter;
lstrcpy(szDefaultExt, "txt");
LoadString(Globals.hInstance, IDS_TEXT_FILES_TXT, p, MAX_STRING_LEN);
p += strlen(p) + 1;
lstrcpy(p, "*.txt");
p += strlen(p) + 1;
LoadString(Globals.hInstance, IDS_ALL_FILES, p, MAX_STRING_LEN);
p += strlen(p) + 1;
lstrcpy(p, "*.*");
p += strlen(p) + 1;
*p = '\0';
lstrcpy(szPath,"*.*");
GetCurrentDirectory(sizeof(szDir), szDir);
saveas.lStructSize = sizeof(OPENFILENAME);
saveas.hwndOwner = Globals.hMainWnd;
saveas.hInstance = Globals.hInstance;
saveas.lpstrFilter = szzFilter;
saveas.lpstrCustomFilter = 0;
saveas.nMaxCustFilter = 0;
saveas.nFilterIndex = 0;
saveas.lpstrFile = szPath;
saveas.nMaxFile = sizeof(szPath);
saveas.lpstrFileTitle = 0;
saveas.nMaxFileTitle = 0;
saveas.lpstrInitialDir = szDir;
saveas.lpstrTitle = 0;
saveas.Flags = OFN_PATHMUSTEXIST + OFN_OVERWRITEPROMPT + OFN_HIDEREADONLY;
saveas.nFileOffset = 0;
saveas.nFileExtension = 0;
saveas.lpstrDefExt = szDefaultExt;
saveas.lCustData = 0;
saveas.lpfnHook = 0;
saveas.lpTemplateName = 0;
if (GetSaveFileName(&saveas)) {
lstrcpy(Globals.szFileName, saveas.lpstrFile);
LANGUAGE_UpdateWindowCaption();
DIALOG_FileSave();
}
}
VOID DIALOG_FilePrint(VOID)
{
LONG bFlags, nBase;
WORD nOffset;
DOCINFO di;
int nResult;
HDC hContext;
PRINTDLG printer;
CHAR szDocumentName[MAX_STRING_LEN]; /* Name of document */
CHAR szPrinterName[MAX_STRING_LEN]; /* Name of the printer */
CHAR szDeviceName[MAX_STRING_LEN]; /* Name of the printer device */
CHAR szOutput[MAX_STRING_LEN]; /* in which file/device to print */
/* LPDEVMODE hDevMode; */
/* LPDEVNAMES hDevNames; */
/* hDevMode = GlobalAlloc(GMEM_MOVEABLE + GMEM_ZEROINIT, sizeof(DEVMODE)); */
/* hDevNames = GlobalAlloc(GMEM_MOVEABLE + GMEM_ZEROINIT, sizeof(DEVNAMES)); */
/* Get Current Settings */
printer.lStructSize = sizeof(PRINTDLG);
printer.hwndOwner = Globals.hMainWnd;
printer.hInstance = Globals.hInstance;
/* Let PrintDlg create a DEVMODE structure */
printer.hDevMode = 0;
printer.hDevNames = 0;
printer.hDC = 0;
printer.Flags = PD_RETURNDEFAULT;
printer.nFromPage = 0;
printer.nToPage = 0;
printer.nMinPage = 0;
printer.nMaxPage = 0;
printer.nCopies = 0;
printer.lCustData = 0;
printer.lpfnPrintHook = 0;
printer.lpfnSetupHook = 0;
printer.lpPrintTemplateName = 0;
printer.lpSetupTemplateName = 0;
printer.hPrintTemplate = 0;
printer.hSetupTemplate = 0;
nResult = PrintDlg(&printer);
/* hContext = CreateDC(, szDeviceName, "TEST.TXT", 0); */
/* Congratulations to those Microsoft Engineers responsable */
/* for the following pointer acrobatics */
assert(printer.hDevNames!=0);
nBase = (LONG)(printer.hDevNames);
nOffset = (WORD)((LPDEVNAMES) printer.hDevNames)->wDriverOffset;
lstrcpy(szPrinterName, (LPCSTR) (nBase + nOffset));
nOffset = (WORD)((LPDEVNAMES) printer.hDevNames)->wDeviceOffset;
lstrcpy(szDeviceName, (LPCSTR) (nBase + nOffset));
nOffset = (WORD)((LPDEVNAMES) printer.hDevNames)->wOutputOffset;
lstrcpy(szOutput, (LPCSTR) (nBase + nOffset));
MessageBox(Globals.hMainWnd, szPrinterName, "Printer Name", MB_ICONEXCLAMATION);
MessageBox(Globals.hMainWnd, szDeviceName, "Device Name", MB_ICONEXCLAMATION);
MessageBox(Globals.hMainWnd, szOutput, "Output", MB_ICONEXCLAMATION);
/* Set some default flags */
bFlags = PD_RETURNDC + PD_SHOWHELP;
if (TRUE) {
/* Remove "Print Selection" if there is no selection */
bFlags = bFlags + PD_NOSELECTION;
}
printer.Flags = bFlags;
/*
printer.nFromPage = 0;
printer.nToPage = 0;
printer.nMinPage = 0;
printer.nMaxPage = 0;
*/
/* Let commdlg manage copy settings */
printer.nCopies = PD_USEDEVMODECOPIES;
if (PrintDlg(&printer)) {
/* initialize DOCINFO */
di.cbSize = sizeof(DOCINFO);
lstrcpy(di.lpszDocName, szDocumentName);
lstrcpy(di.lpszOutput, szOutput);
hContext = printer.hDC;
assert(hContext!=0);
assert( (int) hContext!=PD_RETURNDC);
SetMapMode(hContext, MM_LOMETRIC);
/* SetViewPortExExt(hContext, 10, 10, 0); */
SetBkMode(hContext, OPAQUE);
nResult = TextOut(hContext, 0, 0, " ", 1);
assert(nResult != 0);
nResult = StartDoc(hContext, &di);
assert(nResult != SP_ERROR);
nResult = StartPage(hContext);
assert(nResult >0);
/* FIXME: actually print */
nResult = EndPage(hContext);
switch (nResult) {
case SP_ERROR:
MessageBox(Globals.hMainWnd, "Generic Error", "Print Engine Error", MB_ICONEXCLAMATION);
break;
case SP_APPABORT:
MessageBox(Globals.hMainWnd, "The print job was aborted.", "Print Engine Error", MB_ICONEXCLAMATION);
break;
case SP_USERABORT:
MessageBox(Globals.hMainWnd, "The print job was aborted using the Print Manager ", "Print Engine Error", MB_ICONEXCLAMATION);
break;
case SP_OUTOFDISK:
MessageBox(Globals.hMainWnd, "Out of disk space", "Print Engine Error", MB_ICONEXCLAMATION);
break;
case SP_OUTOFMEMORY:
AlertOutOfMemory();
break;
default:
MessageBox(Globals.hMainWnd, "Default", "Print", MB_ICONEXCLAMATION);
} /* switch */
nResult = EndDoc(hContext);
assert(nResult>=0);
nResult = DeleteDC(hContext);
assert(nResult!=0);
} /* if */
/* GlobalFree(hDevNames); */
/* GlobalFree(hDevMode); */
}
VOID DIALOG_FilePageSetup(VOID)
{
DIALOG_PageSetup();
}
VOID DIALOG_FilePrinterSetup(VOID)
{
PRINTDLG printer;
printer.lStructSize = sizeof(PRINTDLG);
printer.hwndOwner = Globals.hMainWnd;
printer.hInstance = Globals.hInstance;
printer.hDevMode = 0;
printer.hDevNames = 0;
printer.hDC = 0;
printer.Flags = PD_PRINTSETUP;
printer.nFromPage = 0;
printer.nToPage = 0;
printer.nMinPage = 0;
printer.nMaxPage = 0;
printer.nCopies = 1;
printer.lCustData = 0;
printer.lpfnPrintHook = 0;
printer.lpfnSetupHook = 0;
printer.lpPrintTemplateName = 0;
printer.lpSetupTemplateName = 0;
printer.hPrintTemplate = 0;
printer.hSetupTemplate = 0;
if (PrintDlg(&printer)) {
/* do nothing */
};
}
VOID DIALOG_FileExit(VOID)
{
if (DoCloseFile()) {
PostQuitMessage(0);
}
}
VOID DIALOG_EditUndo(VOID)
{
MessageBox(Globals.hMainWnd, "Undo", "Debug", MB_ICONEXCLAMATION);
/* undo */
}
VOID DIALOG_EditCut(VOID)
{
HANDLE hMem;
hMem = GlobalAlloc(GMEM_ZEROINIT, 99);
OpenClipboard(Globals.hMainWnd);
EmptyClipboard();
/* FIXME: Get text */
lstrcpy((CHAR *)hMem, "Hello World");
SetClipboardData(CF_TEXT, hMem);
CloseClipboard();
GlobalFree(hMem);
}
VOID DIALOG_EditCopy(VOID)
{
HANDLE hMem;
hMem = GlobalAlloc(GMEM_ZEROINIT, 99);
OpenClipboard(Globals.hMainWnd);
EmptyClipboard();
/* FIXME: Get text */
lstrcpy((CHAR *)hMem, "Hello World");
SetClipboardData(CF_TEXT, hMem);
CloseClipboard();
GlobalFree(hMem);
}
VOID DIALOG_EditPaste(VOID)
{
HANDLE hClipText;
if (IsClipboardFormatAvailable(CF_TEXT)) {
OpenClipboard(Globals.hMainWnd);
hClipText = GetClipboardData(CF_TEXT);
CloseClipboard();
MessageBox(Globals.hMainWnd, (CHAR *)hClipText, "PASTE", MB_ICONEXCLAMATION);
}
}
VOID DIALOG_EditDelete(VOID)
{
/* Delete */
}
VOID DIALOG_EditSelectAll(VOID)
{
/* Select all */
}
VOID DIALOG_EditTimeDate(VOID)
{
SYSTEMTIME st;
LPSYSTEMTIME lpst = &st;
CHAR szDate[MAX_STRING_LEN];
LPSTR date = szDate;
GetLocalTime(&st);
GetDateFormat(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, lpst, NULL, date, MAX_STRING_LEN);
GetTimeFormat(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, lpst, NULL, date, MAX_STRING_LEN);
}
VOID DIALOG_EditWrap(VOID)
{
Globals.bWrapLongLines = !Globals.bWrapLongLines;
CheckMenuItem(Globals.hEditMenu, NP_EDIT_WRAP, MF_BYCOMMAND |
(Globals.bWrapLongLines ? MF_CHECKED : MF_UNCHECKED));
}
VOID DIALOG_Search(VOID)
{
Globals.find.lStructSize = sizeof(Globals.find);
Globals.find.hwndOwner = Globals.hMainWnd;
Globals.find.hInstance = Globals.hInstance;
Globals.find.lpstrFindWhat = (CHAR *) &Globals.szFindText;
Globals.find.wFindWhatLen = sizeof(Globals.szFindText);
Globals.find.lpstrReplaceWith = 0;
Globals.find.wReplaceWithLen = 0;
Globals.find.Flags = FR_DOWN;
Globals.find.lCustData = 0;
Globals.find.lpfnHook = 0;
Globals.find.lpTemplateName = 0;
/* We only need to create the modal FindReplace dialog which will */
/* notify us of incoming events using hMainWnd Window Messages */
Globals.hFindReplaceDlg = FindText(&Globals.find);
assert(Globals.hFindReplaceDlg !=0);
}
VOID DIALOG_SearchNext(VOID)
{
/* Search Next */
}
VOID DIALOG_HelpContents(VOID)
{
WinHelp(Globals.hMainWnd, HELPFILE, HELP_INDEX, 0);
}
VOID DIALOG_HelpSearch(VOID)
{
/* Search Help */
}
VOID DIALOG_HelpHelp(VOID)
{
WinHelp(Globals.hMainWnd, HELPFILE, HELP_HELPONHELP, 0);
}
VOID DIALOG_HelpLicense(VOID)
{
WineLicense(Globals.hMainWnd, Globals.lpszLanguage);
}
VOID DIALOG_HelpNoWarranty(VOID)
{
WineWarranty(Globals.hMainWnd, Globals.lpszLanguage);
}
VOID DIALOG_HelpAboutWine(VOID)
{
CHAR szNotepad[MAX_STRING_LEN];
LoadString(Globals.hInstance, IDS_NOTEPAD, szNotepad, sizeof(szNotepad));
ShellAbout(Globals.hMainWnd, szNotepad, "Notepad\n" WINE_RELEASE_INFO, 0);
}
/***********************************************************************
*
* DIALOG_PageSetup
*/
VOID DIALOG_PageSetup(VOID)
{
WNDPROC lpfnDlg;
lpfnDlg = MakeProcInstance(DIALOG_PAGESETUP_DlgProc, Globals.hInstance);
DialogBox(Globals.hInstance, STRING_PAGESETUP_Xx, Globals.hMainWnd, lpfnDlg);
FreeProcInstance(lpfnDlg);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* DIALOG_PAGESETUP_DlgProc
*/
static LRESULT DIALOG_PAGESETUP_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_COMMAND:
switch (wParam)
{
case IDOK:
/* save user input and close dialog */
GetDlgItemText(hDlg, NP_PAGESETUP_HEAD, Globals.szHeader, sizeof(Globals.szHeader));
GetDlgItemText(hDlg, NP_PAGESETUP_TAIL, Globals.szFooter, sizeof(Globals.szFooter));
GetDlgItemText(hDlg, NP_PAGESETUP_TOP, Globals.szMarginTop, sizeof(Globals.szMarginTop));
GetDlgItemText(hDlg, NP_PAGESETUP_BOTTOM, Globals.szMarginBottom, sizeof(Globals.szMarginBottom));
GetDlgItemText(hDlg, NP_PAGESETUP_LEFT, Globals.szMarginLeft, sizeof(Globals.szMarginLeft));
GetDlgItemText(hDlg, NP_PAGESETUP_RIGHT, Globals.szMarginRight, sizeof(Globals.szMarginRight));
EndDialog(hDlg, IDOK);
return TRUE;
case IDCANCEL:
/* discard user input and close dialog */
EndDialog(hDlg, IDCANCEL);
return TRUE;
case IDHELP:
/* FIXME: Bring this to work */
MessageBox(Globals.hMainWnd, "Sorry, no help available", "Help", MB_ICONEXCLAMATION);
return TRUE;
}
break;
case WM_INITDIALOG:
/* fetch last user input prior to display dialog */
SetDlgItemText(hDlg, NP_PAGESETUP_HEAD, Globals.szHeader);
SetDlgItemText(hDlg, NP_PAGESETUP_TAIL, Globals.szFooter);
SetDlgItemText(hDlg, NP_PAGESETUP_TOP, Globals.szMarginTop);
SetDlgItemText(hDlg, NP_PAGESETUP_BOTTOM, Globals.szMarginBottom);
SetDlgItemText(hDlg, NP_PAGESETUP_LEFT, Globals.szMarginLeft);
SetDlgItemText(hDlg, NP_PAGESETUP_RIGHT, Globals.szMarginRight);
break;
}
return FALSE;
}
|