1 | /**********************************************************************
|
---|
2 | *<
|
---|
3 | FILE: winutil.h
|
---|
4 |
|
---|
5 | DESCRIPTION: Misc. windows related functions
|
---|
6 |
|
---|
7 | CREATED BY: Rolf Berteig
|
---|
8 |
|
---|
9 | HISTORY: 1-6-95 file created
|
---|
10 |
|
---|
11 | *> Copyright (c) 1994, All Rights Reserved.
|
---|
12 | **********************************************************************/
|
---|
13 |
|
---|
14 | #ifndef __WINUTIL__
|
---|
15 | #define __WINUTIL__
|
---|
16 |
|
---|
17 |
|
---|
18 | float CoreExport GetWindowFloat(HWND hwnd,BOOL *valid=NULL);
|
---|
19 | int CoreExport GetWindowInt(HWND hwnd,BOOL *valid=NULL);
|
---|
20 | BOOL CoreExport SetWindowTextInt( HWND hwnd, int i );
|
---|
21 | BOOL CoreExport SetWindowTextFloat( HWND hwnd, float f, int precision=3 );
|
---|
22 | BOOL CoreExport SetDlgItemFloat( HWND hwnd, int idControl, float val );
|
---|
23 | float CoreExport GetDlgItemFloat( HWND hwnd, int idControl );
|
---|
24 | void CoreExport SetDlgFont( HWND hDlg, HFONT hFont );
|
---|
25 | void CoreExport SlideWindow( HWND hwnd, int x, int y );
|
---|
26 | void CoreExport StretchWindow( HWND hwnd, int w, int h );
|
---|
27 | BOOL CoreExport CenterWindow(HWND hWndChild, HWND hWndParent);
|
---|
28 | void CoreExport GetClientRectP( HWND hwnd, Rect *rect );
|
---|
29 | void CoreExport DrawIconButton( HDC hdc, HBITMAP hBitmap, Rect& wrect, Rect& brect, BOOL in );
|
---|
30 | int CoreExport GetListHieght( HWND hList );
|
---|
31 | void CoreExport ShadedVertLine( HDC hdc, int x, int y0, int y1, BOOL in );
|
---|
32 | void CoreExport ShadedHorizLine( HDC hdc, int y, int x0, int x1, BOOL in );
|
---|
33 | void CoreExport ShadedRect( HDC hdc, RECT& rect );
|
---|
34 | void CoreExport Rect3D( HDC hdc, RECT& rect, BOOL in );
|
---|
35 | void CoreExport WhiteRect3D( HDC hdc, RECT rect, BOOL in );
|
---|
36 | void CoreExport DrawButton( HDC hdc, RECT rect, BOOL in );
|
---|
37 | void CoreExport XORDottedRect( HWND hwnd, IPoint2 p0, IPoint2 p1 );
|
---|
38 | void CoreExport XORDottedCircle( HWND hwnd, IPoint2 p0, IPoint2 p1 );
|
---|
39 | void CoreExport XORDottedPolyline( HWND hwnd, int count, IPoint2 *pts);
|
---|
40 | void CoreExport XORRect(HDC hdc, RECT& r, int border=1);
|
---|
41 | void CoreExport MakeButton2State(HWND hCtrl);
|
---|
42 | void CoreExport MakeButton3State(HWND hCtrl);
|
---|
43 | int CoreExport GetCheckBox(HWND hw, int id);
|
---|
44 | void CoreExport SetCheckBox(HWND hw, int id, BOOL b);
|
---|
45 | BOOL CoreExport DoesFileExist(const TCHAR *file);
|
---|
46 |
|
---|
47 | // Delete superfluous zeroes from float string: 1.2300000 -> 1.23
|
---|
48 | void CoreExport StripTrailingZeros(TCHAR* buf);
|
---|
49 |
|
---|
50 | template<class T> void LimitValue( T& value, T min, T max )
|
---|
51 | {
|
---|
52 | if ( value < min ) value = min;
|
---|
53 | if ( value > max ) value = max;
|
---|
54 | }
|
---|
55 |
|
---|
56 |
|
---|
57 | #define MAKEPOINT( lparam, pt ) { pt.x = (short)LOWORD(lparam); pt.y = (short)HIWORD(lparam); }
|
---|
58 |
|
---|
59 | #endif
|
---|