Fix and improve DPI handling in wxStyledTextCtrl.

Fix cursor size after DPI change.

Enable handling DPI events in wxSTCPopupWindow and other popup windows
(that do not inherit from wxTopLevelWindow).

Some cleanup of STC example, and add option to select drawing
technology.

See https://github.com/wxWidgets/wxWidgets/pull/1885
This commit is contained in:
Vadim Zeitlin
2020-06-09 23:56:37 +02:00
17 changed files with 254 additions and 227 deletions

View File

@@ -2392,6 +2392,17 @@
# endif
#endif /* wxUSE_RICHTEXT */
#if wxUSE_RICHTOOLTIP
# if !wxUSE_POPUPWIN
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxRichToolTip requires wxUSE_POPUPWIN"
# else
# undef wxUSE_POPUPWIN
# define wxUSE_POPUPWIN 1
# endif
# endif
#endif /* wxUSE_RICHTOOLTIP */
#if wxUSE_PROPGRID
# if !wxUSE_VARIANT
# ifdef wxABORT_ON_CONFIG_ERROR

View File

@@ -27,11 +27,27 @@ protected:
virtual bool DoSetRegionShape(const wxRegion& region) wxOVERRIDE;
#if wxUSE_GRAPHICS_CONTEXT
virtual bool DoSetPathShape(const wxGraphicsPath& path) wxOVERRIDE;
#endif // wxUSE_GRAPHICS_CONTEXT
virtual WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE;
virtual void InheritAttributes() wxOVERRIDE;
private:
bool HandleDPIChange(const wxSize& newDPI, const wxRect& newRect);
#if wxUSE_GRAPHICS_CONTEXT
wxNonOwnedWindowShapeImpl* m_shapeImpl;
#endif // wxUSE_GRAPHICS_CONTEXT
// Keep track of the DPI used in this window. So when per-monitor dpi
// awareness is enabled, both old and new DPI are known for
// wxDPIChangedEvent and wxWindow::MSWUpdateOnDPIChange.
wxSize m_activeDPI;
// This window supports handling per-monitor DPI awareness when the
// application manifest contains <dpiAwareness>PerMonitorV2</dpiAwareness>.
bool m_perMonitorDPIaware;
wxDECLARE_NO_COPY_CLASS(wxNonOwnedWindow);
};

View File

@@ -115,7 +115,7 @@ public:
virtual WXHWND MSWGetParent() const wxOVERRIDE;
// window proc for the frames
WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE;
virtual WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const wxOVERRIDE { return false; }
@@ -166,9 +166,6 @@ protected:
int& x, int& y,
int& w, int& h) const wxOVERRIDE;
// WM_DPICHANGED handler.
bool HandleDPIChange(const wxSize& newDPI, const wxRect& newRect);
// This field contains the show command to use when showing the window the
// next time and also indicates whether the window should be considered
// being iconized or maximized (which may be different from whether it's
@@ -195,15 +192,6 @@ protected:
wxWindowRef m_winLastFocused;
private:
// Keep track of the DPI used in this window. So when per-monitor dpi
// awareness is enabled, both old and new DPI are known for
// wxDPIChangedEvent and wxWindow::MSWUpdateOnDPIChange.
wxSize m_activeDPI;
// This window supports handling per-monitor DPI awareness when the
// application manifest contains <dpiAwareness>PerMonitorV2</dpiAwareness>.
bool m_perMonitorDPIaware;
// The system menu: initially NULL but can be set (once) by
// MSWGetSystemMenu(). Owned by this window.
wxMenu *m_menuSystem;