summaryrefslogtreecommitdiffstats
path: root/gui/checkbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/checkbox.cpp')
-rw-r--r--gui/checkbox.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/gui/checkbox.cpp b/gui/checkbox.cpp
index fe5f557bb..f4900ba2c 100644
--- a/gui/checkbox.cpp
+++ b/gui/checkbox.cpp
@@ -48,12 +48,8 @@ GUICheckbox::GUICheckbox(xml_node<>* node)
child = node->first_node("image");
if (child)
{
- attr = child->first_attribute("checked");
- if (attr)
- mChecked = PageManager::FindResource(attr->value());
- attr = child->first_attribute("unchecked");
- if (attr)
- mUnchecked = PageManager::FindResource(attr->value());
+ mChecked = LoadAttrImage(child, "checked");
+ mUnchecked = LoadAttrImage(child, "unchecked");
}
// Get the variable data
@@ -68,22 +64,17 @@ GUICheckbox::GUICheckbox(xml_node<>* node)
DataManager::SetValue(mVarName, attr->value());
}
- mCheckW = 0; mCheckH = 0;
- if (mChecked && mChecked->GetResource())
- {
- mCheckW = gr_get_width(mChecked->GetResource());
- mCheckH = gr_get_height(mChecked->GetResource());
- }
- else if (mUnchecked && mUnchecked->GetResource())
+ mCheckW = mChecked->GetWidth();
+ mCheckH = mChecked->GetHeight();
+ if (mCheckW == 0)
{
- mCheckW = gr_get_width(mUnchecked->GetResource());
- mCheckH = gr_get_height(mUnchecked->GetResource());
+ mCheckW = mUnchecked->GetWidth();
+ mCheckH = mUnchecked->GetHeight();
}
int x, y, w, h;
mLabel->GetRenderPos(x, y, w, h);
SetRenderPos(x, y, 0, 0);
- return;
}
GUICheckbox::~GUICheckbox()