-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEDIT.C
36 lines (32 loc) · 1.02 KB
/
EDIT.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "golf.h"
/*
**************************************************************************
edit.c Brett A. Morrison
This file contains the routines for processing edit box messages.
**************************************************************************
*/
extern char szAppName[];
BOOL CheckEditShort(HWND hDlg, int iControl_Id, char szField_Name[], short *iItem,
short min, short max)
{
BOOL lpTranslated;
int iTemp;
char szTemp[40];
char szTemp2[3];
iTemp = GetDlgItemInt(hDlg, iControl_Id, &lpTranslated, FALSE);
if (!lpTranslated || (!range(iTemp, min, max)))
{
lstrcpy(szTemp, szField_Name);
lstrcat(szTemp, " must be between ");
lstrcat(szTemp, itoa((int)min, szTemp2, 10));
lstrcat(szTemp, " and ");
lstrcat(szTemp, itoa((int)max, szTemp2, 10));
lstrcat(szTemp, ".");
MessageBeep(0);
MessageBox(hDlg, szTemp, szAppName, MB_OK | MB_ICONSTOP);
SetFocus(GetDlgItem(hDlg, iControl_Id));
return FALSE;
} /* if */
*iItem = (short)iTemp;
return TRUE;
} /* CheckEdit */