Implement support for wxTE_PASSWORD and MarkDirty()/DiscardEdits() in
wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1026
This commit is contained in:
Vadim Zeitlin 2018-11-20 14:13:45 +01:00
commit a1adc2efa4

View File

@ -121,6 +121,8 @@ bool wxTextCtrl::Create(wxWindow *parent,
{
m_qtLineEdit = new wxQtLineEdit( parent, this );
m_qtTextEdit = NULL;
if ( style & wxTE_PASSWORD )
m_qtLineEdit->setEchoMode( QLineEdit::Password );
}
else
{
@ -161,15 +163,26 @@ int wxTextCtrl::GetNumberOfLines() const
bool wxTextCtrl::IsModified() const
{
return false;
if ( IsSingleLine() )
return m_qtLineEdit->isModified();
else
return m_qtTextEdit->isWindowModified();
}
void wxTextCtrl::MarkDirty()
{
if ( IsSingleLine() )
return m_qtLineEdit->setModified( true );
else
return m_qtTextEdit->setWindowModified( true );
}
void wxTextCtrl::DiscardEdits()
{
if ( IsSingleLine() )
return m_qtLineEdit->setModified( false );
else
return m_qtTextEdit->setWindowModified( false );
}
bool wxTextCtrl::SetStyle(long WXUNUSED(start), long WXUNUSED(end), const wxTextAttr& WXUNUSED(style))