diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2021-08-31 15:38:52 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2021-12-07 17:04:49 +1100 |
commit | 72ba20fa5f077bab4286dd78f9944df15de3b3b4 (patch) | |
tree | 0c4fb4e63b80b3a20d5f50bdac6bed9fe2bee607 /Panel.h | |
parent | ff4f44b22ae8d6522ee22599174a6cdd41bc0314 (diff) |
Introduce screen tabs
This is a forward port (by nathans) of Hisham's original code.
Diffstat (limited to 'Panel.h')
-rw-r--r-- | Panel.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 |