Rewrote Unix process launching to allow passing startup information to
[wine/multimedia.git] / programs / winemine / dialog.c
blobeba82973b4751d99e39c701f6b51145436475f64
1 /*
2 * WineMine (dialog.c)
3 *
4 * Copyright 2000 Joshua Thielen <jt85296@ltu.edu>
5 * To be distributed under the Wine License
6 */
9 #include <windows.h>
10 #include "main.h"
11 #include "dialog.h"
12 #include "resource.h"
14 BOOL CALLBACK CustomDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
16 BOOL IsRet;
17 static BOARD *p_board;
19 switch( uMsg ) {
20 case WM_INITDIALOG:
21 p_board = (BOARD*) lParam;
22 SetDlgItemInt( hDlg, IDC_EDITROWS, p_board->rows, FALSE );
23 SetDlgItemInt( hDlg, IDC_EDITCOLS, p_board->cols, FALSE );
24 SetDlgItemInt( hDlg, IDC_EDITMINES, p_board->mines, FALSE );
25 return TRUE;
27 case WM_COMMAND:
28 switch( LOWORD( wParam ) ) {
29 case IDOK:
30 p_board->rows = GetDlgItemInt( hDlg, IDC_EDITROWS, &IsRet, FALSE );
31 p_board->cols = GetDlgItemInt( hDlg, IDC_EDITCOLS, &IsRet, FALSE );
32 p_board->mines = GetDlgItemInt( hDlg, IDC_EDITMINES, &IsRet, FALSE );
33 CheckLevel( p_board );
34 EndDialog( hDlg, 0 );
35 return TRUE;
37 case IDCANCEL:
38 EndDialog( hDlg, 0 );
39 return TRUE;
41 break;
43 return FALSE;
46 BOOL CALLBACK CongratsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
48 static BOARD *p_board;
50 switch( uMsg ) {
51 case WM_INITDIALOG:
52 p_board = (BOARD*) lParam;
53 SetDlgItemText( hDlg, IDC_EDITNAME,
54 p_board->best_name[p_board->difficulty] );
55 return TRUE;
57 case WM_COMMAND:
58 switch( LOWORD( wParam ) ) {
59 case IDOK:
60 GetDlgItemText( hDlg, IDC_EDITNAME,
61 p_board->best_name[p_board->difficulty],
62 sizeof( p_board->best_name[p_board->difficulty] ) );
63 EndDialog( hDlg, 0 );
64 return TRUE;
66 case IDCANCEL:
67 EndDialog( hDlg, 0 );
68 return TRUE;
70 break;
72 return FALSE;
75 BOOL CALLBACK TimesDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
77 static BOARD *p_board;
78 unsigned i;
80 switch( uMsg ) {
81 case WM_INITDIALOG:
82 p_board = (BOARD*) lParam;
84 /* set best names */
85 for( i = 0; i < 3; i++ )
86 SetDlgItemText( hDlg, (IDC_NAME1) + i, p_board->best_name[i] );
88 /* set best times */
89 for( i = 0; i < 3; i++ )
90 SetDlgItemInt( hDlg, (IDC_TIME1) + i, p_board->best_time[i], FALSE );
91 return TRUE;
93 case WM_COMMAND:
94 switch( LOWORD( wParam ) ) {
95 case IDOK:
96 EndDialog( hDlg, 0 );
97 return TRUE;
99 break;
101 return FALSE;
104 BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
106 switch( uMsg ) {
107 case WM_INITDIALOG:
108 return TRUE;
110 case WM_COMMAND:
111 switch( LOWORD( wParam ) ) {
112 case IDOK:
113 EndDialog( hDlg, 0 );
114 return TRUE;
116 break;
118 return FALSE;