diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-01-16 16:39:46 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-01-16 16:39:46 +0000 |
commit | b4607a6c80a5ab7b09a79baa7b9f9d9c7aeab6ef (patch) | |
tree | cb36408544711f46b1394f3cc758b3d52736885b /src/gui/checkbox.cpp | |
parent | cf815e520dda01b291a8020db04c67c4ff1ebfbf (diff) | |
download | mana-b4607a6c80a5ab7b09a79baa7b9f9d9c7aeab6ef.tar.gz mana-b4607a6c80a5ab7b09a79baa7b9f9d9c7aeab6ef.tar.bz2 mana-b4607a6c80a5ab7b09a79baa7b9f9d9c7aeab6ef.tar.xz mana-b4607a6c80a5ab7b09a79baa7b9f9d9c7aeab6ef.zip |
Checkbox update
Diffstat (limited to 'src/gui/checkbox.cpp')
-rw-r--r-- | src/gui/checkbox.cpp | 24 |
1 files changed, 16 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); + } } |