Merge branch 'searchctrl-improve'

Closes https://github.com/wxWidgets/wxWidgets/pull/851
This commit is contained in:
Vadim Zeitlin
2018-07-10 14:40:58 +02:00
7 changed files with 82 additions and 103 deletions

View File

@@ -172,26 +172,6 @@ public:
virtual bool DoAutoCompleteFileNames(int flags) wxOVERRIDE;
virtual bool DoAutoCompleteCustom(wxTextCompleter *completer) wxOVERRIDE;
#if 0
// override streambuf method
#if wxHAS_TEXT_WINDOW_STREAM
int overflow(int i);
#endif // wxHAS_TEXT_WINDOW_STREAM
// stream-like insertion operators: these are always available, whether we
// were, or not, compiled with streambuf support
wxTextCtrl& operator<<(const wxString& s);
wxTextCtrl& operator<<(int i);
wxTextCtrl& operator<<(long i);
wxTextCtrl& operator<<(float f);
wxTextCtrl& operator<<(double d);
wxTextCtrl& operator<<(wxChar c);
#endif
// do the window-specific processing after processing the update event
virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) wxOVERRIDE;
virtual bool ShouldInheritColours() const wxOVERRIDE;
// wxWindow overrides
@@ -214,7 +194,6 @@ protected:
// override the base class virtuals involved into geometry calculations
virtual wxSize DoGetBestClientSize() const wxOVERRIDE;
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
virtual void RecalcBitmaps();
@@ -257,9 +236,6 @@ private:
wxMenu *m_menu;
#endif // wxUSE_MENUS
bool m_searchButtonVisible;
bool m_cancelButtonVisible;
bool m_searchBitmapUser;
bool m_cancelBitmapUser;
#if wxUSE_MENUS

View File

@@ -82,19 +82,35 @@ WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
// misc macros
// ---------------------------------------------------------------------------
#if wxUSE_GUI
#define MEANING_CHARACTER '0'
#define DEFAULT_ITEM_WIDTH 100
#define DEFAULT_ITEM_HEIGHT 80
// Scale font to get edit control height
//#define EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) (3*(cy)/2)
#define EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) (cy+8)
// Return the height of a native text control corresponding to the given
// character height (as returned by GetCharHeight() or wxGetCharSize()).
//
// The wxWindow parameter must be valid and used for getting the DPI.
inline int wxGetEditHeightFromCharHeight(int cy, const wxWindow* w)
{
// The value 8 here is empiric, i.e. it's not necessarily correct, but
// seems to work relatively well.
return cy + w->FromDIP(8);
}
// Compatibility macro used in the existing code. It assumes that it's called
// from a method of wxWindow-derived object.
#define EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) \
wxGetEditHeightFromCharHeight((cy), this)
// Generic subclass proc, for panel item moving/sizing and intercept
// EDIT control VK_RETURN messages
extern LONG APIENTRY
wxSubclassedGenericControlProc(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
#endif // wxUSE_GUI
// ---------------------------------------------------------------------------
// useful macros and functions
// ---------------------------------------------------------------------------