2001-06-26 21:05:06 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-08-01 22:57:11 +00:00
|
|
|
// Name: wx/mgl/window.h
|
|
|
|
// Purpose: wxWindow class
|
2001-06-26 21:05:06 +00:00
|
|
|
// Author: Vaclav Slavik
|
2001-08-01 22:57:11 +00:00
|
|
|
// RCS-ID: $Id$
|
2002-02-14 20:30:34 +00:00
|
|
|
// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2001-06-26 21:05:06 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
#ifndef _WX_WINDOW_H_
|
|
|
|
#define _WX_WINDOW_H_
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ---------------------------------------------------------------------------
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
#include "wx/font.h"
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
struct window_t;
|
|
|
|
class MGLDevCtx;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// wxWindow declaration for MGL
|
|
|
|
// ---------------------------------------------------------------------------
|
2001-06-26 21:05:06 +00:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxWindowMGL : public wxWindowBase
|
|
|
|
{
|
|
|
|
public:
|
2001-08-01 22:57:11 +00:00
|
|
|
wxWindowMGL() { Init(); }
|
|
|
|
|
2001-06-26 21:05:06 +00:00
|
|
|
wxWindowMGL(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
2001-08-01 22:57:11 +00:00
|
|
|
const wxString& name = wxPanelNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~wxWindowMGL();
|
|
|
|
|
2001-06-26 21:05:06 +00:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
2001-08-01 22:57:11 +00:00
|
|
|
const wxString& name = wxPanelNameStr);
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2005-11-04 18:49:49 +00:00
|
|
|
// implement base class (pure) virtual methods
|
|
|
|
// -------------------------------------------
|
|
|
|
|
|
|
|
virtual void SetLabel( const wxString &WXUNUSED(label) ) {}
|
|
|
|
virtual wxString GetLabel() const { return wxEmptyString; }
|
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
virtual void Raise();
|
|
|
|
virtual void Lower();
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2005-11-04 18:49:49 +00:00
|
|
|
virtual bool Show(bool show = true);
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
virtual void SetFocus();
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
virtual bool Reparent(wxWindowBase *newParent);
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
virtual void WarpPointer(int x, int y);
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2005-11-04 18:49:49 +00:00
|
|
|
virtual void Refresh(bool eraseBackground = true,
|
2001-08-01 22:57:11 +00:00
|
|
|
const wxRect *rect = (const wxRect *) NULL);
|
|
|
|
virtual void Update();
|
|
|
|
virtual void Clear();
|
|
|
|
virtual void Freeze();
|
|
|
|
virtual void Thaw();
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
virtual bool SetCursor(const wxCursor &cursor);
|
2005-11-04 18:49:49 +00:00
|
|
|
virtual bool SetFont(const wxFont &font) { m_font = font; return true; }
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
virtual int GetCharHeight() const;
|
|
|
|
virtual int GetCharWidth() const;
|
2001-06-26 21:05:06 +00:00
|
|
|
virtual void GetTextExtent(const wxString& string,
|
|
|
|
int *x, int *y,
|
|
|
|
int *descent = (int *) NULL,
|
|
|
|
int *externalLeading = (int *) NULL,
|
|
|
|
const wxFont *theFont = (const wxFont *) NULL)
|
2001-08-01 22:57:11 +00:00
|
|
|
const;
|
2001-06-26 21:05:06 +00:00
|
|
|
|
|
|
|
#if wxUSE_DRAG_AND_DROP
|
2001-08-01 22:57:11 +00:00
|
|
|
virtual void SetDropTarget(wxDropTarget *dropTarget);
|
2001-06-26 21:05:06 +00:00
|
|
|
#endif // wxUSE_DRAG_AND_DROP
|
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
// Accept files for dragging
|
|
|
|
virtual void DragAcceptFiles(bool accept);
|
|
|
|
|
|
|
|
virtual WXWidget GetHandle() const { return m_wnd; }
|
2005-11-04 18:49:49 +00:00
|
|
|
|
2001-10-30 23:30:51 +00:00
|
|
|
void SetMGLwindow_t(struct window_t *wnd);
|
2001-08-01 22:57:11 +00:00
|
|
|
|
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
2005-11-04 18:49:49 +00:00
|
|
|
|
2003-09-18 10:55:44 +00:00
|
|
|
void OnInternalIdle();
|
2001-08-01 22:57:11 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// the window handle
|
|
|
|
struct window_t *m_wnd;
|
|
|
|
// whether there should be wxEraseEvent before wxPaintEvent or not
|
|
|
|
// (see wxWindow::Refresh)
|
2001-10-28 23:25:35 +00:00
|
|
|
bool m_frozen:1;
|
|
|
|
bool m_refreshAfterThaw:1;
|
2001-08-16 22:53:43 +00:00
|
|
|
int m_eraseBackground;
|
2001-06-26 21:05:06 +00:00
|
|
|
|
|
|
|
// implement the base class pure virtuals
|
2001-08-01 22:57:11 +00:00
|
|
|
virtual void DoClientToScreen( int *x, int *y ) const;
|
|
|
|
virtual void DoScreenToClient( int *x, int *y ) const;
|
|
|
|
virtual void DoGetPosition( int *x, int *y ) const;
|
|
|
|
virtual void DoGetSize( int *width, int *height ) const;
|
|
|
|
virtual void DoGetClientSize( int *width, int *height ) const;
|
2001-06-26 21:05:06 +00:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
2001-08-01 22:57:11 +00:00
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
|
|
|
virtual void DoSetClientSize(int width, int height);
|
2001-06-26 21:05:06 +00:00
|
|
|
|
2002-01-19 19:38:46 +00:00
|
|
|
virtual void DoCaptureMouse();
|
|
|
|
virtual void DoReleaseMouse();
|
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
// move the window to the specified location and resize it: this is called
|
|
|
|
// from both DoSetSize() and DoSetClientSize() and would usually just call
|
|
|
|
// ::MoveWindow() except for composite controls which will want to arrange
|
|
|
|
// themselves inside the given rectangle
|
|
|
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
2005-11-04 18:49:49 +00:00
|
|
|
|
2001-06-26 21:05:06 +00:00
|
|
|
private:
|
2001-08-01 22:57:11 +00:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
// counterpart to SetFocus
|
|
|
|
void KillFocus();
|
2005-11-04 18:49:49 +00:00
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
MGLDevCtx *m_paintMGLDC;
|
|
|
|
friend class wxPaintDC;
|
|
|
|
|
2001-12-03 10:55:58 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxWindowMGL)
|
|
|
|
DECLARE_NO_COPY_CLASS(wxWindowMGL)
|
2001-08-01 22:57:11 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
|
|
|
public:
|
|
|
|
void HandlePaint(MGLDevCtx *dc);
|
|
|
|
// needed by wxWindowPainter
|
2001-08-09 22:40:39 +00:00
|
|
|
MGLDevCtx *GetPaintMGLDC() const { return m_paintMGLDC; }
|
2001-06-26 21:05:06 +00:00
|
|
|
};
|
|
|
|
|
2001-08-01 22:57:11 +00:00
|
|
|
|
2005-11-04 18:49:49 +00:00
|
|
|
#endif // _WX_WINDOW_H_
|