Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog Class Reference
Inheritance diagram for anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog:
[legend]
Collaboration diagram for anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog:
[legend]

Public Member Functions

 PluginScanDialog (wxWindow *parent, wxWindowID winid, const TranslatableString &title)
 
void UpdateProgress (const wxString &text, float progress)
 
void OnShow (wxShowEvent &evt)
 
void OnIdle (wxIdleEvent &evt)
 
void UpdateElapsedTime ()
 
- 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 Attributes

wxStaticText * mText {nullptr}
 
wxStaticText * mElapsed {nullptr}
 
wxGauge * mProgress {nullptr}
 
std::chrono::system_clock::time_point mStartTime
 

Detailed Description

Definition at line 33 of file PluginStartupRegistration.cpp.

Constructor & Destructor Documentation

◆ PluginScanDialog()

anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog::PluginScanDialog ( wxWindow *  parent,
wxWindowID  winid,
const TranslatableString title 
)
inline

Definition at line 41 of file PluginStartupRegistration.cpp.

45 : wxDialogWrapper(parent, winid, title)
46 {
47 auto rootSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
48 auto topSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
49 topSizer->Add(mText =
50 safenew wxStaticText(
51 this,
52 wxID_ANY,
53 wxEmptyString,
54 wxDefaultPosition,
55 wxDefaultSize,
56 wxST_ELLIPSIZE_START | wxST_NO_AUTORESIZE),
57 1, wxEXPAND);
58 topSizer->AddSpacer(5);
59 topSizer->Add(safenew wxButton(this, wxID_IGNORE, _("&Skip")), 0);
60
61 auto timerSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
62 timerSizer->Add(
63 safenew wxStaticText(
64 this,
65 wxID_ANY,
66 _("Elapsed Time:"),
67 wxDefaultPosition,
68 wxDefaultSize,
69 wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL), 1, wxEXPAND);
70 timerSizer->AddSpacer(5);
71 timerSizer->Add(mElapsed =
72 safenew wxStaticText(
73 this,
74 wxID_ANY,
75 wxEmptyString,
76 wxDefaultPosition,
77 wxDefaultSize,
78 wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL), 1, wxEXPAND);
79
80 rootSizer->Add(topSizer.release(), 0, wxEXPAND | wxALL, 10);
81 rootSizer->Add(mProgress =
82 safenew wxGauge(this, wxID_ANY, 1000),
83 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
84 rootSizer->AddSpacer(10);
85 rootSizer->Add(timerSizer.release(), 0, wxEXPAND);
86#ifdef __WXMAC__
87 rootSizer->Add(CreateButtonSizer(wxCANCEL), 0, wxEXPAND);
88#else
89 rootSizer->Add(CreateButtonSizer(wxCANCEL), 0, wxEXPAND | wxALL, 10);
90#endif
91 SetSizer(rootSizer.release());
92
93 Bind(wxEVT_SHOW, &PluginScanDialog::OnShow, this);
94 Bind(wxEVT_IDLE, &PluginScanDialog::OnIdle, this);
95
96 SetInitialSize({500, -1});
97 }
#define _(s)
Definition: Internat.h:73
#define safenew
Definition: MemoryX.h:9
static const auto title

References _, and safenew.

Member Function Documentation

◆ OnIdle()

void anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog::OnIdle ( wxIdleEvent &  evt)
inline

◆ OnShow()

void anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog::OnShow ( wxShowEvent &  evt)
inline

Definition at line 106 of file PluginStartupRegistration.cpp.

107 {
108 evt.Skip();
109 if(evt.IsShown())
110 {
111 mStartTime = std::chrono::system_clock::now();
113 }
114 }

◆ UpdateElapsedTime()

void anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog::UpdateElapsedTime ( )
inline

Definition at line 122 of file PluginStartupRegistration.cpp.

123 {
124 auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - mStartTime).count();
125 mElapsed->SetLabel(wxTimeSpan(0, 0, 0, elapsed).Format("%H:%M:%S"));
126 }
Abstract base class used in importing a file.

◆ UpdateProgress()

void anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog::UpdateProgress ( const wxString &  text,
float  progress 
)
inline

Definition at line 99 of file PluginStartupRegistration.cpp.

100 {
101 mText->SetLabel(text);
102 mText->SetToolTip(text);
103 mProgress->SetValue(mProgress->GetRange() * progress);
104 }

Member Data Documentation

◆ mElapsed

wxStaticText* anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog::mElapsed {nullptr}
private

Definition at line 36 of file PluginStartupRegistration.cpp.

◆ mProgress

wxGauge* anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog::mProgress {nullptr}
private

Definition at line 37 of file PluginStartupRegistration.cpp.

◆ mStartTime

std::chrono::system_clock::time_point anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog::mStartTime
private

Definition at line 38 of file PluginStartupRegistration.cpp.

◆ mText

wxStaticText* anonymous_namespace{PluginStartupRegistration.cpp}::PluginScanDialog::mText {nullptr}
private

Definition at line 35 of file PluginStartupRegistration.cpp.


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