From 1b805a31720727008b32b1129a167758519fd4db Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 2 May 2022 16:04:21 +0200 Subject: New upstream version 3.2.0 --- Panel.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Panel.h') diff --git a/Panel.h b/Panel.h index 9bb4c77..33d532e 100644 --- a/Panel.h +++ b/Panel.h @@ -39,6 +39,10 @@ typedef enum HandlerResult_ { #define EVENT_IS_HEADER_CLICK(ev_) ((ev_) >= -10000 && (ev_) <= -9000) #define EVENT_HEADER_CLICK_GET_X(ev_) ((ev_) + 10000) +#define EVENT_SCREEN_TAB_CLICK(x_) (-20000 + (x_)) +#define EVENT_IS_SCREEN_TAB_CLICK(ev_) ((ev_) >= -20000 && (ev_) < -10000) +#define EVENT_SCREEN_TAB_GET_X(ev_) ((ev_) + 20000) + typedef HandlerResult (*Panel_EventHandler)(Panel*, int); typedef void (*Panel_DrawFunctionBar)(Panel*, bool); typedef void (*Panel_PrintHeader)(Panel*); @@ -61,6 +65,7 @@ typedef struct PanelClass_ { struct Panel_ { Object super; int x, y, w, h; + int cursorX, cursorY; Vector* items; int selected; int oldSelected; @@ -69,6 +74,7 @@ struct Panel_ { int scrollV; int scrollH; bool needsRedraw; + bool cursorOn; bool wasFocus; FunctionBar* currentBar; FunctionBar* defaultBar; @@ -90,6 +96,8 @@ void Panel_init(Panel* this, int x, int y, int w, int h, const ObjectClass* type void Panel_done(Panel* this); +void Panel_setCursorToSelection(Panel* this); + void Panel_setSelectionColor(Panel* this, ColorElements colorId); void Panel_setHeader(Panel* this, const char* header); @@ -130,4 +138,6 @@ bool Panel_onKey(Panel* this, int key); HandlerResult Panel_selectByTyping(Panel* this, int ch); +int Panel_getCh(Panel* this); + #endif -- cgit v1.2.3