summaryrefslogtreecommitdiff
path: root/src/ui/widget.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/widget.h')
-rw-r--r--src/ui/widget.h19
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 *);
142void drawBackground_Widget(const iWidget *); 143void drawBackground_Widget(const iWidget *);
143void drawChildren_Widget (const iWidget *); 144void drawChildren_Widget (const iWidget *);
144 145
146iLocalDef int width_Widget(const iAnyObject *d) {
147 iAssert(isInstance_Object(d, &Class_Widget));
148 return ((const iWidget *) d)->rect.size.x;
149}
145iLocalDef iObjectList *children_Widget(iAnyObject *d) { 150iLocalDef 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
150iBool isVisible_Widget (const iWidget *); 155iBool isVisible_Widget (const iAnyObject *);
151iBool isDisabled_Widget (const iWidget *); 156iBool isDisabled_Widget (const iAnyObject *);
152iBool isFocused_Widget (const iWidget *); 157iBool isFocused_Widget (const iAnyObject *);
153iBool isHover_Widget (const iWidget *); 158iBool isHover_Widget (const iAnyObject *);
154iBool isSelected_Widget (const iWidget *); 159iBool isSelected_Widget (const iAnyObject *);
155iBool isCommand_Widget (const iWidget *d, const SDL_Event *ev, const char *cmd); 160iBool isCommand_Widget (const iWidget *d, const SDL_Event *ev, const char *cmd);
156iBool hasParent_Widget (const iWidget *d, const iWidget *someParent); 161iBool hasParent_Widget (const iWidget *d, const iWidget *someParent);
157void setId_Widget (iWidget *, const char *id); 162void setId_Widget (iWidget *, const char *id);
@@ -172,8 +177,8 @@ size_t childIndex_Widget (const iWidget *, const iAnyObject *child); /* O(n)
172void arrange_Widget (iWidget *); 177void arrange_Widget (iWidget *);
173iBool dispatchEvent_Widget(iWidget *, const SDL_Event *); 178iBool dispatchEvent_Widget(iWidget *, const SDL_Event *);
174iBool processEvent_Widget (iWidget *, const SDL_Event *); 179iBool processEvent_Widget (iWidget *, const SDL_Event *);
175void postCommand_Widget (const iWidget *, const char *cmd, ...); 180void postCommand_Widget (const iAnyObject *, const char *cmd, ...);
176void refresh_Widget (const iWidget *); 181void refresh_Widget (const iAnyObject *);
177 182
178void setFocus_Widget (iWidget *); 183void setFocus_Widget (iWidget *);
179iWidget *focus_Widget (void); 184iWidget *focus_Widget (void);