]>
Commit | Line | Data |
---|---|---|
32b8ec41 | 1 | ///////////////////////////////////////////////////////////////////////////// |
a4bbc9f7 VS |
2 | // Name: wx/mgl/window.h |
3 | // Purpose: wxWindow class | |
32b8ec41 | 4 | // Author: Vaclav Slavik |
a4bbc9f7 | 5 | // RCS-ID: $Id$ |
52750c2e | 6 | // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) |
32b8ec41 VZ |
7 | // Licence: wxWindows licence |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
a4bbc9f7 VS |
10 | #ifndef _WX_WINDOW_H_ |
11 | #define _WX_WINDOW_H_ | |
32b8ec41 | 12 | |
a4bbc9f7 VS |
13 | // --------------------------------------------------------------------------- |
14 | // headers | |
15 | // --------------------------------------------------------------------------- | |
32b8ec41 | 16 | |
12028905 | 17 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
32b8ec41 VZ |
18 | #pragma interface "window.h" |
19 | #endif | |
20 | ||
a4bbc9f7 | 21 | #include "wx/font.h" |
32b8ec41 | 22 | |
a4bbc9f7 VS |
23 | struct window_t; |
24 | class MGLDevCtx; | |
25 | ||
26 | // --------------------------------------------------------------------------- | |
27 | // wxWindow declaration for MGL | |
28 | // --------------------------------------------------------------------------- | |
32b8ec41 VZ |
29 | |
30 | class WXDLLEXPORT wxWindowMGL : public wxWindowBase | |
31 | { | |
32b8ec41 | 32 | public: |
a4bbc9f7 VS |
33 | wxWindowMGL() { Init(); } |
34 | ||
32b8ec41 VZ |
35 | wxWindowMGL(wxWindow *parent, |
36 | wxWindowID id, | |
37 | const wxPoint& pos = wxDefaultPosition, | |
38 | const wxSize& size = wxDefaultSize, | |
39 | long style = 0, | |
a4bbc9f7 VS |
40 | const wxString& name = wxPanelNameStr) |
41 | { | |
42 | Init(); | |
43 | Create(parent, id, pos, size, style, name); | |
44 | } | |
45 | ||
46 | virtual ~wxWindowMGL(); | |
47 | ||
32b8ec41 VZ |
48 | bool Create(wxWindow *parent, |
49 | wxWindowID id, | |
50 | const wxPoint& pos = wxDefaultPosition, | |
51 | const wxSize& size = wxDefaultSize, | |
52 | long style = 0, | |
a4bbc9f7 | 53 | const wxString& name = wxPanelNameStr); |
32b8ec41 | 54 | |
a4bbc9f7 VS |
55 | virtual void Raise(); |
56 | virtual void Lower(); | |
32b8ec41 | 57 | |
a4bbc9f7 | 58 | virtual bool Show(bool show = TRUE); |
32b8ec41 | 59 | |
a4bbc9f7 | 60 | virtual void SetFocus(); |
32b8ec41 | 61 | |
a4bbc9f7 | 62 | virtual bool Reparent(wxWindowBase *newParent); |
32b8ec41 | 63 | |
a4bbc9f7 | 64 | virtual void WarpPointer(int x, int y); |
32b8ec41 | 65 | |
a4bbc9f7 VS |
66 | virtual void Refresh(bool eraseBackground = TRUE, |
67 | const wxRect *rect = (const wxRect *) NULL); | |
68 | virtual void Update(); | |
69 | virtual void Clear(); | |
70 | virtual void Freeze(); | |
71 | virtual void Thaw(); | |
32b8ec41 | 72 | |
a4bbc9f7 VS |
73 | virtual bool SetCursor(const wxCursor &cursor); |
74 | virtual bool SetFont(const wxFont &font) { m_font = font; return TRUE; } | |
32b8ec41 | 75 | |
a4bbc9f7 VS |
76 | virtual int GetCharHeight() const; |
77 | virtual int GetCharWidth() const; | |
32b8ec41 VZ |
78 | virtual void GetTextExtent(const wxString& string, |
79 | int *x, int *y, | |
80 | int *descent = (int *) NULL, | |
81 | int *externalLeading = (int *) NULL, | |
82 | const wxFont *theFont = (const wxFont *) NULL) | |
a4bbc9f7 | 83 | const; |
32b8ec41 VZ |
84 | |
85 | #if wxUSE_DRAG_AND_DROP | |
a4bbc9f7 | 86 | virtual void SetDropTarget(wxDropTarget *dropTarget); |
32b8ec41 VZ |
87 | #endif // wxUSE_DRAG_AND_DROP |
88 | ||
a4bbc9f7 VS |
89 | // Accept files for dragging |
90 | virtual void DragAcceptFiles(bool accept); | |
91 | ||
a4bbc9f7 | 92 | virtual WXWidget GetHandle() const { return m_wnd; } |
58061670 VS |
93 | |
94 | void SetMGLwindow_t(struct window_t *wnd); | |
a4bbc9f7 | 95 | |
a4bbc9f7 VS |
96 | // implementation from now on |
97 | // -------------------------- | |
98 | ||
99 | protected: | |
100 | // the window handle | |
101 | struct window_t *m_wnd; | |
102 | // whether there should be wxEraseEvent before wxPaintEvent or not | |
103 | // (see wxWindow::Refresh) | |
f41ed3c4 VS |
104 | bool m_frozen:1; |
105 | bool m_refreshAfterThaw:1; | |
2b260bc3 | 106 | int m_eraseBackground; |
32b8ec41 VZ |
107 | |
108 | // implement the base class pure virtuals | |
a4bbc9f7 VS |
109 | virtual void DoClientToScreen( int *x, int *y ) const; |
110 | virtual void DoScreenToClient( int *x, int *y ) const; | |
111 | virtual void DoGetPosition( int *x, int *y ) const; | |
112 | virtual void DoGetSize( int *width, int *height ) const; | |
113 | virtual void DoGetClientSize( int *width, int *height ) const; | |
32b8ec41 VZ |
114 | virtual void DoSetSize(int x, int y, |
115 | int width, int height, | |
a4bbc9f7 VS |
116 | int sizeFlags = wxSIZE_AUTO); |
117 | virtual void DoSetClientSize(int width, int height); | |
32b8ec41 | 118 | |
4116c221 VZ |
119 | virtual void DoCaptureMouse(); |
120 | virtual void DoReleaseMouse(); | |
121 | ||
a4bbc9f7 VS |
122 | // move the window to the specified location and resize it: this is called |
123 | // from both DoSetSize() and DoSetClientSize() and would usually just call | |
124 | // ::MoveWindow() except for composite controls which will want to arrange | |
125 | // themselves inside the given rectangle | |
126 | virtual void DoMoveWindow(int x, int y, int width, int height); | |
cbe0afe0 | 127 | |
e39af974 | 128 | void OnInternalIdle(); |
32b8ec41 VZ |
129 | |
130 | private: | |
a4bbc9f7 VS |
131 | // common part of all ctors |
132 | void Init(); | |
133 | // counterpart to SetFocus | |
134 | void KillFocus(); | |
135 | ||
136 | MGLDevCtx *m_paintMGLDC; | |
137 | friend class wxPaintDC; | |
138 | ||
0bd63eb6 GT |
139 | DECLARE_DYNAMIC_CLASS(wxWindowMGL) |
140 | DECLARE_NO_COPY_CLASS(wxWindowMGL) | |
a4bbc9f7 VS |
141 | DECLARE_EVENT_TABLE() |
142 | ||
143 | public: | |
144 | void HandlePaint(MGLDevCtx *dc); | |
145 | // needed by wxWindowPainter | |
7bdc1879 | 146 | MGLDevCtx *GetPaintMGLDC() const { return m_paintMGLDC; } |
32b8ec41 VZ |
147 | }; |
148 | ||
a4bbc9f7 VS |
149 | |
150 | #endif | |
151 | // _WX_WINDOW_H_ |