]>
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
);
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();
71 virtual void Freeze();
74 virtual bool SetCursor(const wxCursor
&cursor
);
75 virtual bool SetFont(const wxFont
&font
) { m_font
= font
; return true; }
77 virtual int GetCharHeight() const;
78 virtual int GetCharWidth() const;
79 virtual void GetTextExtent(const wxString
& string
,
81 int *descent
= (int *) NULL
,
82 int *externalLeading
= (int *) NULL
,
83 const wxFont
*theFont
= (const wxFont
*) NULL
)
86 #if wxUSE_DRAG_AND_DROP
87 virtual void SetDropTarget(wxDropTarget
*dropTarget
);
88 #endif // wxUSE_DRAG_AND_DROP
90 // Accept files for dragging
91 virtual void DragAcceptFiles(bool accept
);
93 virtual WXWidget
GetHandle() const { return m_wnd
; }
95 void SetMGLwindow_t(struct window_t
*wnd
);
97 // implementation from now on
98 // --------------------------
100 void OnInternalIdle();
104 struct window_t
*m_wnd
;
105 // whether there should be wxEraseEvent before wxPaintEvent or not
106 // (see wxWindow::Refresh)
108 bool m_refreshAfterThaw
:1;
109 int m_eraseBackground
;
111 // implement the base class pure virtuals
112 virtual void DoClientToScreen( int *x
, int *y
) const;
113 virtual void DoScreenToClient( int *x
, int *y
) const;
114 virtual void DoGetPosition( int *x
, int *y
) const;
115 virtual void DoGetSize( int *width
, int *height
) const;
116 virtual void DoGetClientSize( int *width
, int *height
) const;
117 virtual void DoSetSize(int x
, int y
,
118 int width
, int height
,
119 int sizeFlags
= wxSIZE_AUTO
);
120 virtual void DoSetClientSize(int width
, int height
);
122 virtual void DoCaptureMouse();
123 virtual void DoReleaseMouse();
125 // move the window to the specified location and resize it: this is called
126 // from both DoSetSize() and DoSetClientSize() and would usually just call
127 // ::MoveWindow() except for composite controls which will want to arrange
128 // themselves inside the given rectangle
129 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
132 // common part of all ctors
134 // counterpart to SetFocus
137 MGLDevCtx
*m_paintMGLDC
;
138 friend class wxPaintDC
;
140 DECLARE_DYNAMIC_CLASS(wxWindowMGL
)
141 DECLARE_NO_COPY_CLASS(wxWindowMGL
)
142 DECLARE_EVENT_TABLE()
145 void HandlePaint(MGLDevCtx
*dc
);
146 // needed by wxWindowPainter
147 MGLDevCtx
*GetPaintMGLDC() const { return m_paintMGLDC
; }
151 #endif // _WX_WINDOW_H_