diff -r e377456302df -r a82d9beaa94a ui/ui/tree.h --- a/ui/ui/tree.h Tue Oct 17 21:50:48 2023 +0200 +++ b/ui/ui/tree.h Thu Oct 19 18:30:19 2023 +0200 @@ -40,6 +40,7 @@ typedef struct UiListSelection UiListSelection; typedef struct UiListArgs UiListArgs; +typedef struct UiPathBarArgs UiPathBarArgs; typedef enum UiModelType { UI_STRING = 0, @@ -125,7 +126,40 @@ void* onactivatedata; ui_callback onselection; void* onselectiondata; + ui_callback ondragstart; + void* ondragstartdata; + ui_callback ondragcomplete; + void* ondragcompletedata; + ui_callback ondrop; + void* ondropsdata; UiBool multiselection; + UiBool enabledrag; + UiBool enabledrop; +}; + +struct UiPathBarArgs { + UiTri fill; + UiBool hexpand; + UiBool vexpand; + int colspan; + int rowspan; + + UiList* list; + const char* varname; + UiModel* model; + ui_getvaluefunc getvalue; + ui_callback onactivate; + void* onactivatedata; + ui_callback ontextinput; + void* ontextinputdata; + ui_callback ondragstart; + void* ondragstartdata; + ui_callback ondragcomplete; + void* ondragcompletedata; + ui_callback ondrop; + void* ondropsdata; + UiBool enabledrag; + UiBool enabledrop; }; UIEXPORT UiModel* ui_model(UiContext *ctx, ...); @@ -136,11 +170,13 @@ #define ui_table(obj, ...) ui_table_create(obj, (UiListArgs) { __VA_ARGS__ } ) #define ui_combobox(obj, ...) ui_combobox_create(obj, (UiListArgs) { __VA_ARGS__ } ) #define ui_breadcrumbbar(obj, ...) ui_breadcrumbbar_create(obj, (UiListArgs) { __VA_ARGS__ } ) +#define ui_pathbar(obj, ...) ui_pathbar_create(obj, (UiPathBarArgs) { __VA_ARGS__ } ) UIEXPORT UIWIDGET ui_listview_create(UiObject* obj, UiListArgs args); UIEXPORT UIWIDGET ui_table_create(UiObject* obj, UiListArgs args); UIEXPORT UIWIDGET ui_combobox_create(UiObject* obj, UiListArgs args); UIEXPORT UIWIDGET ui_breadcrumbbar_create(UiObject* obj, UiListArgs args); +UIEXPORT UIWIDGET ui_pathbar_create(UiObject* obj, UiPathBarArgs args); void ui_table_dragsource(UIWIDGET tablewidget, int actions, char *target0, ...);