diff options
Diffstat (limited to 'src/ui/widget.h')
-rw-r--r-- | src/ui/widget.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/ui/widget.h b/src/ui/widget.h index b1b7a1d7..25208c30 100644 --- a/src/ui/widget.h +++ b/src/ui/widget.h | |||
@@ -59,6 +59,7 @@ enum iWidgetFlag { | |||
59 | keepOnTop_WidgetFlag = iBit(13), /* gets events first; drawn last */ | 59 | keepOnTop_WidgetFlag = iBit(13), /* gets events first; drawn last */ |
60 | mouseModal_WidgetFlag = iBit(14), /* eats all unprocessed mouse events */ | 60 | mouseModal_WidgetFlag = iBit(14), /* eats all unprocessed mouse events */ |
61 | /* arrange behavior */ | 61 | /* arrange behavior */ |
62 | fixedPosition_WidgetFlag = iBit(16), | ||
62 | arrangeHorizontal_WidgetFlag = iBit(17), /* arrange children horizontally */ | 63 | arrangeHorizontal_WidgetFlag = iBit(17), /* arrange children horizontally */ |
63 | arrangeVertical_WidgetFlag = iBit(18), /* arrange children vertically */ | 64 | arrangeVertical_WidgetFlag = iBit(18), /* arrange children vertically */ |
64 | arrangeWidth_WidgetFlag = iBit(19), /* area of children becomes parent size */ | 65 | arrangeWidth_WidgetFlag = iBit(19), /* area of children becomes parent size */ |
@@ -142,16 +143,20 @@ void draw_Widget (const iWidget *); | |||
142 | void drawBackground_Widget(const iWidget *); | 143 | void drawBackground_Widget(const iWidget *); |
143 | void drawChildren_Widget (const iWidget *); | 144 | void drawChildren_Widget (const iWidget *); |
144 | 145 | ||
146 | iLocalDef int width_Widget(const iAnyObject *d) { | ||
147 | iAssert(isInstance_Object(d, &Class_Widget)); | ||
148 | return ((const iWidget *) d)->rect.size.x; | ||
149 | } | ||
145 | iLocalDef iObjectList *children_Widget(iAnyObject *d) { | 150 | iLocalDef iObjectList *children_Widget(iAnyObject *d) { |
146 | iAssert(isInstance_Object(d, &Class_Widget)); | 151 | iAssert(isInstance_Object(d, &Class_Widget)); |
147 | return ((iWidget *) d)->children; | 152 | return ((iWidget *) d)->children; |
148 | } | 153 | } |
149 | 154 | ||
150 | iBool isVisible_Widget (const iWidget *); | 155 | iBool isVisible_Widget (const iAnyObject *); |
151 | iBool isDisabled_Widget (const iWidget *); | 156 | iBool isDisabled_Widget (const iAnyObject *); |
152 | iBool isFocused_Widget (const iWidget *); | 157 | iBool isFocused_Widget (const iAnyObject *); |
153 | iBool isHover_Widget (const iWidget *); | 158 | iBool isHover_Widget (const iAnyObject *); |
154 | iBool isSelected_Widget (const iWidget *); | 159 | iBool isSelected_Widget (const iAnyObject *); |
155 | iBool isCommand_Widget (const iWidget *d, const SDL_Event *ev, const char *cmd); | 160 | iBool isCommand_Widget (const iWidget *d, const SDL_Event *ev, const char *cmd); |
156 | iBool hasParent_Widget (const iWidget *d, const iWidget *someParent); | 161 | iBool hasParent_Widget (const iWidget *d, const iWidget *someParent); |
157 | void setId_Widget (iWidget *, const char *id); | 162 | void setId_Widget (iWidget *, const char *id); |
@@ -172,8 +177,8 @@ size_t childIndex_Widget (const iWidget *, const iAnyObject *child); /* O(n) | |||
172 | void arrange_Widget (iWidget *); | 177 | void arrange_Widget (iWidget *); |
173 | iBool dispatchEvent_Widget(iWidget *, const SDL_Event *); | 178 | iBool dispatchEvent_Widget(iWidget *, const SDL_Event *); |
174 | iBool processEvent_Widget (iWidget *, const SDL_Event *); | 179 | iBool processEvent_Widget (iWidget *, const SDL_Event *); |
175 | void postCommand_Widget (const iWidget *, const char *cmd, ...); | 180 | void postCommand_Widget (const iAnyObject *, const char *cmd, ...); |
176 | void refresh_Widget (const iWidget *); | 181 | void refresh_Widget (const iAnyObject *); |
177 | 182 | ||
178 | void setFocus_Widget (iWidget *); | 183 | void setFocus_Widget (iWidget *); |
179 | iWidget *focus_Widget (void); | 184 | iWidget *focus_Widget (void); |