]>
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 // ---------------------------------------------------------------------------
22 // ---------------------------------------------------------------------------
23 // wxWindow declaration for MGL
24 // ---------------------------------------------------------------------------
26 class WXDLLEXPORT wxWindowMGL
: public wxWindowBase
29 wxWindowMGL() { Init(); }
31 wxWindowMGL(wxWindow
*parent
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
36 const wxString
& name
= wxPanelNameStr
)
39 Create(parent
, id
, pos
, size
, style
, name
);
42 virtual ~wxWindowMGL();
44 bool Create(wxWindow
*parent
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
,
49 const wxString
& name
= wxPanelNameStr
);
54 virtual bool Show(bool show
= TRUE
);
56 virtual void SetFocus();
58 virtual bool Reparent(wxWindowBase
*newParent
);
60 virtual void WarpPointer(int x
, int y
);
62 virtual void Refresh(bool eraseBackground
= TRUE
,
63 const wxRect
*rect
= (const wxRect
*) NULL
);
64 virtual void Update();
66 virtual void Freeze();
69 virtual bool SetCursor(const wxCursor
&cursor
);
70 virtual bool SetFont(const wxFont
&font
) { m_font
= font
; return TRUE
; }
72 virtual int GetCharHeight() const;
73 virtual int GetCharWidth() const;
74 virtual void GetTextExtent(const wxString
& string
,
76 int *descent
= (int *) NULL
,
77 int *externalLeading
= (int *) NULL
,
78 const wxFont
*theFont
= (const wxFont
*) NULL
)
81 #if wxUSE_DRAG_AND_DROP
82 virtual void SetDropTarget(wxDropTarget
*dropTarget
);
83 #endif // wxUSE_DRAG_AND_DROP
85 // Accept files for dragging
86 virtual void DragAcceptFiles(bool accept
);
88 virtual WXWidget
GetHandle() const { return m_wnd
; }
90 void SetMGLwindow_t(struct window_t
*wnd
);
92 // implementation from now on
93 // --------------------------
95 void OnInternalIdle();
99 struct window_t
*m_wnd
;
100 // whether there should be wxEraseEvent before wxPaintEvent or not
101 // (see wxWindow::Refresh)
103 bool m_refreshAfterThaw
:1;
104 int m_eraseBackground
;
106 // implement the base class pure virtuals
107 virtual void DoClientToScreen( int *x
, int *y
) const;
108 virtual void DoScreenToClient( int *x
, int *y
) const;
109 virtual void DoGetPosition( int *x
, int *y
) const;
110 virtual void DoGetSize( int *width
, int *height
) const;
111 virtual void DoGetClientSize( int *width
, int *height
) const;
112 virtual void DoSetSize(int x
, int y
,
113 int width
, int height
,
114 int sizeFlags
= wxSIZE_AUTO
);
115 virtual void DoSetClientSize(int width
, int height
);
117 virtual void DoCaptureMouse();
118 virtual void DoReleaseMouse();
120 // move the window to the specified location and resize it: this is called
121 // from both DoSetSize() and DoSetClientSize() and would usually just call
122 // ::MoveWindow() except for composite controls which will want to arrange
123 // themselves inside the given rectangle
124 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
127 // common part of all ctors
129 // counterpart to SetFocus
132 MGLDevCtx
*m_paintMGLDC
;
133 friend class wxPaintDC
;
135 DECLARE_DYNAMIC_CLASS(wxWindowMGL
)
136 DECLARE_NO_COPY_CLASS(wxWindowMGL
)
137 DECLARE_EVENT_TABLE()
140 void HandlePaint(MGLDevCtx
*dc
);
141 // needed by wxWindowPainter
142 MGLDevCtx
*GetPaintMGLDC() const { return m_paintMGLDC
; }