Audacity  3.0.3
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
GetPreferenceCommand Class Referencefinal

Command for getting the value of a preference. More...

#include <PreferenceCommands.h>

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

Public Member Functions

ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
bool DefineParams (ShuttleParams &S) override
 
void PopulateOrExchange (ShuttleGui &S) override
 
bool Apply (const CommandContext &context) override
 
ManualPageID ManualPage () override
 
- Public Member Functions inherited from AudacityCommand
 AudacityCommand ()
 
virtual ~AudacityCommand ()
 
PluginPath GetPath () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
virtual bool Apply (const CommandContext &WXUNUSED(context))
 
bool ShowInterface (wxWindow *parent, bool forceModal=false)
 
virtual void SetHostUI (EffectUIHostInterface *WXUNUSED(host))
 
wxDialog * CreateUI (wxWindow *parent, AudacityCommand *client)
 
virtual bool GetAutomationParameters (wxString &parms)
 
virtual bool SetAutomationParameters (const wxString &parms)
 
bool DoAudacityCommand (wxWindow *parent, const CommandContext &context, bool shouldPrompt=true)
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
virtual bool Init ()
 
virtual bool PromptUser (wxWindow *parent)
 
virtual bool CheckWhetherSkipAudacityCommand ()
 
virtual void End ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual bool TransferDataToWindow ()
 
virtual bool TransferDataFromWindow ()
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 

Public Attributes

wxString mName
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Get Preference") }
 

Additional Inherited Members

- Public Types inherited from AudacityCommand
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
using VetoDialogHook = bool(*)(wxDialog *)
 
- Static Public Member Functions inherited from AudacityCommand
static VetoDialogHook SetVetoDialogHook (VetoDialogHook hook)
 
- Protected Attributes inherited from AudacityCommand
ProgressDialogmProgress
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 
int mUIResultID
 

Detailed Description

Command for getting the value of a preference.

Definition at line 29 of file PreferenceCommands.h.

Member Function Documentation

◆ Apply()

bool GetPreferenceCommand::Apply ( const CommandContext context)
override

Definition at line 50 of file PreferenceCommands.cpp.

51 {
52  wxString prefValue;
53  if (!gPrefs->Read(mName, &prefValue))
54  return false;
55 
56  context.Status(prefValue);
57  return true;
58 }

References gPrefs, mName, and CommandContext::Status().

Here is the call graph for this function:

◆ DefineParams()

bool GetPreferenceCommand::DefineParams ( ShuttleParams S)
override

Definition at line 33 of file PreferenceCommands.cpp.

33  {
34  S.Define( mName, wxT("Name"), wxT("") );
35  return true;
36 }

References ShuttleParams::Define(), and mName.

Here is the call graph for this function:

◆ GetDescription()

TranslatableString GetPreferenceCommand::GetDescription ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 36 of file PreferenceCommands.h.

36 {return XO("Gets the value of a single preference.");};

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol GetPreferenceCommand::GetSymbol ( )
inlineoverridevirtual

Implements AudacityCommand.

Definition at line 35 of file PreferenceCommands.h.

35 {return Symbol;};

References Symbol.

◆ ManualPage()

ManualPageID GetPreferenceCommand::ManualPage ( )
inlineoverridevirtual

Reimplemented from AudacityCommand.

Definition at line 42 of file PreferenceCommands.h.

42 {return L"Extra_Menu:_Scriptables_I#get_preference";}

◆ PopulateOrExchange()

void GetPreferenceCommand::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 38 of file PreferenceCommands.cpp.

39 {
40  S.AddSpace(0, 5);
41 
42  S.StartMultiColumn(2, wxALIGN_CENTER);
43  {
44  S.TieTextBox(XXO("Name:"),mName);
45  }
46  S.EndMultiColumn();
47 }

References ShuttleGui::AddSpace(), ShuttleGuiBase::EndMultiColumn(), mName, ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::TieTextBox(), and XXO.

Here is the call graph for this function:

Member Data Documentation

◆ mName

wxString GetPreferenceCommand::mName

Definition at line 44 of file PreferenceCommands.h.

Referenced by Apply(), DefineParams(), and PopulateOrExchange().

◆ Symbol

const ComponentInterfaceSymbol GetPreferenceCommand::Symbol { XO("Get Preference") }
static

Definition at line 32 of file PreferenceCommands.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2459
XO
#define XO(s)
Definition: Internat.h:31
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
GetPreferenceCommand::mName
wxString mName
Definition: PreferenceCommands.h:44
ShuttleGuiBase::TieTextBox
wxTextCtrl * TieTextBox(const TranslatableString &Caption, wxString &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1652
CommandContext::Status
virtual void Status(const wxString &message, bool bFlush=false) const
Definition: CommandContext.cpp:63
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
GetPreferenceCommand::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: PreferenceCommands.h:32
ShuttleParams::Define
virtual void Define(bool &var, const wxChar *key, const bool vdefault, const bool vmin=false, const bool vmax=false, const bool vscl=false)
Definition: Shuttle.cpp:332