Implement wxTextCtrl::{Set,Is}Editable() under wxQt
This commit is contained in:
parent
334814bf85
commit
d91fd33ffd
2 changed files with 21 additions and 0 deletions
|
|
@ -76,6 +76,9 @@ public:
|
|||
|
||||
virtual void EmptyUndoBuffer() override;
|
||||
|
||||
virtual bool IsEditable() const override;
|
||||
virtual void SetEditable(bool editable) override;
|
||||
|
||||
virtual wxString DoGetValue() const override;
|
||||
virtual void DoSetValue(const wxString &text, int flags = 0) override;
|
||||
virtual void WriteText(const wxString& text) override;
|
||||
|
|
|
|||
|
|
@ -816,6 +816,24 @@ void wxTextCtrl::EmptyUndoBuffer()
|
|||
m_qtEdit->EmptyUndoBuffer();
|
||||
}
|
||||
|
||||
bool wxTextCtrl::IsEditable() const
|
||||
{
|
||||
return HasFlag(wxTE_READONLY);
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetEditable(bool editable)
|
||||
{
|
||||
long flags = GetWindowStyle();
|
||||
|
||||
if ( editable )
|
||||
flags &= ~wxTE_READONLY;
|
||||
else
|
||||
flags |= wxTE_READONLY;
|
||||
|
||||
SetWindowStyle(flags);
|
||||
m_qtEdit->SetStyleFlags(flags);
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetInsertionPoint(long pos)
|
||||
{
|
||||
m_qtEdit->SetInsertionPoint(pos);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue