Delete unused CCheckbox text setting remains following b1422137e5, refs 0f807c643a.

Differential Revision: https://code.wildfiregames.com/D2314
Tested on: clang 8.0.1., Jenkins

This was SVN commit r22952.
This commit is contained in:
elexis 2019-09-21 03:11:18 +00:00
parent aa72791b69
commit d412b2010b
6 changed files with 3 additions and 52 deletions

View File

@ -139,7 +139,6 @@
sprite2="ModernTickOn"
sprite_disabled="ModernTickDisabledOff"
sprite2_disabled="ModernTickDisabledOn"
square_side="22"
sound_pressed="audio/interface/ui/ui_button_click.ogg"
/>
<style name="ModernSlider"

View File

@ -29,7 +29,6 @@
checked="false"
style="ModernTickBox"
size="186 0 206 100%"
font="serif-bold-13"
>
<action on="Press">applyFilters();</action>
</object>

View File

@ -243,12 +243,7 @@
<object type="text" size="22 0 52%-10 100%" text_align="left" textcolor="white">
<translatableAttribute id="caption">Show only open games</translatableAttribute>
</object>
<object name="filterOpenGames"
type="checkbox"
checked="false"
style="ModernTickBox"
size="0 0 20 20"
font="sans-bold-13">
<object name="filterOpenGames" type="checkbox" checked="false" style="ModernTickBox" size="0 0 20 20">
<action on="Press">
applyFilters();
</action>

View File

@ -19,22 +19,11 @@
#include "CCheckBox.h"
#include "gui/CGUIColor.h"
#include "graphics/FontMetrics.h"
#include "ps/CStrIntern.h"
/**
* TODO: Since there is no call to DrawText, the checkbox won't render any text.
* Thus the font, caption, textcolor and other settings have no effect.
*/
CCheckBox::CCheckBox(CGUI& pGUI)
: IGUIObject(pGUI), IGUITextOwner(pGUI), IGUIButtonBehavior(pGUI)
: IGUIObject(pGUI), IGUIButtonBehavior(pGUI)
{
AddSetting<float>("buffer_zone");
AddSetting<CGUIString>("caption");
AddSetting<i32>("cell_id");
AddSetting<bool>("checked");
AddSetting<CStrW>("font");
AddSetting<CStrW>("sound_disabled");
AddSetting<CStrW>("sound_enter");
AddSetting<CStrW>("sound_leave");
@ -48,39 +37,18 @@ CCheckBox::CCheckBox(CGUI& pGUI)
AddSetting<CGUISpriteInstance>("sprite2_over");
AddSetting<CGUISpriteInstance>("sprite2_pressed");
AddSetting<CGUISpriteInstance>("sprite2_disabled");
AddSetting<float>("square_side");
AddSetting<CGUIColor>("textcolor");
AddSetting<CGUIColor>("textcolor_over");
AddSetting<CGUIColor>("textcolor_pressed");
AddSetting<CGUIColor>("textcolor_disabled");
AddSetting<CStrW>("tooltip");
AddSetting<CStr>("tooltip_style");
AddText();
}
CCheckBox::~CCheckBox()
{
}
void CCheckBox::SetupText()
{
ENSURE(m_GeneratedTexts.size() == 1);
m_GeneratedTexts[0] = CGUIText(
m_pGUI,
GetSetting<CGUIString>("caption"),
GetSetting<CStrW>("font"),
m_CachedActualSize.GetWidth() - GetSetting<float>("square_side"),
GetSetting<float>("buffer_zone"),
this);
}
void CCheckBox::HandleMessage(SGUIMessage& Message)
{
// Important
IGUIButtonBehavior::HandleMessage(Message);
IGUITextOwner::HandleMessage(Message);
switch (Message.type)
{

View File

@ -19,10 +19,8 @@
#define INCLUDED_CCHECKBOX
#include "gui/IGUIButtonBehavior.h"
#include "gui/IGUIObject.h"
#include "gui/IGUITextOwner.h"
class CCheckBox : public IGUIButtonBehavior, public IGUITextOwner
class CCheckBox : public IGUIButtonBehavior
{
GUI_OBJECT(CCheckBox)
@ -44,13 +42,6 @@ public:
* Draws the control
*/
virtual void Draw();
protected:
/**
* Sets up text, should be called every time changes has been
* made that can change the visual.
*/
void SetupText();
};
#endif // INCLUDED_CCHECKBOX

View File

@ -28,7 +28,6 @@ void CRadioButton::HandleMessage(SGUIMessage& Message)
{
// Important
IGUIButtonBehavior::HandleMessage(Message);
IGUITextOwner::HandleMessage(Message);
switch (Message.type)
{