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:
Rodrigo Braz Monteiro 2007-07-26 22:47:49 +00:00
parent 55f64cf6a4
commit 14b425d0a3
2 changed files with 7 additions and 7 deletions

View file

@ -100,14 +100,14 @@ void TimeEdit::OnModified(wxCommandEvent &event) {
///////////////////// /////////////////////
// Modified function // Modified function
void TimeEdit::Modified() { void TimeEdit::Modified(bool byUser) {
// Lock // Lock
if (!ready) return; if (!ready) return;
ready = false; ready = false;
// Update // Update
if (byFrame) Update(); if (byFrame) Update();
else UpdateTime(); else UpdateTime(byUser);
// Colour // Colour
if (showModified && !modified) { if (showModified && !modified) {
@ -126,7 +126,7 @@ void TimeEdit::SetTime(int ms,bool setModified) {
int oldMs = time.GetMS(); int oldMs = time.GetMS();
time.SetMS(ms); time.SetMS(ms);
UpdateText(); 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 // 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")); bool insertion = Options.AsBool(_T("Insert Mode on Time Boxes"));
wxString text = GetValue(); wxString text = GetValue();
long start=0,end=0; long start=0,end=0;
if (insertion) { if (insertion && byUser) {
GetSelection(&start,&end); GetSelection(&start,&end);
if (start == end) { if (start == end) {
wxString nextChar = text.Mid(start,1); wxString nextChar = text.Mid(start,1);

View file

@ -51,11 +51,11 @@ private:
bool ready; bool ready;
bool modified; bool modified;
void Modified(); void Modified(bool byUser=true);
void UpdateText(); void UpdateText();
void CopyTime(); void CopyTime();
void PasteTime(); void PasteTime();
void UpdateTime(); void UpdateTime(bool byUser=true);
void OnModified(wxCommandEvent &event); void OnModified(wxCommandEvent &event);
void OnMouseEvent(wxMouseEvent &event); void OnMouseEvent(wxMouseEvent &event);