wxFlexGridSizer* OptionPage::PageSizer(wxString name) { auto tmp_sizer = new wxStaticBoxSizer(wxHORIZONTAL, this, name); sizer->Add(tmp_sizer, 0,wxEXPAND, 5); auto flex = new wxFlexGridSizer(2,5,5); flex->AddGrowableCol(0,1); tmp_sizer->Add(flex, 1, wxEXPAND, 5); sizer->AddSpacer(8); return flex; }
// ----------------------------------------------------------------------------- // Lays out the controls on the panel // ----------------------------------------------------------------------------- void BaseResourceArchivesPanel::setupLayout() { auto sizer = new wxGridBagSizer(UI::pad(), UI::pad()); SetSizer(sizer); // Paths list + buttons sizer->Add(list_base_archive_paths_, { 0, 0 }, { 4, 1 }, wxEXPAND); sizer->Add(btn_add_, { 0, 1 }, { 1, 1 }, wxEXPAND); sizer->Add(btn_remove_, { 1, 1 }, { 1, 1 }, wxEXPAND); sizer->Add(btn_detect_, { 2, 1 }, { 1, 1 }, wxEXPAND); // ZDoom.pk3 path sizer->Add(WxUtils::createLabelHBox(this, "ZDoom PK3 Path:", flp_zdoom_pk3_), { 4, 0 }, { 1, 2 }, wxEXPAND); sizer->AddGrowableRow(3, 1); sizer->AddGrowableCol(0, 1); }
// ----------------------------------------------------------------------------- // NodesPrefsPanel class constructor // ----------------------------------------------------------------------------- NodesPrefsPanel::NodesPrefsPanel(wxWindow* parent, bool useframe) : PrefsPanelBase(parent) { // Create sizer auto sizer = new wxGridBagSizer(UI::pad(), UI::pad()); SetSizer(sizer); // Nodebuilder list wxArrayString builders; unsigned sel = 0; for (unsigned a = 0; a < NodeBuilders::nNodeBuilders(); a++) { builders.Add(NodeBuilders::getBuilder(a).name); if (nodebuilder_id == NodeBuilders::getBuilder(a).id) sel = a; } choice_nodebuilder_ = new wxChoice(this, -1, wxDefaultPosition, wxDefaultSize, builders); sizer->Add(new wxStaticText(this, -1, "Node Builder:"), { 0, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); sizer->Add(choice_nodebuilder_, { 0, 1 }, { 1, 2 }, wxEXPAND); // Nodebuilder path text text_path_ = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_READONLY); sizer->Add(new wxStaticText(this, -1, "Path:"), { 1, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); sizer->Add(text_path_, { 1, 1 }, { 1, 1 }, wxEXPAND); // Browse nodebuilder path button btn_browse_path_ = new wxButton(this, -1, "Browse"); sizer->Add(btn_browse_path_, { 1, 2 }, { 1, 1 }, wxEXPAND); // Nodebuilder options clb_options_ = new wxCheckListBox(this, -1, wxDefaultPosition, wxDefaultSize); sizer->Add(WxUtils::createLabelVBox(this, "Options:", clb_options_), { 2, 0 }, { 1, 3 }, wxEXPAND); sizer->AddGrowableCol(1, 1); sizer->AddGrowableRow(2, 1); // Bind events choice_nodebuilder_->Bind(wxEVT_CHOICE, &NodesPrefsPanel::onChoiceBuilderChanged, this); btn_browse_path_->Bind(wxEVT_BUTTON, &NodesPrefsPanel::onBtnBrowse, this); // Init choice_nodebuilder_->Select(sel); populateOptions(nodebuilder_options); }
TaskProgressDialog::TaskProgressDialog ( wxWindow* parent) : wxDialog ( parent, -1, _("Please wait..."), wxDefaultPosition, wxDefaultSize , wxCAPTION) { wxClientDC dc(this); dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); long widthText = 0; long heightText = 0; long lineHeight = 0; dc.GetTextExtent(initial_text, &widthText, &heightText, NULL, NULL, NULL); dc.GetTextExtent("ABEND", NULL, &lineHeight, NULL, NULL, NULL); auto wrapsizer = new wxBoxSizer(wxVERTICAL); auto centerizer = new wxGridBagSizer( 0, 0 ); centerizer->AddGrowableCol( 0 ); centerizer->AddGrowableRow( 0 ); centerizer->SetFlexibleDirection( wxBOTH ); centerizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL ); wrapsizer->Add( centerizer, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL); wxSize textSize(widthText, heightText); message = new wxGenericStaticText(this, -1, "" ,wxDefaultPosition, textSize,wxALIGN_CENTRE_HORIZONTAL); message->SetMinSize(textSize); centerizer->Add(message,wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, lineHeight/2); gauge = new wxGauge(this,-1,100,wxDefaultPosition,wxDefaultSize,wxGA_HORIZONTAL | wxGA_SMOOTH); wrapsizer->Add(gauge,wxSizerFlags().Expand().Border(wxBOTTOM|wxLEFT|wxRIGHT,lineHeight/2).Proportion(0)); EnableCloseButton(false); SetSizerAndFit(wrapsizer); CenterOnParent(); #ifdef __WXGTK__ pulse_timer = new wxTimer(this,ID_PulseTimer); #endif }
// ----------------------------------------------------------------------------- // GfxCropDialog class constructor // ----------------------------------------------------------------------------- GfxCropDialog::GfxCropDialog(wxWindow* parent, SImage* image, Palette* palette) : wxDialog(parent, -1, "Crop", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { // Set max crop size if (image) { max_width_ = image->width(); max_height_ = image->height(); } else max_width_ = max_height_ = 0; crop_rect_.set(0, 0, max_width_, max_height_); // Set dialog icon wxIcon icon; icon.CopyFromBitmap(Icons::getIcon(Icons::General, "settings")); SetIcon(icon); // Setup main sizer auto msizer = new wxBoxSizer(wxVERTICAL); SetSizer(msizer); auto sizer = new wxBoxSizer(wxVERTICAL); msizer->Add(sizer, 1, wxEXPAND | wxALL, UI::padLarge()); // Add preview canvas_preview_ = new CropCanvas(this, image, palette); sizer->Add(canvas_preview_, 1, wxEXPAND | wxBOTTOM, UI::pad()); // Add crop controls auto frame = new wxStaticBox(this, -1, "Crop Borders"); auto framesizer = new wxStaticBoxSizer(frame, wxVERTICAL); sizer->Add(framesizer, 0, wxEXPAND | wxBOTTOM, UI::padLarge()); // Absolute auto hbox = new wxBoxSizer(wxHORIZONTAL); framesizer->Add(hbox, 0, wxEXPAND | wxALL, UI::pad()); rb_absolute_ = new wxRadioButton(frame, -1, "Absolute"); rb_absolute_->SetValue(true); hbox->Add(rb_absolute_, 0, wxEXPAND | wxRIGHT, UI::pad()); // Relative rb_relative_ = new wxRadioButton(frame, -1, "Relative"); hbox->Add(rb_relative_, 0, wxEXPAND); auto gb_sizer = new wxGridBagSizer(UI::pad(), UI::pad()); framesizer->Add(gb_sizer, 1, wxEXPAND | wxALL, UI::pad()); // Left gb_sizer->Add(new wxStaticText(frame, -1, "Left:"), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); text_left_ = new NumberTextCtrl(frame); text_left_->SetWindowStyleFlag(wxTE_PROCESS_ENTER); text_left_->setNumber(0); gb_sizer->Add(text_left_, wxGBPosition(0, 1), wxDefaultSpan, wxEXPAND); // Top gb_sizer->Add(new wxStaticText(frame, -1, "Top:"), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); text_top_ = new NumberTextCtrl(frame); text_top_->SetWindowStyleFlag(wxTE_PROCESS_ENTER); text_top_->setNumber(0); gb_sizer->Add(text_top_, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND); // Right gb_sizer->Add(new wxStaticText(frame, -1, "Right:"), wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); text_right_ = new NumberTextCtrl(frame); text_right_->SetWindowStyleFlag(wxTE_PROCESS_ENTER); text_right_->setNumber(image->width()); gb_sizer->Add(text_right_, wxGBPosition(2, 1), wxDefaultSpan, wxEXPAND); // Bottom gb_sizer->Add(new wxStaticText(frame, -1, "Bottom:"), wxGBPosition(3, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); text_bottom_ = new NumberTextCtrl(frame); text_bottom_->SetWindowStyleFlag(wxTE_PROCESS_ENTER); text_bottom_->setNumber(image->height()); gb_sizer->Add(text_bottom_, wxGBPosition(3, 1), wxDefaultSpan, wxEXPAND); gb_sizer->AddGrowableCol(1); // Add buttons sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND); bindEvents(); // Setup dialog size SetInitialSize(wxSize(-1, -1)); wxTopLevelWindowBase::SetMinSize(GetSize()); CenterOnParent(); }
EffectRack::EffectRack() : wxFrame(GetActiveProject(), wxID_ANY, _("Effects Rack"), wxDefaultPosition, wxDefaultSize, wxSYSTEM_MENU | wxCLOSE_BOX | wxCAPTION | wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT) { mBypassing = false; mNumEffects = 0; mLastLatency = 0; mTimer.SetOwner(this); mPowerPushed = CreateBitmap(power_on_16x16_xpm, false, false); mPowerRaised = CreateBitmap(power_off_16x16_xpm, true, false); mSettingsPushed = CreateBitmap(settings_up_16x16_xpm, false, true); mSettingsRaised = CreateBitmap(settings_down_16x16_xpm, true, true); mUpDisabled = CreateBitmap(up_9x16_xpm, true, true); mUpPushed = CreateBitmap(up_9x16_xpm, false, true); mUpRaised = CreateBitmap(up_9x16_xpm, true, true); mDownDisabled = CreateBitmap(down_9x16_xpm, true, true); mDownPushed = CreateBitmap(down_9x16_xpm, false, true); mDownRaised = CreateBitmap(down_9x16_xpm, true, true); mFavPushed = CreateBitmap(fav_down_16x16_xpm, false, false); mFavRaised = CreateBitmap(fav_up_16x16_xpm, true, false); mRemovePushed = CreateBitmap(remove_16x16_xpm, false, true); mRemoveRaised = CreateBitmap(remove_16x16_xpm, true, true); { auto bs = std::make_unique<wxBoxSizer>(wxVERTICAL); mPanel = safenew wxPanel(this, wxID_ANY); bs->Add(mPanel, 1, wxEXPAND); SetSizer(bs.release()); } { auto bs = std::make_unique<wxBoxSizer>(wxVERTICAL); { auto hs = std::make_unique<wxBoxSizer>(wxHORIZONTAL); wxASSERT(mPanel); // To justify safenew hs->Add(safenew wxButton(mPanel, wxID_APPLY, _("&Apply")), 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); hs->AddStretchSpacer(); mLatency = safenew wxStaticText(mPanel, wxID_ANY, _("Latency: 0")); hs->Add(mLatency, 0, wxALIGN_CENTER); hs->AddStretchSpacer(); hs->Add(safenew wxToggleButton(mPanel, wxID_CLEAR, _("&Bypass")), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); bs->Add(hs.release(), 0, wxEXPAND); } bs->Add(safenew wxStaticLine(mPanel, wxID_ANY), 0, wxEXPAND); { auto uMainSizer = std::make_unique<wxFlexGridSizer>(7); uMainSizer->AddGrowableCol(6); uMainSizer->SetHGap(0); uMainSizer->SetVGap(0); bs->Add((mMainSizer = uMainSizer.release()), 1, wxEXPAND); } mPanel->SetSizer(bs.release()); } wxString oldPath = gPrefs->GetPath(); gPrefs->SetPath(wxT("/EffectsRack")); size_t cnt = gPrefs->GetNumberOfEntries(); gPrefs->SetPath(oldPath); EffectManager & em = EffectManager::Get(); for (size_t i = 0; i < cnt; i++) { wxString slot; gPrefs->Read(wxString::Format(wxT("/EffectsRack/Slot%02d"), i), &slot); Effect *effect = em.GetEffect(slot.AfterFirst(wxT(',')).c_str()); if (effect) { Add(effect, slot.BeforeFirst(wxT(',')) == wxT("1"), true); } } Fit(); }
// ----------------------------------------------------------------------------- // Sets up the things tab // ----------------------------------------------------------------------------- void MapDisplayPrefsPanel::setupThingsTab() { // Add tab auto panel = new wxPanel(stc_pages_, -1); stc_pages_->AddPage(panel, "Things"); auto sz_border = new wxBoxSizer(wxVERTICAL); panel->SetSizer(sz_border); auto gb_sizer = new wxGridBagSizer(UI::pad(), UI::pad()); sz_border->Add(gb_sizer, 1, wxEXPAND | wxALL, UI::padLarge()); int row = 0; // Thing style gb_sizer->Add(new wxStaticText(panel, -1, "Thing style: "), { row, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); choice_thing_drawtype_ = new wxChoice(panel, -1); choice_thing_drawtype_->Set( WxUtils::arrayString({ "Square", "Round", "Sprite", "Square + Sprite", "Framed Sprite" })); gb_sizer->Add(choice_thing_drawtype_, { row++, 1 }, { 1, 1 }, wxEXPAND); // When not in things mode gb_sizer->Add( new wxStaticText(panel, -1, "When not in things mode: "), { row, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); choice_things_always_ = new wxChoice(panel, -1); choice_things_always_->Set(WxUtils::arrayString({ "Hide", "Show", "Fade" })); gb_sizer->Add(choice_things_always_, { row++, 1 }, { 1, 1 }, wxEXPAND); // Shadow opacity gb_sizer->Add(new wxStaticText(panel, -1, "Thing shadow opacity: "), { row, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); slider_thing_shadow_ = new wxSlider( panel, -1, thing_shadow * 10, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS); gb_sizer->Add(slider_thing_shadow_, { row++, 1 }, { 1, 1 }, wxEXPAND); // Arrow opacity gb_sizer->Add( new wxStaticText(panel, -1, "Thing angle arrow opacity: "), { row, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); slider_thing_arrow_alpha_ = new wxSlider( panel, -1, thing_shadow * 10, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS); gb_sizer->Add(slider_thing_arrow_alpha_, { row++, 1 }, { 1, 1 }, wxEXPAND); // Halo width gb_sizer->Add(new wxStaticText(panel, -1, "Halo extra width: "), { row, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); slider_halo_width_ = new wxSlider(panel, -1, halo_width, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS); gb_sizer->Add(slider_halo_width_, { row++, 1 }, { 1, 1 }, wxEXPAND); // Always show angles cb_thing_force_dir_ = new wxCheckBox(panel, -1, "Always show thing angles"); gb_sizer->Add(cb_thing_force_dir_, { row++, 0 }, { 1, 2 }, wxEXPAND); // Colour angle arrows cb_thing_arrow_colour_ = new wxCheckBox(panel, -1, "Colour thing angle arrows"); gb_sizer->Add(cb_thing_arrow_colour_, { row++, 0 }, { 1, 2 }, wxEXPAND); // Force square hilight/selection cb_thing_overlay_square_ = new wxCheckBox(panel, -1, "Force square thing hilight/selection overlay"); gb_sizer->Add(cb_thing_overlay_square_, { row++, 0 }, { 1, 2 }, wxEXPAND); // Use zeth icons cb_use_zeth_icons_ = new wxCheckBox(panel, -1, "Use ZETH thing type icons"); gb_sizer->Add(cb_use_zeth_icons_, { row++, 0 }, { 1, 2 }, wxEXPAND); gb_sizer->AddGrowableCol(1, 1); }
// ----------------------------------------------------------------------------- // Sets up the general tab // ----------------------------------------------------------------------------- void MapDisplayPrefsPanel::setupGeneralTab() { // Add tab auto panel = new wxPanel(stc_pages_, -1); stc_pages_->AddPage(panel, "General", true); auto sz_border = new wxBoxSizer(wxVERTICAL); panel->SetSizer(sz_border); auto gb_sizer = new wxGridBagSizer(UI::pad(), UI::pad()); sz_border->Add(gb_sizer, 1, wxEXPAND | wxALL, UI::padLarge()); int row = 0; // Crosshair choice_crosshair_ = new wxChoice(panel, -1); choice_crosshair_->Set(WxUtils::arrayString({ "None", "Small", "Full" })); gb_sizer->Add(new wxStaticText(panel, -1, "Cursor Crosshair:"), { row, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(choice_crosshair_, { row++, 1 }, { 1, 2 }, wxEXPAND); // Texture filter choice_tex_filter_ = new wxChoice(panel, -1); choice_tex_filter_->Set(WxUtils::arrayString({ "None", "Linear", "Linear (Mipmapped)", "None (Mipmapped)" })); gb_sizer->Add(new wxStaticText(panel, -1, "Texture Filtering:"), { row, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(choice_tex_filter_, { row++, 1 }, { 1, 2 }, wxEXPAND); // 64 grid choice_grid_64_ = new wxChoice(panel, -1); choice_grid_64_->Set(WxUtils::arrayString({ "None", "Full", "Crosses" })); gb_sizer->Add(new wxStaticText(panel, -1, "64 Grid:"), { row, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(choice_grid_64_, { row++, 1 }, { 1, 2 }, wxEXPAND); // Dashed grid cb_grid_dashed_ = new wxCheckBox(panel, -1, "Dashed grid"); gb_sizer->Add(cb_grid_dashed_, { row++, 0 }, { 1, 2 }, wxEXPAND); // Hilight origin on grid cb_grid_show_origin_ = new wxCheckBox(panel, -1, "Hilight origin (0,0) on grid"); gb_sizer->Add(cb_grid_show_origin_, { row++, 0 }, { 1, 2 }, wxEXPAND); // Always show line direction tabs cb_line_tabs_always_ = new wxCheckBox(panel, -1, "Always show line direction tabs"); gb_sizer->Add(cb_line_tabs_always_, { row++, 0 }, { 1, 2 }, wxEXPAND); // Animate hilighted object cb_animate_hilight_ = new wxCheckBox(panel, -1, "Animated hilight"); gb_sizer->Add(cb_animate_hilight_, { row++, 0 }, { 1, 2 }, wxEXPAND); // Animate selected objects cb_animate_selection_ = new wxCheckBox(panel, -1, "Animated selection"); gb_sizer->Add(cb_animate_selection_, { row++, 0 }, { 1, 2 }, wxEXPAND); // Animate tagged objects cb_animate_tagged_ = new wxCheckBox(panel, -1, "Animated tag indicator"); gb_sizer->Add(cb_animate_tagged_, { row++, 0 }, { 1, 2 }, wxEXPAND); // Show action lines cb_action_lines_ = new wxCheckBox(panel, -1, "Show Action Lines"); cb_action_lines_->SetToolTip( "Show lines from an object with an action special to the tagged object(s) when highlighted"); gb_sizer->Add(cb_action_lines_, { row++, 0 }, { 1, 2 }, wxEXPAND); // Show help text cb_show_help_ = new wxCheckBox(panel, -1, "Show Help Text"); gb_sizer->Add(cb_show_help_, { row++, 0 }, { 1, 2 }, wxEXPAND); gb_sizer->AddGrowableCol(1, 1); }
DialogSpellChecker::DialogSpellChecker(agi::Context *context) : wxDialog(context->parent, -1, _("Spell Checker")) , context(context) , spellchecker(SpellCheckerFactory::GetSpellChecker()) { SetIcon(GETICON(spellcheck_toolbutton_16)); wxSizer *main_sizer = new wxBoxSizer(wxVERTICAL); auto current_word_sizer = new wxFlexGridSizer(2, 5, 5); main_sizer->Add(current_word_sizer, wxSizerFlags().Expand().Border(wxALL, 5)); wxSizer *bottom_sizer = new wxBoxSizer(wxHORIZONTAL); main_sizer->Add(bottom_sizer, wxSizerFlags().Expand().Border(~wxTOP & wxALL, 5)); wxSizer *bottom_left_sizer = new wxBoxSizer(wxVERTICAL); bottom_sizer->Add(bottom_left_sizer, wxSizerFlags().Expand().Border(wxRIGHT, 5)); wxSizer *actions_sizer = new wxBoxSizer(wxVERTICAL); bottom_sizer->Add(actions_sizer, wxSizerFlags().Expand()); // Misspelled word and currently selected correction current_word_sizer->AddGrowableCol(1, 1); current_word_sizer->Add(new wxStaticText(this, -1, _("Misspelled word:")), 0, wxALIGN_CENTER_VERTICAL); current_word_sizer->Add(orig_word = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_READONLY), wxSizerFlags(1).Expand()); current_word_sizer->Add(new wxStaticText(this, -1, _("Replace with:")), 0, wxALIGN_CENTER_VERTICAL); current_word_sizer->Add(replace_word = new wxTextCtrl(this, -1, ""), wxSizerFlags(1).Expand()); replace_word->Bind(wxEVT_TEXT, [=](wxCommandEvent&) { remove_button->Enable(spellchecker->CanRemoveWord(from_wx(replace_word->GetValue()))); }); // List of suggested corrections suggest_list = new wxListBox(this, -1, wxDefaultPosition, wxSize(300, 150)); suggest_list->Bind(wxEVT_LISTBOX, &DialogSpellChecker::OnChangeSuggestion, this); suggest_list->Bind(wxEVT_LISTBOX_DCLICK, &DialogSpellChecker::OnReplace, this); bottom_left_sizer->Add(suggest_list, wxSizerFlags(1).Expand()); // List of supported spellchecker languages { if (!spellchecker.get()) { wxMessageBox("No spellchecker available.", "Error", wxOK | wxICON_ERROR | wxCENTER); throw agi::UserCancelException("No spellchecker available"); } dictionary_lang_codes = to_wx(spellchecker->GetLanguageList()); if (dictionary_lang_codes.empty()) { wxMessageBox("No spellchecker dictionaries available.", "Error", wxOK | wxICON_ERROR | wxCENTER); throw agi::UserCancelException("No spellchecker dictionaries available"); } wxArrayString language_names(dictionary_lang_codes); for (size_t i = 0; i < dictionary_lang_codes.size(); ++i) { if (const wxLanguageInfo *info = wxLocale::FindLanguageInfo(dictionary_lang_codes[i])) language_names[i] = info->Description; } language = new wxComboBox(this, -1, "", wxDefaultPosition, wxDefaultSize, language_names, wxCB_DROPDOWN | wxCB_READONLY); wxString cur_lang = to_wx(OPT_GET("Tool/Spell Checker/Language")->GetString()); int cur_lang_index = dictionary_lang_codes.Index(cur_lang); if (cur_lang_index == wxNOT_FOUND) cur_lang_index = dictionary_lang_codes.Index("en"); if (cur_lang_index == wxNOT_FOUND) cur_lang_index = dictionary_lang_codes.Index("en_US"); if (cur_lang_index == wxNOT_FOUND) cur_lang_index = 0; language->SetSelection(cur_lang_index); language->Bind(wxEVT_COMBOBOX, &DialogSpellChecker::OnChangeLanguage, this); bottom_left_sizer->Add(language, wxSizerFlags().Expand().Border(wxTOP, 5)); } { wxSizerFlags button_flags = wxSizerFlags().Expand().Bottom().Border(wxBOTTOM, 5); auto make_checkbox = [&](wxString const& text, const char *opt) { auto checkbox = new wxCheckBox(this, -1, text); actions_sizer->Add(checkbox, button_flags); checkbox->SetValue(OPT_GET(opt)->GetBool()); checkbox->Bind(wxEVT_CHECKBOX, [=](wxCommandEvent &evt) { OPT_SET(opt)->SetBool(!!evt.GetInt()); }); }; make_checkbox(_("&Skip Comments"), "Tool/Spell Checker/Skip Comments"); make_checkbox(_("Ignore &UPPERCASE words"), "Tool/Spell Checker/Skip Uppercase"); wxButton *button; actions_sizer->Add(button = new wxButton(this, -1, _("&Replace")), button_flags); button->Bind(wxEVT_BUTTON, &DialogSpellChecker::OnReplace, this); actions_sizer->Add(button = new wxButton(this, -1, _("Replace &all")), button_flags); button->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { auto_replace[from_wx(orig_word->GetValue())] = from_wx(replace_word->GetValue()); Replace(); FindNext(); }); actions_sizer->Add(button = new wxButton(this, -1, _("&Ignore")), button_flags); button->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { FindNext(); }); actions_sizer->Add(button = new wxButton(this, -1, _("Ignore a&ll")), button_flags); button->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { auto_ignore.insert(from_wx(orig_word->GetValue())); FindNext(); }); actions_sizer->Add(add_button = new wxButton(this, -1, _("Add to &dictionary")), button_flags); add_button->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { spellchecker->AddWord(from_wx(orig_word->GetValue())); FindNext(); }); actions_sizer->Add(remove_button = new wxButton(this, -1, _("Remove fro&m dictionary")), button_flags); remove_button->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { spellchecker->RemoveWord(from_wx(replace_word->GetValue())); SetWord(from_wx(orig_word->GetValue())); }); actions_sizer->Add(new HelpButton(this, "Spell Checker"), button_flags); actions_sizer->Add(new wxButton(this, wxID_CANCEL), button_flags.Border(0)); } SetSizerAndFit(main_sizer); CenterOnParent(); if (FindNext()) Show(); }
// ----------------------------------------------------------------------------- // Creates and sets up the general properties panel // ----------------------------------------------------------------------------- wxPanel* SectorPropsPanel::setupGeneralPanel() { // Create panel auto panel = new wxPanel(stc_tabs_); // Setup sizer auto sizer = new wxBoxSizer(wxVERTICAL); panel->SetSizer(sizer); // --- Floor --- auto m_hbox = new wxBoxSizer(wxHORIZONTAL); sizer->Add(m_hbox, 0, wxEXPAND | wxALL, UI::pad()); auto frame = new wxStaticBox(panel, -1, "Floor"); auto framesizer = new wxStaticBoxSizer(frame, wxVERTICAL); m_hbox->Add(framesizer, 1, wxALIGN_CENTER | wxRIGHT, UI::pad()); // Texture auto gb_sizer = new wxGridBagSizer(UI::pad(), UI::pad()); framesizer->Add(gb_sizer, 1, wxEXPAND | wxALL, UI::pad()); gb_sizer->Add(gfx_floor_ = new FlatTexCanvas(panel), { 0, 0 }, { 1, 2 }, wxALIGN_CENTER); gb_sizer->Add(new wxStaticText(panel, -1, "Texture:"), { 1, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(fcb_floor_ = new FlatComboBox(panel), { 1, 1 }, { 1, 1 }, wxEXPAND); // Height gb_sizer->Add(new wxStaticText(panel, -1, "Height:"), { 2, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(text_height_floor_ = new NumberTextCtrl(panel), { 2, 1 }, { 1, 1 }, wxEXPAND); gb_sizer->AddGrowableCol(1, 1); // --- Ceiling --- frame = new wxStaticBox(panel, -1, "Ceiling"); framesizer = new wxStaticBoxSizer(frame, wxVERTICAL); m_hbox->Add(framesizer, 1, wxALIGN_CENTER); // Texture gb_sizer = new wxGridBagSizer(UI::pad(), UI::pad()); framesizer->Add(gb_sizer, 1, wxEXPAND | wxALL, UI::pad()); gb_sizer->Add(gfx_ceiling_ = new FlatTexCanvas(panel), { 0, 0 }, { 1, 2 }, wxALIGN_CENTER); gb_sizer->Add(new wxStaticText(panel, -1, "Texture:"), { 1, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(fcb_ceiling_ = new FlatComboBox(panel), { 1, 1 }, { 1, 1 }, wxEXPAND); // Height gb_sizer->Add(new wxStaticText(panel, -1, "Height:"), { 2, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(text_height_ceiling_ = new NumberTextCtrl(panel), { 2, 1 }, { 1, 1 }, wxEXPAND); gb_sizer->AddGrowableCol(1, 1); // -- General --- frame = new wxStaticBox(panel, -1, "General"); framesizer = new wxStaticBoxSizer(frame, wxVERTICAL); sizer->Add(framesizer, 0, wxEXPAND | wxALL, UI::pad()); gb_sizer = new wxGridBagSizer(UI::pad(), UI::pad()); framesizer->Add(gb_sizer, 1, wxEXPAND | wxALL, UI::pad()); // Light level gb_sizer->Add(new wxStaticText(panel, -1, "Light Level:"), { 0, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(text_light_ = new NumberTextCtrl(panel), { 0, 1 }, { 1, 2 }, wxEXPAND); // Tag gb_sizer->Add(new wxStaticText(panel, -1, "Tag:"), { 1, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(text_tag_ = new NumberTextCtrl(panel), { 1, 1 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(btn_new_tag_ = new wxButton(panel, -1, "New Tag"), { 1, 2 }, { 1, 1 }, wxEXPAND); gb_sizer->AddGrowableCol(1, 1); return panel; }
// ----------------------------------------------------------------------------- // Sets up the dialog UI layout // ----------------------------------------------------------------------------- void GfxConvDialog::setupLayout() { int px_inner = UI::pad(); int px_outer = UI::padLarge(); int px_pad = UI::px(UI::Size::PadMinimum); int px_preview_size = UI::scalePx(192); auto msizer = new wxBoxSizer(wxVERTICAL); SetSizer(msizer); auto m_vbox = new wxBoxSizer(wxVERTICAL); msizer->Add(m_vbox, 1, wxEXPAND | wxALL, px_outer); // Add current format label label_current_format_ = new wxStaticText(this, -1, "Current Format:"); m_vbox->Add(label_current_format_, 0, wxALIGN_CENTER_VERTICAL | wxBOTTOM, px_inner); // Add 'Convert To' combo box auto hbox = new wxBoxSizer(wxHORIZONTAL); m_vbox->Add(hbox, 0, wxEXPAND | wxBOTTOM, px_outer); hbox->Add(new wxStaticText(this, -1, "Convert to:"), 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, px_pad); combo_target_format_ = new wxChoice(this, -1); hbox->Add(combo_target_format_, 1, wxEXPAND); // Add Gfx previews auto frame = new wxStaticBox(this, -1, "Colour Options"); auto framesizer = new wxStaticBoxSizer(frame, wxHORIZONTAL); m_vbox->Add(framesizer, 1, wxEXPAND | wxBOTTOM, px_outer); auto gbsizer = new wxGridBagSizer(px_inner, px_inner); framesizer->Add(gbsizer, 1, wxEXPAND | wxALL, px_inner); // Current gbsizer->Add(new wxStaticText(this, -1, "Current Graphic"), { 0, 0 }, { 1, 1 }); gfx_current_ = new GfxCanvas(this, -1); gfx_current_->SetInitialSize(wxSize(px_preview_size, px_preview_size)); gfx_current_->setViewType(GfxCanvas::View::Centered); gbsizer->Add(gfx_current_, { 1, 0 }, { 1, 1 }, wxEXPAND); pal_chooser_current_ = new PaletteChooser(this, -1); pal_chooser_current_->selectPalette(current_palette_name_); gbsizer->Add(pal_chooser_current_, { 2, 0 }, { 1, 1 }, wxEXPAND); // Converted gbsizer->Add(new wxStaticText(this, -1, "Converted Graphic"), { 0, 1 }, { 1, 2 }); gfx_target_ = new GfxCanvas(this, -1); gfx_target_->SetInitialSize(wxSize(px_preview_size, px_preview_size)); gfx_target_->setViewType(GfxCanvas::View::Centered); gbsizer->Add(gfx_target_, { 1, 1 }, { 1, 2 }, wxEXPAND); pal_chooser_target_ = new PaletteChooser(this, -1); pal_chooser_target_->selectPalette(target_palette_name_); gbsizer->Add(pal_chooser_target_, { 2, 1 }, { 1, 1 }, wxEXPAND); btn_colorimetry_settings_ = new wxBitmapButton(this, -1, Icons::getIcon(Icons::General, "settings"), wxDefaultPosition, wxDefaultSize); btn_colorimetry_settings_->SetToolTip("Adjust Colorimetry Settings..."); gbsizer->Add(btn_colorimetry_settings_, { 2, 2 }, { 1, 1 }, wxALIGN_CENTER); gbsizer->AddGrowableCol(0, 1); gbsizer->AddGrowableCol(1, 1); gbsizer->AddGrowableRow(1, 1); // Add transparency options frame = new wxStaticBox(this, -1, "Transparency Options"); framesizer = new wxStaticBoxSizer(frame, wxVERTICAL); m_vbox->Add(framesizer, 0, wxEXPAND | wxBOTTOM, px_outer); gbsizer = new wxGridBagSizer(px_inner, px_inner); framesizer->Add(gbsizer, 1, wxEXPAND | wxALL, px_inner); // 'Enable transparency' checkbox cb_enable_transparency_ = new wxCheckBox(this, -1, "Enable Transparency"); cb_enable_transparency_->SetValue(true); cb_enable_transparency_->SetToolTip("Uncheck this to remove any existing transparency from the graphic"); gbsizer->Add(cb_enable_transparency_, { 0, 0 }, { 1, 2 }); // Keep existing transparency rb_transparency_existing_ = new wxRadioButton(this, 100, "Existing w/Threshold:", wxDefaultPosition, wxDefaultSize, wxRB_GROUP); rb_transparency_existing_->SetValue(true); gbsizer->Add(rb_transparency_existing_, { 1, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); // Alpha threshold slider_alpha_threshold_ = new wxSlider( this, -1, 0, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS | wxSL_BOTTOM); slider_alpha_threshold_->SetToolTip( "Specifies the 'cutoff' transparency level, anything above this will be fully opaque, " "anything equal or below will be completely transparent"); gbsizer->Add(slider_alpha_threshold_, { 1, 1 }, { 1, 1 }, wxEXPAND); // Transparent colour rb_transparency_colour_ = new wxRadioButton(this, 101, "Transparent Colour:", wxDefaultPosition, wxDefaultSize, 0); rb_transparency_colour_->SetValue(false); gbsizer->Add(rb_transparency_colour_, { 2, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); colbox_transparent_ = new ColourBox(this, -1, false); colbox_transparent_->setColour(ColRGBA(0, 255, 255, 255)); gbsizer->Add(colbox_transparent_, { 2, 1 }, { 1, 1 }); // From brightness rb_transparency_brightness_ = new wxRadioButton(this, 102, "Transparency from Brightness"); rb_transparency_brightness_->SetValue(false); gbsizer->Add(rb_transparency_brightness_, { 3, 0 }, { 1, 2 }); gbsizer->AddGrowableCol(1, 1); // Buttons hbox = new wxBoxSizer(wxHORIZONTAL); m_vbox->Add(hbox, 0, wxEXPAND); btn_convert_ = new wxButton(this, -1, "Convert"); btn_convert_all_ = new wxButton(this, -1, "Convert All"); btn_skip_ = new wxButton(this, -1, "Skip"); btn_skip_all_ = new wxButton(this, -1, "Skip All"); hbox->AddStretchSpacer(1); hbox->Add(btn_convert_, 0, wxEXPAND | wxRIGHT, px_inner); hbox->Add(btn_convert_all_, 0, wxEXPAND | wxRIGHT, px_inner); hbox->Add(btn_skip_, 0, wxEXPAND | wxRIGHT, px_inner); hbox->Add(btn_skip_all_, 0, wxEXPAND); // Bind events Bind(wxEVT_SIZE, &GfxConvDialog::onResize, this); btn_convert_->Bind(wxEVT_BUTTON, &GfxConvDialog::onBtnConvert, this); btn_convert_all_->Bind(wxEVT_BUTTON, &GfxConvDialog::onBtnConvertAll, this); btn_skip_->Bind(wxEVT_BUTTON, &GfxConvDialog::onBtnSkip, this); btn_skip_all_->Bind(wxEVT_BUTTON, &GfxConvDialog::onBtnSkipAll, this); combo_target_format_->Bind(wxEVT_CHOICE, &GfxConvDialog::onTargetFormatChanged, this); pal_chooser_current_->Bind(wxEVT_CHOICE, &GfxConvDialog::onCurrentPaletteChanged, this); pal_chooser_target_->Bind(wxEVT_CHOICE, &GfxConvDialog::onTargetPaletteChanged, this); slider_alpha_threshold_->Bind(wxEVT_SLIDER, &GfxConvDialog::onAlphaThresholdChanged, this); cb_enable_transparency_->Bind(wxEVT_CHECKBOX, &GfxConvDialog::onEnableTransparencyChanged, this); rb_transparency_colour_->Bind(wxEVT_RADIOBUTTON, &GfxConvDialog::onTransTypeChanged, this); rb_transparency_existing_->Bind(wxEVT_RADIOBUTTON, &GfxConvDialog::onTransTypeChanged, this); rb_transparency_brightness_->Bind(wxEVT_RADIOBUTTON, &GfxConvDialog::onTransTypeChanged, this); Bind(wxEVT_COLOURBOX_CHANGED, &GfxConvDialog::onTransColourChanged, this, colbox_transparent_->GetId()); gfx_current_->Bind(wxEVT_LEFT_DOWN, &GfxConvDialog::onPreviewCurrentMouseDown, this); btn_colorimetry_settings_->Bind(wxEVT_BUTTON, &GfxConvDialog::onBtnColorimetrySettings, this); // Autosize to fit contents (and set this as the minimum size) SetMinClientSize(msizer->GetMinSize()); }
DialogProperties::DialogProperties(agi::Context *c) : wxDialog(c->parent, -1, _("Script Properties")) , c(c) { SetIcon(GETICON(properties_toolbutton_16)); // Script details crap wxSizer *TopSizer = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Script")); auto TopSizerGrid = new wxFlexGridSizer(0,2,5,5); AddProperty(TopSizerGrid, _("Title:"), "Title"); AddProperty(TopSizerGrid, _("Original script:"), "Original Script"); AddProperty(TopSizerGrid, _("Translation:"), "Original Translation"); AddProperty(TopSizerGrid, _("Editing:"), "Original Editing"); AddProperty(TopSizerGrid, _("Timing:"), "Original Timing"); AddProperty(TopSizerGrid, _("Synch point:"), "Synch Point"); AddProperty(TopSizerGrid, _("Updated by:"), "Script Updated By"); AddProperty(TopSizerGrid, _("Update details:"), "Update Details"); TopSizerGrid->AddGrowableCol(1,1); TopSizer->Add(TopSizerGrid,1,wxALL | wxEXPAND,0); // Resolution box wxSizer *ResSizer = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Resolution")); ResX = new wxTextCtrl(this,-1,"",wxDefaultPosition,wxSize(50,20),0,IntValidator(c->ass->GetScriptInfoAsInt("PlayResX"))); ResY = new wxTextCtrl(this,-1,"",wxDefaultPosition,wxSize(50,20),0,IntValidator(c->ass->GetScriptInfoAsInt("PlayResY"))); wxStaticText *ResText = new wxStaticText(this,-1,"x"); wxButton *FromVideo = new wxButton(this,-1,_("From &video")); if (!c->videoController->IsLoaded()) FromVideo->Enable(false); else FromVideo->Bind(wxEVT_BUTTON, &DialogProperties::OnSetFromVideo, this); ResSizer->Add(ResX,1,wxRIGHT | wxALIGN_CENTER_VERTICAL,5); ResSizer->Add(ResText,0,wxALIGN_CENTER | wxRIGHT,5); ResSizer->Add(ResY,1,wxRIGHT | wxALIGN_CENTER_VERTICAL,5); ResSizer->Add(FromVideo,1,0,0); // Options wxSizer *optionsBox = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Options")); auto optionsGrid = new wxFlexGridSizer(3,2,5,5); wxString wrap_opts[] = { _("0: Smart wrapping, top line is wider"), _("1: End-of-line word wrapping, only \\N breaks"), _("2: No word wrapping, both \\n and \\N break"), _("3: Smart wrapping, bottom line is wider") }; WrapStyle = new wxComboBox(this, -1, "", wxDefaultPosition, wxDefaultSize, 4, wrap_opts, wxCB_READONLY); WrapStyle->SetSelection(c->ass->GetScriptInfoAsInt("WrapStyle")); optionsGrid->Add(new wxStaticText(this,-1,_("Wrap Style: ")),0,wxALIGN_CENTER_VERTICAL,0); optionsGrid->Add(WrapStyle,1,wxEXPAND,0); ScaleBorder = new wxCheckBox(this,-1,_("Scale Border and Shadow")); ScaleBorder->SetToolTip(_("Scale border and shadow together with script/render resolution. If this is unchecked, relative border and shadow size will depend on renderer.")); ScaleBorder->SetValue(boost::iequals(c->ass->GetScriptInfo("ScaledBorderAndShadow"), "yes")); optionsGrid->AddSpacer(0); optionsGrid->Add(ScaleBorder,1,wxEXPAND,0); optionsGrid->AddGrowableCol(1,1); optionsBox->Add(optionsGrid,1,wxEXPAND,0); // Button sizer wxStdDialogButtonSizer *ButtonSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP); Bind(wxEVT_BUTTON, &DialogProperties::OnOK, this, wxID_OK); Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Properties"), wxID_HELP); // MainSizer wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL); MainSizer->Add(TopSizer,0,wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND,5); MainSizer->Add(ResSizer,0,wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND,5); MainSizer->Add(optionsBox,0,wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND,5); MainSizer->Add(ButtonSizer,0,wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND,5); SetSizerAndFit(MainSizer); CenterOnParent(); }
// ----------------------------------------------------------------------------- // TextEditorPrefsPanel class constructor // ----------------------------------------------------------------------------- TextEditorPrefsPanel::TextEditorPrefsPanel(wxWindow* parent) : PrefsPanelBase(parent) { // Create main sizer auto sizer = new wxBoxSizer(wxVERTICAL); SetSizer(sizer); auto gb_sizer = new wxGridBagSizer(UI::pad(), UI::padLarge()); auto row = 0; sizer->Add(gb_sizer, 0, wxEXPAND); // --- Whitespace/indentation --- // Tab width spin_tab_width_ = new wxSpinCtrl( this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS | wxTE_PROCESS_ENTER, 1, 100, txed_tab_width); gb_sizer->Add(new wxStaticText(this, -1, "Indentation Width: "), { row, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(spin_tab_width_, { row, 1 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); // Tabs as spaces cb_tab_spaces_ = new wxCheckBox(this, -1, "Indent With Spaces"); gb_sizer->Add(cb_tab_spaces_, { row, 2 }, { 1, 2 }, wxEXPAND); // Auto indent cb_auto_indent_ = new wxCheckBox(this, -1, "Enable Auto-Indent"); gb_sizer->Add(cb_auto_indent_, { ++row, 0 }, { 1, 2 }, wxEXPAND); // Trim whitespace cb_trim_whitespace_ = new wxCheckBox(this, -1, "Trim Whitespace on Save"); gb_sizer->Add(cb_trim_whitespace_, { row, 2 }, { 1, 2 }, wxEXPAND); // Separator gb_sizer->Add( new wxStaticLine(this, -1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL), { ++row, 0 }, { 1, 4 }, wxEXPAND | wxTOP | wxBOTTOM, 8); // --- Display --- // Right margin spin_right_margin_ = new wxSpinCtrl( this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS | wxTE_PROCESS_ENTER, 0, 1000, txed_edge_column); gb_sizer->Add( new wxStaticText(this, -1, "Right Margin at Column: "), { ++row, 0 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(spin_right_margin_, { row, 1 }, { 1, 1 }, wxEXPAND); // Indentation guides cb_indent_guides_ = new wxCheckBox(this, -1, "Show Indentation Guides"); gb_sizer->Add(cb_indent_guides_, { row, 2 }, { 1, 2 }, wxEXPAND); // Syntax Hilighting cb_syntax_hilight_ = new wxCheckBox(this, -1, "Show Syntax Hilighting"); gb_sizer->Add(cb_syntax_hilight_, { ++row, 0 }, { 1, 2 }, wxEXPAND); // Hilight current line string hl_line_choices[] = { "Off", "Background", "Background+Underline" }; choice_line_hilight_ = new wxChoice(this, -1, wxDefaultPosition, wxDefaultSize, 3, hl_line_choices); gb_sizer->Add(new wxStaticText(this, -1, "Current Line Hilight: "), { row, 2 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(choice_line_hilight_, { row, 3 }, { 1, 1 }, wxEXPAND); // Brace matching cb_brace_match_ = new wxCheckBox(this, -1, "Hilight Matching Braces"); gb_sizer->Add(cb_brace_match_, { ++row, 0 }, { 1, 2 }, wxEXPAND); // Line extra spacing spin_line_spacing_ = new wxSpinCtrl( this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS | wxTE_PROCESS_ENTER, 0, 10, txed_edge_column); gb_sizer->Add(new wxStaticText(this, -1, "Extra Line Spacing: "), { row, 2 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(spin_line_spacing_, { row, 3 }, { 1, 1 }, wxEXPAND); // Word matching cb_match_cursor_word_ = new wxCheckBox(this, -1, "Hilight Matching Words"); cb_match_cursor_word_->SetToolTip( "When enabled, any words matching the word at the current cursor position or selection will be hilighted"); gb_sizer->Add(cb_match_cursor_word_, { ++row, 0 }, { 1, 2 }, wxEXPAND); // Show whitespace string show_ws_choices[] = { "Off", "After Indentation Only", "Always" }; choice_show_whitespace_ = new wxChoice(this, -1, wxDefaultPosition, wxDefaultSize, 3, show_ws_choices); gb_sizer->Add(new wxStaticText(this, -1, "Show Whitespace: "), { row, 2 }, { 1, 1 }, wxALIGN_CENTER_VERTICAL); gb_sizer->Add(choice_show_whitespace_, { row, 3 }, { 1, 1 }, wxEXPAND); // Separator gb_sizer->Add( new wxStaticLine(this, -1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL), { ++row, 0 }, { 1, 4 }, wxEXPAND | wxTOP | wxBOTTOM, 8); // --- Calltips --- // Calltips on mouse hover cb_calltips_mouse_ = new wxCheckBox(this, -1, "Show calltips on mouse hover"); gb_sizer->Add(cb_calltips_mouse_, { ++row, 0 }, { 1, 2 }, wxEXPAND); // Colourise calltips cb_calltips_colourise_ = new wxCheckBox(this, -1, "Colourise calltip text"); gb_sizer->Add(cb_calltips_colourise_, { row, 2 }, { 1, 2 }, wxEXPAND); // Calltips on parenthesis cb_calltips_parenthesis_ = new wxCheckBox(this, -1, "Show calltips on opening parenthesis"); gb_sizer->Add(cb_calltips_parenthesis_, { ++row, 0 }, { 1, 2 }, wxEXPAND); // Dim optional calltip parameters cb_calltips_dim_optional_ = new wxCheckBox(this, -1, "Dim optional function parameters"); cb_calltips_dim_optional_->SetToolTip("If disabled, optional parameters will be shown between [] brackets"); gb_sizer->Add(cb_calltips_dim_optional_, { row, 2 }, { 1, 2 }, wxEXPAND); // Use text editor font in calltips cb_calltips_use_font_ = new wxCheckBox(this, -1, "Use the text editor font in calltips"); gb_sizer->Add(cb_calltips_use_font_, { ++row, 0 }, { 1, 2 }, wxEXPAND); // Separator gb_sizer->Add( new wxStaticLine(this, -1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL), { ++row, 0 }, { 1, 4 }, wxEXPAND | wxTOP | wxBOTTOM, 8); // --- Folding --- // Enable Code Folding cb_fold_enable_ = new wxCheckBox(this, -1, "Enable Code Folding"); gb_sizer->Add(cb_fold_enable_, { ++row, 0 }, { 1, 2 }, wxEXPAND); // Fold Comments cb_fold_comments_ = new wxCheckBox(this, -1, "Fold comment blocks"); gb_sizer->Add(cb_fold_comments_, { row, 2 }, { 1, 2 }, wxEXPAND); // Fold Lines cb_fold_lines_ = new wxCheckBox(this, -1, "Show lines at contracted code folding regions"); gb_sizer->Add(cb_fold_lines_, { ++row, 0 }, { 1, 2 }, wxEXPAND); // Fold Preprcessor cb_fold_preprocessor_ = new wxCheckBox(this, -1, "Fold preprocessor regions"); cb_fold_preprocessor_->SetToolTip("Enable folding for preprocessor regions, eg. #if/#endif, #region/#endregion"); gb_sizer->Add(cb_fold_preprocessor_, { row, 2 }, { 1, 2 }, wxEXPAND); gb_sizer->AddGrowableCol(0, 1); gb_sizer->AddGrowableCol(2, 1); }