MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / DialogSelection

Method DialogSelection

src/dialog_selection.cpp:105–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105DialogSelection::DialogSelection(agi::Context *c) :
106wxDialog (c->parent, -1, _("Select"), wxDefaultPosition, wxDefaultSize, wxCAPTION)
107, con(c)
108{
109 SetIcon(GETICON(select_lines_button_16));
110
111 wxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
112
113 wxSizerFlags main_flags = wxSizerFlags().Expand().Border();
114
115 wxRadioButton *select_matching_lines = nullptr;
116 {
117 wxSizer *match_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Match"));
118 {
119 wxSizerFlags radio_flags = wxSizerFlags().Border(wxLEFT | wxRIGHT);
120 wxSizer *match_radio_line = new wxBoxSizer(wxHORIZONTAL);
121 match_radio_line->Add(select_matching_lines = new wxRadioButton(this, -1, _("&Matches"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP), radio_flags);
122 match_radio_line->Add(select_unmatching_lines = new wxRadioButton(this, -1, _("&Doesn't Match")), radio_flags);
123 match_radio_line->Add(case_sensitive = new wxCheckBox(this, -1, _("Match c&ase")), radio_flags);
124 match_sizer->Add(match_radio_line);
125 }
126 match_sizer->Add(match_text = new wxTextCtrl(this, -1, to_wx(OPT_GET("Tool/Select Lines/Text")->GetString())), main_flags);
127
128 main_sizer->Add(match_sizer, main_flags);
129 }
130
131 {
132 wxString modes[] = { _("&Exact match"), _("&Contains"), _("&Regular Expression match") };
133 main_sizer->Add(match_mode = new wxRadioBox(this, -1, _("Mode"), wxDefaultPosition, wxDefaultSize, 3, modes, 1), main_flags);
134 }
135
136 {
137 wxString fields[] = { _("&Text"), _("&Style"), _("Act&or"), _("E&ffect") };
138 main_sizer->Add(dialogue_field = new wxRadioBox(this, -1, _("In Field"), wxDefaultPosition, wxDefaultSize, 4, fields), main_flags);
139 }
140
141 {
142 wxSizer *comment_sizer = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Match dialogues/comments"));
143 comment_sizer->Add(apply_to_dialogue = new wxCheckBox(this, -1, _("D&ialogues")), wxSizerFlags().Border());
144 comment_sizer->Add(apply_to_comments = new wxCheckBox(this, -1, _("Comme&nts")), wxSizerFlags().Border());
145 main_sizer->Add(comment_sizer, main_flags);
146 }
147
148 {
149 wxString actions[] = { _("Set se&lection"), _("&Add to selection"), _("S&ubtract from selection"), _("Intersect &with selection") };
150 main_sizer->Add(selection_change_type = new wxRadioBox(this, -1, _("Action"), wxDefaultPosition, wxDefaultSize, 4, actions, 1), main_flags);
151 }
152
153 main_sizer->Add(CreateButtonSizer(wxOK | wxCANCEL | wxAPPLY | wxHELP), main_flags);
154
155 SetSizerAndFit(main_sizer);
156 CenterOnParent();
157
158 dialogue_field->SetSelection(OPT_GET("Tool/Select Lines/Field")->GetInt());
159 selection_change_type->SetSelection(OPT_GET("Tool/Select Lines/Action")->GetInt());
160 case_sensitive->SetValue(OPT_GET("Tool/Select Lines/Match/Case")->GetBool());
161 apply_to_dialogue->SetValue(OPT_GET("Tool/Select Lines/Match/Dialogue")->GetBool());
162 apply_to_comments->SetValue(OPT_GET("Tool/Select Lines/Match/Comment")->GetBool());

Callers

nothing calls this directly

Calls 6

BindMethod · 0.80
to_wxFunction · 0.70
AddMethod · 0.45
SetSelectionMethod · 0.45
SetValueMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected