buttons in page setup now working properly (for En and De only)
authorChristoph von Wittich <christoph_vw@reactos.org>
Fri, 6 Jan 2006 22:41:42 +0000 (22:41 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Fri, 6 Jan 2006 22:41:42 +0000 (22:41 +0000)
svn path=/trunk/; revision=20631

reactos/subsys/system/notepad/De.rc
reactos/subsys/system/notepad/En.rc
reactos/subsys/system/notepad/dialog.c

index daa27a0..0e79d92 100644 (file)
@@ -95,8 +95,8 @@ EDITTEXT /*STRING_PAGESETUP_RIGHTVALUE,*/  0x14D,     130, 55, 35, 11, WS_CHILD
 LTEXT    "&Unten:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Abbrechen",     0x152,               180, 21, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Abbrechen",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
 PUSHBUTTON    "&Hilfe",       0x153,                180, 39, 40, 15, WS_TABSTOP
 }
 
index 84b7967..516fe9d 100644 (file)
@@ -97,8 +97,8 @@ EDITTEXT /*STRING_PAGESETUP_RIGHTVALUE,*/  0x14D,     130, 55, 35, 11, WS_CHILD
 LTEXT    "&Bottom:",      0x14E,100, 73, 30, 10, WS_CHILD
 EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150,    130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP
 
-DEFPUSHBUTTON "OK",         0x151,                   180,  3, 40, 15, WS_TABSTOP
-PUSHBUTTON    "Cancel",     0x152,               180, 21, 40, 15, WS_TABSTOP
+DEFPUSHBUTTON "OK",         IDOK,                   180,  3, 40, 15, WS_TABSTOP
+PUSHBUTTON    "Cancel",     IDCANCEL,               180, 21, 40, 15, WS_TABSTOP
 PUSHBUTTON    "&Help",       0x153,                180, 39, 40, 15, WS_TABSTOP
 }
 
index 2fd8fbf..590ea33 100644 (file)
@@ -847,51 +847,54 @@ VOID DIALOG_FilePageSetup(void)
 static INT_PTR WINAPI DIALOG_PAGESETUP_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
 {
 
-   switch (msg)
+    switch (msg)
     {
     case WM_COMMAND:
-      switch (wParam)
-        {
-        case IDOK:
-          /* save user input and close dialog */
-          GetDlgItemText(hDlg, 0x141, Globals.szHeader, SIZEOF(Globals.szHeader));
-          GetDlgItemText(hDlg, 0x143, Globals.szFooter, SIZEOF(Globals.szFooter));
-          GetDlgItemText(hDlg, 0x14A, Globals.szMarginTop, SIZEOF(Globals.szMarginTop));
-          GetDlgItemText(hDlg, 0x150, Globals.szMarginBottom, SIZEOF(Globals.szMarginBottom));
-          GetDlgItemText(hDlg, 0x147, Globals.szMarginLeft, SIZEOF(Globals.szMarginLeft));
-          GetDlgItemText(hDlg, 0x14D, 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:
+        if (HIWORD(wParam) == BN_CLICKED)
         {
-          /* FIXME: Bring this to work */
-          static const WCHAR sorryW[] = { 'S','o','r','r','y',',',' ','n','o',' ','h','e','l','p',' ','a','v','a','i','l','a','b','l','e',0 };
-          static const WCHAR helpW[] = { 'H','e','l','p',0 };
-          MessageBox(Globals.hMainWnd, sorryW, helpW, MB_ICONEXCLAMATION);
-          return TRUE;
-        }
+            switch (LOWORD(wParam))
+            {
+            case IDOK:
+                /* save user input and close dialog */
+                GetDlgItemText(hDlg, 0x141, Globals.szHeader, SIZEOF(Globals.szHeader));
+                GetDlgItemText(hDlg, 0x143, Globals.szFooter, SIZEOF(Globals.szFooter));
+                GetDlgItemText(hDlg, 0x14A, Globals.szMarginTop, SIZEOF(Globals.szMarginTop));
+                GetDlgItemText(hDlg, 0x150, Globals.szMarginBottom, SIZEOF(Globals.szMarginBottom));
+                GetDlgItemText(hDlg, 0x147, Globals.szMarginLeft, SIZEOF(Globals.szMarginLeft));
+                GetDlgItemText(hDlg, 0x14D, 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 */
+                    static const WCHAR sorryW[] = { 'S','o','r','r','y',',',' ','n','o',' ','h','e','l','p',' ','a','v','a','i','l','a','b','l','e',0 };
+                    static const WCHAR helpW[] = { 'H','e','l','p',0 };
+                    MessageBox(Globals.hMainWnd, sorryW, helpW, MB_ICONEXCLAMATION);
+                    return TRUE;
+                }
 
-        default:
-          break;
+            default:
+                break;
+            }
         }
-      break;
+        break;
 
     case WM_INITDIALOG:
-       /* fetch last user input prior to display dialog */
-       SetDlgItemText(hDlg, 0x141, Globals.szHeader);
-       SetDlgItemText(hDlg, 0x143, Globals.szFooter);
-       SetDlgItemText(hDlg, 0x14A, Globals.szMarginTop);
-       SetDlgItemText(hDlg, 0x150, Globals.szMarginBottom);
-       SetDlgItemText(hDlg, 0x147, Globals.szMarginLeft);
-       SetDlgItemText(hDlg, 0x14D, Globals.szMarginRight);
-       break;
+        /* fetch last user input prior to display dialog */
+        SetDlgItemText(hDlg, 0x141, Globals.szHeader);
+        SetDlgItemText(hDlg, 0x143, Globals.szFooter);
+        SetDlgItemText(hDlg, 0x14A, Globals.szMarginTop);
+        SetDlgItemText(hDlg, 0x150, Globals.szMarginBottom);
+        SetDlgItemText(hDlg, 0x147, Globals.szMarginLeft);
+        SetDlgItemText(hDlg, 0x14D, Globals.szMarginRight);
+        break;
     }
 
-  return FALSE;
+    return FALSE;
 }