Use the new much shorter event names

This commit is contained in:
Thomas Goyne 2013-12-11 18:25:13 -08:00
parent 7c68c81ea3
commit 038eb6e58b
41 changed files with 224 additions and 224 deletions

View File

@ -74,11 +74,11 @@ AudioKaraoke::AudioKaraoke(wxWindow *parent, agi::Context *c)
cancel_button = new wxBitmapButton(this, -1, GETIMAGE(kara_split_cancel_16));
cancel_button->SetToolTip(_("Discard all uncommitted splits"));
cancel_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&AudioKaraoke::CancelSplit, this));
cancel_button->Bind(wxEVT_BUTTON, bind(&AudioKaraoke::CancelSplit, this));
accept_button = new wxBitmapButton(this, -1, GETIMAGE(kara_split_accept_16));
accept_button->SetToolTip(_("Commit splits"));
accept_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&AudioKaraoke::AcceptSplit, this));
accept_button->Bind(wxEVT_BUTTON, bind(&AudioKaraoke::AcceptSplit, this));
split_area = new wxPanel(this);
@ -234,7 +234,7 @@ void AudioKaraoke::RenderText() {
void AudioKaraoke::AddMenuItem(wxMenu &menu, std::string const& tag, wxString const& help, std::string const& selected) {
wxMenuItem *item = menu.AppendCheckItem(-1, to_wx(tag), help);
menu.Bind(wxEVT_COMMAND_MENU_SELECTED, std::bind(&AudioKaraoke::SetTagType, this, tag), item->GetId());
menu.Bind(wxEVT_MENU, std::bind(&AudioKaraoke::SetTagType, this, tag), item->GetId());
item->Check(tag == selected);
}

View File

@ -498,7 +498,7 @@ namespace Automation4 {
auto make_button = [&](wxWindowID id, int button_pushed, wxString const& text) -> wxButton *{
auto button = new wxButton(window, id, text);
button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent &evt) {
button->Bind(wxEVT_BUTTON, [=](wxCommandEvent &evt) {
this->button_pushed = button_pushed;
dialog->TransferDataFromWindow();
dialog->EndModal(0);

View File

@ -31,7 +31,7 @@ ColourButton::ColourButton(wxWindow *parent, wxSize const& size, bool alpha, agi
, colour(std::move(col))
{
UpdateBitmap();
Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) {
Bind(wxEVT_BUTTON, [=](wxCommandEvent&) {
GetColorFromUser(GetParent(), colour, alpha, [=](agi::Color new_color) {
colour = new_color;
UpdateBitmap();

View File

@ -82,14 +82,14 @@ DialogAttachments::DialogAttachments(wxWindow *parent, AssFile *ass)
SetSizerAndFit(mainSizer);
CenterOnParent();
attachFont->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAttachments::OnAttachFont, this);
attachGraphics->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAttachments::OnAttachGraphics, this);
extractButton->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAttachments::OnExtract, this);
deleteButton->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAttachments::OnDelete, this);
attachFont->Bind(wxEVT_BUTTON, &DialogAttachments::OnAttachFont, this);
attachGraphics->Bind(wxEVT_BUTTON, &DialogAttachments::OnAttachGraphics, this);
extractButton->Bind(wxEVT_BUTTON, &DialogAttachments::OnExtract, this);
deleteButton->Bind(wxEVT_BUTTON, &DialogAttachments::OnDelete, this);
listView->Bind(wxEVT_COMMAND_LIST_ITEM_SELECTED, &DialogAttachments::OnListClick, this);
listView->Bind(wxEVT_COMMAND_LIST_ITEM_DESELECTED, &DialogAttachments::OnListClick, this);
listView->Bind(wxEVT_COMMAND_LIST_ITEM_FOCUSED, &DialogAttachments::OnListClick, this);
listView->Bind(wxEVT_LIST_ITEM_SELECTED, &DialogAttachments::OnListClick, this);
listView->Bind(wxEVT_LIST_ITEM_DESELECTED, &DialogAttachments::OnListClick, this);
listView->Bind(wxEVT_LIST_ITEM_FOCUSED, &DialogAttachments::OnListClick, this);
}
void DialogAttachments::UpdateList() {

View File

@ -77,13 +77,13 @@ DialogAutomation::DialogAutomation(agi::Context *c)
wxButton *reload_autoload_button = new wxButton(this, -1, _("Re&scan Autoload Dir"));
wxButton *close_button = new wxButton(this, wxID_CANCEL, _("&Close"));
list->Bind(wxEVT_COMMAND_LIST_ITEM_SELECTED, std::bind(&DialogAutomation::UpdateDisplay, this));
list->Bind(wxEVT_COMMAND_LIST_ITEM_DESELECTED, std::bind(&DialogAutomation::UpdateDisplay, this));
add_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAutomation::OnAdd, this);
remove_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAutomation::OnRemove, this);
reload_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAutomation::OnReload, this);
info_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAutomation::OnInfo, this);
reload_autoload_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogAutomation::OnReloadAutoload, this);
list->Bind(wxEVT_LIST_ITEM_SELECTED, std::bind(&DialogAutomation::UpdateDisplay, this));
list->Bind(wxEVT_LIST_ITEM_DESELECTED, std::bind(&DialogAutomation::UpdateDisplay, this));
add_button->Bind(wxEVT_BUTTON, &DialogAutomation::OnAdd, this);
remove_button->Bind(wxEVT_BUTTON, &DialogAutomation::OnRemove, this);
reload_button->Bind(wxEVT_BUTTON, &DialogAutomation::OnReload, this);
info_button->Bind(wxEVT_BUTTON, &DialogAutomation::OnInfo, this);
reload_autoload_button->Bind(wxEVT_BUTTON, &DialogAutomation::OnReloadAutoload, this);
// add headers to list view
list->InsertColumn(0, "", wxLIST_FORMAT_CENTER, 20);

View File

@ -42,12 +42,12 @@ DialogAutosave::DialogAutosave(wxWindow *parent)
wxSizer *files_box = new wxStaticBoxSizer(wxVERTICAL, this, _("Files"));
file_list = new wxListBox(this, -1);
file_list->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, &DialogAutosave::OnSelectFile, this);
file_list->Bind(wxEVT_LISTBOX, &DialogAutosave::OnSelectFile, this);
files_box->Add(file_list, wxSizerFlags(1).Expand().Border());
wxSizer *versions_box = new wxStaticBoxSizer(wxVERTICAL, this, _("Versions"));
version_list = new wxListBox(this, -1);
version_list->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, [=](wxCommandEvent&) { EndModal(wxID_OK); });
version_list->Bind(wxEVT_LISTBOX_DCLICK, [=](wxCommandEvent&) { EndModal(wxID_OK); });
versions_box->Add(version_list, wxSizerFlags(1).Expand().Border());
wxSizer *boxes_sizer = new wxBoxSizer(wxHORIZONTAL);

View File

@ -677,17 +677,17 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, agi::Color initial_color,
using std::bind;
for (int i = 0; i < 3; ++i) {
rgb_input[i]->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, bind(&DialogColorPicker::UpdateFromRGB, this, true));
rgb_input[i]->Bind(wxEVT_COMMAND_TEXT_UPDATED, bind(&DialogColorPicker::UpdateFromRGB, this, true));
hsl_input[i]->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, bind(&DialogColorPicker::UpdateFromHSL, this, true));
hsl_input[i]->Bind(wxEVT_COMMAND_TEXT_UPDATED, bind(&DialogColorPicker::UpdateFromHSL, this, true));
hsv_input[i]->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, bind(&DialogColorPicker::UpdateFromHSV, this, true));
hsv_input[i]->Bind(wxEVT_COMMAND_TEXT_UPDATED, bind(&DialogColorPicker::UpdateFromHSV, this, true));
rgb_input[i]->Bind(wxEVT_SPINCTRL, bind(&DialogColorPicker::UpdateFromRGB, this, true));
rgb_input[i]->Bind(wxEVT_TEXT, bind(&DialogColorPicker::UpdateFromRGB, this, true));
hsl_input[i]->Bind(wxEVT_SPINCTRL, bind(&DialogColorPicker::UpdateFromHSL, this, true));
hsl_input[i]->Bind(wxEVT_TEXT, bind(&DialogColorPicker::UpdateFromHSL, this, true));
hsv_input[i]->Bind(wxEVT_SPINCTRL, bind(&DialogColorPicker::UpdateFromHSV, this, true));
hsv_input[i]->Bind(wxEVT_TEXT, bind(&DialogColorPicker::UpdateFromHSV, this, true));
}
ass_input->Bind(wxEVT_COMMAND_TEXT_UPDATED, bind(&DialogColorPicker::UpdateFromAss, this));
html_input->Bind(wxEVT_COMMAND_TEXT_UPDATED, bind(&DialogColorPicker::UpdateFromHTML, this));
alpha_input->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, bind(&DialogColorPicker::UpdateFromAlpha, this));
alpha_input->Bind(wxEVT_COMMAND_TEXT_UPDATED, bind(&DialogColorPicker::UpdateFromAlpha, this));
ass_input->Bind(wxEVT_TEXT, bind(&DialogColorPicker::UpdateFromAss, this));
html_input->Bind(wxEVT_TEXT, bind(&DialogColorPicker::UpdateFromHTML, this));
alpha_input->Bind(wxEVT_SPINCTRL, bind(&DialogColorPicker::UpdateFromAlpha, this));
alpha_input->Bind(wxEVT_TEXT, bind(&DialogColorPicker::UpdateFromAlpha, this));
screen_dropper_icon->Bind(wxEVT_MOTION, &DialogColorPicker::OnDropperMouse, this);
screen_dropper_icon->Bind(wxEVT_LEFT_DOWN, &DialogColorPicker::OnDropperMouse, this);
@ -703,9 +703,9 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, agi::Color initial_color,
recent_box->Bind(EVT_RECENT_SELECT, &DialogColorPicker::OnRecentSelect, this);
screen_dropper->Bind(EVT_DROPPER_SELECT, &DialogColorPicker::OnRecentSelect, this);
colorspace_choice->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &DialogColorPicker::OnChangeMode, this);
colorspace_choice->Bind(wxEVT_CHOICE, &DialogColorPicker::OnChangeMode, this);
button_sizer->GetHelpButton()->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&HelpButton::OpenPage, "Colour Picker"));
button_sizer->GetHelpButton()->Bind(wxEVT_BUTTON, bind(&HelpButton::OpenPage, "Colour Picker"));
}
template<int N, class Control>

View File

@ -116,7 +116,7 @@ DialogDummyVideo::DialogDummyVideo(wxWindow *parent)
AddCtrl("", length_display = new wxStaticText(this, -1, ""));
wxStdDialogButtonSizer *btn_sizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP);
btn_sizer->GetHelpButton()->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Dummy Video"));
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());
@ -128,9 +128,9 @@ DialogDummyVideo::DialogDummyVideo(wxWindow *parent)
SetSizerAndFit(main_sizer);
CenterOnParent();
Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &DialogDummyVideo::OnResolutionShortcut, this);
Bind(wxEVT_COMBOBOX, &DialogDummyVideo::OnResolutionShortcut, this);
color_btn->Bind(EVT_COLOR, [=](wxThreadEvent& e) { color = color_btn->GetColor(); });
Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, [=](wxCommandEvent&) {
Bind(wxEVT_SPINCTRL, [=](wxCommandEvent&) {
TransferDataFromWindow();
UpdateLengthDisplay();
});

View File

@ -85,8 +85,8 @@ DialogExport::DialogExport(agi::Context *c)
std::vector<std::string> filters = exporter->GetAllFilterNames();
filter_list = new wxCheckListBox(this, -1, wxDefaultPosition, wxSize(200, 100), to_wx(filters));
filter_list->Bind(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, [=](wxCommandEvent&) { RefreshOptions(); });
filter_list->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, &DialogExport::OnChange, this);
filter_list->Bind(wxEVT_CHECKLISTBOX, [=](wxCommandEvent&) { RefreshOptions(); });
filter_list->Bind(wxEVT_LISTBOX, &DialogExport::OnChange, this);
// Get selected filters
std::string selected = c->ass->GetScriptInfo("Export filters");
@ -102,10 +102,10 @@ DialogExport::DialogExport(agi::Context *c)
wxButton *btn_all = new wxButton(this, -1, _("Select &All"), wxDefaultPosition, wxSize(80, -1));
wxButton *btn_none = new wxButton(this, -1, _("Select &None"), wxDefaultPosition, wxSize(80, -1));
btn_up->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection() - 1, 0); });
btn_down->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection() - 1, 0); });
btn_all->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { SetAll(true); });
btn_none->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { SetAll(false); });
btn_up->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection() - 1, 0); });
btn_down->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { swap(filter_list, filter_list->GetSelection() - 1, 0); });
btn_all->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { SetAll(true); });
btn_none->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { SetAll(false); });
wxSizer *top_buttons = new wxBoxSizer(wxHORIZONTAL);
top_buttons->Add(btn_up, wxSizerFlags(1).Expand());
@ -132,8 +132,8 @@ DialogExport::DialogExport(agi::Context *c)
wxStdDialogButtonSizer *btn_sizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP);
btn_sizer->GetAffirmativeButton()->SetLabelText(_("Export..."));
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogExport::OnProcess, this, wxID_OK);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Export"), wxID_HELP);
Bind(wxEVT_BUTTON, &DialogExport::OnProcess, this, wxID_OK);
Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Export"), wxID_HELP);
wxSizer *horz_sizer = new wxBoxSizer(wxHORIZONTAL);
opt_sizer = new wxBoxSizer(wxVERTICAL);

View File

@ -244,10 +244,10 @@ DialogFontsCollector::DialogFontsCollector(agi::Context *c)
wxCommandEvent evt;
OnRadio(evt);
start_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogFontsCollector::OnStart, this);
dest_browse_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogFontsCollector::OnBrowse, this);
collection_mode->Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &DialogFontsCollector::OnRadio, this);
button_sizer->GetHelpButton()->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Fonts Collector"));
start_btn->Bind(wxEVT_BUTTON, &DialogFontsCollector::OnStart, this);
dest_browse_button->Bind(wxEVT_BUTTON, &DialogFontsCollector::OnBrowse, this);
collection_mode->Bind(wxEVT_RADIOBOX, &DialogFontsCollector::OnRadio, this);
button_sizer->GetHelpButton()->Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Fonts Collector"));
Bind(EVT_ADD_TEXT, &DialogFontsCollector::OnAddText, this);
Bind(EVT_COLLECTION_DONE, &DialogFontsCollector::OnCollectionComplete, this);
}

View File

@ -80,10 +80,10 @@ DialogJumpTo::DialogJumpTo(agi::Context *c)
CenterOnParent();
Bind(wxEVT_INIT_DIALOG, &DialogJumpTo::OnInitDialog, this);
Bind(wxEVT_COMMAND_TEXT_ENTER, &DialogJumpTo::OnOK, this);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogJumpTo::OnOK, this, wxID_OK);
JumpTime->Bind(wxEVT_COMMAND_TEXT_UPDATED, &DialogJumpTo::OnEditTime, this);
JumpFrame->Bind(wxEVT_COMMAND_TEXT_UPDATED, &DialogJumpTo::OnEditFrame, this);
Bind(wxEVT_TEXT_ENTER, &DialogJumpTo::OnOK, this);
Bind(wxEVT_BUTTON, &DialogJumpTo::OnOK, this, wxID_OK);
JumpTime->Bind(wxEVT_TEXT, &DialogJumpTo::OnEditTime, this);
JumpFrame->Bind(wxEVT_TEXT, &DialogJumpTo::OnEditFrame, this);
}
void DialogJumpTo::OnInitDialog(wxInitDialogEvent&) {

View File

@ -528,14 +528,14 @@ DialogKanjiTimer::DialogKanjiTimer(agi::Context *c)
Bind(wxEVT_KEY_DOWN, &DialogKanjiTimer::OnKeyDown, this);
display->Bind(wxEVT_KEY_DOWN, &DialogKanjiTimer::OnKeyDown, this);
CloseKT->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogKanjiTimer::OnClose, this);
Start->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogKanjiTimer::OnStart, this);
Link->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogKanjiTimer::OnLink, this);
Unlink->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogKanjiTimer::OnUnlink, this);
SkipSourceLine->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogKanjiTimer::OnSkipSource, this);
SkipDestLine->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogKanjiTimer::OnSkipDest, this);
GoBackLine->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogKanjiTimer::OnGoBack, this);
AcceptLine->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogKanjiTimer::OnAccept, this);
CloseKT->Bind(wxEVT_BUTTON, &DialogKanjiTimer::OnClose, this);
Start->Bind(wxEVT_BUTTON, &DialogKanjiTimer::OnStart, this);
Link->Bind(wxEVT_BUTTON, &DialogKanjiTimer::OnLink, this);
Unlink->Bind(wxEVT_BUTTON, &DialogKanjiTimer::OnUnlink, this);
SkipSourceLine->Bind(wxEVT_BUTTON, &DialogKanjiTimer::OnSkipSource, this);
SkipDestLine->Bind(wxEVT_BUTTON, &DialogKanjiTimer::OnSkipDest, this);
GoBackLine->Bind(wxEVT_BUTTON, &DialogKanjiTimer::OnGoBack, this);
AcceptLine->Bind(wxEVT_BUTTON, &DialogKanjiTimer::OnAccept, this);
}
void DialogKanjiTimer::OnClose(wxCommandEvent &) {

View File

@ -73,7 +73,7 @@ public:
wxDialog *d = new DialogType(c);
created_dialogs[&typeid(DialogType)] = d;
d->Bind(wxEVT_CLOSE_WINDOW, &DialogManager::OnClose<wxCloseEvent>, this);
d->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogManager::OnClose<wxCommandEvent>, this, wxID_CANCEL);
d->Bind(wxEVT_BUTTON, &DialogManager::OnClose<wxCommandEvent>, this, wxID_CANCEL);
d->Show();
SetFloatOnParent(d);
}
@ -109,7 +109,7 @@ public:
~DialogManager() {
for (auto const& it : created_dialogs) {
it.second->Unbind(wxEVT_CLOSE_WINDOW, &DialogManager::OnClose<wxCloseEvent>, this);
it.second->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogManager::OnClose<wxCommandEvent>, this, wxID_CANCEL);
it.second->Unbind(wxEVT_BUTTON, &DialogManager::OnClose<wxCommandEvent>, this, wxID_CANCEL);
it.second->Destroy();
}
created_dialogs.clear();

View File

@ -80,18 +80,18 @@ DialogPasteOver::DialogPasteOver(wxWindow *parent)
wxSizer *TopButtonSizer = new wxBoxSizer(wxHORIZONTAL);
TopButtonSizer->Add(btn = new wxButton(this, -1, _("&All")), wxSizerFlags(1));
btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogPasteOver::CheckAll, this, true));
btn->Bind(wxEVT_BUTTON, std::bind(&DialogPasteOver::CheckAll, this, true));
TopButtonSizer->Add(btn = new wxButton(this, -1, _("&None")), wxSizerFlags(1));
btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogPasteOver::CheckAll, this, false));
btn->Bind(wxEVT_BUTTON, std::bind(&DialogPasteOver::CheckAll, this, false));
TopButtonSizer->Add(btn = new wxButton(this, -1, _("&Times")), wxSizerFlags(1));
btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogPasteOver::OnTimes, this);
btn->Bind(wxEVT_BUTTON, &DialogPasteOver::OnTimes, this);
TopButtonSizer->Add(btn = new wxButton(this, -1, _("T&ext")), wxSizerFlags(1));
btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogPasteOver::OnText, this);
btn->Bind(wxEVT_BUTTON, &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::bind(&HelpButton::OpenPage, "Paste Over"), wxID_HELP);
Bind(wxEVT_BUTTON, &DialogPasteOver::OnOK, this, wxID_OK);
Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Paste Over"), wxID_HELP);
// Main sizer
wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL);

View File

@ -164,7 +164,7 @@ void DialogProgress::Run(std::function<void(agi::ProgressSink*)> task, int prior
// Unbind the cancel handler so that the default behavior happens (i.e. the
// dialog is closed) as there's no longer a task to cancel
Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogProgress::OnCancel, this, wxID_CANCEL);
Unbind(wxEVT_BUTTON, &DialogProgress::OnCancel, this, wxID_CANCEL);
// If it ran to completion and there is debug output, leave the window open
// so the user can read the debug output and switch the cancel button to a
@ -185,7 +185,7 @@ void DialogProgress::Run(std::function<void(agi::ProgressSink*)> task, int prior
void DialogProgress::OnShow(wxShowEvent&) {
// Restore the cancel button in case it was previously switched to a close
// button
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogProgress::OnCancel, this, wxID_CANCEL);
Bind(wxEVT_BUTTON, &DialogProgress::OnCancel, this, wxID_CANCEL);
cancel_button->SetLabelText(_("Cancel"));
cancel_button->Enable();

View File

@ -86,7 +86,7 @@ DialogProperties::DialogProperties(agi::Context *c)
if (!c->videoController->IsLoaded())
FromVideo->Enable(false);
else
FromVideo->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogProperties::OnSetFromVideo, this);
FromVideo->Bind(wxEVT_BUTTON, &DialogProperties::OnSetFromVideo, this);
ResSizer->Add(ResX,1,wxRIGHT | wxALIGN_CENTER_VERTICAL,5);
ResSizer->Add(ResText,0,wxALIGN_CENTER | wxRIGHT,5);
@ -117,8 +117,8 @@ DialogProperties::DialogProperties(agi::Context *c)
// Button sizer
wxStdDialogButtonSizer *ButtonSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogProperties::OnOK, this, wxID_OK);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Properties"), wxID_HELP);
Bind(wxEVT_BUTTON, &DialogProperties::OnOK, this, wxID_OK);
Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Properties"), wxID_HELP);
// MainSizer
wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL);

View File

@ -109,11 +109,11 @@ DialogResample::DialogResample(agi::Context *c, ResampleSettings &settings)
// Bind events
using std::bind;
Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&HelpButton::OpenPage, "Resample resolution"), wxID_HELP);
from_video->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogResample::SetDestFromVideo, this);
symmetrical->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &DialogResample::OnSymmetrical, this);
margin_ctrl[LEFT]->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, bind(&DialogResample::OnMarginChange, this, margin_ctrl[LEFT], margin_ctrl[RIGHT]));
margin_ctrl[TOP]->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, bind(&DialogResample::OnMarginChange, this, margin_ctrl[TOP], margin_ctrl[BOTTOM]));
Bind(wxEVT_BUTTON, bind(&HelpButton::OpenPage, "Resample resolution"), wxID_HELP);
from_video->Bind(wxEVT_BUTTON, &DialogResample::SetDestFromVideo, this);
symmetrical->Bind(wxEVT_CHECKBOX, &DialogResample::OnSymmetrical, this);
margin_ctrl[LEFT]->Bind(wxEVT_SPINCTRL, bind(&DialogResample::OnMarginChange, this, margin_ctrl[LEFT], margin_ctrl[RIGHT]));
margin_ctrl[TOP]->Bind(wxEVT_SPINCTRL, bind(&DialogResample::OnMarginChange, this, margin_ctrl[TOP], margin_ctrl[BOTTOM]));
}
void DialogResample::SetDestFromVideo(wxCommandEvent &) {

View File

@ -120,9 +120,9 @@ DialogSearchReplace::DialogSearchReplace(agi::Context* c, bool replace)
find_edit->SetFocus();
find_edit->SelectAll();
find_next->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, &SearchReplaceEngine::FindNext));
replace_next->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, &SearchReplaceEngine::ReplaceNext));
replace_all->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, &SearchReplaceEngine::ReplaceAll));
find_next->Bind(wxEVT_BUTTON, std::bind(&DialogSearchReplace::FindReplace, this, &SearchReplaceEngine::FindNext));
replace_next->Bind(wxEVT_BUTTON, std::bind(&DialogSearchReplace::FindReplace, this, &SearchReplaceEngine::ReplaceNext));
replace_all->Bind(wxEVT_BUTTON, std::bind(&DialogSearchReplace::FindReplace, this, &SearchReplaceEngine::ReplaceAll));
}
DialogSearchReplace::~DialogSearchReplace() {

View File

@ -30,8 +30,8 @@ SelectedChoicesDialog::SelectedChoicesDialog(wxWindow *parent, wxString const& m
wxButton *selAll = new wxButton(this, -1, _("Select &All"));
wxButton *selNone = new wxButton(this, -1, _("Select &None"));
selAll->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SelectedChoicesDialog::SelectAll, this);
selNone->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { SetSelections(wxArrayInt()); });
selAll->Bind(wxEVT_BUTTON, &SelectedChoicesDialog::SelectAll, this);
selNone->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { SetSelections(wxArrayInt()); });
auto buttonSizer = new wxBoxSizer(wxHORIZONTAL);
buttonSizer->Add(selAll, wxSizerFlags(0).Left());

View File

@ -150,10 +150,10 @@ wxDialog (c->parent, -1, _("Select"), wxDefaultPosition, wxDefaultSize, wxCAPTIO
select_matching_lines->SetValue(!select_unmatching_lines->GetValue());
match_mode->SetSelection(OPT_GET("Tool/Select Lines/Mode")->GetInt());
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogSelection::Process, this, wxID_OK);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Select Lines"), wxID_HELP);
apply_to_comments->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, std::bind(&DialogSelection::OnDialogueCheckbox, this, apply_to_dialogue));
apply_to_dialogue->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, std::bind(&DialogSelection::OnDialogueCheckbox, this, apply_to_comments));
Bind(wxEVT_BUTTON, &DialogSelection::Process, this, wxID_OK);
Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Select Lines"), wxID_HELP);
apply_to_comments->Bind(wxEVT_CHECKBOX, std::bind(&DialogSelection::OnDialogueCheckbox, this, apply_to_dialogue));
apply_to_dialogue->Bind(wxEVT_CHECKBOX, std::bind(&DialogSelection::OnDialogueCheckbox, this, apply_to_comments));
}
DialogSelection::~DialogSelection() {

View File

@ -111,11 +111,11 @@ DialogShiftTimes::DialogShiftTimes(agi::Context *context)
// Create controls
shift_by_time = new wxRadioButton(this, -1, _("&Time: "), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
shift_by_time->SetToolTip(_("Shift by time"));
shift_by_time->Bind(wxEVT_COMMAND_RADIOBUTTON_SELECTED, &DialogShiftTimes::OnByTime, this);
shift_by_time->Bind(wxEVT_RADIOBUTTON, &DialogShiftTimes::OnByTime, this);
shift_by_frames = new wxRadioButton(this, -1 , _("&Frames: "));
shift_by_frames->SetToolTip(_("Shift by frames"));
shift_by_frames->Bind(wxEVT_COMMAND_RADIOBUTTON_SELECTED, &DialogShiftTimes::OnByFrames, this);
shift_by_frames->Bind(wxEVT_RADIOBUTTON, &DialogShiftTimes::OnByFrames, this);
shift_time = new TimeEdit(this, -1, context);
shift_time->SetToolTip(_("Enter time in h:mm:ss.cs notation"));
@ -138,7 +138,7 @@ DialogShiftTimes::DialogShiftTimes(agi::Context *context)
history_box = new wxListBox(this, -1, wxDefaultPosition, wxSize(350, 100), 0, nullptr, wxLB_HSCROLL);
wxButton *clear_button = new wxButton(this, -1, _("&Clear"));
clear_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogShiftTimes::OnClear, this);
clear_button->Bind(wxEVT_BUTTON, &DialogShiftTimes::OnClear, this);
// Set initial control states
OnTimecodesLoaded(context->videoController->FPS());
@ -192,10 +192,10 @@ DialogShiftTimes::DialogShiftTimes(agi::Context *context)
SetSizerAndFit(main_sizer);
CenterOnParent();
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogShiftTimes::Process, this, wxID_OK);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Shift Times"), wxID_HELP);
shift_time->Bind(wxEVT_COMMAND_TEXT_ENTER, &DialogShiftTimes::Process, this);
history_box->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &DialogShiftTimes::OnHistoryClick, this);
Bind(wxEVT_BUTTON, &DialogShiftTimes::Process, this, wxID_OK);
Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Shift Times"), wxID_HELP);
shift_time->Bind(wxEVT_TEXT_ENTER, &DialogShiftTimes::Process, this);
history_box->Bind(wxEVT_LISTBOX_DCLICK, &DialogShiftTimes::OnHistoryClick, this);
}
DialogShiftTimes::~DialogShiftTimes() {

View File

@ -78,14 +78,14 @@ DialogSpellChecker::DialogSpellChecker(agi::Context *context)
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_COMMAND_TEXT_UPDATED, [=](wxCommandEvent&) {
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_COMMAND_LISTBOX_SELECTED, &DialogSpellChecker::OnChangeSuggestion, this);
suggest_list->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &DialogSpellChecker::OnReplace, this);
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
@ -114,7 +114,7 @@ DialogSpellChecker::DialogSpellChecker(agi::Context *context)
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_COMMAND_COMBOBOX_SELECTED, &DialogSpellChecker::OnChangeLanguage, this);
language->Bind(wxEVT_COMBOBOX, &DialogSpellChecker::OnChangeLanguage, this);
bottom_left_sizer->Add(language, wxSizerFlags().Expand().Border(wxTOP, 5));
}
@ -126,7 +126,7 @@ DialogSpellChecker::DialogSpellChecker(agi::Context *context)
auto checkbox = new wxCheckBox(this, -1, text);
actions_sizer->Add(checkbox, button_flags);
checkbox->SetValue(OPT_GET(opt)->GetBool());
checkbox->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED,
checkbox->Bind(wxEVT_CHECKBOX,
[=](wxCommandEvent &evt) { OPT_SET(opt)->SetBool(!!evt.GetInt()); });
};
@ -136,32 +136,32 @@ DialogSpellChecker::DialogSpellChecker(agi::Context *context)
wxButton *button;
actions_sizer->Add(button = new wxButton(this, -1, _("&Replace")), button_flags);
button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogSpellChecker::OnReplace, this);
button->Bind(wxEVT_BUTTON, &DialogSpellChecker::OnReplace, this);
actions_sizer->Add(button = new wxButton(this, -1, _("Replace &all")), button_flags);
button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) {
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_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { FindNext(); });
button->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { FindNext(); });
actions_sizer->Add(button = new wxButton(this, -1, _("Ignore a&ll")), button_flags);
button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) {
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_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) {
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_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) {
remove_button->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) {
spellchecker->RemoveWord(from_wx(replace_word->GetValue()));
SetWord(from_wx(orig_word->GetValue()));
});

View File

@ -365,18 +365,18 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
Bind(wxEVT_CHILD_FOCUS, &DialogStyleEditor::OnChildFocus, this);
Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &DialogStyleEditor::OnCommandPreviewUpdate, this);
Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &DialogStyleEditor::OnCommandPreviewUpdate, this);
Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &DialogStyleEditor::OnCommandPreviewUpdate, this);
Bind(wxEVT_CHECKBOX, &DialogStyleEditor::OnCommandPreviewUpdate, this);
Bind(wxEVT_COMBOBOX, &DialogStyleEditor::OnCommandPreviewUpdate, this);
Bind(wxEVT_SPINCTRL, &DialogStyleEditor::OnCommandPreviewUpdate, this);
previewButton->Bind(EVT_COLOR, &DialogStyleEditor::OnPreviewColourChange, this);
FontName->Bind(wxEVT_COMMAND_TEXT_ENTER, &DialogStyleEditor::OnCommandPreviewUpdate, this);
PreviewText->Bind(wxEVT_COMMAND_TEXT_UPDATED, &DialogStyleEditor::OnPreviewTextChange, this);
FontName->Bind(wxEVT_TEXT_ENTER, &DialogStyleEditor::OnCommandPreviewUpdate, this);
PreviewText->Bind(wxEVT_TEXT, &DialogStyleEditor::OnPreviewTextChange, this);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogStyleEditor::Apply, this, true, true), wxID_OK);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogStyleEditor::Apply, this, true, false), wxID_APPLY);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogStyleEditor::Apply, this, false, true), wxID_CANCEL);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Style Editor"), wxID_HELP);
Bind(wxEVT_BUTTON, std::bind(&DialogStyleEditor::Apply, this, true, true), wxID_OK);
Bind(wxEVT_BUTTON, std::bind(&DialogStyleEditor::Apply, this, true, false), wxID_APPLY);
Bind(wxEVT_BUTTON, std::bind(&DialogStyleEditor::Apply, this, false, true), wxID_CANCEL);
Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Style Editor"), wxID_HELP);
for (auto const& elem : colorButton)
elem->Bind(EVT_COLOR, &DialogStyleEditor::OnSetColor, this);

View File

@ -213,7 +213,7 @@ DialogStyleManager::DialogStyleManager(agi::Context *context)
// Buttons
wxStdDialogButtonSizer *buttonSizer = CreateStdDialogButtonSizer(wxCANCEL | wxHELP);
buttonSizer->GetCancelButton()->SetLabel(_("Close"));
Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&HelpButton::OpenPage, "Styles Manager"), wxID_HELP);
Bind(wxEVT_BUTTON, bind(&HelpButton::OpenPage, "Styles Manager"), wxID_HELP);
// General layout
wxSizer *StylesSizer = new wxBoxSizer(wxHORIZONTAL);
@ -238,43 +238,43 @@ DialogStyleManager::DialogStyleManager(agi::Context *context)
StorageList->Bind(wxEVT_KEY_DOWN, &DialogStyleManager::OnKeyDown, this);
CurrentList->Bind(wxEVT_KEY_DOWN, &DialogStyleManager::OnKeyDown, this);
StorageMoveUp->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::MoveStyles, this, true, 0));
StorageMoveTop->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::MoveStyles, this, true, 1));
StorageMoveDown->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::MoveStyles, this, true, 2));
StorageMoveBottom->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::MoveStyles, this, true, 3));
StorageSort->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::MoveStyles, this, true, 4));
StorageMoveUp->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::MoveStyles, this, true, 0));
StorageMoveTop->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::MoveStyles, this, true, 1));
StorageMoveDown->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::MoveStyles, this, true, 2));
StorageMoveBottom->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::MoveStyles, this, true, 3));
StorageSort->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::MoveStyles, this, true, 4));
CurrentMoveUp->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::MoveStyles, this, false, 0));
CurrentMoveTop->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::MoveStyles, this, false, 1));
CurrentMoveDown->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::MoveStyles, this, false, 2));
CurrentMoveBottom->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::MoveStyles, this, false, 3));
CurrentSort->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::MoveStyles, this, false, 4));
CurrentMoveUp->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::MoveStyles, this, false, 0));
CurrentMoveTop->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::MoveStyles, this, false, 1));
CurrentMoveDown->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::MoveStyles, this, false, 2));
CurrentMoveBottom->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::MoveStyles, this, false, 3));
CurrentSort->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::MoveStyles, this, false, 4));
CatalogNew->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnCatalogNew, this));
CatalogDelete->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnCatalogDelete, this));
CatalogNew->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnCatalogNew, this));
CatalogDelete->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnCatalogDelete, this));
StorageNew->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnStorageNew, this));
StorageEdit->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnStorageEdit, this));
StorageCopy->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnStorageCopy, this));
StorageDelete->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnStorageDelete, this));
StorageNew->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnStorageNew, this));
StorageEdit->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnStorageEdit, this));
StorageCopy->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnStorageCopy, this));
StorageDelete->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnStorageDelete, this));
CurrentNew->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnCurrentNew, this));
CurrentEdit->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnCurrentEdit, this));
CurrentCopy->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnCurrentCopy, this));
CurrentDelete->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnCurrentDelete, this));
CurrentNew->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnCurrentNew, this));
CurrentEdit->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnCurrentEdit, this));
CurrentCopy->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnCurrentCopy, this));
CurrentDelete->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnCurrentDelete, this));
CurrentImport->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnCurrentImport, this));
CurrentImport->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnCurrentImport, this));
MoveToLocal->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnCopyToCurrent, this));
MoveToStorage->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogStyleManager::OnCopyToStorage, this));
MoveToLocal->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnCopyToCurrent, this));
MoveToStorage->Bind(wxEVT_BUTTON, bind(&DialogStyleManager::OnCopyToStorage, this));
CatalogList->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, bind(&DialogStyleManager::OnChangeCatalog, this));
CatalogList->Bind(wxEVT_COMBOBOX, bind(&DialogStyleManager::OnChangeCatalog, this));
StorageList->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, bind(&DialogStyleManager::UpdateButtons, this));
StorageList->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, bind(&DialogStyleManager::OnStorageEdit, this));
StorageList->Bind(wxEVT_LISTBOX, bind(&DialogStyleManager::UpdateButtons, this));
StorageList->Bind(wxEVT_LISTBOX_DCLICK, bind(&DialogStyleManager::OnStorageEdit, this));
CurrentList->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, bind(&DialogStyleManager::UpdateButtons, this));
CurrentList->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, bind(&DialogStyleManager::OnCurrentEdit, this));
CurrentList->Bind(wxEVT_LISTBOX, bind(&DialogStyleManager::UpdateButtons, this));
CurrentList->Bind(wxEVT_LISTBOX_DCLICK, bind(&DialogStyleManager::OnCurrentEdit, this));
}
DialogStyleManager::~DialogStyleManager() {

View File

@ -142,11 +142,11 @@ DialogStyling::DialogStyling(agi::Context *context)
Bind(wxEVT_CHAR_HOOK, &DialogStyling::OnCharHook, this);
style_name->Bind(wxEVT_CHAR_HOOK, &DialogStyling::OnCharHook, this);
style_name->Bind(wxEVT_KEY_DOWN, &DialogStyling::OnKeyDown, this);
play_video->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogStyling::OnPlayVideoButton, this);
play_audio->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogStyling::OnPlayAudioButton, this);
style_list->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, &DialogStyling::OnListClicked, this);
style_list->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &DialogStyling::OnListDoubleClicked, this);
style_name->Bind(wxEVT_COMMAND_TEXT_UPDATED, &DialogStyling::OnStyleBoxModified, this);
play_video->Bind(wxEVT_BUTTON, &DialogStyling::OnPlayVideoButton, this);
play_audio->Bind(wxEVT_BUTTON, &DialogStyling::OnPlayAudioButton, this);
style_list->Bind(wxEVT_LISTBOX, &DialogStyling::OnListClicked, this);
style_list->Bind(wxEVT_LISTBOX_DCLICK, &DialogStyling::OnListDoubleClicked, this);
style_name->Bind(wxEVT_TEXT, &DialogStyling::OnStyleBoxModified, this);
OnActiveLineChanged(c->selectionController->GetActiveLine());
}

View File

@ -68,7 +68,7 @@ DialogTextImport::DialogTextImport()
SetSizerAndFit(main_sizer);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) {
Bind(wxEVT_BUTTON, [=](wxCommandEvent&) {
TransferDataFromWindow();
OPT_SET("Tool/Import/Text/Actor Separator")->SetString(seperator);

View File

@ -81,7 +81,7 @@ wxTextCtrl *make_ctrl(wxWindow *parent, wxSizer *sizer, wxString const& desc, in
sizer->Add(ctrl, wxSizerFlags().Expand().Border(wxRIGHT));
ctrl->Enable(cb->IsChecked());
cb->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, bind(set_ctrl_state, _1, cb, ctrl));
cb->Bind(wxEVT_CHECKBOX, bind(set_ctrl_state, _1, cb, ctrl));
return ctrl;
}
@ -210,7 +210,7 @@ DialogTimingProcessor::DialogTimingProcessor(agi::Context *c)
// Button sizer
wxStdDialogButtonSizer *ButtonSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP);
ApplyButton = ButtonSizer->GetAffirmativeButton();
ButtonSizer->GetHelpButton()->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&HelpButton::OpenPage, "Timing Processor"));
ButtonSizer->GetHelpButton()->Bind(wxEVT_BUTTON, bind(&HelpButton::OpenPage, "Timing Processor"));
// Right Sizer
wxSizer *RightSizer = new wxBoxSizer(wxVERTICAL);
@ -241,11 +241,11 @@ DialogTimingProcessor::DialogTimingProcessor(agi::Context *c)
SetSizerAndFit(MainSizer);
CenterOnParent();
Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, bind(&DialogTimingProcessor::UpdateControls, this));
Bind(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, bind(&DialogTimingProcessor::UpdateControls, this));
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogTimingProcessor::OnApply, this, wxID_OK);
all->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogTimingProcessor::CheckAll, this, true));
none->Bind(wxEVT_COMMAND_BUTTON_CLICKED, bind(&DialogTimingProcessor::CheckAll, this, false));
Bind(wxEVT_CHECKBOX, bind(&DialogTimingProcessor::UpdateControls, this));
Bind(wxEVT_CHECKLISTBOX, bind(&DialogTimingProcessor::UpdateControls, this));
Bind(wxEVT_BUTTON, &DialogTimingProcessor::OnApply, this, wxID_OK);
all->Bind(wxEVT_BUTTON, bind(&DialogTimingProcessor::CheckAll, this, true));
none->Bind(wxEVT_BUTTON, bind(&DialogTimingProcessor::CheckAll, this, false));
CheckAll(true);
}

View File

@ -130,12 +130,12 @@ DialogTranslation::DialogTranslation(agi::Context *c)
wxButton *play_audio = new wxButton(this, -1, _("Play &Audio"));
play_audio->Enable(c->audioController->IsAudioOpen());
play_audio->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogTranslation::OnPlayAudioButton, this);
play_audio->Bind(wxEVT_BUTTON, &DialogTranslation::OnPlayAudioButton, this);
actions_box->Add(play_audio, 0, wxALL, 5);
wxButton *play_video = new wxButton(this, -1, _("Play &Video"));
play_video->Enable(c->videoController->IsLoaded());
play_video->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogTranslation::OnPlayVideoButton, this);
play_video->Bind(wxEVT_BUTTON, &DialogTranslation::OnPlayVideoButton, this);
actions_box->Add(play_video, 0, wxLEFT | wxRIGHT | wxBOTTOM, 5);
right_box->Add(actions_box, 0);

View File

@ -161,8 +161,8 @@ VersionCheckerResultDialog::VersionCheckerResultDialog(wxString const& main_text
Centre();
Show();
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&VersionCheckerResultDialog::Close, this, false), wxID_OK);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &VersionCheckerResultDialog::OnRemindMeLater, this, wxID_NO);
Bind(wxEVT_BUTTON, std::bind(&VersionCheckerResultDialog::Close, this, false), wxID_OK);
Bind(wxEVT_BUTTON, &VersionCheckerResultDialog::OnRemindMeLater, this, wxID_NO);
Bind(wxEVT_CLOSE_WINDOW, &VersionCheckerResultDialog::OnClose, this);
}

View File

@ -77,7 +77,7 @@ wxWindow *AssTransformFramerateFilter::GetConfigDialogWindow(wxWindow *parent, a
wxButton *FromVideo = new wxButton(base,-1,_("From &video"));
if (Input->IsLoaded()) {
initialInput = wxString::Format("%2.3f",Input->FPS());
FromVideo->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) {
FromVideo->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) {
InputFramerate->SetValue(wxString::Format("%g", c->videoController->FPS().FPS()));
});
}

View File

@ -80,7 +80,7 @@ static void init_static() {
HelpButton::HelpButton(wxWindow *parent, wxString const& page, wxPoint position, wxSize size)
: wxButton(parent, wxID_HELP, "", position, size)
{
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, page));
Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, page));
init_static();
if (pages->find(page) == pages->end())
throw agi::InternalError("Invalid help page", nullptr);

View File

@ -454,7 +454,7 @@ namespace menu {
}
window->Bind(wxEVT_MENU_OPEN, &CommandManager::OnMenuOpen, &menu->cm);
window->Bind(wxEVT_COMMAND_MENU_SELECTED, &CommandManager::OnMenuClick, &menu->cm);
window->Bind(wxEVT_MENU, &CommandManager::OnMenuClick, &menu->cm);
window->SetMenuBar(menu.get());
menu.release();
@ -464,7 +464,7 @@ namespace menu {
auto menu = new CommandMenu(c);
build_menu(name, c, &menu->cm, menu);
menu->Bind(wxEVT_MENU_OPEN, &CommandManager::OnMenuOpen, &menu->cm);
menu->Bind(wxEVT_COMMAND_MENU_SELECTED, &CommandManager::OnMenuClick, &menu->cm);
menu->Bind(wxEVT_MENU, &CommandManager::OnMenuClick, &menu->cm);
return std::unique_ptr<wxMenu>(menu);
}

View File

@ -383,12 +383,12 @@ Interface_Hotkeys::Interface_Hotkeys(wxTreebook *book, Preferences *parent)
wxButton *edit_button = new wxButton(this, -1, _("&Edit"));
wxButton *delete_button = new wxButton(this, -1, _("&Delete"));
new_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &Interface_Hotkeys::OnNewButton, this);
edit_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { edit_item(dvc, dvc->GetSelection()); });
delete_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [=](wxCommandEvent&) { model->Delete(dvc->GetSelection()); });
new_button->Bind(wxEVT_BUTTON, &Interface_Hotkeys::OnNewButton, this);
edit_button->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { edit_item(dvc, dvc->GetSelection()); });
delete_button->Bind(wxEVT_BUTTON, [=](wxCommandEvent&) { model->Delete(dvc->GetSelection()); });
quick_search->Bind(wxEVT_COMMAND_TEXT_UPDATED, &Interface_Hotkeys::OnUpdateFilter, this);
quick_search->Bind(wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, [=](wxCommandEvent&) { quick_search->SetValue(""); });
quick_search->Bind(wxEVT_TEXT, &Interface_Hotkeys::OnUpdateFilter, this);
quick_search->Bind(wxEVT_SEARCHCTRL_CANCEL_BTN, [=](wxCommandEvent&) { quick_search->SetValue(""); });
dvc = new wxDataViewCtrl(this, -1);
dvc->AssociateModel(model.get());
@ -666,7 +666,7 @@ Preferences::Preferences(wxWindow *parent): wxDialog(parent, -1, _("Preferences"
book->Fit();
book->ChangeSelection(OPT_GET("Tool/Preferences/Page")->GetInt());
book->Bind(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, &PageChanged);
book->Bind(wxEVT_TREEBOOK_PAGE_CHANGED, &PageChanged);
// Bottom Buttons
wxStdDialogButtonSizer *stdButtonSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxAPPLY | wxHELP);
@ -687,10 +687,10 @@ Preferences::Preferences(wxWindow *parent): wxDialog(parent, -1, _("Preferences"
applyButton->Enable(false);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &Preferences::OnOK, this, wxID_OK);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, &Preferences::OnApply, this, wxID_APPLY);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&HelpButton::OpenPage, "Options"), wxID_HELP);
defaultButton->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &Preferences::OnResetDefault, this);
Bind(wxEVT_BUTTON, &Preferences::OnOK, this, wxID_OK);
Bind(wxEVT_BUTTON, &Preferences::OnApply, this, wxID_APPLY);
Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Options"), wxID_HELP);
defaultButton->Bind(wxEVT_BUTTON, &Preferences::OnResetDefault, this);
}
Preferences::~Preferences() {

View File

@ -78,8 +78,8 @@ static void font_button(Preferences *parent, wxTextCtrl *name, wxSpinCtrl *size)
if (font.IsOk()) {
name->SetValue(font.GetFaceName());
size->SetValue(font.GetPointSize());
// wxGTK doesn't generate wxEVT_COMMAND_SPINCTRL_UPDATED from SetValue
wxSpinEvent evt(wxEVT_COMMAND_SPINCTRL_UPDATED);
// wxGTK doesn't generate wxEVT_SPINCTRL from SetValue
wxSpinEvent evt(wxEVT_SPINCTRL);
evt.SetInt(font.GetPointSize());
size->ProcessWindowEvent(evt);
}
@ -121,27 +121,27 @@ wxControl *OptionPage::OptionAdd(wxFlexGridSizer *flex, const wxString &name, co
wxCheckBox *cb = new wxCheckBox(this, -1, name);
flex->Add(cb, 1, wxEXPAND, 0);
cb->SetValue(opt->GetBool());
cb->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, BoolUpdater(opt_name, parent));
cb->Bind(wxEVT_CHECKBOX, BoolUpdater(opt_name, parent));
return cb;
}
case agi::OptionValue::Type_Int: {
wxSpinCtrl *sc = new wxSpinCtrl(this, -1, std::to_wstring((int)opt->GetInt()), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, min, max, opt->GetInt());
sc->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, IntUpdater(opt_name, parent));
sc->Bind(wxEVT_SPINCTRL, IntUpdater(opt_name, parent));
Add(flex, name, sc);
return sc;
}
case agi::OptionValue::Type_Double: {
wxSpinCtrlDouble *scd = new wxSpinCtrlDouble(this, -1, wxString::Format("%g", opt->GetDouble()), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, min, max, opt->GetDouble(), inc);
scd->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, DoubleUpdater(opt_name, parent));
scd->Bind(wxEVT_SPINCTRL, DoubleUpdater(opt_name, parent));
Add(flex, name, scd);
return scd;
}
case agi::OptionValue::Type_String: {
wxTextCtrl *text = new wxTextCtrl(this, -1 , to_wx(opt->GetString()));
text->Bind(wxEVT_COMMAND_TEXT_UPDATED, StringUpdater(opt_name, parent));
text->Bind(wxEVT_TEXT, StringUpdater(opt_name, parent));
Add(flex, name, text);
return text;
}
@ -169,7 +169,7 @@ void OptionPage::OptionChoice(wxFlexGridSizer *flex, const wxString &name, const
case agi::OptionValue::Type_Int: {
int val = opt->GetInt();
cb->Select(val < (int)choices.size() ? val : 0);
cb->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, IntCBUpdater(opt_name, parent));
cb->Bind(wxEVT_COMBOBOX, IntCBUpdater(opt_name, parent));
break;
}
case agi::OptionValue::Type_String: {
@ -178,7 +178,7 @@ void OptionPage::OptionChoice(wxFlexGridSizer *flex, const wxString &name, const
cb->SetStringSelection(val);
else if (!choices.empty())
cb->SetSelection(0);
cb->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, StringUpdater(opt_name, parent));
cb->Bind(wxEVT_COMBOBOX, StringUpdater(opt_name, parent));
break;
}
@ -206,10 +206,10 @@ void OptionPage::OptionBrowse(wxFlexGridSizer *flex, const wxString &name, const
wxTextCtrl *text = new wxTextCtrl(this, -1 , to_wx(opt->GetString()));
text->SetMinSize(wxSize(160, -1));
text->Bind(wxEVT_COMMAND_TEXT_UPDATED, StringUpdater(opt_name, parent));
text->Bind(wxEVT_TEXT, StringUpdater(opt_name, parent));
wxButton *browse = new wxButton(this, -1, _("Browse..."));
browse->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(browse_button, text));
browse->Bind(wxEVT_BUTTON, std::bind(browse_button, text));
wxSizer *button_sizer = new wxBoxSizer(wxHORIZONTAL);
button_sizer->Add(text, wxSizerFlags(1).Expand());
@ -238,13 +238,13 @@ void OptionPage::OptionFont(wxSizer *sizer, std::string opt_prefix) {
wxTextCtrl *font_name = new wxTextCtrl(this, -1, to_wx(face_opt->GetString()));
font_name->SetMinSize(wxSize(160, -1));
font_name->Bind(wxEVT_COMMAND_TEXT_UPDATED, StringUpdater(face_opt->GetName().c_str(), parent));
font_name->Bind(wxEVT_TEXT, StringUpdater(face_opt->GetName().c_str(), parent));
wxSpinCtrl *font_size = new wxSpinCtrl(this, -1, std::to_wstring((int)size_opt->GetInt()), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 3, 42, size_opt->GetInt());
font_size->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, IntUpdater(size_opt->GetName().c_str(), parent));
font_size->Bind(wxEVT_SPINCTRL, IntUpdater(size_opt->GetName().c_str(), parent));
wxButton *pick_btn = new wxButton(this, -1, _("Choose..."));
pick_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(font_button, parent, font_name, font_size));
pick_btn->Bind(wxEVT_BUTTON, std::bind(font_button, parent, font_name, font_size));
wxSizer *button_sizer = new wxBoxSizer(wxHORIZONTAL);
button_sizer->Add(font_name, wxSizerFlags(1).Expand());
@ -270,7 +270,7 @@ void OptionPage::EnableIfChecked(wxControl *cbx, wxControl *ctrl) {
if (!cb) return;
ctrl->Enable(cb->IsChecked());
cb->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, disabler(ctrl, true));
cb->Bind(wxEVT_CHECKBOX, disabler(ctrl, true));
}
void OptionPage::DisableIfChecked(wxControl *cbx, wxControl *ctrl) {
@ -278,5 +278,5 @@ void OptionPage::DisableIfChecked(wxControl *cbx, wxControl *ctrl) {
if (!cb) return;
ctrl->Enable(!cb->IsChecked());
cb->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, disabler(ctrl, false));
cb->Bind(wxEVT_CHECKBOX, disabler(ctrl, false));
}

View File

@ -112,13 +112,13 @@ SubsEditBox::SubsEditBox(wxWindow *parent, agi::Context *context)
style_box = MakeComboBox("Default", wxCB_READONLY, &SubsEditBox::OnStyleChange, _("Style for this line"));
actor_box = new Placeholder<wxComboBox>(this, _("Actor"), wxSize(110, -1), wxCB_DROPDOWN | wxTE_PROCESS_ENTER, _("Actor name for this speech. This is only for reference, and is mainly useless."));
Bind(wxEVT_COMMAND_TEXT_UPDATED, &SubsEditBox::OnActorChange, this, actor_box->GetId());
Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &SubsEditBox::OnActorChange, this, actor_box->GetId());
Bind(wxEVT_TEXT, &SubsEditBox::OnActorChange, this, actor_box->GetId());
Bind(wxEVT_COMBOBOX, &SubsEditBox::OnActorChange, this, actor_box->GetId());
top_sizer->Add(actor_box, wxSizerFlags(2).Center().Border(wxRIGHT));
effect_box = new Placeholder<wxComboBox>(this, _("Effect"), wxSize(80,-1), wxCB_DROPDOWN | wxTE_PROCESS_ENTER, _("Effect for this line. This can be used to store extra information for karaoke scripts, or for the effects supported by the renderer."));
Bind(wxEVT_COMMAND_TEXT_UPDATED, &SubsEditBox::OnEffectChange, this, effect_box->GetId());
Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &SubsEditBox::OnEffectChange, this, effect_box->GetId());
Bind(wxEVT_TEXT, &SubsEditBox::OnEffectChange, this, effect_box->GetId());
Bind(wxEVT_COMBOBOX, &SubsEditBox::OnEffectChange, this, effect_box->GetId());
top_sizer->Add(effect_box, 3, wxALIGN_CENTER, 5);
char_count = new wxTextCtrl(this, -1, "0", wxDefaultPosition, wxSize(30, -1), wxTE_READONLY | wxTE_CENTER);
@ -166,7 +166,7 @@ SubsEditBox::SubsEditBox(wxWindow *parent, agi::Context *context)
split_box = new wxCheckBox(this,-1,_("Show Original"));
split_box->SetToolTip(_("Show the contents of the subtitle line when it was first selected above the edit box. This is sometimes useful when editing subtitles or translating subtitles into another language."));
split_box->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &SubsEditBox::OnSplit, this);
split_box->Bind(wxEVT_CHECKBOX, &SubsEditBox::OnSplit, this);
middle_right_sizer->Add(split_box, wxSizerFlags().Center().Left());
// Main sizer
@ -198,9 +198,9 @@ SubsEditBox::SubsEditBox(wxWindow *parent, agi::Context *context)
edit_ctrl->Bind(wxEVT_STC_MODIFIED, &SubsEditBox::OnChange, this);
edit_ctrl->SetModEventMask(wxSTC_MOD_INSERTTEXT | wxSTC_MOD_DELETETEXT | wxSTC_STARTACTION);
Bind(wxEVT_COMMAND_TEXT_UPDATED, &SubsEditBox::OnLayerEnter, this, layer->GetId());
Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &SubsEditBox::OnLayerEnter, this, layer->GetId());
Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &SubsEditBox::OnCommentChange, this, comment_box->GetId());
Bind(wxEVT_TEXT, &SubsEditBox::OnLayerEnter, this, layer->GetId());
Bind(wxEVT_SPINCTRL, &SubsEditBox::OnLayerEnter, this, layer->GetId());
Bind(wxEVT_CHECKBOX, &SubsEditBox::OnCommentChange, this, comment_box->GetId());
Bind(wxEVT_CHAR_HOOK, &SubsEditBox::OnKeyDown, this);
Bind(wxEVT_SIZE, &SubsEditBox::OnSize, this);
@ -229,7 +229,7 @@ wxTextCtrl *SubsEditBox::MakeMarginCtrl(wxString const& tooltip, int margin, wxS
ctrl->SetToolTip(tooltip);
middle_left_sizer->Add(ctrl, wxSizerFlags().Center());
Bind(wxEVT_COMMAND_TEXT_UPDATED, [=](wxCommandEvent&) {
Bind(wxEVT_TEXT, [=](wxCommandEvent&) {
int value = mid(0, atoi(ctrl->GetValue().utf8_str()), 9999);
SetSelectedRows([&](AssDialogue *d) { d->Margin[margin] = value; },
commit_msg, AssFile::COMMIT_DIAG_META);
@ -241,7 +241,7 @@ wxTextCtrl *SubsEditBox::MakeMarginCtrl(wxString const& tooltip, int margin, wxS
TimeEdit *SubsEditBox::MakeTimeCtrl(wxString const& tooltip, TimeField field) {
TimeEdit *ctrl = new TimeEdit(this, -1, c, "", wxSize(GetTextExtent(wxS(" 0:00:00.000 ")).GetWidth(),-1), field == TIME_END);
ctrl->SetToolTip(tooltip);
Bind(wxEVT_COMMAND_TEXT_UPDATED, [=](wxCommandEvent&) { CommitTimes(field); }, ctrl->GetId());
Bind(wxEVT_TEXT, [=](wxCommandEvent&) { CommitTimes(field); }, ctrl->GetId());
ctrl->Bind(wxEVT_CHAR_HOOK, time_edit_char_hook);
middle_left_sizer->Add(ctrl, wxSizerFlags().Center());
return ctrl;
@ -253,7 +253,7 @@ void SubsEditBox::MakeButton(const char *cmd_name) {
ToolTipManager::Bind(btn, command->StrHelp(), "Subtitle Edit Box", cmd_name);
middle_right_sizer->Add(btn, wxSizerFlags().Center().Expand());
btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&SubsEditBox::CallCommand, this, cmd_name));
btn->Bind(wxEVT_BUTTON, std::bind(&SubsEditBox::CallCommand, this, cmd_name));
}
wxButton *SubsEditBox::MakeBottomButton(const char *cmd_name) {
@ -261,7 +261,7 @@ wxButton *SubsEditBox::MakeBottomButton(const char *cmd_name) {
wxButton *btn = new wxButton(this, -1, command->StrDisplay(c));
ToolTipManager::Bind(btn, command->StrHelp(), "Subtitle Edit Box", cmd_name);
btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&SubsEditBox::CallCommand, this, cmd_name));
btn->Bind(wxEVT_BUTTON, std::bind(&SubsEditBox::CallCommand, this, cmd_name));
return btn;
}
@ -270,14 +270,14 @@ wxComboBox *SubsEditBox::MakeComboBox(wxString const& initial_text, int style, v
wxComboBox *ctrl = new wxComboBox(this, -1, initial_text, wxDefaultPosition, wxSize(110,-1), 1, styles, style | wxTE_PROCESS_ENTER);
ctrl->SetToolTip(tooltip);
top_sizer->Add(ctrl, wxSizerFlags(2).Center().Border(wxRIGHT));
Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, handler, this, ctrl->GetId());
Bind(wxEVT_COMBOBOX, handler, this, ctrl->GetId());
return ctrl;
}
wxRadioButton *SubsEditBox::MakeRadio(wxString const& text, bool start, wxString const& tooltip) {
wxRadioButton *ctrl = new wxRadioButton(this, -1, text, wxDefaultPosition, wxDefaultSize, start ? wxRB_GROUP : 0);
ctrl->SetToolTip(tooltip);
Bind(wxEVT_COMMAND_RADIOBUTTON_SELECTED, &SubsEditBox::OnFrameTimeRadio, this, ctrl->GetId());
Bind(wxEVT_RADIOBUTTON, &SubsEditBox::OnFrameTimeRadio, this, ctrl->GetId());
middle_right_sizer->Add(ctrl, wxSizerFlags().Center().Expand().Border(wxRIGHT));
return ctrl;
}
@ -548,7 +548,7 @@ void SubsEditBox::OnStyleChange(wxCommandEvent &) {
}
void SubsEditBox::OnActorChange(wxCommandEvent &evt) {
bool amend = evt.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED;
bool amend = evt.GetEventType() == wxEVT_TEXT;
SetSelectedRows(&AssDialogue::Actor, actor_box->GetValue(), _("actor change"), AssFile::COMMIT_DIAG_META, amend);
PopulateList(actor_box, &AssDialogue::Actor);
}
@ -558,7 +558,7 @@ void SubsEditBox::OnLayerEnter(wxCommandEvent &) {
}
void SubsEditBox::OnEffectChange(wxCommandEvent &evt) {
bool amend = evt.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED;
bool amend = evt.GetEventType() == wxEVT_TEXT;
SetSelectedRows(&AssDialogue::Effect, effect_box->GetValue(), _("effect change"), AssFile::COMMIT_DIAG_META, amend);
PopulateList(effect_box, &AssDialogue::Effect);
}

View File

@ -110,15 +110,15 @@ SubsTextEditCtrl::SubsTextEditCtrl(wxWindow* parent, wxSize wsize, long style, a
Bind(wxEVT_CHAR_HOOK, &SubsTextEditCtrl::OnKeyDown, this);
Bind(wxEVT_COMMAND_MENU_SELECTED, bind(&SubsTextEditCtrl::Cut, this), EDIT_MENU_CUT);
Bind(wxEVT_COMMAND_MENU_SELECTED, bind(&SubsTextEditCtrl::Copy, this), EDIT_MENU_COPY);
Bind(wxEVT_COMMAND_MENU_SELECTED, bind(&SubsTextEditCtrl::Paste, this), EDIT_MENU_PASTE);
Bind(wxEVT_COMMAND_MENU_SELECTED, bind(&SubsTextEditCtrl::SelectAll, this), EDIT_MENU_SELECT_ALL);
Bind(wxEVT_MENU, bind(&SubsTextEditCtrl::Cut, this), EDIT_MENU_CUT);
Bind(wxEVT_MENU, bind(&SubsTextEditCtrl::Copy, this), EDIT_MENU_COPY);
Bind(wxEVT_MENU, bind(&SubsTextEditCtrl::Paste, this), EDIT_MENU_PASTE);
Bind(wxEVT_MENU, bind(&SubsTextEditCtrl::SelectAll, this), EDIT_MENU_SELECT_ALL);
if (context) {
Bind(wxEVT_COMMAND_MENU_SELECTED, bind(&cmd::call, "edit/line/split/preserve", context), EDIT_MENU_SPLIT_PRESERVE);
Bind(wxEVT_COMMAND_MENU_SELECTED, bind(&cmd::call, "edit/line/split/estimate", context), EDIT_MENU_SPLIT_ESTIMATE);
Bind(wxEVT_COMMAND_MENU_SELECTED, bind(&cmd::call, "edit/line/split/video", context), EDIT_MENU_SPLIT_VIDEO);
Bind(wxEVT_MENU, bind(&cmd::call, "edit/line/split/preserve", context), EDIT_MENU_SPLIT_PRESERVE);
Bind(wxEVT_MENU, bind(&cmd::call, "edit/line/split/estimate", context), EDIT_MENU_SPLIT_ESTIMATE);
Bind(wxEVT_MENU, bind(&cmd::call, "edit/line/split/video", context), EDIT_MENU_SPLIT_VIDEO);
}
Bind(wxEVT_CONTEXT_MENU, &SubsTextEditCtrl::OnContextMenu, this);
@ -150,13 +150,13 @@ SubsTextEditCtrl::SubsTextEditCtrl(wxWindow* parent, wxSize wsize, long style, a
OPT_SUB("Subtitle/Highlight/Syntax", &SubsTextEditCtrl::UpdateStyle, this);
OPT_SUB("App/Call Tips", &SubsTextEditCtrl::UpdateCallTip, this);
Bind(wxEVT_COMMAND_MENU_SELECTED, [=](wxCommandEvent&) {
Bind(wxEVT_MENU, [=](wxCommandEvent&) {
if (spellchecker) spellchecker->AddWord(currentWord);
UpdateStyle();
SetFocus();
}, EDIT_MENU_ADD_TO_DICT);
Bind(wxEVT_COMMAND_MENU_SELECTED, [=](wxCommandEvent&) {
Bind(wxEVT_MENU, [=](wxCommandEvent&) {
if (spellchecker) spellchecker->RemoveWord(currentWord);
UpdateStyle();
SetFocus();

View File

@ -73,9 +73,9 @@ TimeEdit::TimeEdit(wxWindow* parent, wxWindowID id, agi::Context *c, const std::
// Other stuff
if (value.empty()) SetValue(to_wx(time.GetAssFormated()));
Bind(wxEVT_COMMAND_MENU_SELECTED, std::bind(&TimeEdit::CopyTime, this), Time_Edit_Copy);
Bind(wxEVT_COMMAND_MENU_SELECTED, std::bind(&TimeEdit::PasteTime, this), Time_Edit_Paste);
Bind(wxEVT_COMMAND_TEXT_UPDATED, &TimeEdit::OnModified, this);
Bind(wxEVT_MENU, std::bind(&TimeEdit::CopyTime, this), Time_Edit_Copy);
Bind(wxEVT_MENU, std::bind(&TimeEdit::PasteTime, this), Time_Edit_Paste);
Bind(wxEVT_TEXT, &TimeEdit::OnModified, this);
Bind(wxEVT_CONTEXT_MENU, &TimeEdit::OnContextMenu, this);
Bind(wxEVT_CHAR_HOOK, &TimeEdit::OnKeyDown, this);
Bind(wxEVT_CHAR, &TimeEdit::OnChar, this);
@ -238,7 +238,7 @@ void TimeEdit::PasteTime() {
SetTime(tempTime);
SetSelection(0, GetValue().size());
wxCommandEvent evt(wxEVT_COMMAND_TEXT_UPDATED, GetId());
wxCommandEvent evt(wxEVT_TEXT, GetId());
evt.SetEventObject(this);
HandleWindowEvent(evt);
}

View File

@ -174,7 +174,7 @@ namespace {
, hotkeys_changed_slot(hotkey::inst->AddHotkeyChangeListener(&Toolbar::RegenerateToolbar, this))
{
Populate();
Bind(wxEVT_COMMAND_TOOL_CLICKED, &Toolbar::OnClick, this);
Bind(wxEVT_TOOL, &Toolbar::OnClick, this);
}
Toolbar(wxFrame *parent, std::string name, agi::Context *c, std::string ht_context)
@ -192,7 +192,7 @@ namespace {
{
parent->SetToolBar(this);
Populate();
Bind(wxEVT_COMMAND_TOOL_CLICKED, &Toolbar::OnClick, this);
Bind(wxEVT_TOOL, &Toolbar::OnClick, this);
}
};
}

View File

@ -101,8 +101,8 @@ VideoDisplay::VideoDisplay(
, freeSize(freeSize)
{
zoomBox->SetValue(wxString::Format("%g%%", zoomValue * 100.));
zoomBox->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &VideoDisplay::SetZoomFromBox, this);
zoomBox->Bind(wxEVT_COMMAND_TEXT_ENTER, &VideoDisplay::SetZoomFromBoxText, this);
zoomBox->Bind(wxEVT_COMBOBOX, &VideoDisplay::SetZoomFromBox, this);
zoomBox->Bind(wxEVT_TEXT_ENTER, &VideoDisplay::SetZoomFromBoxText, this);
con->videoController->Bind(EVT_FRAME_READY, &VideoDisplay::UploadFrameData, this);
slots.push_back(con->videoController->AddVideoOpenListener(&VideoDisplay::UpdateSize, this));

View File

@ -59,7 +59,7 @@ void VisualToolDrag::SetToolbar(wxToolBar *tb) {
toolbar->Realize();
toolbar->Show(true);
toolbar->Bind(wxEVT_COMMAND_TOOL_CLICKED, &VisualToolDrag::OnSubTool, this);
toolbar->Bind(wxEVT_TOOL, &VisualToolDrag::OnSubTool, this);
}
void VisualToolDrag::UpdateToggleButtons() {

View File

@ -74,7 +74,7 @@ void VisualToolVectorClip::SetToolbar(wxToolBar *toolBar) {
toolBar->ToggleTool(BUTTON_DRAG, true);
toolBar->Realize();
toolBar->Show(true);
toolBar->Bind(wxEVT_COMMAND_TOOL_CLICKED, [=](wxCommandEvent& e) { SetMode(e.GetId() - BUTTON_DRAG); });
toolBar->Bind(wxEVT_TOOL, [=](wxCommandEvent& e) { SetMode(e.GetId() - BUTTON_DRAG); });
SetMode(features.empty());
#undef ICON
}