Files
player/Project/Src/MyWin/Window/mywin_button.h

33 lines
967 B
C
Raw Normal View History

2025-06-27 00:32:57 +08:00
#ifndef MYWIN_BUTTON_H__
#define MYWIN_BUTTON_H__
2025-07-06 18:46:13 +08:00
// <20><><EFBFBD><EFBFBD><E5B0B4><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>Ϣ
#define BUTTON_PRESSED 0x00000001
2025-06-27 00:32:57 +08:00
2025-07-06 18:46:13 +08:00
// <20><>ť<EFBFBD><C5A5><EFBFBD>̳<EFBFBD><CCB3><EFBFBD>MYWIN<49><4E><EFBFBD><EFBFBD>
2025-06-27 00:32:57 +08:00
2025-07-06 18:46:13 +08:00
typedef struct {
WIN_WindowStruct win;
int press; // <20><>ť״̬
char *key; // <20><>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>ʾ
void (*pressShortFun)(void *ptr); // <20><>ť<EFBFBD>̰<EFBFBD>֮<EFBFBD><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void *shortFunPtr; // <20>̰<EFBFBD><CCB0><EFBFBD><EFBFBD>ú<EFBFBD><C3BA><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>
} WIN_ButtonStruct;
2025-06-27 00:32:57 +08:00
2025-07-06 18:46:13 +08:00
// <20>ڶ<EFBFBD><DAB6>д<EFBFBD><D0B4><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ť
WIN_ButtonStruct *WIN_CreatButton(WIN_WindowStruct *base,
void (*msgLoop)(struct _WIN_WindowStruct *win,
WIN_MsgStruct *msg),
int x, int y, int x_size, int y_size);
2025-06-27 00:32:57 +08:00
2025-07-06 18:46:13 +08:00
// <20><><EFBFBD>ð<EFBFBD><C3B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>
void BUTTON_SetKeyString(WIN_ButtonStruct *button, char *key);
2025-06-27 00:32:57 +08:00
2025-07-06 18:46:13 +08:00
// Ĭ<>ϻ<EFBFBD><CFBB>ƺ<EFBFBD><C6BA><EFBFBD>
void BUTTON_DefaultPaint(WIN_ButtonStruct *button);
2025-06-27 00:32:57 +08:00
2025-07-06 18:46:13 +08:00
// Ĭ<><C4AC><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void BUTTON_DefaultMsgLoop(WIN_ButtonStruct *button, WIN_MsgStruct *msg);
2025-06-27 00:32:57 +08:00
#endif