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 WXDLLIMPEXP_CORE 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
);
51 // implement base class (pure) virtual methods
52 // -------------------------------------------
54 virtual void SetLabel( const wxString
&WXUNUSED(label
) ) {}
55 virtual wxString
GetLabel() const { return wxEmptyString
; }
60 virtual bool Show(bool show
= true);
62 virtual void SetFocus();
64 virtual bool Reparent(wxWindowBase
*newParent
);
66 virtual void WarpPointer(int x
, int y
);
68 virtual void Refresh(bool eraseBackground
= true,
69 const wxRect
*rect
= (const wxRect
*) NULL
);
70 virtual void Update();
72 virtual bool SetCursor(const wxCursor
&cursor
);
73 virtual bool SetFont(const wxFont
&font
) { m_font
= font
; return true; }
75 virtual int GetCharHeight() const;
76 virtual int GetCharWidth() const;
78 #if wxUSE_DRAG_AND_DROP
79 virtual void SetDropTarget(wxDropTarget
*dropTarget
);
80 #endif // wxUSE_DRAG_AND_DROP
82 // Accept files for dragging
83 virtual void DragAcceptFiles(bool accept
);
85 virtual WXWidget
GetHandle() const { return m_wnd
; }
87 void SetMGLwindow_t(struct window_t
*wnd
);
89 // implementation from now on
90 // --------------------------
93 virtual void DoFreeze();
94 virtual void DoThaw();
98 struct window_t
*m_wnd
;
99 // whether there should be wxEraseEvent before wxPaintEvent or not
100 // (see wxWindow::Refresh)
101 bool m_refreshAfterThaw
:1;
102 int m_eraseBackground
;
104 // implement the base class pure virtuals
105 virtual void DoGetTextExtent(const wxString
& string
,
108 int *externalLeading
= NULL
,
109 const wxFont
*font
= NULL
) const;
110 virtual void DoClientToScreen( int *x
, int *y
) const;
111 virtual void DoScreenToClient( int *x
, int *y
) const;
112 virtual void DoGetPosition( int *x
, int *y
) const;
113 virtual void DoGetSize( int *width
, int *height
) const;
114 virtual void DoGetClientSize( int *width
, int *height
) const;
115 virtual void DoSetSize(int x
, int y
,
116 int width
, int height
,
117 int sizeFlags
= wxSIZE_AUTO
);
118 virtual void DoSetClientSize(int width
, int height
);
120 virtual void DoCaptureMouse();
121 virtual void DoReleaseMouse();
123 // move the window to the specified location and resize it: this is called
124 // from both DoSetSize() and DoSetClientSize() and would usually just call
125 // ::MoveWindow() except for composite controls which will want to arrange
126 // themselves inside the given rectangle
127 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
130 // common part of all ctors
132 // counterpart to SetFocus
135 MGLDevCtx
*m_paintMGLDC
;
136 friend class wxPaintDC
;
138 DECLARE_DYNAMIC_CLASS(wxWindowMGL
)
139 wxDECLARE_NO_COPY_CLASS(wxWindowMGL
);
140 DECLARE_EVENT_TABLE()
143 void HandlePaint(MGLDevCtx
*dc
);
144 // needed by wxWindowPainter
145 MGLDevCtx
*GetPaintMGLDC() const { return m_paintMGLDC
; }
149 #endif // _WX_WINDOW_H_