X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..c56ae04274fda26269c6d06be34cf59a45eb70ce:/src/common/dpycmn.cpp diff --git a/src/common/dpycmn.cpp b/src/common/dpycmn.cpp index 8797f81ecb..6527fc64de 100644 --- a/src/common/dpycmn.cpp +++ b/src/common/dpycmn.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: common/dpycmn.cpp +// Name: src/common/dpycmn.cpp // Purpose: wxDisplayBase implementation // Author: Vadim Zeitlin // Modified by: @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "displaybase.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -28,12 +24,17 @@ #pragma hdrstop #endif -#include "wx/display.h" - #if wxUSE_DISPLAY +#ifndef WX_PRECOMP + #include "wx/gdicmn.h" + #include "wx/window.h" +#endif //WX_PRECOMP + +#include "wx/display.h" + #include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxArrayVideoModes); +WX_DEFINE_OBJARRAY(wxArrayVideoModes) const wxVideoMode wxDefaultVideoMode; @@ -48,5 +49,18 @@ wxDisplayBase::wxDisplayBase(size_t index) wxT("An invalid index was passed to wxDisplay") ); } -#endif // wxUSE_DISPLAY +// MSW has its own specific implementation of this +#ifndef __WXMSW__ + +int wxDisplayBase::GetFromWindow(wxWindow *window) +{ + wxCHECK_MSG( window, wxNOT_FOUND, _T("NULL window") ); + // consider that the window belong to the display containing its centre + const wxRect r(window->GetRect()); + return GetFromPoint(wxPoint(r.x + r.width/2, r.y + r.height/2)); +} + +#endif // !__WXMSW__ + +#endif // wxUSE_DISPLAY