X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad6f09f543cc0dbf657cac4a6242d263b9d760dd..ad653fa23069c5d9378247084f03c9a718c3ad62:/src/msw/display.cpp?ds=sidebyside diff --git a/src/msw/display.cpp b/src/msw/display.cpp index ebe394b0d7..ae087f9cd9 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -35,7 +35,7 @@ #include "wx/frame.h" #endif -#include "wx/dynload.h" +#include "wx/dynlib.h" #include "wx/sysopt.h" #include "wx/display_impl.h" @@ -431,7 +431,7 @@ bool wxDisplayMSW::ChangeMode(const wxVideoMode& mode) // do change the mode switch ( pfnChangeDisplaySettingsEx ( - GetName().wx_str(), // display name + GetName().t_str(), // display name pDevMode, // dev mode or NULL to reset NULL, // reserved flags, @@ -608,8 +608,34 @@ int wxDisplayFactoryMSW::GetFromPoint(const wxPoint& pt) int wxDisplayFactoryMSW::GetFromWindow(const wxWindow *window) { +#ifdef __WXMSW__ return FindDisplayFromHMONITOR(gs_MonitorFromWindow(GetHwndOf(window), MONITOR_DEFAULTTONULL)); +#else + const wxSize halfsize = window->GetSize() / 2; + wxPoint pt = window->GetScreenPosition(); + pt.x += halfsize.x; + pt.y += halfsize.y; + return GetFromPoint(pt); +#endif } #endif // wxUSE_DISPLAY + +void wxClientDisplayRect(int *x, int *y, int *width, int *height) +{ +#if defined(__WXMICROWIN__) + *x = 0; *y = 0; + wxDisplaySize(width, height); +#else + // Determine the desktop dimensions minus the taskbar and any other + // special decorations... + RECT r; + + SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0); + if (x) *x = r.left; + if (y) *y = r.top; + if (width) *width = r.right - r.left; + if (height) *height = r.bottom - r.top; +#endif +}