ReactOS  0.4.14-dev-57-g333b8f1
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 }
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2208
#define IDC_EDITNAME
Definition: resource.h:43
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
WCHAR best_name[3][MAX_PLAYER_NAME_SIZE+1]
Definition: main.h:98
WPARAM wParam
Definition: combotst.c:138
Definition: main.h:71
BOOL WINAPI SetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPCWSTR lpString)
Definition: dialog.c:2769
__wchar_t WCHAR
Definition: xmlstorage.h:180
DIFFICULTY difficulty
Definition: main.h:100
#define WM_COMMAND
Definition: winuser.h:1722
BOOL WINAPI EndDialog(HWND hwnd, INT_PTR retval)
Definition: dialog.c:2028
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

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 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
BOOL WINAPI SetDlgItemInt(HWND hDlg, int nIDDlgItem, UINT uValue, BOOL bSigned)
Definition: dialog.c:2733
unsigned mines
Definition: main.h:97
void CheckLevel(BOARD *p_board)
Definition: main.c:49
WPARAM wParam
Definition: combotst.c:138
#define IDC_EDITROWS
Definition: resource.h:46
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: main.h:71
unsigned rows
Definition: main.h:95
unsigned cols
Definition: main.h:96
#define WM_COMMAND
Definition: winuser.h:1722
UINT WINAPI GetDlgItemInt(HWND hDlg, int nIDDlgItem, BOOL *lpTranslated, BOOL bSigned)
Definition: dialog.c:2152
#define IDC_EDITCOLS
Definition: resource.h:45
BOOL WINAPI EndDialog(HWND hwnd, INT_PTR retval)
Definition: dialog.c:2028
#define IDCANCEL
Definition: winuser.h:825
#define IDC_EDITMINES
Definition: resource.h:47
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

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 TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
BOOL WINAPI SetDlgItemInt(HWND hDlg, int nIDDlgItem, UINT uValue, BOOL bSigned)
Definition: dialog.c:2733
#define IDC_TIME1
Definition: resource.h:36
WCHAR best_name[3][MAX_PLAYER_NAME_SIZE+1]
Definition: main.h:98
WPARAM wParam
Definition: combotst.c:138
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
Definition: main.h:71
DWORD best_time[3]
Definition: main.h:99
BOOL WINAPI SetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPCWSTR lpString)
Definition: dialog.c:2769
#define WM_COMMAND
Definition: winuser.h:1722
BOOL WINAPI EndDialog(HWND hwnd, INT_PTR retval)
Definition: dialog.c:2028
#define IDCANCEL
Definition: winuser.h:825
#define IDC_NAME1
Definition: resource.h:39
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by MainProc(), and TestBoard().