Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
wxTextCtrlWrapper Class Referencefinal

#include <wxTextCtrlWrapper.h>

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

Public Member Functions

 wxTextCtrlWrapper (wxWindow *parent, wxWindowID id, const wxString &value={}, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxTextCtrlNameStr)
 
 ~wxTextCtrlWrapper ()
 
virtual bool AcceptsFocusFromKeyboard () const override
 
bool IsReadOnly ()
 
void SetReadOnly (bool readonly=true)
 

Private Attributes

bool mReadOnly
 

Detailed Description

Definition at line 20 of file wxTextCtrlWrapper.h.

Constructor & Destructor Documentation

◆ wxTextCtrlWrapper()

wxTextCtrlWrapper::wxTextCtrlWrapper ( wxWindow *  parent,
wxWindowID  id,
const wxString &  value = {},
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = 0,
const wxValidator &  validator = wxDefaultValidator,
const wxString &  name = wxTextCtrlNameStr 
)
inline

Definition at line 23 of file wxTextCtrlWrapper.h.

24 {},
25 const wxPoint &pos = wxDefaultPosition,
26 const wxSize &size = wxDefaultSize,
27 long style = 0,
28 const wxValidator &validator = wxDefaultValidator,
29 const wxString &name = wxTextCtrlNameStr)
30 : wxTextCtrl(parent, id, value, pos, size, style, validator, name)
31 {
32 mReadOnly = false;
33
34 Bind(wxEVT_KEY_DOWN, [&](wxKeyEvent &event)
35 {
36 auto keyCode = event.GetKeyCode();
37 if (mReadOnly)
38 {
39 if (keyCode >= WXK_SPACE || keyCode == WXK_DELETE || keyCode == WXK_BACK)
40 {
41 event.Skip(false);
42 return;
43 }
44 }
45
46 event.Skip();
47 });
48 };
const TranslatableString name
Definition: Distortion.cpp:76

◆ ~wxTextCtrlWrapper()

wxTextCtrlWrapper::~wxTextCtrlWrapper ( )
inline

Definition at line 50 of file wxTextCtrlWrapper.h.

51 {
52 };

Member Function Documentation

◆ AcceptsFocusFromKeyboard()

virtual bool wxTextCtrlWrapper::AcceptsFocusFromKeyboard ( ) const
inlineoverridevirtual

Definition at line 54 of file wxTextCtrlWrapper.h.

55 {
56 return true;
57 }

◆ IsReadOnly()

bool wxTextCtrlWrapper::IsReadOnly ( )
inline

Definition at line 59 of file wxTextCtrlWrapper.h.

60 {
61 return mReadOnly;
62 }

References mReadOnly.

◆ SetReadOnly()

void wxTextCtrlWrapper::SetReadOnly ( bool  readonly = true)
inline

Definition at line 64 of file wxTextCtrlWrapper.h.

65 {
66 mReadOnly = readonly;
67 }

References mReadOnly.

Referenced by TimerRecordDialog::PopulateOrExchange().

Here is the caller graph for this function:

Member Data Documentation

◆ mReadOnly

bool wxTextCtrlWrapper::mReadOnly
private

Definition at line 70 of file wxTextCtrlWrapper.h.

Referenced by IsReadOnly(), and SetReadOnly().


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