MCPcopy Create free account
hub / github.com/audacity/audacity / PopulateOrExchange

Method PopulateOrExchange

src/TimerRecordDialog.cpp:820–1004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

818}
819
820void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
821{
822 bool bAutoSave = gPrefs->ReadBool("/TimerRecord/AutoSave", false);
823 bool bAutoExport = gPrefs->ReadBool("/TimerRecord/AutoExport", false);
824 int iPostTimerRecordAction = gPrefs->ReadLong("/TimerRecord/PostAction", 0);
825
826 S.SetBorder(5);
827 using Options = NumericTextCtrl::Options;
828 /* i18n-hint a format string for hours, minutes, and seconds */
829 auto strFormat = XO("099 h 060 m 060 s");
830 /* i18n-hint a format string for days, hours, minutes, and seconds */
831 auto strFormat1 = XO("099 days 024 h 060 m 060 s");
832
833 S.StartMultiColumn(2, wxCENTER);
834 {
835 S.StartVerticalLay(true);
836 {
837 /* i18n-hint: This string is used to configure the controls for times when the recording is
838 * started and stopped. As such it is important that only the alphabetic parts of the string
839 * are translated, with the numbers left exactly as they are.
840 * The 'h' indicates the first number displayed is hours, the 'm' indicates the second number
841 * displayed is minutes, and the 's' indicates that the third number displayed is seconds.
842 */
843 S.StartStatic(XO("Start Date and Time"), true);
844 {
845 m_pDatePickerCtrl_Start =
846 safenew wxDatePickerCtrl(S.GetParent(), // wxWindow *parent,
847 ID_DATEPICKER_START, // wxWindowID id,
848 m_DateTime_Start); // const wxDateTime& dt = wxDefaultDateTime,
849 // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = "datectrl")
850 m_pDatePickerCtrl_Start->SetRange(wxDateTime::Today(), wxInvalidDateTime); // No backdating.
851#if wxUSE_ACCESSIBILITY
852 m_pDatePickerCtrl_Start->SetAccessible( safenew DatePickerCtrlAx(m_pDatePickerCtrl_Start));
853#endif
854 S.Name(XO("Start Date"))
855 .AddWindow(m_pDatePickerCtrl_Start);
856
857 m_pTimeTextCtrl_Start = safenew NumericTextCtrl(FormatterContext::EmptyContext(),
858 S.GetParent(), ID_TIMETEXT_START, NumericConverterType_TIME(),
859 {}, 0,
860 Options{}
861 .MenuEnabled(false)
862 .CustomFormat(strFormat)
863 .Value(true, wxDateTime_to_AudacityTime(m_DateTime_Start)));
864 S.Name(XO("Start Time"))
865 .AddWindow(m_pTimeTextCtrl_Start);
866 }
867 S.EndStatic();
868
869 S.StartStatic(XO("End Date and Time"), true);
870 {
871 m_pDatePickerCtrl_End =
872 safenew wxDatePickerCtrl(S.GetParent(), // wxWindow *parent,
873 ID_DATEPICKER_END, // wxWindowID id,
874 m_DateTime_End); // const wxDateTime& dt = wxDefaultDateTime,
875 // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
876 // long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
877 // const wxValidator& validator = wxDefaultValidator,

Callers 1

TimerRecordDialogMethod · 0.95

Calls 15

wxDatePickerCtrlClass · 0.85
DatePickerCtrlAxClass · 0.85
GetFunction · 0.85
ReadBoolMethod · 0.80
ReadLongMethod · 0.80
StartStaticMethod · 0.80
AddWindowMethod · 0.80
ValueMethod · 0.80
EndStaticMethod · 0.80
AddCheckBoxMethod · 0.80
AddPromptMethod · 0.80

Tested by

no test coverage detected