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(); }
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); }
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); }
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(); }
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(); }
DialogVideoDetails::DialogVideoDetails(agi::Context *c) : wxDialog(c->parent , -1, _("Video Details")) { int width = c->videoController->GetWidth(); int height = c->videoController->GetHeight(); int framecount = c->videoController->GetLength(); double fps = c->videoController->FPS().FPS(); wxFlexGridSizer *fg = new wxFlexGridSizer(2, 5, 10); make_field(this, fg, _("File name:"), c->videoController->videoName); make_field(this, fg, _("FPS:"), wxString::Format("%.3f", fps)); make_field(this, fg, _("Resolution:"), wxString::Format("%dx%d (%s)", width, height, pretty_ar(width, height))); make_field(this, fg, _("Length:"), wxString::Format("%d frames (%s)", framecount, pretty_time_stamp(framecount, fps))); make_field(this, fg, _("Decoder:"), c->videoController->GetProvider()->GetDecoderName()); wxStaticBoxSizer *video_sizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Video")); video_sizer->Add(fg); wxBoxSizer *main_sizer = new wxBoxSizer(wxVERTICAL); main_sizer->Add(video_sizer, 1, wxALL|wxEXPAND, 5); main_sizer->Add(CreateSeparatedButtonSizer(wxOK), 0, wxALL|wxEXPAND, 5); main_sizer->SetSizeHints(this); SetSizer(main_sizer); CenterOnParent(); }
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; }
/* 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(); }
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(); }
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(); }
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(); }
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(); } } }
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; }
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); }
// ----------------------------------------------------------------------------- // 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(); }
void ItemPropertiesBase::OnInitDialog(wxInitDialogEvent&) { CenterOnParent(); InitSpecific(); pi->LoadProperties(static_cast<PropertyBox*>(this)); EnableOK(); }
void Regard3DComputeMatchesDialog::OnInitDialog( wxInitDialogEvent& event ) { pKeypointSensitivitySlider_->SetValue(1); updateICKeypointSensitivityText(); pKeypointMatchingRatioSlider_->SetValue(0); updateICKeypointMatchingRatioText(); Fit(); CenterOnParent(); }
int wxDialogEx::ShowModal() { CenterOnParent(); #ifdef __WXMSW__ // All open menus need to be closed or app will become unresponsive. ::EndMenu(); #endif return wxDialog::ShowModal(); }
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(); }
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(); }
/******************************************************************* * 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(); }
clSingleChoiceDialog::clSingleChoiceDialog(wxWindow* parent, const wxArrayString& options, int initialSelection) : clSingleChoiceDialogBase(parent) { if(!options.IsEmpty()) { m_listBox->Append(options); if(initialSelection >= 0 && initialSelection < (int)options.size()) { m_listBox->Select(initialSelection); } } CenterOnParent(); }
OptionsDlg2::OptionsDlg2(wxWindow* parent) : OptionsBaseDlg2(parent) , m_contentObjects() , restartRquired(false) { Initialize(); SetName("OptionsDlg2"); WindowAttrManager::Load(this); CenterOnParent(); MSWSetNativeTheme(m_treeBook->GetTreeCtrl()); GetSizer()->Layout(); }
void GSPanel::DoResize() { if( GetParent() == NULL ) return; wxSize client = GetParent()->GetClientSize(); wxSize viewport = client; if ( !client.GetHeight() || !client.GetWidth() ) return; double clientAr = (double)client.GetWidth()/(double)client.GetHeight(); extern AspectRatioType iniAR; extern bool switchAR; double targetAr = clientAr; if (g_Conf->GSWindow.AspectRatio != iniAR) { switchAR = false; } if (!switchAR) { if (g_Conf->GSWindow.AspectRatio == AspectRatio_4_3) targetAr = 4.0 / 3.0; else if (g_Conf->GSWindow.AspectRatio == AspectRatio_16_9) targetAr = 16.0 / 9.0; } else { targetAr = 4.0 / 3.0; } double arr = targetAr / clientAr; if( arr < 1 ) viewport.x = (int)( (double)viewport.x*arr + 0.5); else if( arr > 1 ) viewport.y = (int)( (double)viewport.y/arr + 0.5); float zoom = g_Conf->GSWindow.Zoom.ToFloat()/100.0; if( zoom == 0 )//auto zoom in untill black-bars are gone (while keeping the aspect ratio). zoom = std::max( (float)arr, (float)(1.0/arr) ); viewport.Scale(zoom, zoom*g_Conf->GSWindow.StretchY.ToFloat()/100.0 ); if (viewport == client && EmuConfig.Gamefixes.FMVinSoftwareHack && g_Conf->GSWindow.IsFullscreen) viewport.x += 1; //avoids crash on some systems switching HW><SW in fullscreen aspect ratio's with FMV Software switch. SetSize( viewport ); CenterOnParent(); int cx, cy; GetPosition(&cx, &cy); float unit = .01*(float)std::min(viewport.x, viewport.y); SetPosition( wxPoint( cx + unit*g_Conf->GSWindow.OffsetX.ToFloat(), cy + unit*g_Conf->GSWindow.OffsetY.ToFloat() ) ); #ifdef GSWindowScaleDebug Console.WriteLn(Color_Yellow, "GSWindowScaleDebug: zoom %f, viewport.x %d, viewport.y %d", zoom, viewport.GetX(), viewport.GetY()); #endif }
/* GfxConvDialog::GfxConvDialog * GfxConvDialog class constructor *******************************************************************/ GfxConvDialog::GfxConvDialog(wxWindow* parent) : SDialog(parent, "Graphic Format Conversion", "gfxconv") { current_item = 0; // Set dialog icon wxIcon icon; icon.CopyFromBitmap(getIcon("t_convert")); SetIcon(icon); setupLayout(); CenterOnParent(); }
/////////////// // Constructor DialogResample::DialogResample(wxWindow *parent, SubtitlesGrid *_grid) : wxDialog (parent,-1,_("Resample resolution"),wxDefaultPosition) { // Variables AssFile *subs = AssFile::top; grid = _grid; vid = grid->video; // Resolution line wxSizer *ResBoxSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Resolution")); wxSizer *ResSizer = new wxBoxSizer(wxHORIZONTAL); int sw,sh; subs->GetResolution(sw,sh); ResXValue = wxString::Format(_T("%i"),sw); ResYValue = wxString::Format(_T("%i"),sh); ResX = new wxTextCtrl(this,-1,_T(""),wxDefaultPosition,wxSize(50,20),0,NumValidator(&ResXValue)); ResY = new wxTextCtrl(this,-1,_T(""),wxDefaultPosition,wxSize(50,20),0,NumValidator(&ResYValue)); wxStaticText *ResText = new wxStaticText(this,-1,_("x")); wxButton *FromVideo = new wxButton(this,BUTTON_DEST_FROM_VIDEO,_("From video")); if (!vid->loaded) FromVideo->Enable(false); ResSizer->Add(ResX,1,wxRIGHT,5); ResSizer->Add(ResText,0,wxALIGN_CENTER | wxRIGHT,5); ResSizer->Add(ResY,1,wxRIGHT,5); ResSizer->Add(FromVideo,1,0,0); // Resolution box Anamorphic = new wxCheckBox(this,CHECK_ANAMORPHIC,_("Change aspect ratio")); ResBoxSizer->Add(ResSizer,1,wxEXPAND|wxBOTTOM,5); ResBoxSizer->Add(Anamorphic,0,0,0); // Button sizer wxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL); ButtonSizer->AddStretchSpacer(1); #ifndef __WXMAC__ ButtonSizer->Add(new wxButton(this,BUTTON_RESAMPLE,_("Resample")),0,wxRIGHT,5); ButtonSizer->Add(new wxButton(this,wxID_CANCEL),0,wxRIGHT,0); #else ButtonSizer->Add(new wxButton(this,wxID_CANCEL),0,wxRIGHT,5); wxButton *resampleButton = new wxButton(this,BUTTON_RESAMPLE,_("Resample")); ButtonSizer->Add(resampleButton,0,wxRight,0); resampleButton->SetDefault(); #endif // Main sizer wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL); MainSizer->Add(ResBoxSizer,1,wxEXPAND|wxALL,5); MainSizer->Add(ButtonSizer,0,wxEXPAND|wxRIGHT|wxLEFT|wxBOTTOM,5); MainSizer->SetSizeHints(this); SetSizer(MainSizer); CenterOnParent(); }
frmAbout::frmAbout(wxFrame *parent) : wxFrame(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(100, 100), 0 | wxFRAME_SHAPED | wxSIMPLE_BORDER | wxFRAME_NO_TASKBAR | wxSTAY_ON_TOP) { appearanceFactory->SetIcons(this); about = appearanceFactory->GetSplashImage(); SetClientSize(about.GetWidth(), about.GetHeight()); #ifndef __WXGTK__ SetWindowShape(); #endif CenterOnParent(); }
DialogDummyVideo::DialogDummyVideo(wxWindow *parent) : wxDialog(parent, -1, _("Dummy video options")) , fps(OPT_GET("Video/Dummy/FPS")->GetDouble()) , width(OPT_GET("Video/Dummy/Last/Width")->GetInt()) , height(OPT_GET("Video/Dummy/Last/Height")->GetInt()) , length(OPT_GET("Video/Dummy/Last/Length")->GetInt()) , color(OPT_GET("Colour/Video Dummy/Last Colour")->GetColor()) , pattern(OPT_GET("Video/Dummy/Pattern")->GetBool()) { SetIcon(GETICON(use_dummy_video_menu_16)); auto res_sizer = new wxBoxSizer(wxHORIZONTAL); res_sizer->Add(spin_ctrl(this, 1, 10000, &width), wxSizerFlags(1).Expand()); res_sizer->Add(new wxStaticText(this, -1, " x "), wxSizerFlags().Center()); res_sizer->Add(spin_ctrl(this, 1, 10000, &height), wxSizerFlags(1).Expand()); auto color_sizer = new wxBoxSizer(wxHORIZONTAL); auto color_btn = new ColourButton(this, wxSize(30, 17), false, color); color_sizer->Add(color_btn, wxSizerFlags().DoubleBorder(wxRIGHT)); color_sizer->Add(new wxCheckBox(this, -1, _("Checkerboard &pattern"), wxDefaultPosition, wxDefaultSize, 0, wxGenericValidator(&pattern)), wxSizerFlags(1).Center()); sizer = new wxFlexGridSizer(2, 5, 5); AddCtrl(_("Video resolution:"), resolution_shortcuts(this, width, height)); AddCtrl("", res_sizer); AddCtrl(_("Color:"), color_sizer); AddCtrl(_("Frame rate (fps):"), spin_ctrl(this, .1, 1000.0, &fps)); AddCtrl(_("Duration (frames):"), spin_ctrl(this, 2, 36000000, &length)); // Ten hours of 1k FPS AddCtrl("", length_display = new wxStaticText(this, -1, "")); wxStdDialogButtonSizer *btn_sizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP); btn_sizer->GetHelpButton()->Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Dummy Video")); auto main_sizer = new wxBoxSizer(wxVERTICAL); main_sizer->Add(sizer, wxSizerFlags(1).Border().Expand()); main_sizer->Add(new wxStaticLine(this, wxHORIZONTAL), wxSizerFlags().HorzBorder().Expand()); main_sizer->Add(btn_sizer, wxSizerFlags().Expand().Border()); UpdateLengthDisplay(); SetSizerAndFit(main_sizer); CenterOnParent(); Bind(wxEVT_COMBOBOX, &DialogDummyVideo::OnResolutionShortcut, this); color_btn->Bind(EVT_COLOR, [=](wxThreadEvent& e) { color = color_btn->GetColor(); }); Bind(wxEVT_SPINCTRL, [=](wxCommandEvent&) { TransferDataFromWindow(); UpdateLengthDisplay(); }); }
PaletteColouriseDialog(wxWindow* parent, Palette8bit* pal) : wxDialog(parent, -1, "Colourise", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) { // Init variable this->palette = pal; // Set dialog icon wxIcon icon; icon.CopyFromBitmap(Icons::getIcon(Icons::GENERAL, "palette_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 pal_preview = new PaletteCanvas(this, -1); sizer->Add(pal_preview, 1, wxEXPAND|wxALL, 4); // Add buttons sizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxBOTTOM|wxTOP, 4); // Setup preview pal_preview->allowSelection(2); pal_preview->SetInitialSize(wxSize(384, 384)); redraw(); // Init layout Layout(); // Bind events cp_colour->Bind(wxEVT_COLOURPICKER_CHANGED, &PaletteColouriseDialog::onColourChanged, this); pal_preview->Bind(wxEVT_LEFT_UP, &PaletteColouriseDialog::onPaletteLeftUp, this); // Setup dialog size SetInitialSize(wxSize(-1, -1)); SetMinSize(GetSize()); CenterOnParent(); }
nkIODialog::nkIODialog(wxWindow* parent, wxString p_text, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name): wxDialog(parent, id, title, pos, size, style, name) { new wxTextCtrl(this,-1,p_text,wxPoint(30,30),wxSize(580,240),wxTE_MULTILINE | wxTE_READONLY ); new wxButton(this, wxID_OK, _("OK"),wxPoint(270,280)); CenterOnParent(); }