]> git.saurik.com Git - wxWidgets.git/blame_incremental - interface/wx/display.h
A lot of documentation revision. Updated doctest code in propgrid sample to reflect...
[wxWidgets.git] / interface / wx / display.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: display.h
3// Purpose: interface of wxDisplay
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxDisplay
11
12 Determines the sizes and locations of displays connected to the system.
13
14 @library{wxcore}
15 @category{misc}
16
17 @see wxClientDisplayRect(), wxDisplaySize(), wxDisplaySizeMM()
18*/
19class wxDisplay
20{
21public:
22 /**
23 Constructor, setting up a wxDisplay instance with the specified
24 display.
25
26 @param index
27 The index of the display to use. This must be non-negative and
28 lower than the value returned by GetCount().
29 */
30 wxDisplay(unsigned index = 0);
31
32 /**
33 Destructor.
34 */
35 ~wxDisplay();
36
37 /**
38 Changes the video mode of this display to the mode specified in the
39 mode parameter.
40
41 If wxDefaultVideoMode is passed in as the mode parameter, the defined
42 behaviour is that wxDisplay will reset the video mode to the default
43 mode used by the display. On Windows, the behavior is normal. However,
44 there are differences on other platforms. On Unix variations using X11
45 extensions it should behave as defined, but some irregularities may
46 occur.
47
48 On wxMac passing in wxDefaultVideoMode as the mode parameter does
49 nothing. This happens because carbon no longer has access to
50 @c DMUseScreenPrefs(), an undocumented function that changed the video
51 mode to the system default by using the system's "scrn" resource.
52 */
53 bool ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode);
54
55 /**
56 Returns the client area of the display. The client area is the part of
57 the display available for the normal (non full screen) windows, usually
58 it is the same as GetGeometry() but it could be less if there is a
59 taskbar (or equivalent) on this display.
60 */
61 wxRect GetClientArea() const;
62
63 /**
64 Returns the number of connected displays.
65 */
66 static unsigned GetCount();
67
68 /**
69 Returns the current video mode that this display is in.
70 */
71 wxVideoMode GetCurrentMode() const;
72
73 /**
74 Returns the bit depth of the display whose index was passed to the
75 constructor.
76 */
77 int GetDepth() const;
78
79 /**
80 Returns the index of the display on which the given point lies, or
81 @c wxNOT_FOUND if the point is not on any connected display.
82
83 @param pt
84 The point to locate.
85 */
86 static int GetFromPoint(const wxPoint& pt);
87
88 /**
89 Returns the index of the display on which the given window lies.
90
91 If the window is on more than one display it gets the display that
92 overlaps the window the most.
93
94 Returns @c wxNOT_FOUND if the window is not on any connected display.
95
96 @param win
97 The window to locate.
98 */
99 static int GetFromWindow(const wxWindow* win);
100
101 /**
102 Returns the bounding rectangle of the display whose index was passed to
103 the constructor.
104
105 @see GetClientArea(), wxDisplaySize()
106 */
107 wxRect GetGeometry() const;
108
109 /**
110 Fills and returns an array with all the video modes that are supported
111 by this display, or video modes that are supported by this display and
112 match the mode parameter (if mode is not wxDefaultVideoMode).
113 */
114 wxArrayVideoModes GetModes(const wxVideoMode& mode = wxDefaultVideoMode) const;
115
116 /**
117 Returns the display's name. A name is not available on all platforms.
118 */
119 wxString GetName() const;
120
121 /**
122 Returns @true if the display is the primary display. The primary
123 display is the one whose index is 0.
124 */
125 bool IsPrimary();
126};
127