mirror of https://github.com/odrling/Aegisub
Clean up DialogJumpTo slightly
This commit is contained in:
parent
d2a16ed923
commit
ca9a2f533e
|
@ -34,12 +34,6 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <wx/button.h>
|
|
||||||
#include <wx/dialog.h>
|
|
||||||
#include <wx/sizer.h>
|
|
||||||
#include <wx/stattext.h>
|
|
||||||
#include <wx/textctrl.h>
|
|
||||||
|
|
||||||
#include "dialog_jumpto.h"
|
#include "dialog_jumpto.h"
|
||||||
|
|
||||||
#include "include/aegisub/context.h"
|
#include "include/aegisub/context.h"
|
||||||
|
@ -49,6 +43,11 @@
|
||||||
#include "validators.h"
|
#include "validators.h"
|
||||||
#include "video_context.h"
|
#include "video_context.h"
|
||||||
|
|
||||||
|
#include <wx/button.h>
|
||||||
|
#include <wx/sizer.h>
|
||||||
|
#include <wx/stattext.h>
|
||||||
|
#include <wx/textctrl.h>
|
||||||
|
|
||||||
DialogJumpTo::DialogJumpTo(agi::Context *c)
|
DialogJumpTo::DialogJumpTo(agi::Context *c)
|
||||||
: wxDialog(c->parent, -1, _("Jump to"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxWANTS_CHARS)
|
: wxDialog(c->parent, -1, _("Jump to"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxWANTS_CHARS)
|
||||||
, c(c)
|
, c(c)
|
||||||
|
@ -56,15 +55,11 @@ DialogJumpTo::DialogJumpTo(agi::Context *c)
|
||||||
{
|
{
|
||||||
SetIcon(GETICON(jumpto_button_16));
|
SetIcon(GETICON(jumpto_button_16));
|
||||||
|
|
||||||
// Set initial values
|
auto LabelFrame = new wxStaticText(this, -1, _("Frame: "));
|
||||||
wxString maxLength = wxString::Format("%i",c->videoController->GetLength() - 1);
|
auto LabelTime = new wxStaticText(this, -1, _("Time: "));
|
||||||
|
|
||||||
// Times
|
|
||||||
wxStaticText *LabelFrame = new wxStaticText(this,-1,_("Frame: "));
|
|
||||||
wxStaticText *LabelTime = new wxStaticText(this,-1,_("Time: "));
|
|
||||||
|
|
||||||
JumpFrame = new wxTextCtrl(this,-1,"",wxDefaultPosition,wxSize(-1,-1),wxTE_PROCESS_ENTER, NumValidator((int)jumpframe));
|
JumpFrame = new wxTextCtrl(this,-1,"",wxDefaultPosition,wxSize(-1,-1),wxTE_PROCESS_ENTER, NumValidator((int)jumpframe));
|
||||||
JumpFrame->SetMaxLength(maxLength.size());
|
JumpFrame->SetMaxLength(std::to_string(c->videoController->GetLength() - 1).size());
|
||||||
JumpTime = new TimeEdit(this, -1, c, AssTime(c->videoController->TimeAtFrame(jumpframe)).GetAssFormated(), wxSize(-1,-1));
|
JumpTime = new TimeEdit(this, -1, c, AssTime(c->videoController->TimeAtFrame(jumpframe)).GetAssFormated(), wxSize(-1,-1));
|
||||||
|
|
||||||
wxGridSizer *TimesSizer = new wxGridSizer(2, 5, 5);
|
wxGridSizer *TimesSizer = new wxGridSizer(2, 5, 5);
|
||||||
|
@ -75,15 +70,12 @@ DialogJumpTo::DialogJumpTo(agi::Context *c)
|
||||||
TimesSizer->Add(LabelTime, 1, wxALIGN_CENTER_VERTICAL);
|
TimesSizer->Add(LabelTime, 1, wxALIGN_CENTER_VERTICAL);
|
||||||
TimesSizer->Add(JumpTime, wxEXPAND);
|
TimesSizer->Add(JumpTime, wxEXPAND);
|
||||||
|
|
||||||
// Buttons
|
auto ButtonSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL);
|
||||||
wxStdDialogButtonSizer *ButtonSizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL);
|
|
||||||
|
|
||||||
// General layout
|
// General layout
|
||||||
wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL);
|
auto MainSizer = new wxBoxSizer(wxVERTICAL);
|
||||||
MainSizer->Add(TimesSizer, 0, wxALL | wxALIGN_CENTER, 5);
|
MainSizer->Add(TimesSizer, 0, wxALL | wxALIGN_CENTER, 5);
|
||||||
MainSizer->Add(ButtonSizer,0,wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT,5);
|
MainSizer->Add(ButtonSizer, 0, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 5);
|
||||||
|
|
||||||
// Set sizer
|
|
||||||
SetSizerAndFit(MainSizer);
|
SetSizerAndFit(MainSizer);
|
||||||
CenterOnParent();
|
CenterOnParent();
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
/// @ingroup secondary_ui
|
/// @ingroup secondary_ui
|
||||||
///
|
///
|
||||||
|
|
||||||
|
#include <wx/dialog.h>
|
||||||
|
|
||||||
namespace agi { struct Context; }
|
namespace agi { struct Context; }
|
||||||
class TimeEdit;
|
class TimeEdit;
|
||||||
class wxTextCtrl;
|
class wxTextCtrl;
|
||||||
|
|
Loading…
Reference in New Issue