]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: dcclient.h | |
3 | // Purpose: interface of wxClientDC and wxPaintDC | |
4 | // Author: wxWidgets team | |
5 | // Licence: wxWindows licence | |
6 | ///////////////////////////////////////////////////////////////////////////// | |
7 | ||
8 | /** | |
9 | @class wxPaintDC | |
10 | ||
11 | A wxPaintDC must be constructed if an application wishes to paint on the | |
12 | client area of a window from within an EVT_PAINT() event handler. This | |
13 | should normally be constructed as a temporary stack object; don't store a | |
14 | wxPaintDC object. If you have an EVT_PAINT() handler, you @e must create a | |
15 | wxPaintDC object within it even if you don't actually use it. | |
16 | ||
17 | Using wxPaintDC within your EVT_PAINT() handler is important because it | |
18 | automatically sets the clipping area to the damaged area of the window. | |
19 | Attempts to draw outside this area do not appear. | |
20 | ||
21 | To draw on a window from outside your EVT_PAINT() handler, construct a | |
22 | wxClientDC object. | |
23 | ||
24 | To draw on the whole window including decorations, construct a wxWindowDC | |
25 | object (Windows only). | |
26 | ||
27 | A wxPaintDC object is initialized to use the same font and colours as the | |
28 | window it is associated with. | |
29 | ||
30 | @library{wxcore} | |
31 | @category{dc} | |
32 | ||
33 | @see wxDC, wxClientDC, wxMemoryDC, wxWindowDC, wxScreenDC | |
34 | */ | |
35 | class wxPaintDC : public wxClientDC | |
36 | { | |
37 | public: | |
38 | /** | |
39 | Constructor. Pass a pointer to the window on which you wish to paint. | |
40 | */ | |
41 | wxPaintDC(wxWindow* window); | |
42 | }; | |
43 | ||
44 | ||
45 | ||
46 | /** | |
47 | @class wxClientDC | |
48 | ||
49 | A wxClientDC must be constructed if an application wishes to paint on the | |
50 | client area of a window from outside an EVT_PAINT() handler. This should | |
51 | normally be constructed as a temporary stack object; don't store a | |
52 | wxClientDC object. | |
53 | ||
54 | To draw on a window from within an EVT_PAINT() handler, construct a | |
55 | wxPaintDC object instead. | |
56 | ||
57 | To draw on the whole window including decorations, construct a wxWindowDC | |
58 | object (Windows only). | |
59 | ||
60 | A wxClientDC object is initialized to use the same font and colours as the | |
61 | window it is associated with. | |
62 | ||
63 | @library{wxcore} | |
64 | @category{dc} | |
65 | ||
66 | @see wxDC, wxMemoryDC, wxPaintDC, wxWindowDC, wxScreenDC | |
67 | */ | |
68 | class wxClientDC : public wxWindowDC | |
69 | { | |
70 | public: | |
71 | /** | |
72 | Constructor. Pass a pointer to the window on which you wish to paint. | |
73 | */ | |
74 | wxClientDC(wxWindow* window); | |
75 | }; | |
76 | ||
77 | ||
78 | ||
79 | /** | |
80 | @class wxWindowDC | |
81 | ||
82 | A wxWindowDC must be constructed if an application wishes to paint on the | |
83 | whole area of a window (client and decorations). This should normally be | |
84 | constructed as a temporary stack object; don't store a wxWindowDC object. | |
85 | ||
86 | To draw on a window from inside an EVT_PAINT() handler, construct a | |
87 | wxPaintDC object instead. | |
88 | ||
89 | To draw on the client area of a window from outside an EVT_PAINT() handler, | |
90 | construct a wxClientDC object. | |
91 | ||
92 | A wxWindowDC object is initialized to use the same font and colours as the | |
93 | window it is associated with. | |
94 | ||
95 | @library{wxcore} | |
96 | @category{dc} | |
97 | ||
98 | @see wxDC, wxMemoryDC, wxPaintDC, wxClientDC, wxScreenDC | |
99 | */ | |
100 | class wxWindowDC : public wxDC | |
101 | { | |
102 | public: | |
103 | /** | |
104 | Constructor. Pass a pointer to the window on which you wish to paint. | |
105 | */ | |
106 | wxWindowDC(wxWindow* window); | |
107 | }; | |
108 |