mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-21 13:26:08 +08:00
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:
@@ -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
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user