From: <tz...@us...> - 2006-01-30 01:32:40
|
Revision: 1707 Author: tzlaine Date: 2006-01-29 17:32:26 -0800 (Sun, 29 Jan 2006) ViewCVS: http://svn.sourceforge.net/freeorion?rev=1707&view=rev Log Message: ----------- Changed the construction of RadioButtonGroups in MultiplayerLobbyWnd and TechWnd to accomodate the recent change to RadioButtonGroup in GG. Modified Paths: -------------- trunk/FreeOrion/UI/MultiplayerLobbyWnd.cpp trunk/FreeOrion/UI/ServerConnectWnd.cpp trunk/FreeOrion/UI/TechWnd.cpp Modified: trunk/FreeOrion/UI/MultiplayerLobbyWnd.cpp =================================================================== --- trunk/FreeOrion/UI/MultiplayerLobbyWnd.cpp 2006-01-29 20:27:50 UTC (rev 1706) +++ trunk/FreeOrion/UI/MultiplayerLobbyWnd.cpp 2006-01-30 01:32:26 UTC (rev 1707) @@ -155,10 +155,15 @@ m_galaxy_setup_panel = new GalaxySetupPanel(CHAT_WIDTH + 2 * CONTROL_MARGIN, RADIO_BN_HT, GALAXY_SETUP_PANEL_WIDTH); - m_new_load_game_buttons = new GG::RadioButtonGroup(CHAT_WIDTH + CONTROL_MARGIN, CONTROL_MARGIN, m_galaxy_setup_panel->LowerRight().y + 100, 2 * RADIO_BN_HT, GG::VERTICAL); - m_new_load_game_buttons->AddButton(new CUIStateButton(0, 0, 100, RADIO_BN_HT, UserString("NEW_GAME_BN"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON)); - m_new_load_game_buttons->AddButton(new CUIStateButton(0, m_galaxy_setup_panel->LowerRight().y, 100, RADIO_BN_HT, UserString("LOAD_GAME_BN"), - GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON)); + m_new_load_game_buttons = + new GG::RadioButtonGroup(CHAT_WIDTH + CONTROL_MARGIN, CONTROL_MARGIN, + m_galaxy_setup_panel->LowerRight().y + 100, m_galaxy_setup_panel->LowerRight().y + RADIO_BN_HT - CONTROL_MARGIN, + GG::VERTICAL); + m_new_load_game_buttons->AddButton( + new CUIStateButton(0, 0, 100, RADIO_BN_HT, UserString("NEW_GAME_BN"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON)); + m_new_load_game_buttons->AddButton( + new CUIStateButton(0, 0, 100, RADIO_BN_HT, UserString("LOAD_GAME_BN"), + GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON)); m_saved_games_list = new CUIDropDownList(CHAT_WIDTH + 2 * CONTROL_MARGIN, m_new_load_game_buttons->LowerRight().y + CONTROL_MARGIN, GALAXY_SETUP_PANEL_WIDTH, SAVED_GAMES_LIST_ROW_HEIGHT, SAVED_GAMES_LIST_DROP_HEIGHT); @@ -178,7 +183,8 @@ m_cancel_bn = new CUIButton(0, 0, 125, UserString("CANCEL")); m_cancel_bn->MoveTo(GG::Pt(ClientWidth() - m_cancel_bn->Width() - CONTROL_MARGIN, ClientHeight() - m_cancel_bn->Height() - CONTROL_MARGIN)); if (m_host) - m_start_game_bn->MoveTo(GG::Pt(m_cancel_bn->UpperLeft().x - CONTROL_MARGIN - m_start_game_bn->Width(), ClientHeight() - m_cancel_bn->Height() - CONTROL_MARGIN)); + m_start_game_bn->MoveTo(GG::Pt(m_cancel_bn->UpperLeft().x - CONTROL_MARGIN - m_start_game_bn->Width(), + ClientHeight() - m_cancel_bn->Height() - CONTROL_MARGIN)); Init(); Modified: trunk/FreeOrion/UI/ServerConnectWnd.cpp =================================================================== --- trunk/FreeOrion/UI/ServerConnectWnd.cpp 2006-01-29 20:27:50 UTC (rev 1706) +++ trunk/FreeOrion/UI/ServerConnectWnd.cpp 2006-01-30 01:32:26 UTC (rev 1707) @@ -54,10 +54,9 @@ const int PLAYER_NAME_EDIT_X = CONTROL_MARGIN + text_width + CONTROL_MARGIN; m_player_name_edit = new CUIEdit(PLAYER_NAME_EDIT_X, CONTROL_MARGIN, ClientWidth() - 5 - PLAYER_NAME_EDIT_X, ""); - GG::TextControl* temp = new GG::TextControl(CONTROL_MARGIN, CONTROL_MARGIN, text_width, m_player_name_edit->Height(), - UserString("PLAYER_NAME_LABEL"), - GG::GUI::GetGUI()->GetFont(ClientUI::FONT, ClientUI::PTS), ClientUI::TEXT_COLOR); - AttachChild(temp); + AttachChild(new GG::TextControl(CONTROL_MARGIN, CONTROL_MARGIN, text_width, m_player_name_edit->Height(), + UserString("PLAYER_NAME_LABEL"), + GG::GUI::GetGUI()->GetFont(ClientUI::FONT, ClientUI::PTS), ClientUI::TEXT_COLOR)); m_host_or_join_radio_group = new GG::RadioButtonGroup(CONTROL_MARGIN, m_player_name_edit->LowerRight().y + CONTROL_MARGIN, SERVERS_LIST_BOX_WIDTH / 2, ClientUI::PTS + 4 + CONTROL_MARGIN + ClientUI::PTS + 4, GG::VERTICAL); Modified: trunk/FreeOrion/UI/TechWnd.cpp =================================================================== --- trunk/FreeOrion/UI/TechWnd.cpp 2006-01-29 20:27:50 UTC (rev 1706) +++ trunk/FreeOrion/UI/TechWnd.cpp 2006-01-30 01:32:26 UTC (rev 1707) @@ -1640,22 +1640,15 @@ font->TextExtent(UserString("TECH_WND_TECH_TYPES_THEORIES_ONLY")).x + RADIO_BUTTON_MARGIN; m_tech_type_buttons = new GG::RadioButtonGroup(button_start, h - LAYOUT_MARGIN_BOTTOM, total_text_width, LAYOUT_MARGIN_BOTTOM / 2, GG::HORIZONTAL); AttachChild(tech_types_to_show_label); - int accum = 0; text_width = font->TextExtent(UserString("TECH_WND_TECH_TYPES_ALL")).x + RADIO_BUTTON_MARGIN; - CUIStateButton* button = new CUIStateButton(accum, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_TYPES_ALL"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); + CUIStateButton* button = new CUIStateButton(0, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_TYPES_ALL"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); m_tech_type_buttons->AddButton(button); - GG::Layout* layout = m_tech_type_buttons->GetLayout(); - layout->SetColumnStretch(0, text_width); - accum += text_width; text_width = font->TextExtent(UserString("TECH_WND_TECH_TYPES_THEORIES_AND_APPS")).x + RADIO_BUTTON_MARGIN; - button = new CUIStateButton(accum, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_TYPES_THEORIES_AND_APPS"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); + button = new CUIStateButton(0, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_TYPES_THEORIES_AND_APPS"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); m_tech_type_buttons->AddButton(button); - layout->SetColumnStretch(1, text_width); - accum += text_width; text_width = font->TextExtent(UserString("TECH_WND_TECH_TYPES_THEORIES_ONLY")).x + RADIO_BUTTON_MARGIN; - button = new CUIStateButton(accum, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_TYPES_THEORIES_ONLY"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); + button = new CUIStateButton(0, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_TYPES_THEORIES_ONLY"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); m_tech_type_buttons->AddButton(button); - layout->SetColumnStretch(2, text_width); m_tech_type_buttons->SetCheck(0); GG::Connect(m_tech_type_buttons->ButtonChangedSignal, &TechTreeWnd::TechTypesShownSlot, this); @@ -1670,22 +1663,15 @@ font->TextExtent(UserString("TECH_WND_TECH_STATUS_AVAILABLE_ONLY")).x + RADIO_BUTTON_MARGIN; m_tech_status_buttons = new GG::RadioButtonGroup(button_start, h - LAYOUT_MARGIN_BOTTOM / 2, total_text_width, LAYOUT_MARGIN_BOTTOM / 2, GG::HORIZONTAL); AttachChild(tech_statuses_to_show_label); - accum = 0; text_width = font->TextExtent(UserString("TECH_WND_TECH_STATUS_ALL")).x + RADIO_BUTTON_MARGIN; - button = new CUIStateButton(accum, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_STATUS_ALL"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); + button = new CUIStateButton(0, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_STATUS_ALL"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); m_tech_status_buttons->AddButton(button); - layout = m_tech_status_buttons->GetLayout(); - layout->SetColumnStretch(0, text_width); - accum += text_width; text_width = font->TextExtent(UserString("TECH_WND_TECH_STATUS_AVAILABLE_AND_COMPLETE")).x + RADIO_BUTTON_MARGIN; - button = new CUIStateButton(accum, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_STATUS_AVAILABLE_AND_COMPLETE"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); + button = new CUIStateButton(0, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_STATUS_AVAILABLE_AND_COMPLETE"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); m_tech_status_buttons->AddButton(button); - layout->SetColumnStretch(1, text_width); - accum += text_width; text_width = font->TextExtent(UserString("TECH_WND_TECH_STATUS_AVAILABLE_ONLY")).x + RADIO_BUTTON_MARGIN; - button = new CUIStateButton(accum, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_STATUS_AVAILABLE_ONLY"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); + button = new CUIStateButton(0, 0, text_width, LAYOUT_MARGIN_BOTTOM / 2, UserString("TECH_WND_TECH_STATUS_AVAILABLE_ONLY"), GG::TF_LEFT, CUIStateButton::SBSTYLE_CUI_RADIO_BUTTON); m_tech_status_buttons->AddButton(button); - layout->SetColumnStretch(2, text_width); m_tech_status_buttons->SetCheck(0); GG::Connect(m_tech_status_buttons->ButtonChangedSignal, &TechTreeWnd::TechStatusesShownSlot, this); |