Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendialog.c
Go to the documentation of this file.
00001 /* 00002 * WineMine (dialog.c) 00003 * 00004 * Copyright 2000 Joshua Thielen 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00019 */ 00020 00021 #define WIN32_LEAN_AND_MEAN 00022 00023 #include <windows.h> 00024 #include "main.h" 00025 #include "resource.h" 00026 00027 INT_PTR CALLBACK CustomDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) 00028 { 00029 BOOL IsRet; 00030 static BOARD *p_board; 00031 00032 switch( uMsg ) { 00033 case WM_INITDIALOG: 00034 p_board = (BOARD*) lParam; 00035 SetDlgItemInt( hDlg, IDC_EDITROWS, p_board->rows, FALSE ); 00036 SetDlgItemInt( hDlg, IDC_EDITCOLS, p_board->cols, FALSE ); 00037 SetDlgItemInt( hDlg, IDC_EDITMINES, p_board->mines, FALSE ); 00038 return TRUE; 00039 00040 case WM_COMMAND: 00041 switch( LOWORD( wParam ) ) { 00042 case IDOK: 00043 p_board->rows = GetDlgItemInt( hDlg, IDC_EDITROWS, &IsRet, FALSE ); 00044 p_board->cols = GetDlgItemInt( hDlg, IDC_EDITCOLS, &IsRet, FALSE ); 00045 p_board->mines = GetDlgItemInt( hDlg, IDC_EDITMINES, &IsRet, FALSE ); 00046 CheckLevel( p_board ); 00047 EndDialog( hDlg, 0 ); 00048 return TRUE; 00049 00050 case IDCANCEL: 00051 EndDialog( hDlg, 1 ); 00052 return TRUE; 00053 } 00054 break; 00055 } 00056 return FALSE; 00057 } 00058 00059 INT_PTR CALLBACK CongratsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) 00060 { 00061 static BOARD *p_board; 00062 00063 switch( uMsg ) { 00064 case WM_INITDIALOG: 00065 p_board = (BOARD*) lParam; 00066 SetDlgItemText( hDlg, IDC_EDITNAME, 00067 p_board->best_name[p_board->difficulty] ); 00068 return TRUE; 00069 00070 case WM_COMMAND: 00071 switch( LOWORD( wParam ) ) { 00072 case IDOK: 00073 GetDlgItemText( hDlg, IDC_EDITNAME, 00074 p_board->best_name[p_board->difficulty], 00075 sizeof( p_board->best_name[p_board->difficulty] ) ); 00076 EndDialog( hDlg, 0 ); 00077 return TRUE; 00078 00079 case IDCANCEL: 00080 EndDialog( hDlg, 0 ); 00081 return TRUE; 00082 } 00083 break; 00084 } 00085 return FALSE; 00086 } 00087 00088 INT_PTR CALLBACK TimesDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ) 00089 { 00090 static BOARD *p_board; 00091 unsigned i; 00092 00093 switch( uMsg ) { 00094 case WM_INITDIALOG: 00095 p_board = (BOARD*) lParam; 00096 00097 /* set best names */ 00098 for( i = 0; i < 3; i++ ) 00099 SetDlgItemText( hDlg, (IDC_NAME1) + i, p_board->best_name[i] ); 00100 00101 /* set best times */ 00102 for( i = 0; i < 3; i++ ) 00103 SetDlgItemInt( hDlg, (IDC_TIME1) + i, p_board->best_time[i], FALSE ); 00104 return TRUE; 00105 00106 case WM_COMMAND: 00107 switch( LOWORD( wParam ) ) { 00108 case IDOK: 00109 case IDCANCEL: 00110 EndDialog( hDlg, 0 ); 00111 return TRUE; 00112 } 00113 break; 00114 } 00115 return FALSE; 00116 } Generated on Sun May 27 2012 04:16:36 for ReactOS by
1.7.6.1
|