288 /*virtual*/ void OnCreate(EvtCreate &ev); |
288 /*virtual*/ void OnCreate(EvtCreate &ev); |
289 /*virtual*/ void OnPaint(EvtPaint &ev); |
289 /*virtual*/ void OnPaint(EvtPaint &ev); |
290 /*virtual*/ void OnLeftButtonDown(EvtLeftButtonDown &ev); |
290 /*virtual*/ void OnLeftButtonDown(EvtLeftButtonDown &ev); |
291 /*virtual*/ void OnRightButtonDown(EvtRightButtonDown &ev); |
291 /*virtual*/ void OnRightButtonDown(EvtRightButtonDown &ev); |
292 /*virtual*/ void OnResize(EvtResize &ev); |
292 /*virtual*/ void OnResize(EvtResize &ev); |
|
293 |
|
294 template <class Tcls, void (Tcls::*Tenum_proc)(typename Tcls::Slot &, int) > void EnumSlotsT(Tcls *cls) |
|
295 { |
|
296 int slot_idx = 0; |
|
297 for (WidgetIterator it = m_widgets.begin(); it != m_widgets.end(); slot_idx++) { |
|
298 SlotPtr &slot = (*(it++)); |
|
299 (cls->*Tenum_proc)(*(typename Tcls::Slot*)(Slot*)slot, slot_idx); |
|
300 } |
|
301 } |
293 }; |
302 }; |
294 |
303 |
295 struct Panel : CompositeWidget { |
304 struct Panel : CompositeWidget { |
296 typedef CompositeWidget super; |
305 typedef CompositeWidget super; |
297 |
306 |
312 |
321 |
313 Panel(CompositeWidget *container, FeatureFlags feature_flags = DEFAULT_FEATURES, StringID tooltips = 0, uint16 color = COLOUR_PARENT) |
322 Panel(CompositeWidget *container, FeatureFlags feature_flags = DEFAULT_FEATURES, StringID tooltips = 0, uint16 color = COLOUR_PARENT) |
314 : CompositeWidget(container, feature_flags, tooltips, color) |
323 : CompositeWidget(container, feature_flags, tooltips, color) |
315 {} |
324 {} |
316 |
325 |
317 virtual CompositeWidget::WidgetIterator AddWidget(Widget *wd, Placement pp); |
326 virtual CompositeWidget::WidgetIterator AddWidget(Widget *wi, Placement pp); |
318 |
327 |
319 /*virtual*/ void QuerySizes(); |
328 /*virtual*/ void QuerySizes(); |
320 /*virtual*/ void DoLayout(); |
329 /*virtual*/ void DoLayout(); |
321 }; |
330 }; |
322 |
331 |
|
332 struct Table : CompositeWidget { |
|
333 typedef CompositeWidget super; |
|
334 |
|
335 static const FeatureFlags DEFAULT_FEATURES = FF_NONE; |
|
336 |
|
337 Rect16 m_used_area; |
|
338 CCountedPtr<SimpleCountedObject> m_size_data; |
|
339 |
|
340 Table(CompositeWidget *container, FeatureFlags feature_flags = DEFAULT_FEATURES, StringID tooltips = 0, uint16 color = COLOUR_PARENT) |
|
341 : CompositeWidget(container, feature_flags, tooltips, color) |
|
342 {} |
|
343 |
|
344 virtual CompositeWidget::WidgetIterator AddWidget(Widget *wi, int x_pos, int y_pos, int x_span = 1, int y_span = 1); |
|
345 |
|
346 /*virtual*/ void QuerySizes(); |
|
347 /*virtual*/ void DoLayout(); |
|
348 }; |
|
349 |
323 }; // namespace gui |
350 }; // namespace gui |
324 |
351 |
325 #endif /* WIDGET_H */ |
352 #endif /* WIDGET_H */ |