1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: common/dpycmn.cpp
3 // Purpose: wxDisplayBase implementation
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
9 // License: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
27 #include "wx/display.h"
31 #include "wx/arrimpl.cpp"
32 WX_DEFINE_OBJARRAY(wxArrayVideoModes
)
34 const wxVideoMode wxDefaultVideoMode
;
36 // ============================================================================
38 // ============================================================================
40 wxDisplayBase::wxDisplayBase(size_t index
)
43 wxASSERT_MSG( m_index
< GetCount(),
44 wxT("An invalid index was passed to wxDisplay") );
47 // MSW has its own specific implementation of this
50 int wxDisplayBase::GetFromWindow(wxWindow
*window
)
52 wxCHECK_MSG( window
, wxNOT_FOUND
, _T("NULL window") );
54 // consider that the window belong to the display containing its centre
55 const wxRect
r(window
->GetRect());
56 return GetFromPoint(wxPoint(r
.x
+ r
.width
/2, r
.y
+ r
.height
/2));
61 #endif // wxUSE_DISPLAY