]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mgl/window.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mgl/window.h
3 // Purpose: wxWindow class
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
13 // ---------------------------------------------------------------------------
15 // ---------------------------------------------------------------------------
17 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
18 #pragma interface "window.h"
26 // ---------------------------------------------------------------------------
27 // wxWindow declaration for MGL
28 // ---------------------------------------------------------------------------
30 class WXDLLEXPORT wxWindowMGL
: public wxWindowBase
33 wxWindowMGL() { Init(); }
35 wxWindowMGL(wxWindow
*parent
,
37 const wxPoint
& pos
= wxDefaultPosition
,
38 const wxSize
& size
= wxDefaultSize
,
40 const wxString
& name
= wxPanelNameStr
)
43 Create(parent
, id
, pos
, size
, style
, name
);
46 virtual ~wxWindowMGL();
48 bool Create(wxWindow
*parent
,
50 const wxPoint
& pos
= wxDefaultPosition
,
51 const wxSize
& size
= wxDefaultSize
,
53 const wxString
& name
= wxPanelNameStr
);
58 virtual bool Show(bool show
= TRUE
);
60 virtual void SetFocus();
62 virtual bool Reparent(wxWindowBase
*newParent
);
64 virtual void WarpPointer(int x
, int y
);
66 virtual void Refresh(bool eraseBackground
= TRUE
,
67 const wxRect
*rect
= (const wxRect
*) NULL
);
68 virtual void Update();
70 virtual void Freeze();
73 virtual bool SetCursor(const wxCursor
&cursor
);
74 virtual bool SetFont(const wxFont
&font
) { m_font
= font
; return TRUE
; }
76 virtual int GetCharHeight() const;
77 virtual int GetCharWidth() const;
78 virtual void GetTextExtent(const wxString
& string
,
80 int *descent
= (int *) NULL
,
81 int *externalLeading
= (int *) NULL
,
82 const wxFont
*theFont
= (const wxFont
*) NULL
)
85 #if wxUSE_DRAG_AND_DROP
86 virtual void SetDropTarget(wxDropTarget
*dropTarget
);
87 #endif // wxUSE_DRAG_AND_DROP
89 // Accept files for dragging
90 virtual void DragAcceptFiles(bool accept
);
92 virtual WXWidget
GetHandle() const { return m_wnd
; }
94 void SetMGLwindow_t(struct window_t
*wnd
);
96 // implementation from now on
97 // --------------------------
101 struct window_t
*m_wnd
;
102 // whether there should be wxEraseEvent before wxPaintEvent or not
103 // (see wxWindow::Refresh)
105 bool m_refreshAfterThaw
:1;
106 int m_eraseBackground
;
108 // implement the base class pure virtuals
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;
114 virtual void DoSetSize(int x
, int y
,
115 int width
, int height
,
116 int sizeFlags
= wxSIZE_AUTO
);
117 virtual void DoSetClientSize(int width
, int height
);
119 virtual void DoCaptureMouse();
120 virtual void DoReleaseMouse();
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
);
128 void OnInternalIdle();
131 // common part of all ctors
133 // counterpart to SetFocus
136 MGLDevCtx
*m_paintMGLDC
;
137 friend class wxPaintDC
;
139 DECLARE_DYNAMIC_CLASS(wxWindowMGL
)
140 DECLARE_NO_COPY_CLASS(wxWindowMGL
)
141 DECLARE_EVENT_TABLE()
144 void HandlePaint(MGLDevCtx
*dc
);
145 // needed by wxWindowPainter
146 MGLDevCtx
*GetPaintMGLDC() const { return m_paintMGLDC
; }