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

Method TimeEdit

src/timeedit_ctrl.cpp:57–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55};
56
57TimeEdit::TimeEdit(wxWindow* parent, wxWindowID id, agi::Context *c, const std::string& value, const wxSize& size, bool asEnd)
58: wxTextCtrl(parent, id, to_wx(value), wxDefaultPosition, size, wxTE_CENTRE | wxTE_PROCESS_ENTER)
59, c(c)
60, isEnd(asEnd)
61, insert(!OPT_GET("Subtitle/Time Edit/Insert Mode")->GetBool())
62, insert_opt(OPT_SUB("Subtitle/Time Edit/Insert Mode", &TimeEdit::OnInsertChanged, this))
63{
64 // Set validator
65 wxTextValidator val(wxFILTER_INCLUDE_CHAR_LIST);
66 wxString includes[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", ".", ":", ","};
67 val.SetIncludes(wxArrayString(std::size(includes), includes));
68 SetValidator(val);
69
70 // Other stuff
71 if (value.empty()) SetValue(to_wx(time.GetAssFormatted()));
72
73 Bind(wxEVT_MENU, std::bind(&TimeEdit::CopyTime, this), Time_Edit_Copy);
74 Bind(wxEVT_MENU, std::bind(&TimeEdit::PasteTime, this), Time_Edit_Paste);
75 Bind(wxEVT_TEXT, &TimeEdit::OnModified, this);
76 Bind(wxEVT_CONTEXT_MENU, &TimeEdit::OnContextMenu, this);
77 Bind(wxEVT_CHAR_HOOK, &TimeEdit::OnKeyDown, this);
78 Bind(wxEVT_CHAR, &TimeEdit::OnChar, this);
79 Bind(wxEVT_KILL_FOCUS, &TimeEdit::OnFocusLost, this);
80}
81
82void TimeEdit::SetTime(agi::Time new_time) {
83 if (time != new_time) {

Callers

nothing calls this directly

Calls 3

GetAssFormattedMethod · 0.80
to_wxFunction · 0.70
wxArrayStringClass · 0.70

Tested by

no test coverage detected