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 NumericFormatID &format, const AudacityProject &project, double time, const TranslatableString &prompt=XO("Duration"))
 
void SetFormatString (const NumericFormatID &formatString)
 
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
 
NumericFormatID mFormat
 
const AudacityProjectmProject
 
double mTime
 
NumericTextCtrlmTimeCtrl
 

Detailed Description

Dialog used to request a time value.

Definition at line 24 of file TimeDialog.h.

Constructor & Destructor Documentation

◆ TimeDialog()

TimeDialog::TimeDialog ( wxWindow *  parent,
const TranslatableString title,
const NumericFormatID format,
const AudacityProject project,
double  time,
const TranslatableString prompt = XO("Duration") 
)

Definition at line 29 of file TimeDialog.cpp.

35: wxDialogWrapper(parent, wxID_ANY, title),
36 mPrompt(prompt),
39 mTime(time),
40 mTimeCtrl(NULL)
41{
42 SetName();
45}
static const auto title
@ eIsCreating
Definition: ShuttleGui.h:37
const auto project
#define S(N)
Definition: ToChars.cpp:64
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
double mTime
Definition: TimeDialog.h:52
void PopulateOrExchange(ShuttleGui &S)
Definition: TimeDialog.cpp:47
NumericTextCtrl * mTimeCtrl
Definition: TimeDialog.h:54
const AudacityProject & mProject
Definition: TimeDialog.h:51
TranslatableString mPrompt
Definition: TimeDialog.h:49
NumericFormatID mFormat
Definition: TimeDialog.h:50

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 112 of file TimeDialog.cpp.

113{
114 Layout();
115 Refresh();
116
117 event.Skip(false);
118}

◆ PopulateOrExchange()

void TimeDialog::PopulateOrExchange ( ShuttleGui S)
private

Definition at line 47 of file TimeDialog.cpp.

48{
49 S.SetBorder(5);
50 S.StartVerticalLay(true);
51 {
52 S.StartStatic(mPrompt, true);
53 {
57 S.GetParent(), wxID_ANY,
59 mFormat,
60 mTime,
62 .AutoPos(true));
63 S.AddWindow(mTimeCtrl);
64 }
65 S.EndStatic();
66 }
67 S.EndVerticalLay();
68 S.AddStandardButtons();
69
71
72 Layout();
73 Fit();
74 SetMinSize(GetSize());
75 Center();
76}
#define safenew
Definition: MemoryX.h:9
const NumericConverterType & NumericConverterType_TIME()
static FormatterContext ProjectContext(const AudacityProject &project)
bool TransferDataToWindow() override
Definition: TimeDialog.cpp:78
Options & AutoPos(bool enable)

References NumericTextCtrl::Options::AutoPos(), mFormat, mProject, mPrompt, mTime, mTimeCtrl, NumericConverterType_TIME(), FormatterContext::ProjectContext(), S, safenew, and TransferDataToWindow().

Here is the call graph for this function:

◆ SetFormatString()

void TimeDialog::SetFormatString ( const NumericFormatID 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:

◆ SetTimeValue()

void TimeDialog::SetTimeValue ( double  newTime)

Definition at line 106 of file TimeDialog.cpp.

107{
108 mTime = newTime;
110}

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 78 of file TimeDialog.cpp.

79{
82 mTimeCtrl->SetFocus();
83
84 return true;
85}
bool SetFormatName(const NumericFormatID &formatName)
void SetValue(double newValue)

References mFormat, mTime, mTimeCtrl, NumericTextCtrl::SetFormatName(), and NumericTextCtrl::SetValue().

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

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

Member Data Documentation

◆ mFormat

NumericFormatID TimeDialog::mFormat
private

Definition at line 50 of file TimeDialog.h.

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

◆ mProject

const AudacityProject& TimeDialog::mProject
private

Definition at line 51 of file TimeDialog.h.

Referenced by PopulateOrExchange().

◆ mPrompt

TranslatableString TimeDialog::mPrompt
private

Definition at line 49 of file TimeDialog.h.

Referenced by PopulateOrExchange().

◆ 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: