remove wxComboBox-specific hack, override DoSetToolTip() in wxComboBox itself instead
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -126,8 +126,13 @@ public:
|
|||||||
void OnUpdateDelete(wxUpdateUIEvent& event);
|
void OnUpdateDelete(wxUpdateUIEvent& event);
|
||||||
void OnUpdateSelectAll(wxUpdateUIEvent& event);
|
void OnUpdateSelectAll(wxUpdateUIEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||||
|
|
||||||
|
#if wxUSE_TOOLTIPS
|
||||||
|
virtual void DoSetToolTip(wxToolTip *tip);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox)
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox)
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
@@ -807,4 +807,16 @@ void wxComboBox::OnUpdateSelectAll(wxUpdateUIEvent& event)
|
|||||||
event.Enable(IsEditable() && GetLastPosition() > 0);
|
event.Enable(IsEditable() && GetLastPosition() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_TOOLTIPS
|
||||||
|
|
||||||
|
void wxComboBox::DoSetToolTip(wxToolTip *tip)
|
||||||
|
{
|
||||||
|
wxChoice::DoSetToolTip(tip);
|
||||||
|
|
||||||
|
if ( tip && !HasFlag(wxCB_READONLY) )
|
||||||
|
tip->Add(GetEditHWND());
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_TOOLTIPS
|
||||||
|
|
||||||
#endif // wxUSE_COMBOBOX
|
#endif // wxUSE_COMBOBOX
|
||||||
|
@@ -31,7 +31,6 @@
|
|||||||
#include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
|
#include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
|
||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
#include "wx/combobox.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/tokenzr.h"
|
#include "wx/tokenzr.h"
|
||||||
@@ -419,22 +418,6 @@ void wxToolTip::SetWindow(wxWindow *win)
|
|||||||
Add((WXHWND)hwnd);
|
Add((WXHWND)hwnd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// VZ: it's ugly to do it here, but I don't want any major changes right
|
|
||||||
// now, later we will probably want to have wxWindow::OnGotToolTip() or
|
|
||||||
// something like this where the derived class can do such things
|
|
||||||
// itself instead of wxToolTip "knowing" about them all
|
|
||||||
wxComboBox *combo = wxDynamicCast(control, wxComboBox);
|
|
||||||
if ( combo )
|
|
||||||
{
|
|
||||||
WXHWND hwndComboEdit = combo->GetWindowStyle() & wxCB_READONLY
|
|
||||||
? combo->GetHWND()
|
|
||||||
: combo->GetEditHWND();
|
|
||||||
if ( hwndComboEdit )
|
|
||||||
{
|
|
||||||
Add(hwndComboEdit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // !defined(__WXUNIVERSAL__)
|
#endif // !defined(__WXUNIVERSAL__)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user