6 #ifndef TB_TOGGLE_CONTAINER_H
7 #define TB_TOGGLE_CONTAINER_H
9 #include "tb_widgets_common.h"
36 TOGGLE GetToggle()
const {
return m_toggle; }
40 bool GetInvert()
const {
return m_invert; }
43 bool GetIsOn()
const {
return m_invert ? !m_value : !!m_value; }
48 virtual long GetValue()
const {
return m_value; }
52 void UpdateInternal();
92 TBLayout *GetLayout() {
return &m_layout; }
115 bool m_pending_scroll;
120 #endif // TB_TOGGLE_CONTAINER_H
virtual PreferredSize OnCalculatePreferredSize(const SizeConstraints &constraints)
Calculate the preferred size for this widget.
Definition: tb_toggle_container.cpp:81
virtual void SetValue(long value)
Set the value of this widget.
Definition: tb_toggle_container.cpp:120
TBToggleContainer is a widget that toggles a property when its value change between 0 and 1...
Definition: tb_toggle_container.h:18
virtual TBWidget * GetContentRoot()
Get this widget or a child widget that should be root for other children.
Definition: tb_toggle_container.h:107
Specifies size constraints used during size calculations.
Definition: tb_widgets.h:321
void SetInvert(bool invert)
Set if the toggle state should be inverted.
Definition: tb_toggle_container.cpp:112
virtual long GetValue() const
See TBWidget::SetValue.
Definition: tb_toggle_container.h:105
bool GetIsOn() const
Get the current value, after checking the invert mode.
Definition: tb_toggle_container.h:43
virtual void SetValue(long value)
< Make all versions in base class available.
Definition: tb_toggle_container.cpp:66
virtual void OnProcessAfterChildren()
Callback for doing anything that might be needed before paint.
Definition: tb_toggle_container.cpp:72
virtual long GetValue() const
See TBWidget::SetValue.
Definition: tb_toggle_container.h:48
TBSection is a widget with a header that when clicked toggles its children on and off (using a intern...
Definition: tb_toggle_container.h:83
Nothing happens (the default)
Definition: tb_toggle_container.h:28
INFLATE_INFO contains info passed to TBWidget::OnInflate during resource loading. ...
Definition: tb_widgets_reader.h:21
virtual void OnInflate(const INFLATE_INFO &info)
Called when this widget is inflated from resources, before any children have been inflated...
Definition: tb_widgets_reader.cpp:738
TBStr is a simple string class.
Definition: tb_str.h:62
void SetToggle(TOGGLE toggle)
Set what should toggle when the value changes.
Definition: tb_toggle_container.cpp:100
Expanded/collapsed (In parent axis direction)
Definition: tb_toggle_container.h:31
TOGGLE
Defines what should toggle when the value changes.
Definition: tb_toggle_container.h:27
virtual bool GetText(TBStr &text) const
Get the text of this widget.
Definition: tb_toggle_container.h:101
virtual bool SetText(const TBStr &text)
Set the text of the text field.
Definition: tb_toggle_container.h:100
PreferredSize contains size preferences for a TBWidget.
Definition: tb_widgets.h:277
Opacity 1/0.
Definition: tb_toggle_container.h:30
TBLayout layouts its children along the given axis.
Definition: tb_layout.h:96
Enabled/disabled state.
Definition: tb_toggle_container.h:29
void SetPendingScrollIntoView(bool pending_scroll)
Set if the section should be scrolled into view after next layout.
Definition: tb_toggle_container.h:97