summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-01-16 16:39:46 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-01-16 16:39:46 +0000
commitb4607a6c80a5ab7b09a79baa7b9f9d9c7aeab6ef (patch)
treecb36408544711f46b1394f3cc758b3d52736885b /src/gui
parentcf815e520dda01b291a8020db04c67c4ff1ebfbf (diff)
downloadmana-client-b4607a6c80a5ab7b09a79baa7b9f9d9c7aeab6ef.tar.gz
mana-client-b4607a6c80a5ab7b09a79baa7b9f9d9c7aeab6ef.tar.bz2
mana-client-b4607a6c80a5ab7b09a79baa7b9f9d9c7aeab6ef.tar.xz
mana-client-b4607a6c80a5ab7b09a79baa7b9f9d9c7aeab6ef.zip
Checkbox update
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/checkbox.cpp24
-rw-r--r--src/gui/checkbox.h6
2 files changed, 22 insertions, 8 deletions
diff --git a/src/gui/checkbox.cpp b/src/gui/checkbox.cpp
index aa6a665a..ed0bb841 100644
--- a/src/gui/checkbox.cpp
+++ b/src/gui/checkbox.cpp
@@ -26,28 +26,36 @@
CheckBox::CheckBox(const std::string& caption, bool marked):
gcn::CheckBox(caption, marked)
{
+ ResourceManager *resman = ResourceManager::getInstance();
+ Image *checkBox = resman->getImage("core/graphics/gui/checkbox.bmp");
+ checkBoxNormal = checkBox->getSubImage(0, 0, 9, 10);
+ checkBoxChecked = checkBox->getSubImage(9, 0, 9, 10);
+ checkBoxDisabled = checkBox->getSubImage(18, 0, 9, 10);
+ checkBoxDisabledChecked = checkBox->getSubImage(27, 0, 9, 10);
+
}
void CheckBox::drawBox(gcn::Graphics* graphics) {
- BITMAP *box = NULL;
+ Image *box = NULL;
int x, y;
getAbsolutePosition(x, y);
if (mMarked) {
if (false /*disabled*/) {
- box = gui_skin.checkbox.disabled_checked;
+ box = checkBoxDisabledChecked;
} else {
- box = gui_skin.checkbox.checked;
+ box = checkBoxChecked;
}
} else if (false /*disabled*/) {
- box = gui_skin.checkbox.disabled;
+ box = checkBoxDisabled;
} else {
- box = gui_skin.checkbox.normal;
+ box = checkBoxNormal;
}
x += 2;
- y += 2;
-
- masked_blit(box, buffer, 0, 0, x, y, box->w, box->h);
+ y += 2;
+ if(box != NULL) {
+ box->draw(buffer, x, y);
+ }
}
diff --git a/src/gui/checkbox.h b/src/gui/checkbox.h
index 5e410a7e..3a678c5e 100644
--- a/src/gui/checkbox.h
+++ b/src/gui/checkbox.h
@@ -42,6 +42,12 @@ class CheckBox : public gcn::CheckBox {
* Draws the check box, not the caption.
*/
void drawBox(gcn::Graphics* graphics);
+
+ private:
+ Image *checkBoxNormal;
+ Image *checkBoxChecked;
+ Image *checkBoxDisabled;
+ Image *checkBoxDisabledChecked;
};
#endif