1 /* 2 * This file is part of Dune Legacy. 3 * 4 * Dune Legacy is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * Dune Legacy is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with Dune Legacy. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef WAITINGFOROTHERPLAYERS_H 19 #define WAITINGFOROTHERPLAYERS_H 20 21 #include <GUI/Window.h> 22 #include <GUI/HBox.h> 23 #include <GUI/VBox.h> 24 #include <GUI/TextButton.h> 25 #include <GUI/Label.h> 26 #include <GUI/Spacer.h> 27 28 #include <algorithm> 29 30 class WaitingForOtherPlayers : public Window 31 { 32 public: 33 WaitingForOtherPlayers(); 34 virtual ~WaitingForOtherPlayers(); 35 36 void onRemove(); 37 38 void update(); 39 40 41 42 private: 43 /** 44 This method sets a new text for this window. 45 \param Text The new text for this window 46 */ setText(const std::string & text)47 inline void setText(const std::string& text) { 48 textLabel.setText(text); 49 resize(std::max(vbox.getMinimumSize().x,120),vbox.getMinimumSize().y); 50 } 51 52 VBox vbox; ///< vertical box 53 HBox hbox; ///< horizontal box 54 VBox vbox2; ///< inner vertical box; 55 Label textLabel; ///< label that contains the text 56 TextButton removeButton; ///< the remove button 57 }; 58 59 60 #endif // WAITINGFOROTHERPLAYERS_H 61