28 #ifndef PARAMETERCONTROLLERBOOL_H
29 #define PARAMETERCONTROLLERBOOL_H
45 typedef typename CC::ATOM_TYPE T;
50 PARAMETERCONTROLLERBOOL_WIDTH = 300,
51 PARAMETERCONTROLLERBOOL_HEIGHT = 40,
53 PARAMETERCONTROLLERBOOL_WIDTH_BIG = 400,
54 PARAMETERCONTROLLERBOOL_HEIGHT_BIG = 50
57 inline u32 GetScaledWidth()
59 return Super::m_bigText ?
60 PARAMETERCONTROLLERBOOL_WIDTH_BIG :
61 PARAMETERCONTROLLERBOOL_WIDTH;
64 inline u32 GetScaledHeight()
66 return Super::m_bigText ?
67 PARAMETERCONTROLLERBOOL_HEIGHT_BIG :
68 PARAMETERCONTROLLERBOOL_HEIGHT;
80 inline u32 GetScaledWidth()
83 PARAMETERCONTROLLERBOOL_WIDTH_BIG :
84 PARAMETERCONTROLLERBOOL_WIDTH;
87 inline u32 GetScaledHeight()
90 PARAMETERCONTROLLERBOOL_HEIGHT_BIG :
91 PARAMETERCONTROLLERBOOL_HEIGHT;
98 virtual bool IsChecked()
const
100 return m_bc.GetParameterValue();
103 virtual void SetChecked(
bool value)
105 m_bc.SetParameterValue(value);
108 virtual void OnCheck(
bool value)
113 void Init(
bool bigText =
false)
116 this->SetName(
"ParmCheckBox");
117 this->SetDimensions(
SPoint(GetScaledWidth(),
119 this->SetDesiredSize(
U32_MAX, GetScaledHeight());
120 this->SetRenderPoint(
SPoint(5, 5));
121 if (m_bc.GetParameter())
123 this->SetText(m_bc.GetParameter()->GetName());
128 ParmCheckbox m_checkbox;
135 this->SetName(
"ParmCtrlBool");
136 Panel::Insert(&m_checkbox, NULL);
140 void SetParameterValue(
bool value)
142 if (!this->m_parameter || !this->m_patom)
146 this->m_parameter->SetBitsAsS32(*this->m_patom, value? -1 : 0);
149 bool GetParameterValue()
const
151 if (!this->m_parameter || !this->m_patom)
156 if (!this->m_parameter->LoadBool(*this->m_patom, ret))
165 Panel::SetDimensions(GetScaledWidth() * 2, GetScaledHeight());
166 Panel::SetDesiredSize(10000, GetScaledHeight());
169 m_checkbox.Init(Super::m_bigText);
171 LOG.
Debug(
"Innitting %s", Super::m_bigText ?
"big" :
"normal");
Definition: ParameterControllerBool.h:42
Definition: ParameterController.h:40
Definition: AbstractCheckbox.h:40
void Debug(const char *format,...)
Definition: Logger.h:301
u32 SetBackground(const u32 color)
Definition: Panel.h:220
#define U32_MAX
Definition: itype.h:95