1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 16:37:12 +01:00

Bug 115 - Snap-to causes spurious 'toolbar' to appear momentarily at start of dragging.

Completes James' TimeConverter work

This completes the work that James started.  It moves most of the non-GUI
related processing from TimeTextCtrl to James' TimeConverter class.

Other changes include:

1)  TimeTextCtrl now expects the format name instead of the format string to be
passed when creating a new instance.  I found that almost all cases created the
instance with a blank format string and then set the string after creation.

2)  To simplify maintenance and prevent a possible discrepancy between the two,
Increase() and Decrease() were merged into a single routine.

As a result:

1)  All cases where a TimeTextCtrl was being used to extract information and
not actually display a control have been changed to use TimeConverter instead.

2)  All cases where TimeTextCtrl was being created with an empty format and
then immediately followed by something like this:

    tt.SetFormatString(tt.GetBuiltinFormat(c->GetFormat()))

    have been changed to pass the format name instead of the format string when
creating the TimeTextCtrl instance.
This commit is contained in:
lllucius
2013-10-23 21:01:52 +00:00
parent 0e1614f41c
commit 71fde85bfe
13 changed files with 619 additions and 627 deletions

View File

@@ -342,8 +342,9 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
m_pDatePickerCtrl_Start->SetRange(wxDateTime::Today(), wxInvalidDateTime); // No backdating.
S.AddWindow(m_pDatePickerCtrl_Start);
m_pTimeTextCtrl_Start = new TimeTextCtrl(this, ID_TIMETEXT_START, strFormat);
m_pTimeTextCtrl_Start = new TimeTextCtrl(this, ID_TIMETEXT_START);
m_pTimeTextCtrl_Start->SetName(_("Start Time"));
m_pTimeTextCtrl_Start->SetFormatString(strFormat);
m_pTimeTextCtrl_Start->SetTimeValue(wxDateTime_to_AudacityTime(m_DateTime_Start));
S.AddWindow(m_pTimeTextCtrl_Start);
m_pTimeTextCtrl_Start->EnableMenu(false);
@@ -361,8 +362,9 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
m_pDatePickerCtrl_End->SetName(_("End Date"));
S.AddWindow(m_pDatePickerCtrl_End);
m_pTimeTextCtrl_End = new TimeTextCtrl(this, ID_TIMETEXT_END, strFormat);
m_pTimeTextCtrl_End = new TimeTextCtrl(this, ID_TIMETEXT_END);
m_pTimeTextCtrl_End->SetName(_("End Time"));
m_pTimeTextCtrl_End->SetFormatString(strFormat);
m_pTimeTextCtrl_End->SetTimeValue(wxDateTime_to_AudacityTime(m_DateTime_End));
S.AddWindow(m_pTimeTextCtrl_End);
m_pTimeTextCtrl_End->EnableMenu(false);
@@ -380,8 +382,9 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
* seconds.
*/
wxString strFormat1 = _("099 days 024 h 060 m 060 s");
m_pTimeTextCtrl_Duration = new TimeTextCtrl(this, ID_TIMETEXT_DURATION, strFormat1);
m_pTimeTextCtrl_Duration = new TimeTextCtrl(this, ID_TIMETEXT_DURATION);
m_pTimeTextCtrl_Duration->SetName(_("Duration"));
m_pTimeTextCtrl_Duration->SetFormatString(strFormat1);
m_pTimeTextCtrl_Duration->SetTimeValue(m_TimeSpan_Duration.GetSeconds().ToDouble());
S.AddWindow(m_pTimeTextCtrl_Duration);
m_pTimeTextCtrl_Duration->EnableMenu(false);