ReactOS 0.4.15-dev-5664-g3bf4ef6
dialog.c File Reference
#include "main.h"
Include dependency graph for dialog.c:

Go to the source code of this file.

Functions

INT_PTR CALLBACK CustomDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK CongratsDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK TimesDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Function Documentation

◆ CongratsDlgProc()

INT_PTR CALLBACK CongratsDlgProc ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 55 of file dialog.c.

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}
#define IDC_EDITNAME
Definition: resource.h:43
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 LOWORD(l)
Definition: pedump.c:82
Definition: main.h:72
DIFFICULTY difficulty
Definition: main.h:100
WCHAR best_name[3][MAX_PLAYER_NAME_SIZE+1]
Definition: main.h:98
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2263
#define IDCANCEL
Definition: winuser.h:825
#define WM_COMMAND
Definition: winuser.h:1730
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define WM_INITDIALOG
Definition: winuser.h:1729
#define IDOK
Definition: winuser.h:824
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by TestBoard().

◆ CustomDlgProc()

INT_PTR CALLBACK CustomDlgProc ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 23 of file dialog.c.

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}
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_EDITROWS
Definition: resource.h:46
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned cols
Definition: main.h:96
unsigned mines
Definition: main.h:97
unsigned rows
Definition: main.h:95
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
UINT WINAPI GetDlgItemInt(_In_ HWND, _In_ int, _Out_opt_ PBOOL, _In_ BOOL)

Referenced by SetDifficulty().

◆ TimesDlgProc()

INT_PTR CALLBACK TimesDlgProc ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 83 of file dialog.c.

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}
#define IDC_NAME1
Definition: resource.h:39
#define IDC_TIME1
Definition: resource.h:36
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
DWORD best_time[3]
Definition: main.h:99

Referenced by MainProc(), and TestBoard().