diff --git a/aegisub/src/dialog_jumpto.cpp b/aegisub/src/dialog_jumpto.cpp index 895998641..3b8610d57 100644 --- a/aegisub/src/dialog_jumpto.cpp +++ b/aegisub/src/dialog_jumpto.cpp @@ -96,6 +96,7 @@ DialogJumpTo::DialogJumpTo(agi::Context *c) SetSizerAndFit(MainSizer); 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); Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::tr1::bind(&DialogJumpTo::EndModal, this, 0), wxID_CANCEL); @@ -103,6 +104,15 @@ DialogJumpTo::DialogJumpTo(agi::Context *c) JumpFrame->Bind(wxEVT_COMMAND_TEXT_UPDATED, &DialogJumpTo::OnEditFrame, this); } +void DialogJumpTo::OnInitDialog(wxInitDialogEvent&) { + TransferDataToWindow(); + UpdateWindowUI(wxUPDATE_UI_RECURSE); + + // This can't simply be done in the constructor as the value hasn't been set yet + JumpFrame->SetFocus(); + JumpFrame->SelectAll(); +} + void DialogJumpTo::OnOK(wxCommandEvent &) { EndModal(0); c->videoController->JumpToFrame(std::min(jumpframe, c->videoController->GetLength() - 1)); diff --git a/aegisub/src/dialog_jumpto.h b/aegisub/src/dialog_jumpto.h index 4d84aa612..f380235cf 100644 --- a/aegisub/src/dialog_jumpto.h +++ b/aegisub/src/dialog_jumpto.h @@ -54,6 +54,8 @@ class DialogJumpTo : public wxDialog { void OnEditTime(wxCommandEvent &event); /// Update target time on target frame changed void OnEditFrame(wxCommandEvent &event); + /// Dialog initializer to set default focus and selection + void OnInitDialog(wxInitDialogEvent&); public: /// Constructor