mirror of https://github.com/odrling/Aegisub
Fixed issue with time edit boxes being unable to represent times over 1 hour in certain cases - #482
Originally committed to SVN as r1439.
This commit is contained in:
parent
55f64cf6a4
commit
14b425d0a3
|
@ -100,14 +100,14 @@ void TimeEdit::OnModified(wxCommandEvent &event) {
|
|||
|
||||
/////////////////////
|
||||
// Modified function
|
||||
void TimeEdit::Modified() {
|
||||
void TimeEdit::Modified(bool byUser) {
|
||||
// Lock
|
||||
if (!ready) return;
|
||||
ready = false;
|
||||
|
||||
// Update
|
||||
if (byFrame) Update();
|
||||
else UpdateTime();
|
||||
else UpdateTime(byUser);
|
||||
|
||||
// Colour
|
||||
if (showModified && !modified) {
|
||||
|
@ -126,7 +126,7 @@ void TimeEdit::SetTime(int ms,bool setModified) {
|
|||
int oldMs = time.GetMS();
|
||||
time.SetMS(ms);
|
||||
UpdateText();
|
||||
if (setModified && oldMs != ms) Modified();
|
||||
if (setModified && oldMs != ms) Modified(false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -191,11 +191,11 @@ void TimeEdit::Update() {
|
|||
|
||||
/////////////////////////////////////////////////
|
||||
// Reads value from a text control and update it
|
||||
void TimeEdit::UpdateTime() {
|
||||
void TimeEdit::UpdateTime(bool byUser) {
|
||||
bool insertion = Options.AsBool(_T("Insert Mode on Time Boxes"));
|
||||
wxString text = GetValue();
|
||||
long start=0,end=0;
|
||||
if (insertion) {
|
||||
if (insertion && byUser) {
|
||||
GetSelection(&start,&end);
|
||||
if (start == end) {
|
||||
wxString nextChar = text.Mid(start,1);
|
||||
|
|
|
@ -51,11 +51,11 @@ private:
|
|||
bool ready;
|
||||
bool modified;
|
||||
|
||||
void Modified();
|
||||
void Modified(bool byUser=true);
|
||||
void UpdateText();
|
||||
void CopyTime();
|
||||
void PasteTime();
|
||||
void UpdateTime();
|
||||
void UpdateTime(bool byUser=true);
|
||||
|
||||
void OnModified(wxCommandEvent &event);
|
||||
void OnMouseEvent(wxMouseEvent &event);
|
||||
|
|
Loading…
Reference in New Issue