////////////////////////////////////////////////// // ResearchWnd // ////////////////////////////////////////////////// ResearchWnd::ResearchWnd(GG::X w, GG::Y h) : GG::Wnd(GG::X0, GG::Y0, w, h, GG::INTERACTIVE | GG::ONTOP), m_research_info_panel(0), m_queue_lb(0), m_tech_tree_wnd(0), m_enabled(false) { GG::X queue_width(GetOptionsDB().Get<int>("UI.queue-width")); m_research_info_panel = new ProductionInfoPanel(UserString("RESEARCH_INFO_PANEL_TITLE"), UserString("RESEARCH_INFO_RP"), GG::X0, GG::Y0, GG::X(queue_width), GG::Y(100), "research.InfoPanel"); m_queue_lb = new QueueListBox("RESEARCH_QUEUE_ROW", UserString("RESEARCH_QUEUE_PROMPT")); m_queue_lb->SetStyle(GG::LIST_NOSORT | GG::LIST_NOSEL | GG::LIST_USERDELETE); GG::Connect(m_queue_lb->QueueItemMovedSignal, &ResearchWnd::QueueItemMoved, this); GG::Connect(m_queue_lb->QueueItemDeletedSignal, &ResearchWnd::DeleteQueueItem, this); GG::Connect(m_queue_lb->LeftClickedSignal, &ResearchWnd::QueueItemClickedSlot, this); GG::Connect(m_queue_lb->DoubleClickedSignal, &ResearchWnd::QueueItemDoubleClickedSlot, this); GG::Pt tech_tree_wnd_size = ClientSize() - GG::Pt(GG::X(GetOptionsDB().Get<int>("UI.queue-width")), GG::Y0); m_tech_tree_wnd = new TechTreeWnd(tech_tree_wnd_size.x, tech_tree_wnd_size.y); GG::Connect(m_tech_tree_wnd->AddTechsToQueueSignal, &ResearchWnd::AddTechsToQueueSlot, this); AttachChild(m_research_info_panel); AttachChild(m_queue_lb); AttachChild(m_tech_tree_wnd); SetChildClippingMode(ClipToClient); DoLayout(); }
void ProductionWnd::DoLayout() { GG::X queue_width(GetOptionsDB().Get<int>("UI.queue-width")); GG::Y info_height(ClientUI::Pts()*6 + 34); m_production_info_panel->MoveTo(GG::Pt(GG::X0, GG::Y0)); m_production_info_panel->Resize(GG::Pt(queue_width, info_height)); m_queue_wnd->MoveTo(GG::Pt(GG::X0, info_height)); m_queue_wnd->Resize(GG::Pt(queue_width, ClientSize().y - info_height)); m_build_designator_wnd->Resize(ClientSize()); }
////////////////////////////////////////////////// // ProductionWnd // ////////////////////////////////////////////////// ProductionWnd::ProductionWnd(GG::X w, GG::Y h) : GG::Wnd(GG::X0, GG::Y0, w, h, GG::INTERACTIVE | GG::ONTOP), m_production_info_panel(0), m_queue_wnd(0), m_build_designator_wnd(0), m_order_issuing_enabled(false), m_empire_shown_id(ALL_EMPIRES) { //DebugLogger() << "ProductionWindow: app-width: "<< GetOptionsDB().Get<int>("app-width") // << " ; windowed width: " << GetOptionsDB().Get<int>("app-width-windowed"); GG::X queue_width(GetOptionsDB().Get<int>("UI.queue-width")); GG::Y info_height(ClientUI::Pts()*8); m_production_info_panel = new ProductionInfoPanel(UserString("PRODUCTION_WND_TITLE"), UserString("PRODUCTION_INFO_PP"), GG::X0, GG::Y0, queue_width, info_height, "production.InfoPanel"); m_queue_wnd = new ProductionQueueWnd(GG::X0, info_height, queue_width, ClientSize().y - info_height); m_build_designator_wnd = new BuildDesignatorWnd(ClientSize().x, ClientSize().y); SetChildClippingMode(ClipToClient); GG::Connect(m_build_designator_wnd->AddBuildToQueueSignal, &ProductionWnd::AddBuildToQueueSlot, this); GG::Connect(m_build_designator_wnd->BuildQuantityChangedSignal, &ProductionWnd::ChangeBuildQuantitySlot, this); GG::Connect(m_build_designator_wnd->SystemSelectedSignal, SystemSelectedSignal); GG::Connect(m_queue_wnd->GetQueueListBox()->QueueItemMovedSignal, &ProductionWnd::QueueItemMoved, this); GG::Connect(m_queue_wnd->GetQueueListBox()->QueueItemDeletedSignal, &ProductionWnd::DeleteQueueItem, this); GG::Connect(m_queue_wnd->GetQueueListBox()->LeftClickedSignal, &ProductionWnd::QueueItemClickedSlot, this); GG::Connect(m_queue_wnd->GetQueueListBox()->DoubleClickedSignal, &ProductionWnd::QueueItemDoubleClickedSlot, this); GG::Connect(m_queue_wnd->GetQueueListBox()->QueueItemRalliedToSignal, &ProductionWnd::QueueItemRallied, this); GG::Connect(m_queue_wnd->GetQueueListBox()->ShowPediaSignal, &ProductionWnd::ShowPedia, this); GG::Connect(m_queue_wnd->GetQueueListBox()->QueueItemPausedSignal, &ProductionWnd::QueueItemPaused, this); AttachChild(m_production_info_panel); AttachChild(m_queue_wnd); AttachChild(m_build_designator_wnd); }