diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-05-16 15:50:42 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-05-16 15:50:42 +0000 |
commit | 57b3e0e1f0b835ff2982e9f66c7af402caecd3c1 (patch) | |
tree | d47849491f941ae2074840d2f44fd8fc1148af5d /src/gui/menuitem.cpp | |
parent | 960257dd1744a7c735f9ece50eaef79c96c895a9 (diff) | |
download | mana-client-57b3e0e1f0b835ff2982e9f66c7af402caecd3c1.tar.gz mana-client-57b3e0e1f0b835ff2982e9f66c7af402caecd3c1.tar.bz2 mana-client-57b3e0e1f0b835ff2982e9f66c7af402caecd3c1.tar.xz mana-client-57b3e0e1f0b835ff2982e9f66c7af402caecd3c1.zip |
Formatting updates to buddy window and menu item and made testing menu item
visible.
Diffstat (limited to 'src/gui/menuitem.cpp')
-rw-r--r-- | src/gui/menuitem.cpp | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/src/gui/menuitem.cpp b/src/gui/menuitem.cpp index 0f3aa2c1..256f5712 100644 --- a/src/gui/menuitem.cpp +++ b/src/gui/menuitem.cpp @@ -18,6 +18,7 @@ * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + * $Id$ */ #include "menuitem.h" @@ -25,46 +26,45 @@ MenuItem::MenuItem(const std::string& label) { - setBorderSize(0); + setBorderSize(0); - // Load graphic - Image *item[4]; - - ResourceManager *resman = ResourceManager::getInstance(); + // Load graphic + Image *item[4]; - item[0] = resman->getImage("graphics/gui/menuitemN.png"); - item[1] = resman->getImage("graphics/gui/menuitemF.png"); - item[2] = resman->getImage("graphics/gui/menuitemP.png"); - item[3] = resman->getImage("graphics/gui/menuitemP.png"); + ResourceManager *resman = ResourceManager::getInstance(); - int bgridx[4] = {0, 9, 16, 25}; - int bgridy[4] = {0, 4, 19, 24}; - int a, x, y; + item[0] = resman->getImage("graphics/gui/menuitemN.png"); + item[1] = resman->getImage("graphics/gui/menuitemF.png"); + item[2] = resman->getImage("graphics/gui/menuitemP.png"); + item[3] = resman->getImage("graphics/gui/menuitemP.png"); - for (int mode = 0; mode < 4; mode++) { - a = 0; - for (y = 0; y < 3; y++) { - for (x = 0; x < 3; x++) { - menuitem[mode].grid[a] = item[mode]->getSubImage( - bgridx[x], bgridy[y], - bgridx[x + 1] - bgridx[x] + 1, - bgridy[y + 1] - bgridy[y] + 1); - a++; - } - } - } - addMouseListener(this); + int bgridx[4] = {0, 9, 16, 25}; + int bgridy[4] = {0, 4, 19, 24}; + int a, x, y; + + for (int mode = 0; mode < 4; mode++) { + a = 0; + for (y = 0; y < 3; y++) { + for (x = 0; x < 3; x++) { + menuitem[mode].grid[a] = item[mode]->getSubImage( + bgridx[x], bgridy[y], + bgridx[x + 1] - bgridx[x] + 1, + bgridy[y + 1] - bgridy[y] + 1); + a++; + } + } + } + addMouseListener(this); + setSize(50,10); } - MenuItem::~MenuItem() +MenuItem::~MenuItem() { - } void MenuItem::draw(gcn::Graphics* graphics) { - int mode=0; - + int mode = 0; int x, y; getAbsolutePosition(x, y); @@ -74,6 +74,4 @@ void MenuItem::draw(gcn::Graphics* graphics) void MenuItem::mousePress(int x, int y, int button) { - } - |