~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/programs/winemine/dialog.c

Version: ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * WineMine (dialog.c)
  3  *
  4  * Copyright 2000 Joshua Thielen
  5  *
  6  * This library is free software; you can redistribute it and/or
  7  * modify it under the terms of the GNU Lesser General Public
  8  * License as published by the Free Software Foundation; either
  9  * version 2.1 of the License, or (at your option) any later version.
 10  *
 11  * This library is distributed in the hope that it will be useful,
 12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14  * Lesser General Public License for more details.
 15  *
 16  * You should have received a copy of the GNU Lesser General Public
 17  * License along with this library; if not, write to the Free Software
 18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 19  */
 20 
 21 #define WIN32_LEAN_AND_MEAN
 22 
 23 #include <windows.h>
 24 #include "main.h"
 25 #include "resource.h"
 26 
 27 INT_PTR CALLBACK CustomDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
 28 {
 29     BOOL IsRet;
 30     static BOARD *p_board;
 31 
 32     switch( uMsg ) {
 33     case WM_INITDIALOG:
 34         p_board = (BOARD*) lParam;
 35         SetDlgItemInt( hDlg, IDC_EDITROWS, p_board->rows, FALSE );
 36         SetDlgItemInt( hDlg, IDC_EDITCOLS, p_board->cols, FALSE );
 37         SetDlgItemInt( hDlg, IDC_EDITMINES, p_board->mines, FALSE );
 38         return TRUE;
 39 
 40     case WM_COMMAND:
 41         switch( LOWORD( wParam ) ) {
 42         case IDOK:
 43             p_board->rows = GetDlgItemInt( hDlg, IDC_EDITROWS, &IsRet, FALSE );
 44             p_board->cols = GetDlgItemInt( hDlg, IDC_EDITCOLS, &IsRet, FALSE );
 45             p_board->mines = GetDlgItemInt( hDlg, IDC_EDITMINES, &IsRet, FALSE );
 46             CheckLevel( p_board );
 47             EndDialog( hDlg, 0 );
 48             return TRUE;
 49 
 50         case IDCANCEL:
 51             EndDialog( hDlg, 1 );
 52             return TRUE;
 53         }
 54         break;
 55     }
 56     return FALSE;
 57 }
 58 
 59 INT_PTR CALLBACK CongratsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
 60 {
 61     static BOARD *p_board;
 62 
 63     switch( uMsg ) {
 64     case WM_INITDIALOG:
 65         p_board = (BOARD*) lParam;
 66         SetDlgItemText( hDlg, IDC_EDITNAME,
 67                 p_board->best_name[p_board->difficulty] );
 68         return TRUE;
 69 
 70     case WM_COMMAND:
 71         switch( LOWORD( wParam ) ) {
 72         case IDOK:
 73             GetDlgItemText( hDlg, IDC_EDITNAME,
 74                 p_board->best_name[p_board->difficulty],
 75                 sizeof( p_board->best_name[p_board->difficulty] ) );
 76             EndDialog( hDlg, 0 );
 77             return TRUE;
 78 
 79         case IDCANCEL:
 80             EndDialog( hDlg, 0 );
 81             return TRUE;
 82         }
 83         break;
 84     }
 85     return FALSE;
 86 }
 87 
 88 INT_PTR CALLBACK TimesDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
 89 {
 90     static BOARD *p_board;
 91     unsigned i;
 92 
 93     switch( uMsg ) {
 94     case WM_INITDIALOG:
 95         p_board = (BOARD*) lParam;
 96 
 97         /* set best names */
 98         for( i = 0; i < 3; i++ )
 99             SetDlgItemText( hDlg, (IDC_NAME1) + i, p_board->best_name[i] );
100 
101         /* set best times */
102         for( i = 0; i < 3; i++ )
103             SetDlgItemInt( hDlg, (IDC_TIME1) + i, p_board->best_time[i], FALSE );
104         return TRUE;
105 
106     case WM_COMMAND:
107         switch( LOWORD( wParam ) ) {
108         case IDOK:
109         case IDCANCEL:
110             EndDialog( hDlg, 0 );
111             return TRUE;
112         }
113         break;
114     }
115     return FALSE;
116 }
117 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.