Audacity  3.0.3
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 31 of file TimeDialog.cpp.

37 : wxDialogWrapper(parent, wxID_ANY, title),
38  mPrompt(prompt),
39  mFormat(format),
40  mRate(rate),
41  mTime(time),
42  mTimeCtrl(NULL)
43 {
44  SetName();
45  ShuttleGui S(this, eIsCreating);
47 }

References eIsCreating.

Member Function Documentation

◆ GetTimeValue()

const double TimeDialog::GetTimeValue ( )

Definition at line 97 of file TimeDialog.cpp.

98 {
99  return mTime;
100 }

References mTime.

Referenced by SelectUtilities::OnSetRegion().

Here is the caller graph for this function:

◆ OnUpdate()

void TimeDialog::OnUpdate ( wxCommandEvent &  event)
private

Definition at line 120 of file TimeDialog.cpp.

121 {
122  Layout();
123  Refresh();
124 
125  event.Skip(false);
126 }

◆ PopulateOrExchange()

void TimeDialog::PopulateOrExchange ( ShuttleGui S)
private

Definition at line 49 of file TimeDialog.cpp.

50 {
51  S.SetBorder(5);
52  S.StartVerticalLay(true);
53  {
54  S.StartStatic(mPrompt, true);
55  {
58  S.GetParent(), wxID_ANY,
60  mFormat,
61  mTime,
62  mRate,
64  .AutoPos(true));
66  }
67  S.EndStatic();
68  }
69  S.EndVerticalLay();
71 
73 
74  Layout();
75  Fit();
76  SetMinSize(GetSize());
77  Center();
78 }

References ShuttleGui::AddStandardButtons(), ShuttleGuiBase::AddWindow(), NumericTextCtrl::Options::AutoPos(), ShuttleGuiBase::EndStatic(), ShuttleGuiBase::EndVerticalLay(), ShuttleGuiBase::GetParent(), mFormat, mPrompt, mRate, mTime, mTimeCtrl, safenew, ShuttleGuiBase::SetBorder(), ShuttleGuiBase::StartStatic(), ShuttleGuiBase::StartVerticalLay(), NumericConverter::TIME, and TransferDataToWindow().

Here is the call graph for this function:

◆ SetFormatString()

void TimeDialog::SetFormatString ( const NumericFormatSymbol formatString)

Definition at line 102 of file TimeDialog.cpp.

103 {
104  mFormat = formatString;
106 }

References mFormat, and TransferDataToWindow().

Here is the call graph for this function:

◆ SetSampleRate()

void TimeDialog::SetSampleRate ( double  sampleRate)

Definition at line 108 of file TimeDialog.cpp.

109 {
110  mRate = sampleRate;
112 }

References mRate, and TransferDataToWindow().

Here is the call graph for this function:

◆ SetTimeValue()

void TimeDialog::SetTimeValue ( double  newTime)

Definition at line 114 of file TimeDialog.cpp.

115 {
116  mTime = newTime;
118 }

References mTime, and TransferDataToWindow().

Here is the call graph for this function:

◆ TransferDataFromWindow()

bool TimeDialog::TransferDataFromWindow ( )
overrideprivate

Definition at line 90 of file TimeDialog.cpp.

91 {
93 
94  return true;
95 }

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

Here is the call graph for this function:

◆ TransferDataToWindow()

bool TimeDialog::TransferDataToWindow ( )
overrideprivate

Definition at line 80 of file TimeDialog.cpp.

81 {
85  mTimeCtrl->SetFocus();
86 
87  return true;
88 }

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:
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
NumericTextCtrl::Options::AutoPos
Options & AutoPos(bool enable)
Definition: NumericTextCtrl.h:190
NumericTextCtrl::SetFormatString
bool SetFormatString(const FormatStrings &formatString)
Definition: NumericTextCtrl.cpp:1451
TimeDialog::mTime
double mTime
Definition: TimeDialog.h:52
NumericTextCtrl
Definition: NumericTextCtrl.h:172
NumericTextCtrl::SetValue
void SetValue(double newValue)
Definition: NumericTextCtrl.cpp:1474
TimeDialog::mTimeCtrl
NumericTextCtrl * mTimeCtrl
Definition: TimeDialog.h:54
NumericTextCtrl::Options
Definition: NumericTextCtrl.h:178
NumericTextCtrl::SetSampleRate
void SetSampleRate(double sampleRate)
Definition: NumericTextCtrl.cpp:1465
NumericConverter::GetBuiltinFormat
FormatStrings GetBuiltinFormat(const int index)
Definition: NumericTextCtrl.cpp:1209
TimeDialog::mPrompt
TranslatableString mPrompt
Definition: TimeDialog.h:49
TimeDialog::mFormat
NumericFormatSymbol mFormat
Definition: TimeDialog.h:50
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
TimeDialog::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: TimeDialog.cpp:49
NumericConverter::TIME
@ TIME
Definition: NumericTextCtrl.h:52
format
int format
Definition: ExportPCM.cpp:56
ShuttleGuiBase::GetParent
wxWindow * GetParent()
Definition: ShuttleGui.h:496
ShuttleGuiBase::AddWindow
wxWindow * AddWindow(wxWindow *pWindow, int PositionFlags=wxALIGN_CENTRE)
Definition: ShuttleGui.cpp:299
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:893
TimeDialog::TransferDataToWindow
bool TransferDataToWindow() override
Definition: TimeDialog.cpp:80
title
static const auto title
Definition: NoUpdatesAvailableDialog.cpp:22
TimeDialog::mRate
double mRate
Definition: TimeDialog.h:51
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2444
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
wxDialogWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:81
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:922
safenew
#define safenew
Definition: MemoryX.h:10
NumericConverter::GetValue
double GetValue()
Definition: NumericTextCtrl.cpp:1174
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631