From 0257f0b53d9a6baed3719159b721abdc31d44715 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 29 Oct 2020 14:10:20 +0200 Subject: LabelWidget: Flag for wrapping text Widgets now have an optional virtual method that gets called when the size of the widget changes during arranging. Wrapped text in LabelWidget uses this to update its height. --- src/ui/widget.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/ui/widget.h') diff --git a/src/ui/widget.h b/src/ui/widget.h index a1a38f28..fd7ee316 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h @@ -41,6 +41,7 @@ iDeclareType(Widget) iBeginDeclareClass(Widget) iBool (*processEvent) (iWidget *, const SDL_Event *); void (*draw) (const iWidget *); + void (*sizeChanged) (iWidget *); /* optional, defaults to NULL */ iEndDeclareClass(Widget) enum iWidgetFlag { @@ -85,6 +86,7 @@ enum iWidgetFlag { #define wasCollapsed_WidgetFlag iBit64(32) #define centerHorizontal_WidgetFlag iBit64(33) #define moveToParentRightEdge_WidgetFlag iBit64(34) +#define wrapText_WidgetFlag iBit64(35) enum iWidgetAddPos { back_WidgetAddPos, @@ -131,8 +133,9 @@ iLocalDef const iWidget *constAs_Widget(const iAnyObject *d) { return (const iWidget *) d; } -void destroy_Widget (iWidget *); /* widget removed and deleted later */ -void destroyPending_Widget(void); +void destroy_Widget (iWidget *); /* widget removed and deleted later */ +void destroyPending_Widget (void); +void releaseChildren_Widget (iWidget *); const iString *id_Widget (const iWidget *); int64_t flags_Widget (const iWidget *); -- cgit v1.2.3