• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CenterOnParent函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GeneratePalettesDialog

	GeneratePalettesDialog(wxWindow* parent)
		: wxDialog(parent, -1, "Generate Palettes", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
	{

		// Set dialog icon
		wxIcon icon;
		icon.CopyFromBitmap(Icons::getIcon(Icons::ENTRY, "palette"));
		SetIcon(icon);

		// Setup main sizer
		wxBoxSizer* msizer = new wxBoxSizer(wxVERTICAL);
		SetSizer(msizer);
		wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
		msizer->Add(sizer, 1, wxEXPAND|wxALL, 6);

		// Add buttons
		rb_doom = new wxRadioButton(this, -1, "Doom (14 Palettes)", wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
		sizer->Add(rb_doom, 0, wxEXPAND|wxALL, 4);
		rb_hexen = new wxRadioButton(this, -1, "Hexen (28 Palettes)");
		sizer->Add(rb_hexen, 0, wxEXPAND|wxALL, 4);

		sizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxBOTTOM|wxTOP, 4);

		// Init layout
		Layout();

		// Setup dialog size
		SetInitialSize(wxSize(-1, -1));
		SetMinSize(GetSize());
		CenterOnParent();
	}
开发者ID:Blue-Shadow,项目名称:SLADE,代码行数:31,代码来源:PaletteEntryPanel.cpp


示例2: wxDialog

SetupWizardDialog::SetupWizardDialog(wxWindow* parent) : wxDialog(parent, -1, "First Time SLADE Setup", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{
	// Create pages
	pages.push_back(new TempFolderWizardPage(this));
	pages.push_back(new BaseResourceWizardPage(this));
	pages.push_back(new NodeBuildersWizardPage(this));
	current_page = 0;

	// Hide all pages
	for (unsigned a = 0; a < pages.size(); a++)
		pages[a]->Show(false);

	// Init layout
	setupLayout();

	// Set icon
	wxIcon icon;
	icon.CopyFromBitmap(getIcon("i_logo"));
	SetIcon(icon);

	// Setup layout
	SetInitialSize(wxSize(600, 500));
	Layout();
	Fit();
	SetMinSize(GetBestSize());
	CenterOnParent();

	showPage(0);

	// Bind events
	btn_next->Bind(wxEVT_BUTTON, &SetupWizardDialog::onBtnNext, this);
	btn_prev->Bind(wxEVT_BUTTON, &SetupWizardDialog::onBtnPrev, this);
}
开发者ID:DemolisherOfSouls,项目名称:SLADE,代码行数:33,代码来源:SetupWizardDialog.cpp


示例3: WebToolsSettingsBase

WebToolsSettings::WebToolsSettings(wxWindow* parent)
    : WebToolsSettingsBase(parent)
    , m_modified(false)
{
    ::wxPGPropertyBooleanUseCheckbox(m_pgMgr->GetGrid());
    {
        WebToolsConfig config;
        config.Load();
        m_pgPropEnableJSCC->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSEnableCC));
        m_pgPropLogging->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSEnableVerboseLogging));
        m_pgPropBrowser->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSLibraryBrowser));
        m_pgPropChai->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSLibraryChai));
        m_pgPropEcma5->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSLibraryEcma5));
        m_pgPropEcma6->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSLibraryEcma6));
        m_pgPropJQuery->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSLibraryJQuery));
        m_pgPropUnderscore->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSLibraryUnderscore));
        m_pgPropAngular->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSPluginAngular));
        m_pgPropNode->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSPluginNode));
        m_pgPropStrings->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSPluginStrings));
        m_pgPropQML->SetValue(config.HasJavaScriptFlag(WebToolsConfig::kJSPluginQML));
    }

    CenterOnParent();
    SetName("WebToolsSettings");
    WindowAttrManager::Load(this);
}
开发者ID:05storm26,项目名称:codelite,代码行数:26,代码来源:WebToolsSettings.cpp


示例4: GetSize

void pgDialog::RestorePosition(int defaultX, int defaultY, int defaultW, int defaultH, int minW, int minH)
{
	if (minW == -1)
		minW = GetSize().GetX();

	if (minH == -1)
		minH = GetSize().GetY();

	wxPoint pos(settings->Read(dlgName, wxPoint(defaultX, defaultY)));
	wxSize size;

	if ((this->GetWindowStyle() & wxRESIZE_BORDER) == wxRESIZE_BORDER)
	{
		if (defaultW < 0)
			size = settings->Read(dlgName, GetSize());
		else
			size = settings->Read(dlgName, wxSize(defaultW, defaultH));
	}
	else
	{
		size = GetSize();
	}

	bool posDefault = (pos.x == -1 && pos.y == -1);

	CheckOnScreen(this, pos, size, minW, minH);
	SetSize(pos.x, pos.y, size.x, size.y);
	if (posDefault)
		CenterOnParent();
}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:30,代码来源:dlgClasses.cpp


示例5: wxDialog

DialogVideoDetails::DialogVideoDetails(agi::Context *c)
: wxDialog(c->parent , -1, _("Video Details"))
{
	auto width = c->videoController->GetWidth();
	auto height = c->videoController->GetHeight();
	auto framecount = c->videoController->GetLength();
	auto fps = c->videoController->FPS();
	boost::rational<int> ar(width, height);

	auto fg = new wxFlexGridSizer(2, 5, 10);
	auto make_field = [&](wxString const& name, wxString const& value) {
		fg->Add(new wxStaticText(this, -1, name), 0, wxALIGN_CENTRE_VERTICAL);
		fg->Add(new wxTextCtrl(this, -1, value, wxDefaultPosition, wxSize(300,-1), wxTE_READONLY), 0, wxALIGN_CENTRE_VERTICAL | wxEXPAND);
	};
	make_field(_("File name:"), c->videoController->GetVideoName().wstring());
	make_field(_("FPS:"), wxString::Format("%.3f", fps.FPS()));
	make_field(_("Resolution:"), wxString::Format("%dx%d (%d:%d)", width, height, ar.numerator(), ar.denominator()));
	make_field(_("Length:"), wxString::Format(_("%d frames (%s)"), framecount, to_wx(AssTime(fps.TimeAtFrame(framecount - 1)).GetAssFormated(true))));
	make_field(_("Decoder:"), to_wx(c->videoController->GetProvider()->GetDecoderName()));

	wxStaticBoxSizer *video_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Video"));
	video_sizer->Add(fg);

	auto main_sizer = new wxBoxSizer(wxVERTICAL);
	main_sizer->Add(video_sizer, 1, wxALL|wxEXPAND, 5);
	main_sizer->Add(CreateSeparatedButtonSizer(wxOK), 0, wxALL|wxEXPAND, 5);
	SetSizerAndFit(main_sizer);

	CenterOnParent();
}
开发者ID:KagamiChan,项目名称:Aegisub,代码行数:30,代码来源:dialog_video_details.cpp


示例6: Fit

bool CConditionalDialog::Run()
{
	wxString dialogs = COptions::Get()->GetOption(OPTION_ONETIME_DIALOGS);
	if (dialogs.Len() > (unsigned int)m_type && dialogs[m_type] == '1')
		return true;

	Fit();
	wxGetApp().GetWrapEngine()->WrapRecursive(this, 3);

	CenterOnParent();

	int id = ShowModal();

	auto cb = dynamic_cast<wxCheckBox*>(FindWindow(wxID_HIGHEST + 1));
	if (cb && cb->GetValue()) {
		while (dialogs.Len() <= (unsigned int)m_type)
			dialogs += _T("0");
		dialogs[m_type] = '1';
		COptions::Get()->SetOption(OPTION_ONETIME_DIALOGS, dialogs.ToStdWstring());
	}

	if (id == wxID_OK || id == wxID_YES)
		return true;

	return false;
}
开发者ID:zedfoxus,项目名称:filezilla-client,代码行数:26,代码来源:conditionaldialog.cpp


示例7: wxDialog

/* ShowItemDialog::ShowItemDialog
 * ShowItemDialog class constructor
 *******************************************************************/
ShowItemDialog::ShowItemDialog(wxWindow* parent) : wxDialog(parent, -1, "Show Item")
{
	// Setup sizer
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(sizer);
	wxGridBagSizer*	gb_sizer = new wxGridBagSizer(4, 4);
	sizer->Add(gb_sizer, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, 10);

	// Object type
	string types[] = { "Vertex", "Line", "Side", "Sector", "Thing" };
	gb_sizer->Add(new wxStaticText(this, -1, "Type:"), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
	choice_type = new wxChoice(this, -1, wxDefaultPosition, wxDefaultSize, 5, types);
	gb_sizer->Add(choice_type, wxGBPosition(0, 1), wxDefaultSpan, wxEXPAND);

	// Index
	gb_sizer->Add(new wxStaticText(this, -1, "Index:"), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
	text_index = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
	gb_sizer->Add(text_index, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND);

	// Dialog buttons
	sizer->AddSpacer(4);
	sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 10);

	// Init layout
	gb_sizer->AddGrowableCol(1, 1);
	SetInitialSize(wxSize(300, -1));
	CenterOnParent();
	Layout();
	text_index->SetFocus();
	text_index->SetFocusFromKbd();
}
开发者ID:Blzut3,项目名称:SLADE,代码行数:34,代码来源:ShowItemDialog.cpp


示例8: wxDialog

nkIODialog::nkIODialog(wxWindow* parent, 
	   wxString unasEtiquetas[100],
	   int un_tamanio,
	   wxWindowID id, 
	   const wxString& title, 
	   const wxPoint& pos, 
	   const wxSize& size, 
	   long style, 
	   const wxString& name):
	wxDialog(parent, id, title, pos, size, style, name)
{
	this->prv_tamanio = un_tamanio;
	for (int i=0; i<prv_tamanio; i++){
		new wxStaticText(this,
			-1,
			unasEtiquetas[i],
			wxPoint(20,20*(i+1)));
		prv_wxTCValores[i] = new wxTextCtrl(this,
			-1,
			wxT("0"),
			wxPoint(200,20*(i+1)));
	}
	new wxButton(this, wxID_OK, _("OK"),wxPoint(40,prv_tamanio*20+40));	
	new wxButton(this, wxID_CANCEL, _("Cancel"),wxPoint(170,prv_tamanio*20+40));

	CenterOnParent();

}
开发者ID:animecomico,项目名称:Nukak3D,代码行数:28,代码来源:nkIODialog.cpp


示例9: wxDialog

DialogAttachments::DialogAttachments(wxWindow *parent, AssFile *ass)
: wxDialog(parent,-1,_("Attachment List"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE)
, ass(ass)
{
	SetIcon(GETICON(attach_button_16));

	listView = new wxListView(this,ATTACHMENT_LIST,wxDefaultPosition,wxSize(500,200));
	UpdateList();

	// Buttons
	extractButton = new wxButton(this,BUTTON_EXTRACT,_("E&xtract"));
	deleteButton = new wxButton(this,BUTTON_DELETE,_("&Delete"));
	extractButton->Enable(false);
	deleteButton->Enable(false);

	// Buttons sizer
	wxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL);
	buttonSizer->Add(new wxButton(this,BUTTON_ATTACH_FONT,_("Attach &Font")),1,0,0);
	buttonSizer->Add(new wxButton(this,BUTTON_ATTACH_GRAPHICS,_("Attach &Graphics")),1,0,0);
	buttonSizer->Add(extractButton,1,0,0);
	buttonSizer->Add(deleteButton,1,0,0);
	buttonSizer->Add(new HelpButton(this,"Attachment Manager"),1,wxLEFT,5);
	buttonSizer->Add(new wxButton(this,wxID_CANCEL,_("&Close")),1,0,0);

	// Main sizer
	wxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
	mainSizer->Add(listView,1,wxTOP | wxLEFT | wxRIGHT | wxEXPAND,5);
	mainSizer->Add(buttonSizer,0,wxALL | wxEXPAND,5);
	SetSizerAndFit(mainSizer);
	CenterOnParent();
}
开发者ID:sthenc,项目名称:Aegisub,代码行数:31,代码来源:dialog_attachments.cpp


示例10: GfxCropDialog

	GfxCropDialog(wxWindow* parent, ArchiveEntry* entry, Palette8bit* pal)
		: wxDialog(parent, -1, "Crop", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
	{
		// Set dialog icon
		wxIcon icon;
		icon.CopyFromBitmap(Icons::getIcon(Icons::GENERAL, "settings"));
		SetIcon(icon);

		// Setup main sizer
		wxBoxSizer* msizer = new wxBoxSizer(wxVERTICAL);
		SetSizer(msizer);
		wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
		msizer->Add(sizer, 1, wxEXPAND|wxALL, 6);

		// Add preview
		canvas_preview = new CropCanvas(this);
		sizer->Add(canvas_preview, 1, wxEXPAND|wxALL, 4);

		// Add buttons
		sizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxBOTTOM, 4);

		// Setup dialog size
		SetInitialSize(wxSize(-1, -1));
		SetMinSize(GetSize());
		CenterOnParent();
	}
开发者ID:SanyaWaffles,项目名称:SLADE,代码行数:26,代码来源:GfxEntryPanel.cpp


示例11: ShowFullScreen

void AeroQSPFrame::SetUserSize( const wxString &size )
{
	long width = 800, height = 600;
	int pos = size.Index(wxT('x'));
	if (pos > 0 && pos + 1 < size.Length())
	{
		size.Mid(0, pos).ToLong(&width);
		size.Mid(pos + 1).ToLong(&height);
	}
	if (width > 0 && height > 0)
	{
		int curW, curH;
		if (_isFullScreen)
		{
			_isFullScreen = false;
			ShowFullScreen(false);
		}
		GetClientSize(&curW, &curH);
		if (width != curW || height != curH)
		{
			SetClientSize(width, height);
			CenterOnParent();
		}
	}
}
开发者ID:Nesles,项目名称:qsp,代码行数:25,代码来源:AeroQSPFrame.cpp


示例12: GetPageAreaSizer

bool CUpdateWizard::Load()
{
	if (!Create(m_parent, wxID_ANY, _("Check for updates"), wxNullBitmap, wxPoint(0, 0)))
		return false;

	wxSize minPageSize = GetPageAreaSizer()->GetMinSize();

	for (int i = 1; i <= 5; i++)
	{
		wxWizardPageSimple* page = new wxWizardPageSimple();
		bool res = wxXmlResource::Get()->LoadPanel(page, this, wxString::Format(_T("ID_CHECKFORUPDATE%d"), i));
		if (!res)
		{
			delete page;
			return false;
		}
		page->Show(false);

		m_pages.push_back(page);
	}
	for (unsigned int i = 0; i < (m_pages.size() - 1); i++)
		m_pages[i]->Chain(m_pages[i], m_pages[i + 1]);


	GetPageAreaSizer()->Add(m_pages[0]);

	std::vector<wxWindow*> windows;
	for (unsigned int i = 0; i < m_pages.size(); i++)
		windows.push_back(m_pages[i]);

	wxGetApp().GetWrapEngine()->WrapRecursive(windows, 1.7, "UpdateCheck", wxSize(), minPageSize);

	XRCCTRL(*this, "ID_CHECKINGTEXT", wxStaticText)->Hide();
	XRCCTRL(*this, "ID_CHECKINGPROGRESS", wxGauge)->Hide();
	XRCCTRL(*this, "ID_CHECKINGTEXTPROGRESS", wxStaticText)->Hide();

	XRCCTRL(*this, "ID_CHECKINGPROGRESS", wxGauge)->SetRange(MAXCHECKPROGRESS);

	GetPageAreaSizer()->Add(m_pages[1]);
	m_pages[1]->SetPrev(0);
	for (int i = 2; i <= 4; i++)
	{
		m_pages[i]->SetPrev(0);
		m_pages[i]->SetNext(0);
		GetPageAreaSizer()->Add(m_pages[i]);
	}

	if (COptions::Get()->GetOptionVal(OPTION_UPDATECHECK_CHECKBETA) != 0)
		XRCCTRL(*this, "ID_CHECKBETA", wxCheckBox)->SetValue(1);
	else
		XRCCTRL(*this, "ID_CHECKBETA", wxCheckBox)->SetValue(0);

	m_loaded = true;

	CenterOnParent();

	return true;
}
开发者ID:madnessw,项目名称:thesnow,代码行数:58,代码来源:updatewizard.cpp


示例13: wxDialog

        AboutDialog::AboutDialog(wxWindow* parent) :
        wxDialog(parent, wxID_ANY, wxT("About")) {
            IO::FileManager fileManager;
            
            wxBitmap icon(fileManager.appendPath(fileManager.resourceDirectory(), "Icon.png"), wxBITMAP_TYPE_PNG);
            
            wxStaticBitmap* appIcon = new wxStaticBitmap(this, wxID_ANY, icon);
            wxStaticLine* appLine = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL);
            wxStaticText* appName = new wxStaticText(this, wxID_ANY, wxT("TrenchBroom"));
            appName->SetFont(appName->GetFont().Larger().Larger().Larger().Larger().Bold());
            
            wxStaticText* appClaim = new wxStaticText(this, wxID_ANY, wxT("A Modern Level Editor for Quake"));
            
            wxString versionStr(wxT("Version "));
            versionStr << VERSIONSTR;
            
            wxStaticText* version = new wxStaticText(this, wxID_ANY, versionStr);
            
            wxStaticText* devHeader = new wxStaticText(this, wxID_ANY, wxT("Development"));
            devHeader->SetFont(devHeader->GetFont().Bold());
            wxStaticText* devText = new wxStaticText(this, wxID_ANY, wxT("Kristian Duske"));
            
            wxStaticText* contrHeader = new wxStaticText(this, wxID_ANY, wxT("Contributions"));
            contrHeader->SetFont(contrHeader->GetFont().Bold());
            wxSizer* contrText = CreateTextSizer(wxT("Corey Jones (feedback, testing, documentation)\nAndré König (feedback, testing)\nWouter van Oortmerssen (feedback)\nHannes Kröger (testing)\nMorgan Allen (testing)\nForest Hale (fov code)\nChristian Grawert (Quake.fdg)"));
            
            wxSizer* copyright = CreateTextSizer(wxT("Copyright 2010-2013 Kristian Duske\nQuake is a registered trademark of id Software"));

            wxGridBagSizer* sizer = new wxGridBagSizer();

            int row = 0;
            sizer->Add(0, 10, wxGBPosition(row++, 1));
            sizer->AddGrowableRow(static_cast<size_t>(row - 1));
            sizer->Add(appName, wxGBPosition(row++, 1));
            sizer->Add(appLine, wxGBPosition(row++, 1), wxDefaultSpan, wxEXPAND);
            sizer->Add(appClaim, wxGBPosition(row++, 1));
            sizer->Add(0, 20, wxGBPosition(row++, 1));
            sizer->Add(version, wxGBPosition(row++, 1));
            sizer->Add(0, 20, wxGBPosition(row++, 1));
            sizer->Add(devHeader, wxGBPosition(row++, 1));
            sizer->Add(devText, wxGBPosition(row++, 1));
            sizer->Add(0, 20, wxGBPosition(row++, 1));
            sizer->Add(contrHeader, wxGBPosition(row++, 1));
            sizer->Add(contrText, wxGBPosition(row++, 1));
            sizer->Add(0, 20, wxGBPosition(row++, 1));
            sizer->Add(copyright, wxGBPosition(row++, 1));
            sizer->Add(0, 10, wxGBPosition(row++, 1));
            sizer->AddGrowableRow(static_cast<size_t>(row - 1));
            sizer->Add(appIcon, wxGBPosition(0, 0), wxGBSpan(row, 1), wxALIGN_CENTER);
            
            SetSizer(sizer);
            SetSize(650, 420);
            CenterOnParent();
            
            SetBackgroundColour(*wxWHITE);
        }
开发者ID:JoshEngebretson,项目名称:FSRadQuakeStuff,代码行数:56,代码来源:AboutDialog.cpp


示例14: SDialog

// -----------------------------------------------------------------------------
// GfxConvDialog class constructor
// -----------------------------------------------------------------------------
GfxConvDialog::GfxConvDialog(wxWindow* parent) : SDialog(parent, "Graphic Format Conversion", "gfxconv")
{
	// Set dialog icon
	wxIcon icon;
	icon.CopyFromBitmap(Icons::getIcon(Icons::General, "convert"));
	SetIcon(icon);

	setupLayout();
	CenterOnParent();
}
开发者ID:alexey-lysiuk,项目名称:SLADE,代码行数:13,代码来源:GfxConvDialog.cpp


示例15: CenterOnParent

void ItemPropertiesBase::OnInitDialog(wxInitDialogEvent&)
{
	CenterOnParent();

	InitSpecific();

	pi->LoadProperties(static_cast<PropertyBox*>(this));

	EnableOK();
}
开发者ID:travisgoodspeed,项目名称:basicsynth,代码行数:10,代码来源:ItemPropertiesDlg.cpp


示例16: updateICKeypointSensitivityText

void Regard3DComputeMatchesDialog::OnInitDialog( wxInitDialogEvent& event )
{
	pKeypointSensitivitySlider_->SetValue(1);
	updateICKeypointSensitivityText();
	pKeypointMatchingRatioSlider_->SetValue(0);
	updateICKeypointMatchingRatioText();

	Fit();
	CenterOnParent();
}
开发者ID:SimFaris,项目名称:Regard3D,代码行数:10,代码来源:Regard3DComputeMatchesDialog.cpp


示例17: CenterOnParent

int wxDialogEx::ShowModal()
{
	CenterOnParent();

#ifdef __WXMSW__
	// All open menus need to be closed or app will become unresponsive.
	::EndMenu();
#endif
	return wxDialog::ShowModal();
}
开发者ID:idgaf,项目名称:FileZilla3,代码行数:10,代码来源:dialogex.cpp


示例18: wxDialog

BFProjectSettingsDlg::BFProjectSettingsDlg (wxWindow* pParent)
                    : wxDialog(pParent,
                               wxID_ANY,
                               _("Project settings"))
{
    wxString strTip;

    // help ctrl
    pHelp_ = new BFHelpCtrl(this);

    // project-settings ctrl
    pCtrl_ = new BFProjectSettingsCtrl(this, pHelp_);

    // name
    wxStaticText* pNameLabel = new wxStaticText(this, wxID_ANY, _("Name:"));
    //pNameLabel->SetMinSize(wxSize(pCtrl_->GetLabelWidth(), pNameLabel->GetSize().GetHeight()));
    pNameCtrl_ = new wxTextCtrl(this, wxID_ANY);
    strTip = _("name of the backup project");
    pNameLabel->SetHelpText(strTip);
    pNameCtrl_->SetHelpText(strTip);

    // button
    BFBitmapButton* pButtonOk     = new BFBitmapButton(this,
                                                       BFPRJSETDLG_ID_BUTTONOK,
                                                       BFIconTable::Instance().GetBitmap(BFIconTable::ok),
                                                       "OK");
    BFBitmapButton* pButtonCancel = new BFBitmapButton(this,
                                                       BFPRJSETDLG_ID_BUTTONCANCEL,
                                                       BFIconTable::Instance().GetBitmap(BFIconTable::cancel),
                                                       _("Cancel"));

    // sizer
    wxBoxSizer*         pTopSizer       = new wxBoxSizer(wxVERTICAL);
    wxBoxSizer*         pNameSizer      = new wxBoxSizer(wxHORIZONTAL);
    wxBoxSizer*         pButtonSizer    = new wxBoxSizer(wxHORIZONTAL);
    pNameSizer->Add(pNameLabel, wxSizerFlags(0).Align(wxALIGN_CENTER_VERTICAL).Border(wxRIGHT));
    pNameSizer->Add(pNameCtrl_, wxSizerFlags(1));
    pButtonSizer->Add(pButtonOk,        wxSizerFlags(0).Border());
    pButtonSizer->Add(pButtonCancel,    wxSizerFlags(0).Border());
    pTopSizer->Add(pNameSizer,              wxSizerFlags(0).Border(wxLEFT | wxUP | wxRIGHT).Expand());
    pTopSizer->Add(new wxStaticLine(this),  wxSizerFlags(0).Border().Expand());
    pTopSizer->Add(pCtrl_,                  wxSizerFlags(0).Border());
    pTopSizer->Add(pHelp_,                  wxSizerFlags(0).Border().Expand());
    pTopSizer->Add(pButtonSizer,            wxSizerFlags(0).Center());

    // motion events
    pHelp_->Connect(pNameLabel);
    pHelp_->Connect(pNameCtrl_);

    // arrange and show
    SetSizerAndFit(pTopSizer);
    GetData();
    CenterOnParent();
    ShowModal();
}
开发者ID:BackupTheBerlios,项目名称:blackfisk-svn,代码行数:55,代码来源:BFProjectSettingsDlg.cpp


示例19: wxDialog

DialogPasteOver::DialogPasteOver(wxWindow *parent)
: wxDialog (parent, -1, _("Select Fields to Paste Over"))
{
	// Label and list sizer
	wxSizer *ListSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Fields"));
	ListSizer->Add(new wxStaticText(this, -1, _("Please select the fields that you want to paste over:")), wxSizerFlags());

	// List box
	wxArrayString choices;
	choices.Add(_("Layer"));
	choices.Add(_("Start Time"));
	choices.Add(_("End Time"));
	choices.Add(_("Style"));
	choices.Add(_("Actor"));
	choices.Add(_("Margin Left"));
	choices.Add(_("Margin Right"));
	choices.Add(_("Margin Vertical"));
	choices.Add(_("Effect"));
	choices.Add(_("Text"));
	ListBox = new wxCheckListBox(this, -1, wxDefaultPosition, wxDefaultSize, choices);
	ListSizer->Add(ListBox, wxSizerFlags(0).Expand().Border(wxTOP));

	std::vector<bool> options = OPT_GET("Tool/Paste Lines Over/Fields")->GetListBool();
	if (options.size() != choices.size())
		options.resize(choices.size(), false);

	for (size_t i = 0; i < choices.size(); ++i)
		ListBox->Check(i, options[i]);

	// Top buttons
	wxButton *btn;
	wxSizer *TopButtonSizer = new wxBoxSizer(wxHORIZONTAL);

	TopButtonSizer->Add(btn = new wxButton(this, -1, _("&All")), wxSizerFlags(1));
	btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogPasteOver::CheckAll, this, true));
	TopButtonSizer->Add(btn = new wxButton(this, -1, _("&None")), wxSizerFlags(1));
	btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogPasteOver::CheckAll, this, false));
	TopButtonSizer->Add(btn = new wxButton(this, -1, _("&Times")), wxSizerFlags(1));
	btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogPasteOver::OnTimes, this);
	TopButtonSizer->Add(btn = new wxButton(this, -1, _("T&ext")), wxSizerFlags(1));
	btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogPasteOver::OnText, this);

	// Buttons
	wxStdDialogButtonSizer *ButtonSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP);
	Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogPasteOver::OnOK, this, wxID_OK);
	Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&HelpButton::OpenPage, "Paste Over"), wxID_HELP);

	// Main sizer
	wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL);
	MainSizer->Add(ListSizer,0,wxEXPAND | wxLEFT | wxRIGHT,5);
	MainSizer->Add(TopButtonSizer,0,wxLEFT | wxRIGHT | wxEXPAND,5);
	MainSizer->Add(ButtonSizer,0,wxALL | wxEXPAND,5);
	SetSizerAndFit(MainSizer);
	CenterOnParent();
}
开发者ID:Azpidatziak,项目名称:Aegisub,代码行数:55,代码来源:dialog_paste_over.cpp


示例20: wxDialog

/*******************************************************************
* GFXCOLOURISEDIALOG FUNCTIONS
*******************************************************************/
GfxColouriseDialog::GfxColouriseDialog(wxWindow* parent, ArchiveEntry* entry, Palette8bit* pal)
: wxDialog(parent, -1, "Colourise", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{
	// Init variables
	this->entry = entry;
	this->palette = pal;

	// Set dialog icon
	wxIcon icon;
	icon.CopyFromBitmap(getIcon("t_colourise"));
	SetIcon(icon);

	// Setup main sizer
	wxBoxSizer* msizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(msizer);
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	msizer->Add(sizer, 1, wxEXPAND|wxALL, 6);

	// Add colour chooser
	wxBoxSizer* hbox = new wxBoxSizer(wxHORIZONTAL);
	sizer->Add(hbox, 0, wxEXPAND|wxALL, 4);

	cp_colour = new wxColourPickerCtrl(this, -1, wxColour(255, 0, 0));
	hbox->Add(new wxStaticText(this, -1, "Colour:"), 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
	hbox->Add(cp_colour, 0, wxEXPAND);

	// Add preview
	gfx_preview = new GfxCanvas(this, -1);
	sizer->Add(gfx_preview, 1, wxEXPAND|wxALL, 4);

	// Add buttons
	sizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxBOTTOM, 4);

	// Setup preview
	gfx_preview->setViewType(GFXVIEW_CENTERED);
	gfx_preview->setPalette(pal);
	gfx_preview->SetInitialSize(wxSize(192, 192));
	Misc::loadImageFromEntry(gfx_preview->getImage(), entry);
	wxColour col = cp_colour->GetColour();
	gfx_preview->getImage()->colourise(rgba_t(col.Red(), col.Green(), col.Blue()), pal);
	gfx_preview->updateImageTexture();

	// Init layout
	Layout();

	// Bind events
	cp_colour->Bind(wxEVT_COLOURPICKER_CHANGED, &GfxColouriseDialog::onColourChanged, this);
	Bind(wxEVT_SIZE, &GfxColouriseDialog::onResize, this);

	// Setup dialog size
	SetInitialSize(wxSize(-1, -1));
	SetMinSize(GetSize());
	CenterOnParent();
}
开发者ID:DemolisherOfSouls,项目名称:SLADE,代码行数:57,代码来源:TranslationEditorDialog.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CenterOnScreen函数代码示例发布时间:2022-05-30
下一篇:
C++ Cell函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap