当前位置: 首页>>代码示例>>C++>>正文


C++ DoLayout函数代码示例

本文整理汇总了C++中DoLayout函数的典型用法代码示例。如果您正苦于以下问题:C++ DoLayout函数的具体用法?C++ DoLayout怎么用?C++ DoLayout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DoLayout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CUIWnd

////////////////////
//   MessageWnd   //
////////////////////
MessageWnd::MessageWnd(GG::X x, GG::Y y, GG::X w, GG::Y h) :
    CUIWnd(UserString("MESSAGES_PANEL_TITLE"), x, y, w, h, GG::INTERACTIVE | GG::DRAGABLE | GG::ONTOP | GG::RESIZABLE | CLOSABLE),
    m_display(0),
    m_edit(0),
    m_display_show_time(0),
    m_history(),
    m_history_position()
{
    m_display = new CUIMultiEdit(
        GG::X0, GG::Y0, ClientWidth(), ClientHeight(), "",
        GG::MULTI_WORDBREAK | GG::MULTI_READ_ONLY | GG::MULTI_TERMINAL_STYLE | GG::MULTI_INTEGRAL_HEIGHT);
    AttachChild(m_display);
    m_display->SetMaxLinesOfHistory(100); // executing this line seems to cause crashes in MultiEdit when adding more lines to the control than the history limit

    m_edit = new MessageWndEdit(GG::X0, GG::Y0, ClientWidth());
    AttachChild(m_edit);

    GG::Connect(m_edit->TextEnteredSignal,  &MessageWnd::MessageEntered,                this);
    GG::Connect(m_edit->UpPressedSignal,    &MessageWnd::MessageHistoryUpRequested,     this);
    GG::Connect(m_edit->DownPressedSignal,  &MessageWnd::MessageHistoryDownRequested,   this);
    GG::Connect(m_edit->GainingFocusSignal, TypingSignal);
    GG::Connect(m_edit->LosingFocusSignal,  DoneTypingSignal);

    m_history.push_front("");

    DoLayout();
}
开发者ID:fourmond,项目名称:freeorion,代码行数:30,代码来源:ChatWnd.cpp

示例2: wxPanel

/**
 * 設定画面のコンストラクタ
 */
SettingDialog::SettingDialog(wxWindow* parent, int id, const wxString& title)
:wxDialog(parent, id, title) 
{
     bottomPanel = new wxPanel(this, wxID_ANY);
     splitterWindow = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER);
     // 左側のツリー部分
     treePanel = new wxPanel(splitterWindow, wxID_ANY);
     settingTreeCtrl = new wxTreeCtrl(treePanel, ID_SettingPanelTree, wxDefaultPosition, wxDefaultSize, 
				      wxTR_HIDE_ROOT|wxTR_HAS_BUTTONS|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER);
     // 右側の設定画面部分
     settingPanel = new wxPanel(splitterWindow, wxID_ANY);
     spacePanel = new wxPanel(bottomPanel, wxID_ANY);
     // OK,キャンセルボタン
     okButton = new wxButton(bottomPanel, ID_OnOkSetting, wxT("OK"));
     cancelButton = new wxButton(bottomPanel, ID_OnCancelSetting, wxT("キャンセル"));

     SetProperties();
     DoLayout();

     // 初回は通信パネルを開く
#ifndef __WXMAC__
     wxBoxSizer* vbox = new wxBoxSizer(wxVERTICAL);
     vbox->Add(new NetworkSettingPanel(settingPanel));
     settingPanel->SetSizer(vbox);
#else
     // メインスレッドに更新してもらう
     SendUIUpdateEvent();
#endif
     this->SetTitle(wxT("設定 - 通信"));
}
开发者ID:Hiroyuki-Nagata,项目名称:JaneClone,代码行数:33,代码来源:settingwindow.cpp

示例3: AttachChild

void About::CompleteConstruction() {
    CUIWnd::CompleteConstruction();

    m_done = Wnd::Create<CUIButton>(UserString("DONE"));
    m_license = Wnd::Create<CUIButton>(UserString("LICENSE"));
    m_vision = Wnd::Create<CUIButton>(UserString("VISION"));
    m_info = GG::Wnd::Create<CUIMultiEdit>(UserString("FREEORION_VISION"), GG::MULTI_WORDBREAK | GG::MULTI_READ_ONLY);
    AttachChild(m_info);
    AttachChild(m_vision);
    AttachChild(m_license);
    AttachChild(m_done);

    DoLayout();

    // Read in the copyright info from a file
    // this is not GetResourceDir() / "COPYING" because if a mod or scenario is loaded
    // that changes the settings directory, the copyright notice should be unchanged
    m_license_str = ReadFile(GetRootDataDir() / "default" / "COPYING").value_or("");

    m_done->LeftClickedSignal.connect(
        boost::bind(&GG::Wnd::EndRun, this));
    m_license->LeftClickedSignal.connect(
        boost::bind(&About::ShowLicense, this));
    m_vision->LeftClickedSignal.connect(
        boost::bind(&About::ShowVision, this));
}
开发者ID:adrianbroher,项目名称:freeorion,代码行数:26,代码来源:About.cpp

示例4: SetPadding

 /**
   * @brief Set the whitespace around the content.
   *
   * @param pixels The number of pixels to reserve for empty space around the content.
   * @return void
   */
 void SetPadding(int pixels)
 {
     if (m_padding != pixels) {
         m_padding = pixels;
         DoLayout();
     }
 }
开发者ID:MatGB,项目名称:freeorion,代码行数:13,代码来源:RichText.cpp

示例5: CUIWnd

InGameMenu::InGameMenu():
    CUIWnd(UserString("GAME_MENU_WINDOW_TITLE"), (GG::GUI::GetGUI()->AppWidth() - IN_GAME_OPTIONS_WIDTH) / 2,
           (GG::GUI::GetGUI()->AppHeight() - IN_GAME_OPTIONS_HEIGHT) / 2, IN_GAME_OPTIONS_WIDTH, IN_GAME_OPTIONS_HEIGHT, GG::INTERACTIVE | GG::MODAL)
{
    m_save_btn = new CUIButton(UserString("GAME_MENU_SAVE"));
    m_load_btn = new CUIButton(UserString("GAME_MENU_LOAD"));
    m_options_btn = new CUIButton(UserString("INTRO_BTN_OPTIONS"));
    m_exit_btn = new CUIButton(UserString("GAME_MENU_RESIGN"));
    m_done_btn = new CUIButton(UserString("DONE"));

    AttachChild(m_save_btn);
    AttachChild(m_load_btn);
    AttachChild(m_options_btn);
    AttachChild(m_exit_btn);
    AttachChild(m_done_btn);

    GG::Connect(m_save_btn->LeftClickedSignal,      &InGameMenu::Save,      this);
    GG::Connect(m_load_btn->LeftClickedSignal,      &InGameMenu::Load,      this);
    GG::Connect(m_options_btn->LeftClickedSignal,   &InGameMenu::Options,   this);
    GG::Connect(m_exit_btn->LeftClickedSignal,      &InGameMenu::Exit,      this);
    GG::Connect(m_done_btn->LeftClickedSignal,      &InGameMenu::Done,      this);

    if (!HumanClientApp::GetApp()->SinglePlayerGame()) {
        // need lobby to load a multiplayer game; menu load of a file is insufficient
        m_load_btn->Disable();
    }

    if (!HumanClientApp::GetApp()->CanSaveNow()) {
        m_save_btn->Disable();
    }

    DoLayout();
}
开发者ID:fatman2021,项目名称:FreeOrion,代码行数:33,代码来源:InGameMenu.cpp

示例6: CUIWnd

////////////////////
//   MessageWnd   //
////////////////////
MessageWnd::MessageWnd(const std::string& config_name) :
    CUIWnd(UserString("MESSAGES_PANEL_TITLE"),
           GG::INTERACTIVE | GG::DRAGABLE | GG::ONTOP | GG::RESIZABLE | CLOSABLE | PINABLE,
           config_name),
    m_display(nullptr),
    m_edit(nullptr),
    m_display_show_time(0),
    m_history(),
    m_history_position()
{
    m_display = new CUIMultiEdit("", GG::MULTI_WORDBREAK | GG::MULTI_READ_ONLY | GG::MULTI_TERMINAL_STYLE | GG::MULTI_INTEGRAL_HEIGHT);
    AttachChild(m_display);
    m_display->SetMaxLinesOfHistory(100); // executing this line seems to cause crashes in MultiEdit when adding more lines to the control than the history limit

    m_edit = new MessageWndEdit();
    AttachChild(m_edit);

    m_edit->TextEnteredSignal.connect(
        boost::bind(&MessageWnd::MessageEntered, this));
    m_edit->UpPressedSignal.connect(
        boost::bind(&MessageWnd::MessageHistoryUpRequested, this));
    m_edit->DownPressedSignal.connect(
        boost::bind(&MessageWnd::MessageHistoryDownRequested, this));
    m_edit->GainingFocusSignal.connect(
        TypingSignal);
    m_edit->LosingFocusSignal.connect(
        DoneTypingSignal);

    m_history.push_front("");

    DoLayout();
}
开发者ID:MatGB,项目名称:freeorion,代码行数:35,代码来源:ChatWnd.cpp

示例7: OptionsBar

 OptionsBar(boost::scoped_ptr<BarSizer>& sizer) :
     GG::Wnd(),
     m_sizer(sizer)
 {
     m_toggles.push_back(new ToggleData(UserString("COMBAT_SUMMARY_PARTICIPANT_RELATIVE"),
                                        UserString("COMBAT_SUMMARY_PARTICIPANT_EQUAL"),
                                        UserString("COMBAT_SUMMARY_PARTICIPANT_RELATIVE_TIP"),
                                        UserString("COMBAT_SUMMARY_PARTICIPANT_EQUAL_TIP"),
                                        TOGGLE_BAR_WIDTH_PROPORTIONAL, &m_sizer, this));
     m_toggles.push_back(new ToggleData(UserString("COMBAT_SUMMARY_HEALTH_SMOOTH"),
                                        UserString("COMBAT_SUMMARY_HEALTH_BAR"),
                                        UserString("COMBAT_SUMMARY_HEALTH_SMOOTH_TIP"),
                                        UserString("COMBAT_SUMMARY_HEALTH_BAR_TIP"),
                                        TOGGLE_BAR_HEALTH_SMOOTH, &m_sizer, this));
     m_toggles.push_back(new ToggleData(UserString("COMBAT_SUMMARY_BAR_HEIGHT_PROPORTIONAL"),
                                        UserString("COMBAT_SUMMARY_BAR_HEIGHT_EQUAL"),
                                        UserString("COMBAT_SUMMARY_BAR_HEIGHT_PROPORTIONAL_TIP"),
                                        UserString("COMBAT_SUMMARY_BAR_HEIGHT_EQUAL_TIP"),
                                        TOGGLE_BAR_HEIGHT_PROPORTIONAL, &m_sizer, this));
     m_toggles.push_back(new ToggleData(UserString("COMBAT_SUMMARY_GRAPH_HEIGHT_PROPORTIONAL"),
                                        UserString("COMBAT_SUMMARY_GRAPH_HEIGHT_EQUAL"),
                                        UserString("COMBAT_SUMMARY_GRAPH_HEIGHT_PROPORTIONAL_TIP"),
                                        UserString("COMBAT_SUMMARY_GRAPH_HEIGHT_EQUAL_TIP"),
                                        TOGGLE_GRAPH_HEIGHT_PROPORTIONAL, &m_sizer, this));
     DoLayout();
 }
开发者ID:spikethehobbitmage,项目名称:freeorion,代码行数:26,代码来源:GraphicalSummary.cpp

示例8: m_research_info_panel

//////////////////////////////////////////////////
// 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();
}
开发者ID:PanchoWW,项目名称:Learnorion,代码行数:38,代码来源:ResearchWnd.cpp

示例9: CUIWnd

SitRepPanel::SitRepPanel(GG::X x, GG::Y y, GG::X w, GG::Y h) :
    CUIWnd(UserString("SITREP_PANEL_TITLE"), x, y, w, h, GG::ONTOP | GG::INTERACTIVE | GG::DRAGABLE | GG::RESIZABLE | CLOSABLE | PINABLE ),
    m_sitreps_lb(0),
    m_prev_turn_button(0),
    m_next_turn_button(0),
    m_last_turn_button(0),
    m_showing_turn(INVALID_GAME_TURN)
{
    Sound::TempUISoundDisabler sound_disabler;
    SetChildClippingMode(DontClip);

    m_sitreps_lb = new CUIListBox();
    m_sitreps_lb->SetStyle(GG::LIST_NOSORT | GG::LIST_NOSEL);
    m_sitreps_lb->SetVScrollWheelIncrement(ClientUI::Pts()*4.5);
    AttachChild(m_sitreps_lb);

    m_prev_turn_button = new CUIButton(UserString("BACK"));
    AttachChild(m_prev_turn_button);
    m_next_turn_button = new CUIButton(UserString("NEXT"));
    AttachChild(m_next_turn_button);
    m_last_turn_button = new CUIButton(UserString("LAST"));
    AttachChild(m_last_turn_button);
    m_filter_button = new CUIButton(UserString("FILTERS"));
    AttachChild(m_filter_button);

    GG::Connect(m_prev_turn_button->LeftClickedSignal,  &SitRepPanel::PrevClicked,          this);
    GG::Connect(m_next_turn_button->LeftClickedSignal,  &SitRepPanel::NextClicked,          this);
    GG::Connect(m_last_turn_button->LeftClickedSignal,  &SitRepPanel::LastClicked,          this);
    GG::Connect(m_filter_button->LeftClickedSignal,     &SitRepPanel::FilterClicked,        this);

    DoLayout();
    Hide();
}
开发者ID:HiroP0,项目名称:freeorion,代码行数:33,代码来源:SitRepPanel.cpp

示例10: quick_thumbnail

OP_STATUS OpSpeedDialView::CreateThumbnail(const DesktopSpeedDial& entry, bool animate)
{
	typedef QuickAnimatedWidget<SpeedDialThumbnail> QuickSpeedDialThumbnail;
	OpAutoPtr<QuickSpeedDialThumbnail> quick_thumbnail(OP_NEW(QuickSpeedDialThumbnail, ()));
	RETURN_OOM_IF_NULL(quick_thumbnail.get());
	RETURN_IF_ERROR(quick_thumbnail->Init());

	SpeedDialThumbnail* thumbnail = quick_thumbnail->GetOpWidget();
	RETURN_IF_ERROR(thumbnail->SetEntry(&entry));
	thumbnail->SetLocked(IsReadOnly());

	const int pos = g_speeddial_manager->FindSpeedDial(&entry);
	if (pos < 0 || pos > (int)m_thumbnails.GetCount())
	{
		OP_ASSERT(!"Out of sync with SpeedDialManager");
		return OpStatus::ERR;
	}
	RETURN_IF_ERROR(m_thumbnails.Insert(pos, thumbnail));

	quick_thumbnail->SetListener(m_thumbnail_flow);
	RETURN_IF_ERROR(m_thumbnail_flow->InsertWidget(quick_thumbnail.release(), pos));

	SetCellSize(pos);

	if (animate)
	{
		DoLayout(); // must do the layout explicitly first, before we do the following animation
		m_thumbnails.Get(pos)->AnimateThumbnailIn();
	}

	return OpStatus::OK;
}
开发者ID:prestocore,项目名称:browser,代码行数:32,代码来源:OpSpeedDialView.cpp

示例11: DeleteSideBars

void GraphicalSummaryWnd::GenerateGraph() {
    DeleteSideBars();

    m_sizer.reset(new BarSizer(m_summaries, ClientSize()));

    for (std::map<int, CombatSummary>::iterator it = m_summaries.begin(); it != m_summaries.end(); ++it) {
        if (it->second.total_max_health > EPSILON) {
            it->second.Sort();
            SideBar* box = new SideBar(it->second, *m_sizer);
            m_side_boxes.push_back(box);
            AttachChild(box);
        }
    }

    if (m_options_bar) {
        DebugLogger() << "GraphicalSummaryWnd::GenerateGraph(): m_options_bar "
                         "already exists, calling DeleteChild(m_options_bar) "
                         "before creating a new one.";
        DeleteChild(m_options_bar);
    }
    m_options_bar = new OptionsBar(m_sizer);
    AttachChild(m_options_bar);
    GG::Connect(m_options_bar->ChangedSignal,
                &GraphicalSummaryWnd::HandleButtonChanged,
                this);

    MinSizeChangedSignal();
    DoLayout();
}
开发者ID:spikethehobbitmage,项目名称:freeorion,代码行数:29,代码来源:GraphicalSummary.cpp

示例12: Open

void MCPrinter::LayoutCardSequence(MCStack *p_stack, uint32_t p_number_cards, const MCRectangle *p_src_rect)
{
    Open();

    if (m_loop_nesting > 0 && m_loop_status == STATUS_READY)
    {
        MCCard *t_current_card;
        t_current_card = p_stack -> getcurcard();

        MCRectangle t_src_rect;
        if (p_src_rect == NULL)
        {
            t_src_rect = t_current_card -> getrect();
            t_src_rect . y += MCdefaultstackptr -> getscroll();
            t_src_rect . height -= MCdefaultstackptr -> getscroll();
        }
        else
            t_src_rect = *p_src_rect;

        // Do the layout, passing false to layout all cards, not just marked ones.
        DoLayout(t_current_card, p_number_cards, t_src_rect, false);
    }

    // Close printing (sets the result).
    Close();
}
开发者ID:runrevben,项目名称:livecode,代码行数:26,代码来源:printer.cpp

示例13: CUIWnd

/////////////////////
//  PlayerListWnd  //
/////////////////////
PlayerListWnd::PlayerListWnd(const std::string& config_name) :
    CUIWnd(UserString("PLAYERS_LIST_PANEL_TITLE"),
           GG::INTERACTIVE | GG::DRAGABLE | GG::ONTOP | GG::RESIZABLE | CLOSABLE | PINABLE,
           config_name),
    m_player_list(nullptr)
{
    m_player_list = new PlayerListBox();
    m_player_list->SetHiliteColor(GG::CLR_ZERO);
    m_player_list->SetStyle(GG::LIST_NOSORT);
    m_player_list->SelRowsChangedSignal.connect(
        boost::bind(&PlayerListWnd::PlayerSelectionChanged, this, _1));
    m_player_list->DoubleClickedRowSignal.connect(
        boost::bind(&PlayerListWnd::PlayerDoubleClicked, this, _1, _2, _3));
    m_player_list->RightClickedRowSignal.connect(
        boost::bind(&PlayerListWnd::PlayerRightClicked, this, _1, _2, _3));
    AttachChild(m_player_list);

    Empires().DiplomaticStatusChangedSignal.connect(
        boost::bind(&PlayerListWnd::Update, this));
    Empires().DiplomaticMessageChangedSignal.connect(
        boost::bind(&PlayerListWnd::Update, this));
    DoLayout();

    Refresh();
}
开发者ID:MatGB,项目名称:freeorion,代码行数:28,代码来源:PlayerListWnd.cpp

示例14: DoLayout

void AccordionPanel::SizeMove(const GG::Pt& ul, const GG::Pt& lr) {
    GG::Pt old_size = GG::Wnd::Size();

    GG::Wnd::SizeMove(ul, lr);

    if (old_size != GG::Wnd::Size())
        DoLayout();
}
开发者ID:Deepsloth,项目名称:freeorion,代码行数:8,代码来源:AccordionPanel.cpp

示例15: OnSize

 void OnSize(wxSizeEvent &inEvent)
 {
    inEvent.Skip();
    wxSize size = GetClientSize();
    DoLayout(size,size.y!=mPrevHeight);
    mPrevHeight = size.y;
    ApplyLayout();
 }
开发者ID:akadjoker,项目名称:waxe,代码行数:8,代码来源:ToolBox.cpp


注:本文中的DoLayout函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。