]>
Commit | Line | Data |
---|---|---|
c6985199 | 1 | /////////////////////////////////////////////////////////////////////////////// |
e77138c0 | 2 | // Name: src/common/dpycmn.cpp |
c6985199 VZ |
3 | // Purpose: wxDisplayBase implementation |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 01.03.03 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwindows.org> | |
65571936 | 9 | // License: wxWindows licence |
c6985199 VZ |
10 | /////////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | // ============================================================================ | |
13 | // declarations | |
14 | // ============================================================================ | |
15 | ||
16 | // ---------------------------------------------------------------------------- | |
17 | // headers | |
18 | // ---------------------------------------------------------------------------- | |
19 | ||
c6985199 VZ |
20 | // For compilers that support precompilation, includes "wx.h". |
21 | #include "wx/wxprec.h" | |
22 | ||
23 | #ifdef __BORLANDC__ | |
24 | #pragma hdrstop | |
25 | #endif | |
26 | ||
fdc37e95 | 27 | #if wxUSE_DISPLAY |
c6985199 | 28 | |
e77138c0 WS |
29 | #ifndef WX_PRECOMP |
30 | #include "wx/gdicmn.h" | |
31 | #include "wx/window.h" | |
32 | #endif //WX_PRECOMP | |
33 | ||
34 | #include "wx/display.h" | |
35 | ||
c6985199 | 36 | #include "wx/arrimpl.cpp" |
28c91b7d | 37 | WX_DEFINE_OBJARRAY(wxArrayVideoModes) |
c6985199 VZ |
38 | |
39 | const wxVideoMode wxDefaultVideoMode; | |
40 | ||
41 | // ============================================================================ | |
42 | // implementation | |
43 | // ============================================================================ | |
44 | ||
45 | wxDisplayBase::wxDisplayBase(size_t index) | |
46 | : m_index (index) | |
47 | { | |
d890ea0d | 48 | wxASSERT_MSG( m_index < GetCount(), |
c6985199 VZ |
49 | wxT("An invalid index was passed to wxDisplay") ); |
50 | } | |
51 | ||
dae6a419 VZ |
52 | // MSW has its own specific implementation of this |
53 | #ifndef __WXMSW__ | |
54 | ||
55 | int wxDisplayBase::GetFromWindow(wxWindow *window) | |
56 | { | |
57 | wxCHECK_MSG( window, wxNOT_FOUND, _T("NULL window") ); | |
58 | ||
59 | // consider that the window belong to the display containing its centre | |
60 | const wxRect r(window->GetRect()); | |
61 | return GetFromPoint(wxPoint(r.x + r.width/2, r.y + r.height/2)); | |
62 | } | |
63 | ||
64 | #endif // !__WXMSW__ | |
65 | ||
c6985199 | 66 | #endif // wxUSE_DISPLAY |