diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-09 02:02:57 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-09 02:02:57 +0000 |
commit | 81cf85e9ec1d37dc6e8dd9883f42bb50dace9135 (patch) | |
tree | 585415bbb85c48fc8fb83cd5f54e1cfe8e988ee7 /src/gui/newskill.cpp | |
parent | 78ab0ec914d3c5a97f162905afb3dede53f8b9ed (diff) | |
download | mana-client-81cf85e9ec1d37dc6e8dd9883f42bb50dace9135.tar.gz mana-client-81cf85e9ec1d37dc6e8dd9883f42bb50dace9135.tar.bz2 mana-client-81cf85e9ec1d37dc6e8dd9883f42bb50dace9135.tar.xz mana-client-81cf85e9ec1d37dc6e8dd9883f42bb50dace9135.zip |
Made the Button ctor accept eventId and action listener.
Diffstat (limited to 'src/gui/newskill.cpp')
-rw-r--r-- | src/gui/newskill.cpp | 44 |
1 files changed, 10 insertions, 34 deletions
diff --git a/src/gui/newskill.cpp b/src/gui/newskill.cpp index 0baf81a5..c04ad6a0 100644 --- a/src/gui/newskill.cpp +++ b/src/gui/newskill.cpp @@ -92,31 +92,19 @@ NewSkillDialog::NewSkillDialog(): resetNSD(); // create controls - catButton[0] = new Button("Weapons"); - catButton[1] = new Button("Magic"); - catButton[2] = new Button("Craft"); - catButton[3] = new Button("General"); - catButton[4] = new Button("Combat"); - catButton[5] = new Button("E. Resist"); - catButton[6] = new Button("S. Resist"); - catButton[7] = new Button("Hunting"); - catButton[8] = new Button("Stat"); - closeButton = new Button("Close"); + catButton[0] = new Button("Weapons", "g1", this); + catButton[1] = new Button("Magic", "g2", this); + catButton[2] = new Button("Craft", "g3", this); + catButton[3] = new Button("General", "g4", this); + catButton[4] = new Button("Combat", "g5", this); + catButton[5] = new Button("E. Resist", "g6", this); + catButton[6] = new Button("S. Resist", "g7", this); + catButton[7] = new Button("Hunting", "g8", this); + catButton[8] = new Button("Stat", "g9", this); + closeButton = new Button("Close", "close", this); // captions - // events - catButton[0]->setEventId("g1"); - catButton[1]->setEventId("g2"); - catButton[2]->setEventId("g3"); - catButton[3]->setEventId("g4"); - catButton[4]->setEventId("g5"); - catButton[5]->setEventId("g6"); - catButton[6]->setEventId("g7"); - catButton[7]->setEventId("g8"); - catButton[8]->setEventId("g9"); - closeButton->setEventId("close"); - // positioning setContentSize(350, 250); catButton[0]->setDimension(gcn::Rectangle(0,0,60,20)); @@ -152,18 +140,6 @@ NewSkillDialog::NewSkillDialog(): add(catButton[8]); add(closeButton); - // add event detection - catButton[0]->addActionListener(this); - catButton[1]->addActionListener(this); - catButton[2]->addActionListener(this); - catButton[3]->addActionListener(this); - catButton[4]->addActionListener(this); - catButton[5]->addActionListener(this); - catButton[6]->addActionListener(this); - catButton[7]->addActionListener(this); - catButton[8]->addActionListener(this); - closeButton->addActionListener(this); - // finsihing touches setLocationRelativeTo(getParent()); } |