Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
FilesystemValidator Class Reference
Inheritance diagram for FilesystemValidator:
[legend]
Collaboration diagram for FilesystemValidator:
[legend]

Public Member Functions

 FilesystemValidator (const TranslatableString &message)
 
virtual wxObject * Clone () const wxOVERRIDE
 
virtual bool Validate (wxWindow *WXUNUSED(parent)) wxOVERRIDE
 
virtual bool TransferToWindow () wxOVERRIDE
 
virtual bool TransferFromWindow () wxOVERRIDE
 
void OnChar (wxKeyEvent &evt)
 
 wxDECLARE_EVENT_TABLE ()
 

Public Attributes

TranslatableString mMessage
 

Detailed Description

Definition at line 41 of file DirectoriesPrefs.cpp.

Constructor & Destructor Documentation

◆ FilesystemValidator()

FilesystemValidator::FilesystemValidator ( const TranslatableString message)
inline

Definition at line 44 of file DirectoriesPrefs.cpp.

45 : wxValidator()
46 {
47 mMessage = message;
48 }
TranslatableString mMessage

References mMessage.

Referenced by Clone().

Here is the caller graph for this function:

Member Function Documentation

◆ Clone()

virtual wxObject * FilesystemValidator::Clone ( ) const
inlinevirtual

Definition at line 50 of file DirectoriesPrefs.cpp.

51 {
53 }
#define safenew
Definition: MemoryX.h:10
FilesystemValidator(const TranslatableString &message)

References FilesystemValidator(), mMessage, and safenew.

Here is the call graph for this function:

◆ OnChar()

void FilesystemValidator::OnChar ( wxKeyEvent &  evt)
inline

Definition at line 79 of file DirectoriesPrefs.cpp.

80 {
81 evt.Skip();
82
83 wxTextCtrl* tc = wxDynamicCast(GetWindow(), wxTextCtrl);
84 if (!tc) {
85 return;
86 }
87
88 auto keycode = evt.GetUnicodeKey();
89 if (keycode < WXK_SPACE || keycode == WXK_DELETE) {
90 return;
91 }
92
93 wxString path = tc->GetValue();
94 path.insert(tc->GetInsertionPoint(), keycode);
95
96 if (FATFilesystemDenied(path, mMessage)) {
97 evt.Skip(false);
98 return;
99 }
100 }
FILES_API bool FATFilesystemDenied(const FilePath &path, const TranslatableString &msg, const BasicUI::WindowPlacement &placement={})

References TempDirectory::FATFilesystemDenied(), and mMessage.

Here is the call graph for this function:

◆ TransferFromWindow()

virtual bool FilesystemValidator::TransferFromWindow ( )
inlinevirtual

Definition at line 74 of file DirectoriesPrefs.cpp.

75 {
76 return true;
77 }

◆ TransferToWindow()

virtual bool FilesystemValidator::TransferToWindow ( )
inlinevirtual

Definition at line 69 of file DirectoriesPrefs.cpp.

70 {
71 return true;
72 }

◆ Validate()

virtual bool FilesystemValidator::Validate ( wxWindow *  WXUNUSEDparent)
inlinevirtual

Definition at line 55 of file DirectoriesPrefs.cpp.

56 {
57 wxTextCtrl* tc = wxDynamicCast(GetWindow(), wxTextCtrl);
58 if (!tc) {
59 return true;
60 }
61
62 if (FATFilesystemDenied(tc->GetValue(), mMessage)) {
63 return false;
64 }
65
66 return true;
67 }

References TempDirectory::FATFilesystemDenied(), and mMessage.

Here is the call graph for this function:

◆ wxDECLARE_EVENT_TABLE()

FilesystemValidator::wxDECLARE_EVENT_TABLE ( )

Member Data Documentation

◆ mMessage

TranslatableString FilesystemValidator::mMessage

Definition at line 102 of file DirectoriesPrefs.cpp.

Referenced by Clone(), FilesystemValidator(), OnChar(), and Validate().


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