Audacity  3.0.3
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 22 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 25 of file wxTextCtrlWrapper.h.

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

◆ ~wxTextCtrlWrapper()

wxTextCtrlWrapper::~wxTextCtrlWrapper ( )
inline

Definition at line 52 of file wxTextCtrlWrapper.h.

53  {
54  };

Member Function Documentation

◆ AcceptsFocusFromKeyboard()

virtual bool wxTextCtrlWrapper::AcceptsFocusFromKeyboard ( ) const
inlineoverridevirtual

Definition at line 56 of file wxTextCtrlWrapper.h.

57  {
58  return true;
59  }

◆ IsReadOnly()

bool wxTextCtrlWrapper::IsReadOnly ( )
inline

Definition at line 61 of file wxTextCtrlWrapper.h.

62  {
63  return mReadOnly;
64  }

References mReadOnly.

◆ SetReadOnly()

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

Definition at line 66 of file wxTextCtrlWrapper.h.

67  {
68  mReadOnly = readonly;
69  }

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 72 of file wxTextCtrlWrapper.h.

Referenced by IsReadOnly(), and SetReadOnly().


The documentation for this class was generated from the following file:
wxTextCtrlWrapper::mReadOnly
bool mReadOnly
Definition: wxTextCtrlWrapper.h:72
name
const TranslatableString name
Definition: Distortion.cpp:98