本文整理汇总了C++中CenterOnParent函数的典型用法代码示例。如果您正苦于以下问题:C++ CenterOnParent函数的具体用法?C++ CenterOnParent怎么用?C++ CenterOnParent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CenterOnParent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
}
示例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;
}
示例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);
}
示例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();
}
示例15: CenterOnParent
void ItemPropertiesBase::OnInitDialog(wxInitDialogEvent&)
{
CenterOnParent();
InitSpecific();
pi->LoadProperties(static_cast<PropertyBox*>(this));
EnableOK();
}