www.pudn.com > GOS.rar > GOS_BASE.h


#ifndef __GUI_BASE_H__ 
#define __GUI_BASE_H__ 
 
#define ABS(a) ((a)<0 ? -(a):(a)) 
#define max(a,b) ((a)>(b)?(a):(b)) 
#define min(a,b) ((a)<(b)?(a):(b)) 
 
//定义结构 
typedef struct _tagSYSTEMTIME {  // st  
    WORD wYear;  
    WORD wMonth;  
    WORD wDayOfWeek;  
    WORD wDay;  
    WORD wHour;  
    WORD wMinute;  
    WORD wSecond;  
    WORD wMilliseconds;  
}SYSTEMTIME,*LPSYSTEMTIME;  
 
//GUI的类型、结构、宏函数定义 
typedef int COLORREF; 
typedef void* HWND; 
typedef struct _tagPOINT 
{ 
	int x; 
	int y; 
}POINT,*PPOINT; 
#define POINT_INVALID    MINLONG 
 
typedef struct _tagSIZE 
{ 
	int cx; 
	int cy; 
}SIZE; 
#define SIZE_INVALID    MINLONG 
 
typedef struct _tagRECT 
{ 
	int top; 
	int left; 
	int right; 
	int bottom; 
}RECT,*PRECT; 
typedef struct _tagMSG 
{ 
    HWND hwnd; 
    int message; 
    int wParam; 
	int lParam; 
}MSG; 
 
typedef struct _tagBITMAP 
{ 
    int     bmWidth; 
    int     bmHeight; 
    BYTE    bmPlanes;  //用作透明色 
    BYTE    bmBitsPixel; 
    LPVOID  bmBits; 
}BITMAP; 
 
typedef struct _tagFONT 
{ 
    int    nWidth; 
    int    nHeight; 
    int    nFirstChar; 
    int    nLastChar; 
    LPVOID  pData; 
}FONT; 
 
#define MATH_PI 3.1415926535897932384626433832795 
#define GUI_DEFAULTFONT acFont8x16 
#define GUI_MBCSFONT acHZK16x16 
 
//#define ODA_DRAWENTIRE  0x0001 
#define ODA_SELECT      0x0002 
#define ODA_FOCUS       0x0004 
#define ODA_CLIENT      0x0001 
#define ODA_EDGE        0x0010 
#define ODA_STATUS      0x0020 
#define ODA_ALL         -1L 
 
#define ODS_SELECTED    0x0001 
#define ODS_GRAYED      0x0002 
#define ODS_DISABLED    0x0004 
#define ODS_CHECKED     0x0008 
#define ODS_FOCUS       0x0010 
 
#define WM_COMMAND 1 
#define WM_PAINT 2 
#define WM_CREATE 3 
#define WM_CLOSE 4 
#define WM_LBUTTONDOWN 5 
#define WM_LBUTTONUP 6 
#define WM_MOVE 7 
#define WM_DRAWITEM 8 
#define WM_TIMER 9 
#define WM_KICKIDLE 10 
 
#define BN_CLICKED 1 
 
#define IDOK 1 
#define IDCANCEL 2 
#define IDABORT 3 
#define IDRETRY 4 
#define IDIGNORE 5 
#define IDYES 6 
#define IDNO 7 
#define IDCLOSE 8 
#define IDHELP 9 
 
#define PS_DOT1 0x01000000 
#define PS_DOT2 0x02000000 
#define PS_DOT3 0x03000000 
 
#define FS_MULTI2 0x04000000 
#define FS_MULTI3 0x08000000 
#define FS_MULTI4 0x0c000000 
 
 
 
#define WS_OVERLAPPED       0x00000000L 
//#define WS_POPUP          0x80000000L 
#define WS_CHILD            0x40000000L 
#define WS_MINIMIZE         0x20000000L 
#define WS_VISIBLE          0x10000000L 
#define WS_DISABLED         0x08000000L 
//#define WS_CLIPSIBLINGS     0x04000000L 
//#define WS_CLIPCHILDREN     0x02000000L 
#define WS_MAXIMIZE         0x01000000L 
#define WS_CAPTION          0x00C00000L     /* WS_BORDER | WS_DLGFRAME  */ 
#define WS_BORDER           0x00800000L 
#define WS_DLGFRAME         0x00400000L 
#define WS_VSCROLL          0x00200000L 
#define WS_HSCROLL          0x00100000L 
#define WS_SYSMENU          0x00080000L 
#define WS_THICKFRAME       0x00040000L 
#define WS_GROUP            0x00020000L 
#define WS_TABSTOP          0x00010000L 
#define WS_MINIMIZEBOX      0x00020000L 
#define WS_MAXIMIZEBOX      0x00010000L 
 
//扩展样式 
#define WS_FLAT             0x80000000L 
#define WS_CLIENT           0x04000000L 
#define WS_NOFOCUS          0x02000000L 
 
//Dialog 
#define DS_CENTER           0x0800L 
 
/* 
 * Button Control Styles 
 */ 
#define BS_PUSHBUTTON       0x00000000L 
#define BS_CHECKBOX         0x00000002L 
#define BS_RADIOBUTTON      0x00000004L 
#define BS_OWNERDRAW        0x0000000BL 
#define BS_LEFTTEXT         0x00000020L 
#define BS_TEXT             0x00000000L 
#define BS_ICON             0x00000040L 
#define BS_BITMAP           0x00000080L 
#define BS_LEFT             0x00000100L 
#define BS_RIGHT            0x00000200L 
#define BS_CENTER           0x00000300L 
#define BS_TOP              0x00000400L 
#define BS_BOTTOM           0x00000800L 
#define BS_VCENTER          0x00000C00L 
#define BS_PUSHLIKE         0x00001000L 
#define BS_MULTILINE        0x00002000L 
#define BS_FLAT             0x00008000L 
#define BS_RIGHTBUTTON      BS_LEFTTEXT 
//超连结样式 
#define BS_LINKLIKE         0x00010000L 
 
 
/* 
 * Static Control Constants 
 */ 
#define SS_LEFT             0x00000000L 
#define SS_CENTER           0x00000001L 
#define SS_RIGHT            0x00000002L 
#define SS_ICON             0x00000003L 
#define SS_OWNERDRAW        0x0000000DL 
#define SS_BITMAP           0x0000000EL 
#define SS_REALSIZEIMAGE    0x00000800L 
 
 /* 
 * MessageBox() Flags 
 */ 
#define MB_OK                       0x00000000L 
#define MB_OKCANCEL                 0x00000001L 
#define MB_ABORTRETRYIGNORE         0x00000002L 
#define MB_YESNOCANCEL              0x00000003L 
#define MB_YESNO                    0x00000004L 
#define MB_RETRYCANCEL              0x00000005L 
 
#define MB_ICONHAND                 0x00000010L 
#define MB_ICONQUESTION             0x00000020L 
#define MB_ICONEXCLAMATION          0x00000030L 
#define MB_ICONASTERISK             0x00000040L 
#define MB_ICONWARNING              MB_ICONEXCLAMATION 
#define MB_ICONERROR                MB_ICONHAND 
#define MB_ICONINFORMATION          MB_ICONASTERISK 
#define MB_ICONSTOP                 MB_ICONHAND 
 
//对话话新样式 
#define MB_NOBUTTON                 0x0000000fL 
#define MB_PROGRESS                 0x00000100L 
#define MB_FACELIKE                0x00000200L 
 
 
//画边框 
#define EDGE_RAISED     0x0005 
#define EDGE_SUNKEN     0x000a 
#define EDGE_ETCHED     0x0006 
#define EDGE_BUMP       0x0009 
 
//画文本 
#define DT_TOP			    0x00 
#define DT_LEFT			    0x00 
#define DT_CENTER			0x01	 
#define DT_RIGHT            0x02 
#define DT_VCENTER       	0x04 
#define DT_BOTTOM           0x08 
 
//Color 
#define CLR_NONE       -1 
#define CLR_MASK       0xffffff 
 
 
#endif /*__GUI_BASE_H__*/