Make wxTextEntry::DoSetValue() reusable under wxQt
This is a preparation for wxComboBox and wxBitmapComboBox to reuse the code from the base class by just forwarding to wxTextEntry.
This commit is contained in:
parent
14ac76ed36
commit
7ec7fe6dea
2 changed files with 14 additions and 1 deletions
|
|
@ -41,6 +41,9 @@ protected:
|
|||
virtual void DoSetValue(const wxString& value, int flags=0) override;
|
||||
|
||||
virtual wxWindow *GetEditableWindow() override;
|
||||
|
||||
// Block/unblock the corresponding Qt signal.
|
||||
virtual void EnableTextChangedEvents(bool enable) override;
|
||||
};
|
||||
|
||||
#endif // _WX_QT_TEXTENTRY_H_
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "wx/textentry.h"
|
||||
#include "wx/window.h"
|
||||
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
wxTextEntry::wxTextEntry()
|
||||
{
|
||||
|
|
@ -104,11 +105,20 @@ wxString wxTextEntry::DoGetValue() const
|
|||
return wxString();
|
||||
}
|
||||
|
||||
void wxTextEntry::DoSetValue(const wxString &WXUNUSED(value), int WXUNUSED(flags))
|
||||
void wxTextEntry::DoSetValue(const wxString& value, int flags)
|
||||
{
|
||||
wxTextEntryBase::DoSetValue(value, flags);
|
||||
}
|
||||
|
||||
wxWindow *wxTextEntry::GetEditableWindow()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void wxTextEntry::EnableTextChangedEvents(bool enable)
|
||||
{
|
||||
wxWindow* const win = GetEditableWindow();
|
||||
|
||||
if ( win )
|
||||
win->GetHandle()->blockSignals(!enable);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue