Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TimeDialog Class Referencefinal

Dialog used to request a time value. More...

#include <TimeDialog.h>

Inheritance diagram for TimeDialog:
[legend]
Collaboration diagram for TimeDialog:
[legend]

Public Member Functions

 TimeDialog (wxWindow *parent, const TranslatableString &title, const NumericFormatSymbol &format, double rate, double time, const TranslatableString &prompt=XO("Duration"))
 
void SetFormatString (const NumericFormatSymbol &formatString)
 
void SetSampleRate (double sampleRate)
 
void SetTimeValue (double newTime)
 
const double GetTimeValue ()
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Member Functions

void PopulateOrExchange (ShuttleGui &S)
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
void OnUpdate (wxCommandEvent &event)
 

Private Attributes

TranslatableString mPrompt
 
NumericFormatSymbol mFormat
 
double mRate
 
double mTime
 
NumericTextCtrlmTimeCtrl
 

Detailed Description

Dialog used to request a time value.

Definition at line 23 of file TimeDialog.h.

Constructor & Destructor Documentation

◆ TimeDialog()

TimeDialog::TimeDialog ( wxWindow *  parent,
const TranslatableString title,
const NumericFormatSymbol format,
double  rate,
double  time,
const TranslatableString prompt = XO("Duration") 
)

Definition at line 28 of file TimeDialog.cpp.

34: wxDialogWrapper(parent, wxID_ANY, title),
35 mPrompt(prompt),
37 mRate(rate),
38 mTime(time),
39 mTimeCtrl(NULL)
40{
41 SetName();
44}
int format
Definition: ExportPCM.cpp:53
static const auto title
@ eIsCreating
Definition: ShuttleGui.h:39
#define S(N)
Definition: ToChars.cpp:64
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:628
double mTime
Definition: TimeDialog.h:52
NumericFormatSymbol mFormat
Definition: TimeDialog.h:50
void PopulateOrExchange(ShuttleGui &S)
Definition: TimeDialog.cpp:46
NumericTextCtrl * mTimeCtrl
Definition: TimeDialog.h:54
TranslatableString mPrompt
Definition: TimeDialog.h:49
double mRate
Definition: TimeDialog.h:51

References eIsCreating, and S.

Member Function Documentation

◆ GetTimeValue()

const double TimeDialog::GetTimeValue ( )

Definition at line 94 of file TimeDialog.cpp.

95{
96 return mTime;
97}

References mTime.

Referenced by SelectUtilities::OnSetRegion().

Here is the caller graph for this function:

◆ OnUpdate()

void TimeDialog::OnUpdate ( wxCommandEvent &  event)
private

Definition at line 117 of file TimeDialog.cpp.

118{
119 Layout();
120 Refresh();
121
122 event.Skip(false);
123}

◆ PopulateOrExchange()

void TimeDialog::PopulateOrExchange ( ShuttleGui S)
private

Definition at line 46 of file TimeDialog.cpp.

47{
48 S.SetBorder(5);
49 S.StartVerticalLay(true);
50 {
51 S.StartStatic(mPrompt, true);
52 {
55 S.GetParent(), wxID_ANY,
57 mFormat,
58 mTime,
59 mRate,
61 .AutoPos(true));
62 S.AddWindow(mTimeCtrl);
63 }
64 S.EndStatic();
65 }
66 S.EndVerticalLay();
67 S.AddStandardButtons();
68
70
71 Layout();
72 Fit();
73 SetMinSize(GetSize());
74 Center();
75}
#define safenew
Definition: MemoryX.h:10
bool TransferDataToWindow() override
Definition: TimeDialog.cpp:77
Options & AutoPos(bool enable)

References NumericTextCtrl::Options::AutoPos(), mFormat, mPrompt, mRate, mTime, mTimeCtrl, S, safenew, NumericConverter::TIME, and TransferDataToWindow().

Here is the call graph for this function:

◆ SetFormatString()

void TimeDialog::SetFormatString ( const NumericFormatSymbol formatString)

Definition at line 99 of file TimeDialog.cpp.

100{
101 mFormat = formatString;
103}

References mFormat, and TransferDataToWindow().

Here is the call graph for this function:

◆ SetSampleRate()

void TimeDialog::SetSampleRate ( double  sampleRate)

Definition at line 105 of file TimeDialog.cpp.

106{
107 mRate = sampleRate;
109}

References mRate, and TransferDataToWindow().

Here is the call graph for this function:

◆ SetTimeValue()

void TimeDialog::SetTimeValue ( double  newTime)

Definition at line 111 of file TimeDialog.cpp.

112{
113 mTime = newTime;
115}

References mTime, and TransferDataToWindow().

Here is the call graph for this function:

◆ TransferDataFromWindow()

bool TimeDialog::TransferDataFromWindow ( )
overrideprivate

Definition at line 87 of file TimeDialog.cpp.

88{
90
91 return true;
92}

References NumericConverter::GetValue(), mTime, and mTimeCtrl.

Here is the call graph for this function:

◆ TransferDataToWindow()

bool TimeDialog::TransferDataToWindow ( )
overrideprivate

Definition at line 77 of file TimeDialog.cpp.

78{
82 mTimeCtrl->SetFocus();
83
84 return true;
85}
FormatStrings GetBuiltinFormat(const int index)
bool SetFormatString(const FormatStrings &formatString)
void SetSampleRate(double sampleRate)
void SetValue(double newValue)

References NumericConverter::GetBuiltinFormat(), mFormat, mRate, mTime, mTimeCtrl, NumericTextCtrl::SetFormatString(), NumericTextCtrl::SetSampleRate(), and NumericTextCtrl::SetValue().

Referenced by PopulateOrExchange(), SetFormatString(), SetSampleRate(), and SetTimeValue().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mFormat

NumericFormatSymbol TimeDialog::mFormat
private

Definition at line 50 of file TimeDialog.h.

Referenced by PopulateOrExchange(), SetFormatString(), and TransferDataToWindow().

◆ mPrompt

TranslatableString TimeDialog::mPrompt
private

Definition at line 49 of file TimeDialog.h.

Referenced by PopulateOrExchange().

◆ mRate

double TimeDialog::mRate
private

Definition at line 51 of file TimeDialog.h.

Referenced by PopulateOrExchange(), SetSampleRate(), and TransferDataToWindow().

◆ mTime

double TimeDialog::mTime
private

◆ mTimeCtrl

NumericTextCtrl* TimeDialog::mTimeCtrl
private

Definition at line 54 of file TimeDialog.h.

Referenced by PopulateOrExchange(), TransferDataFromWindow(), and TransferDataToWindow().


The documentation for this class was generated from the following files: