MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / UpdateCheckbox

Method UpdateCheckbox

SDK/src/NDK/Widgets/CheckboxWidget.cpp:149–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 }
148
149 void CheckboxWidget::UpdateCheckbox()
150 {
151 if (m_checkboxEnabled)
152 {
153 m_checkboxBorderSprite->SetColor(s_borderColor);
154 m_checkboxBackgroundSprite->SetColor(s_backgroundColor);
155 }
156 else
157 {
158 m_checkboxBorderSprite->SetColor(s_disabledBorderColor);
159 m_checkboxBackgroundSprite->SetColor(s_disabledBackgroundColor);
160 }
161
162
163 if (m_state == CheckboxState_Unchecked)
164 {
165 m_checkboxContentEntity->Enable(false);
166 return;
167 }
168 else if (m_state == CheckboxState_Checked)
169 {
170 m_checkboxContentEntity->Enable();
171 m_checkboxContentSprite->SetColor(Nz::Color::White);
172 m_checkboxContentSprite->SetTexture(m_checkMark, false);
173 }
174 else // Tristate
175 {
176 m_checkboxContentEntity->Enable();
177 m_checkboxContentSprite->SetColor(Nz::Color::Black);
178 m_checkboxContentSprite->SetTexture(Nz::TextureRef {});
179 }
180 }
181}

Callers

nothing calls this directly

Calls 3

SetColorMethod · 0.45
EnableMethod · 0.45
SetTextureMethod · 0.45

Tested by

no test coverage detected