From f790ccee6ff6f261a307caa10252a68e954a2349 Mon Sep 17 00:00:00 2001 From: oneeyeman1 Date: Sun, 18 Nov 2018 23:19:45 -0500 Subject: [PATCH 1/3] Implement Password style for text control under wxQt --- src/qt/textctrl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt/textctrl.cpp b/src/qt/textctrl.cpp index c600216903..d9069b9b60 100644 --- a/src/qt/textctrl.cpp +++ b/src/qt/textctrl.cpp @@ -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 { From a245c0af1e4b5ea7faa48521b701e295c8381ce5 Mon Sep 17 00:00:00 2001 From: oneeyeman1 Date: Sun, 18 Nov 2018 23:40:05 -0500 Subject: [PATCH 2/3] Implement modification flag on text control for wxQt --- src/qt/textctrl.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/qt/textctrl.cpp b/src/qt/textctrl.cpp index d9069b9b60..60baa4c719 100644 --- a/src/qt/textctrl.cpp +++ b/src/qt/textctrl.cpp @@ -163,15 +163,26 @@ int wxTextCtrl::GetNumberOfLines() const bool wxTextCtrl::IsModified() const { - return false; + if( !IsMultiLine() ) + return m_qtLineEdit->isModified(); + else + return m_qtTextEdit->isWindowModified(); } void wxTextCtrl::MarkDirty() { + if( !IsMultiLine() ) + return m_qtLineEdit->setModified( true ); + else + return m_qtTextEdit->setWindowModified( true ); } void wxTextCtrl::DiscardEdits() { + if( !IsMultiLine() ) + return m_qtLineEdit->setModified( false ); + else + return m_qtTextEdit->setWindowModified( false ); } bool wxTextCtrl::SetStyle(long WXUNUSED(start), long WXUNUSED(end), const wxTextAttr& WXUNUSED(style)) From add8e8804b41045c297a5e85de711abe2beb002c Mon Sep 17 00:00:00 2001 From: oneeyeman1 Date: Tue, 20 Nov 2018 05:51:29 -0500 Subject: [PATCH 3/3] Follow up with the PR comments --- src/qt/textctrl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qt/textctrl.cpp b/src/qt/textctrl.cpp index 60baa4c719..5ef1bd97ff 100644 --- a/src/qt/textctrl.cpp +++ b/src/qt/textctrl.cpp @@ -121,7 +121,7 @@ bool wxTextCtrl::Create(wxWindow *parent, { m_qtLineEdit = new wxQtLineEdit( parent, this ); m_qtTextEdit = NULL; - if( style & wxTE_PASSWORD ) + if ( style & wxTE_PASSWORD ) m_qtLineEdit->setEchoMode( QLineEdit::Password ); } else @@ -163,7 +163,7 @@ int wxTextCtrl::GetNumberOfLines() const bool wxTextCtrl::IsModified() const { - if( !IsMultiLine() ) + if ( IsSingleLine() ) return m_qtLineEdit->isModified(); else return m_qtTextEdit->isWindowModified(); @@ -171,7 +171,7 @@ bool wxTextCtrl::IsModified() const void wxTextCtrl::MarkDirty() { - if( !IsMultiLine() ) + if ( IsSingleLine() ) return m_qtLineEdit->setModified( true ); else return m_qtTextEdit->setWindowModified( true ); @@ -179,7 +179,7 @@ void wxTextCtrl::MarkDirty() void wxTextCtrl::DiscardEdits() { - if( !IsMultiLine() ) + if ( IsSingleLine() ) return m_qtLineEdit->setModified( false ); else return m_qtTextEdit->setWindowModified( false );