00001 /****************************************************************************** 00002 * Wormux is a convivial mass murder game. 00003 * Copyright (C) 2001-2004 Lawrence Azzoug. 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00018 ****************************************************************************** 00019 * Network teams selection box 00020 *****************************************************************************/ 00021 00022 #ifndef NETWORK_TEAMS_SELECTION_BOX_H 00023 #define NETWORK_TEAMS_SELECTION_BOX_H 00024 00025 #include "../gui/box.h" 00026 #include "../gui/label.h" 00027 #include "../gui/picture_widget.h" 00028 #include "../gui/spin_button.h" 00029 #include "../gui/spin_button_big.h" 00030 #include "../gui/text_box.h" 00031 #include "team_box.h" 00032 00033 #include <vector> 00034 00035 const uint NMAX_NB_TEAMS=4; 00036 00037 class NetworkTeamsSelectionBox : public HBox 00038 { 00039 private: 00040 SpinButtonBig *local_teams_nb; 00041 std::vector<TeamBox*> teams_selections; 00042 00043 void SetNbLocalTeams(uint nb_teams, uint previous_nb); 00044 void AddLocalTeam(uint i); 00045 void RemoveLocalTeam(uint i); 00046 void SetLocalTeam(uint i, Team& team, bool remove_previous_team); 00047 void PrevTeam(uint i); 00048 void NextTeam(uint i, bool check_null_prev_team = true); 00049 00050 public: 00051 NetworkTeamsSelectionBox(const Rectanglei &rect); 00052 00053 void ValidTeamsSelection(); 00054 Widget* Clic(const Point2i &mousePosition, uint button); 00055 00056 void AddTeamCallback(std::string team_id); 00057 void UpdateTeamCallback(std::string team_id); 00058 void DelTeamCallback(std::string team_id); 00059 }; 00060 #endif