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

83 lines
1.4 KiB
C
Raw Normal View History

2025-06-27 00:32:57 +08:00
#ifndef MYWIN_SCROLLBAR_H__
#define MYWIN_SCROLLBAR_H__
#define SCROLLBAR_ITEM_MAXLEN 20
2025-07-05 19:47:28 +08:00
//<2F><><EFBFBD><EFBFBD><E5B0B4><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>Ϣ
2025-06-27 00:32:57 +08:00
#define SCROLLBAR_PRESSED 0x00000001
typedef struct{
char *pic_path;
char txt[SCROLLBAR_ITEM_MAXLEN];
}Scrollbar_ItemStruct;
typedef struct
{
WIN_WindowStruct win;
int index;
Scrollbar_ItemStruct *items;
int itemMaxNum;
int itemNum;
int y_step;
int y_offset;
u32 color_light;
u32 color_dark;
2025-07-05 19:47:28 +08:00
int x_inertia; //x<><78><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD>
int y_inertia; //y<><79><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD>
int num_inertia; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ
int timer_inertia; //<2F><><EFBFBD>Զ<EFBFBD>ʱ<EFBFBD><CAB1>
2025-06-27 00:32:57 +08:00
}WIN_ScrollbarStruct;
WIN_ScrollbarStruct *WIN_CreatScrollbar (WIN_WindowStruct *base,
void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg),
int x,int y,int x_size,int y_size);
2025-07-05 19:47:28 +08:00
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF>
2025-06-27 00:32:57 +08:00
void SCROLLBAR_SetItemNum(WIN_ScrollbarStruct *bar,int itemNum);
2025-07-05 19:47:28 +08:00
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ
2025-06-27 00:32:57 +08:00
void SCROLLBAR_AddItem (WIN_ScrollbarStruct *bar,char *item,char *pic_path);
2025-07-05 19:47:28 +08:00
//Ĭ<>ϻ<EFBFBD><CFBB>ƺ<EFBFBD><C6BA><EFBFBD>
2025-06-27 00:32:57 +08:00
void SCROLLBAR_DefaultPaint (WIN_ScrollbarStruct *bar);
2025-07-05 19:47:28 +08:00
//Ĭ<><C4AC><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2025-06-27 00:32:57 +08:00
void SCROLLBAR_DefaultMsgLoop (WIN_ScrollbarStruct *bar,WIN_MsgStruct *msg);
2025-07-05 19:47:28 +08:00
//<2F><>ָ<EFBFBD><D6B8>λ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>˵<EFBFBD>
2025-06-27 00:32:57 +08:00
WIN_ScrollbarStruct *SCROLLBAR_SelectItem (WIN_WindowStruct *base,char **item,int itemNum,int x,int y,int x_size,int y_size);
WIN_ScrollbarStruct * SCROLLBAR_SelectNum (WIN_WindowStruct *base,int min,int max,int x,int y,int x_size,int y_size);
#endif