mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 19:52:25 +01:00
bugfix for buttons in message boxes. Init is init and not reuse ...
This commit is contained in:
parent
60355fa55d
commit
5fd233c72b
@ -492,6 +492,10 @@ GraphicMessageBox::GraphicMessageBox(std::string containerName, std::string objN
|
||||
|
||||
GraphicMessageBox::~GraphicMessageBox(){
|
||||
//remove buttons
|
||||
removeButtons();
|
||||
}
|
||||
|
||||
void GraphicMessageBox::removeButtons(){
|
||||
while(!buttons.empty()){
|
||||
delete buttons.back();
|
||||
buttons.pop_back();
|
||||
@ -500,23 +504,13 @@ GraphicMessageBox::~GraphicMessageBox(){
|
||||
|
||||
void GraphicMessageBox::init(const string &button1Str, const string &button2Str, int newWidth, int newHeight){
|
||||
init(button1Str, newWidth, newHeight);
|
||||
if(getButtonCount()>1){
|
||||
getButton(1)->setText(button2Str);
|
||||
}
|
||||
else{
|
||||
addButton(button2Str);
|
||||
}
|
||||
addButton(button2Str);
|
||||
}
|
||||
|
||||
void GraphicMessageBox::init(const string &button1Str, int newWidth, int newHeight){
|
||||
init(newWidth,newHeight);
|
||||
|
||||
if(getButtonCount()>0){
|
||||
getButton(0)->setText(button1Str);
|
||||
}
|
||||
else{
|
||||
addButton(button1Str);
|
||||
}
|
||||
removeButtons();
|
||||
addButton(button1Str);
|
||||
}
|
||||
|
||||
void GraphicMessageBox::init(int newWidth, int newHeight){
|
||||
|
@ -273,6 +273,7 @@ public:
|
||||
void init(const string &button1Str, const string &button2Str, int newWidth=-1,int newHeight=-1);
|
||||
void init(const string &button1Str, int newWidth=-1,int newHeight=-1);
|
||||
void init(int newWidth=-1,int newHeight=-1);
|
||||
void removeButtons();
|
||||
void addButton(const string &buttonStr, int width=-1,int height=-1);
|
||||
|
||||
int getButtonCount() const {return buttons.size();}
|
||||
|
Loading…
x
Reference in New Issue
Block a user