ui/ui/button.h

changeset 1205
749a32e91513
parent 1121
f612b342f262
child 1206
4637da12bc6c
equal deleted inserted replaced
1204:bc12e849a0fe 1205:749a32e91513
100 100
101 const int *states; 101 const int *states;
102 const int *visibility_states; 102 const int *visibility_states;
103 } UiToggleArgs; 103 } UiToggleArgs;
104 104
105 typedef struct UiContentToggleArgs {
106 UiBool fill;
107 UiBool hexpand;
108 UiBool vexpand;
109 UiBool hfill;
110 UiBool vfill;
111 UiBool override_defaults;
112 int margin;
113 int margin_left;
114 int margin_right;
115 int margin_top;
116 int margin_bottom;
117 int colspan;
118 int rowspan;
119 const char *name;
120 const char *style_class;
121
122 const char *label0;
123 const char *icon0;
124 const char *tooltip0;
125 const char *label1;
126 const char *icon1;
127 const char *tooltip1;
128 UiLabelType labeltype;
129 UiInteger *value;
130 const char *varname;
131 ui_callback onchange;
132 void *onchangedata;
133 const char *action;
134 UiBool istogglebutton;
135 int enable_state;
136 int enabled_by_state;
137
138 const int *states;
139 const int *visibility_states;
140 } UiContentToggleArgs;
141
105 typedef struct UiLinkButtonArgs { 142 typedef struct UiLinkButtonArgs {
106 UiBool fill; 143 UiBool fill;
107 UiBool hexpand; 144 UiBool hexpand;
108 UiBool vexpand; 145 UiBool vexpand;
109 UiBool hfill; 146 UiBool hfill;
135 172
136 #define ui_button(obj, ...) ui_button_create(obj, &(UiButtonArgs){ __VA_ARGS__ } ) 173 #define ui_button(obj, ...) ui_button_create(obj, &(UiButtonArgs){ __VA_ARGS__ } )
137 #define ui_togglebutton(obj, ...) ui_togglebutton_create(obj, &(UiToggleArgs){ __VA_ARGS__ } ) 174 #define ui_togglebutton(obj, ...) ui_togglebutton_create(obj, &(UiToggleArgs){ __VA_ARGS__ } )
138 #define ui_checkbox(obj, ...) ui_checkbox_create(obj, &(UiToggleArgs){ __VA_ARGS__ } ) 175 #define ui_checkbox(obj, ...) ui_checkbox_create(obj, &(UiToggleArgs){ __VA_ARGS__ } )
139 #define ui_switch(obj, ...) ui_switch_create(obj, &(UiToggleArgs){ __VA_ARGS__ } ) 176 #define ui_switch(obj, ...) ui_switch_create(obj, &(UiToggleArgs){ __VA_ARGS__ } )
177 #define ui_content_togglebutton(obj, ...) ui_content_togglebutton_create(obj, &(UiContentToggleArgs){ __VA_ARGS__ } )
140 #define ui_radiobutton(obj, ...) ui_radiobutton_create(obj, &(UiToggleArgs){ __VA_ARGS__ } ) 178 #define ui_radiobutton(obj, ...) ui_radiobutton_create(obj, &(UiToggleArgs){ __VA_ARGS__ } )
141 #define ui_linkbutton(obj, ...) ui_linkbutton_create(obj, &(UiLinkButtonArgs){ __VA_ARGS__ }) 179 #define ui_linkbutton(obj, ...) ui_linkbutton_create(obj, &(UiLinkButtonArgs){ __VA_ARGS__ })
142 180
143 UIEXPORT UIWIDGET ui_button_create(UiObject *obj, UiButtonArgs *args); 181 UIEXPORT UIWIDGET ui_button_create(UiObject *obj, UiButtonArgs *args);
144 UIEXPORT UIWIDGET ui_togglebutton_create(UiObject *obj, UiToggleArgs *args); 182 UIEXPORT UIWIDGET ui_togglebutton_create(UiObject *obj, UiToggleArgs *args);
145 UIEXPORT UIWIDGET ui_checkbox_create(UiObject *obj, UiToggleArgs *args); 183 UIEXPORT UIWIDGET ui_checkbox_create(UiObject *obj, UiToggleArgs *args);
146 UIEXPORT UIWIDGET ui_switch_create(UiObject *obj, UiToggleArgs *args); 184 UIEXPORT UIWIDGET ui_switch_create(UiObject *obj, UiToggleArgs *args);
185 UIEXPORT UIWIDGET ui_content_togglebutton_create(UiObject *obj, UiContentToggleArgs *args);
147 UIEXPORT UIWIDGET ui_radiobutton_create(UiObject *obj, UiToggleArgs *args); 186 UIEXPORT UIWIDGET ui_radiobutton_create(UiObject *obj, UiToggleArgs *args);
148 UIEXPORT UIWIDGET ui_linkbutton_create(UiObject *obj, UiLinkButtonArgs *args); 187 UIEXPORT UIWIDGET ui_linkbutton_create(UiObject *obj, UiLinkButtonArgs *args);
149 188
150 UIEXPORT void ui_button_set_label(UIWIDGET button, const char *label); 189 UIEXPORT void ui_button_set_label(UIWIDGET button, const char *label);
151 UIEXPORT void ui_button_set_icon(UIWIDGET button, const char *icon); 190 UIEXPORT void ui_button_set_icon(UIWIDGET button, const char *icon);

mercurial