Minor fixes for winemine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

This patch fixes processing of Escape and click on the "Close" button in
the "About" and "Fastest Times" dialogs.  IDCANCEL should not be ignored.

Also, in the "Custom" dialog, there is a "Cancel" button, but it works
incorrectly.  Although it doesn't change the parameters, it still changes
the setting in the menu and makes the board "Custom", i.e. new best
results won't be recorded.

The patch changes the order of calls so that the "Custom" dialog is called
before the menu and the board difficulty are changed.

Finally, all resources have been changed to widen the "About" dialog.
With some fonts, "Copyright 2000, Joshua Thielen" would not fit the
screen.  Only the Russian translation doesn't need it because it's already
using a wider dialog.

ChangeLog:
	programs/winemine/*.rc:
	Widen the "About" dialog to prevent wrapping of text.
	programs/winemine/dialog.c:
	Fix processing of IDCANCEL command.
	programs/winemine/main.c:
	Don't change settings if the user canceled the "Custom" dialog.

-- 
Regards,
Pavel Roskin
--- programs/winemine/En.rc
+++ programs/winemine/En.rc
@@ -90,14 +90,14 @@
     PUSHBUTTON      "Cancel", IDCANCEL,  40,  50,  50,  15
 }
 
-DLG_ABOUT DIALOG DISCARDABLE  0, 0, 145, 80
+DLG_ABOUT DIALOG DISCARDABLE  0, 0, 160, 80
 STYLE  DS_MODALFRAME | DS_3DLOOK |
     WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_POPUP
 CAPTION "About"
 {
-    LTEXT                               "Winemine", IDIGNORE,  10,  10,  35,  10
-    LTEXT         "Copyright 2000, Joshua Thielen", IDIGNORE,  35,  25, 100,  10
-    LTEXT                 "under the Wine license", IDIGNORE,  35,  35, 100,  10
+    LTEXT                               "Winemine", IDIGNORE,  10,  10,  50,  10
+    LTEXT         "Copyright 2000, Joshua Thielen", IDIGNORE,  35,  25, 115,  10
+    LTEXT                 "under the Wine license", IDIGNORE,  35,  35, 115,  10
     ICON                                "WINEMINE", IDIGNORE,  10,  25,  20,  20
-    DEFPUSHBUTTON                             "OK", IDOK,      50,  60,  55,  15
+    DEFPUSHBUTTON                             "OK", IDOK,      50,  60,  60,  15
 }
--- programs/winemine/Es.rc
+++ programs/winemine/Es.rc
@@ -89,14 +89,14 @@
     PUSHBUTTON      "Cancelar", IDCANCEL,  40,  50,  50,  15
 }
 
-DLG_ABOUT DIALOG DISCARDABLE  0, 0, 145, 80
+DLG_ABOUT DIALOG DISCARDABLE  0, 0, 160, 80
 STYLE  DS_MODALFRAME | DS_3DLOOK |
     WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_POPUP
 CAPTION "Acerca de"
 {
-    LTEXT                               "Winemine", IDIGNORE,  10,  10,  35,  10
-    LTEXT         "Copyright 2000, Joshua Thielen", IDIGNORE,  35,  25, 100,  10
-    LTEXT               "bajo la licencia de Wine", IDIGNORE,  35,  35, 100,  10
+    LTEXT                               "Winemine", IDIGNORE,  10,  10,  50,  10
+    LTEXT         "Copyright 2000, Joshua Thielen", IDIGNORE,  35,  25, 115,  10
+    LTEXT               "bajo la licencia de Wine", IDIGNORE,  35,  35, 115,  10
     ICON                                "WINEMINE", IDIGNORE,  10,  25,  20,  20
-    DEFPUSHBUTTON                        "Aceptar", IDOK,      50,  60,  55,  15
+    DEFPUSHBUTTON                        "Aceptar", IDOK,      50,  60,  60,  15
 }
--- programs/winemine/Fr.rc
+++ programs/winemine/Fr.rc
@@ -91,14 +91,14 @@
     PUSHBUTTON      "Annuler", IDCANCEL,  40,  50,  50,  15
 }
 
-DLG_ABOUT DIALOG DISCARDABLE  0, 0, 145, 80
+DLG_ABOUT DIALOG DISCARDABLE  0, 0, 160, 80
 STYLE  DS_MODALFRAME | DS_3DLOOK |
     WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_POPUP
 CAPTION "ю propos"
 {
-    LTEXT                               "Winemine", IDIGNORE,  10,  10,  35,  10
-    LTEXT         "Copyright 2000, Joshua Thielen", IDIGNORE,  35,  25, 100,  10
-    LTEXT                "sous la licence de Wine", IDIGNORE,  35,  35, 100,  10
+    LTEXT                               "Winemine", IDIGNORE,  10,  10,  50,  10
+    LTEXT         "Copyright 2000, Joshua Thielen", IDIGNORE,  35,  25, 115,  10
+    LTEXT                "sous la licence de Wine", IDIGNORE,  35,  35, 115,  10
     ICON                                "WINEMINE", IDIGNORE,  10,  25,  20,  20
-    DEFPUSHBUTTON                             "OK", IDOK,      50,  60,  55,  15
+    DEFPUSHBUTTON                             "OK", IDOK,      50,  60,  60,  15
 }
--- programs/winemine/Pt.rc
+++ programs/winemine/Pt.rc
@@ -89,14 +89,14 @@
     PUSHBUTTON      "Cancelar", IDCANCEL,  40,  50,  50,  15
 }
 
-DLG_ABOUT DIALOG DISCARDABLE  0, 0, 145, 80
+DLG_ABOUT DIALOG DISCARDABLE  0, 0, 160, 80
 STYLE  DS_MODALFRAME | DS_3DLOOK |
     WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_POPUP
 CAPTION "Sobre"
 {
-    LTEXT                               "Winemine", IDIGNORE,  10,  10,  35,  10
-    LTEXT         "Copyright 2000, Joshua Thielen", IDIGNORE,  35,  25, 100,  10
-    LTEXT             "conforme a licenГa do Wine", IDIGNORE,  35,  35, 100,  10
+    LTEXT                               "Winemine", IDIGNORE,  10,  10,  50,  10
+    LTEXT         "Copyright 2000, Joshua Thielen", IDIGNORE,  35,  25, 115,  10
+    LTEXT             "conforme a licenГa do Wine", IDIGNORE,  35,  35, 115,  10
     ICON                                "WINEMINE", IDIGNORE,  10,  25,  20,  20
-    DEFPUSHBUTTON                             "OK", IDOK,      50,  60,  55,  15
+    DEFPUSHBUTTON                             "OK", IDOK,      50,  60,  60,  15
 }
--- programs/winemine/Si.rc
+++ programs/winemine/Si.rc
@@ -89,14 +89,14 @@
     PUSHBUTTON      "PrekliХi", IDCANCEL,  40,  50,  50,  15
 }
 
-DLG_ABOUT DIALOG DISCARDABLE  0, 0, 145, 80
+DLG_ABOUT DIALOG DISCARDABLE  0, 0, 160, 80
 STYLE  DS_MODALFRAME | DS_3DLOOK |
     WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_POPUP
 CAPTION "O programu"
 {
-    LTEXT                               "WineMine", IDIGNORE,  10,  10,  35,  10
-    LTEXT         "Copyright 2000, Joshua Thielen", IDIGNORE,  35,  25, 100,  10
-    LTEXT                 "under the Wine license", IDIGNORE,  35,  35, 100,  10
+    LTEXT                               "Winemine", IDIGNORE,  10,  10,  50,  10
+    LTEXT         "Copyright 2000, Joshua Thielen", IDIGNORE,  35,  25, 115,  10
+    LTEXT                 "under the Wine license", IDIGNORE,  35,  35, 115,  10
     ICON                                "WINEMINE", IDIGNORE,  10,  25,  20,  20
-    DEFPUSHBUTTON                             "OK", IDOK,      50,  60,  55,  15
+    DEFPUSHBUTTON                             "OK", IDOK,      50,  60,  60,  15
 }
--- programs/winemine/dialog.c
+++ programs/winemine/dialog.c
@@ -47,7 +47,7 @@ BOOL CALLBACK CustomDlgProc( HWND hDlg, 
             return TRUE;
 
         case IDCANCEL:
-            EndDialog( hDlg, 0 );
+            EndDialog( hDlg, 1 );
             return TRUE;
         }
         break;
@@ -105,6 +105,7 @@ BOOL CALLBACK TimesDlgProc( HWND hDlg, U
     case WM_COMMAND:
         switch( LOWORD( wParam ) ) {
         case IDOK:
+        case IDCANCEL:
             EndDialog( hDlg, 0 );
             return TRUE;
         }
@@ -122,6 +123,7 @@ BOOL CALLBACK AboutDlgProc( HWND hDlg, U
     case WM_COMMAND:
         switch( LOWORD( wParam ) ) {
         case IDOK:
+        case IDCANCEL:
             EndDialog( hDlg, 0 );
             return TRUE;
         }
--- programs/winemine/main.c
+++ programs/winemine/main.c
@@ -441,8 +441,14 @@ void DestroyBoard( BOARD *p_board )
 
 void SetDifficulty( BOARD *p_board, DIFFICULTY difficulty )
 {
-    HMENU hMenu = GetMenu( p_board->hWnd );
+    HMENU hMenu;
 
+    if ( difficulty == CUSTOM )
+        if (DialogBoxParam( p_board->hInst, "DLG_CUSTOM", p_board->hWnd,
+                    CustomDlgProc, (LPARAM) p_board) != 0)
+           return;
+
+    hMenu = GetMenu( p_board->hWnd );
     CheckMenuItem( hMenu, IDM_BEGINNER + p_board->difficulty, MF_UNCHECKED );
     p_board->difficulty = difficulty;
     CheckMenuItem( hMenu, IDM_BEGINNER + difficulty, MF_CHECKED );
@@ -467,8 +473,6 @@ void SetDifficulty( BOARD *p_board, DIFF
         break;
 
     case CUSTOM:
-        DialogBoxParam( p_board->hInst, "DLG_CUSTOM", p_board->hWnd,
-                CustomDlgProc, (LPARAM) p_board);
         break;
     }
 }

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux