ReactOS 0.4.15-dev-7994-gb388cb6
dialog.c
Go to the documentation of this file.
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#include "main.h"
22
24{
25 BOOL IsRet;
26 static BOARD *p_board;
27
28 switch( uMsg ) {
29 case WM_INITDIALOG:
30 p_board = (BOARD*) lParam;
31 SetDlgItemInt( hDlg, IDC_EDITROWS, p_board->rows, FALSE );
32 SetDlgItemInt( hDlg, IDC_EDITCOLS, p_board->cols, FALSE );
33 SetDlgItemInt( hDlg, IDC_EDITMINES, p_board->mines, FALSE );
34 return TRUE;
35
36 case WM_COMMAND:
37 switch( LOWORD( wParam ) ) {
38 case IDOK:
39 p_board->rows = GetDlgItemInt( hDlg, IDC_EDITROWS, &IsRet, FALSE );
40 p_board->cols = GetDlgItemInt( hDlg, IDC_EDITCOLS, &IsRet, FALSE );
41 p_board->mines = GetDlgItemInt( hDlg, IDC_EDITMINES, &IsRet, FALSE );
42 CheckLevel( p_board );
43 EndDialog( hDlg, 0 );
44 return TRUE;
45
46 case IDCANCEL:
47 EndDialog( hDlg, 1 );
48 return TRUE;
49 }
50 break;
51 }
52 return FALSE;
53}
54
56{
57 static BOARD *p_board;
58
59 switch( uMsg ) {
60 case WM_INITDIALOG:
61 p_board = (BOARD*) lParam;
62 SetDlgItemTextW( hDlg, IDC_EDITNAME, p_board->best_name[p_board->difficulty] );
63 return TRUE;
64
65 case WM_COMMAND:
66 switch( LOWORD( wParam ) ) {
67 case IDOK:
69 p_board->best_name[p_board->difficulty],
70 sizeof( p_board->best_name[p_board->difficulty] ) / sizeof(WCHAR) );
71 EndDialog( hDlg, 0 );
72 return TRUE;
73
74 case IDCANCEL:
75 EndDialog( hDlg, 0 );
76 return TRUE;
77 }
78 break;
79 }
80 return FALSE;
81}
82
84{
85 static BOARD *p_board;
86 unsigned i;
87
88 switch( uMsg ) {
89 case WM_INITDIALOG:
90 p_board = (BOARD*) lParam;
91
92 /* set best names */
93 for( i = 0; i < 3; i++ )
94 SetDlgItemTextW( hDlg, (IDC_NAME1) + i, p_board->best_name[i] );
95
96 /* set best times */
97 for( i = 0; i < 3; i++ )
98 SetDlgItemInt( hDlg, (IDC_TIME1) + i, p_board->best_time[i], FALSE );
99 return TRUE;
100
101 case WM_COMMAND:
102 switch( LOWORD( wParam ) ) {
103 case IDOK:
104 case IDCANCEL:
105 EndDialog( hDlg, 0 );
106 return TRUE;
107 }
108 break;
109 }
110 return FALSE;
111}
INT_PTR CALLBACK CustomDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:23
INT_PTR CALLBACK CongratsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:55
INT_PTR CALLBACK TimesDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:83
void CheckLevel(BOARD *p_board)
Definition: main.c:49
#define IDC_EDITCOLS
Definition: resource.h:45
#define IDC_EDITMINES
Definition: resource.h:47
#define IDC_NAME1
Definition: resource.h:39
#define IDC_EDITNAME
Definition: resource.h:43
#define IDC_TIME1
Definition: resource.h:36
#define IDC_EDITROWS
Definition: resource.h:46
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CALLBACK
Definition: compat.h:35
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
Definition: main.h:72
DIFFICULTY difficulty
Definition: main.h:100
unsigned cols
Definition: main.h:96
DWORD best_time[3]
Definition: main.h:99
unsigned mines
Definition: main.h:97
unsigned rows
Definition: main.h:95
WCHAR best_name[3][MAX_PLAYER_NAME_SIZE+1]
Definition: main.h:98
int32_t INT_PTR
Definition: typedefs.h:64
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define IDCANCEL
Definition: winuser.h:831
#define WM_COMMAND
Definition: winuser.h:1740
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define WM_INITDIALOG
Definition: winuser.h:1739
#define IDOK
Definition: winuser.h:830
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
UINT WINAPI GetDlgItemInt(_In_ HWND, _In_ int, _Out_opt_ PBOOL, _In_ BOOL)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
__wchar_t WCHAR
Definition: xmlstorage.h:180