2001-06-26 17:05:06 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2001-08-01 18:57:11 -04:00
|
|
|
// Name: wx/mgl/window.h
|
|
|
|
// Purpose: wxWindow class
|
2001-06-26 17:05:06 -04:00
|
|
|
// Author: Vaclav Slavik
|
2001-08-01 18:57:11 -04:00
|
|
|
// RCS-ID: $Id$
|
2002-02-14 15:30:34 -05:00
|
|
|
// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2001-06-26 17:05:06 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
#ifndef _WX_WINDOW_H_
|
|
|
|
#define _WX_WINDOW_H_
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ---------------------------------------------------------------------------
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2001-06-26 17:05:06 -04:00
|
|
|
#pragma interface "window.h"
|
|
|
|
#endif
|
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
#include "wx/font.h"
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
struct window_t;
|
|
|
|
class MGLDevCtx;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// wxWindow declaration for MGL
|
|
|
|
// ---------------------------------------------------------------------------
|
2001-06-26 17:05:06 -04:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxWindowMGL : public wxWindowBase
|
|
|
|
{
|
|
|
|
public:
|
2001-08-01 18:57:11 -04:00
|
|
|
wxWindowMGL() { Init(); }
|
|
|
|
|
2001-06-26 17:05:06 -04:00
|
|
|
wxWindowMGL(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
2001-08-01 18:57:11 -04:00
|
|
|
const wxString& name = wxPanelNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~wxWindowMGL();
|
|
|
|
|
2001-06-26 17:05:06 -04:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
2001-08-01 18:57:11 -04:00
|
|
|
const wxString& name = wxPanelNameStr);
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
virtual void Raise();
|
|
|
|
virtual void Lower();
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
virtual bool Show(bool show = TRUE);
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
virtual void SetFocus();
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
virtual bool Reparent(wxWindowBase *newParent);
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
virtual void WarpPointer(int x, int y);
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
virtual void Refresh(bool eraseBackground = TRUE,
|
|
|
|
const wxRect *rect = (const wxRect *) NULL);
|
|
|
|
virtual void Update();
|
|
|
|
virtual void Clear();
|
|
|
|
virtual void Freeze();
|
|
|
|
virtual void Thaw();
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
virtual bool SetCursor(const wxCursor &cursor);
|
|
|
|
virtual bool SetFont(const wxFont &font) { m_font = font; return TRUE; }
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
virtual int GetCharHeight() const;
|
|
|
|
virtual int GetCharWidth() const;
|
2001-06-26 17:05:06 -04: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 18:57:11 -04:00
|
|
|
const;
|
2001-06-26 17:05:06 -04:00
|
|
|
|
|
|
|
#if wxUSE_DRAG_AND_DROP
|
2001-08-01 18:57:11 -04:00
|
|
|
virtual void SetDropTarget(wxDropTarget *dropTarget);
|
2001-06-26 17:05:06 -04:00
|
|
|
#endif // wxUSE_DRAG_AND_DROP
|
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
// Accept files for dragging
|
|
|
|
virtual void DragAcceptFiles(bool accept);
|
|
|
|
|
|
|
|
virtual WXWidget GetHandle() const { return m_wnd; }
|
2001-10-30 18:30:51 -05:00
|
|
|
|
|
|
|
void SetMGLwindow_t(struct window_t *wnd);
|
2001-08-01 18:57:11 -04:00
|
|
|
|
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
2003-09-18 06:55:44 -04:00
|
|
|
|
|
|
|
void OnInternalIdle();
|
2001-08-01 18:57:11 -04: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 18:25:35 -05:00
|
|
|
bool m_frozen:1;
|
|
|
|
bool m_refreshAfterThaw:1;
|
2001-08-16 18:53:43 -04:00
|
|
|
int m_eraseBackground;
|
2001-06-26 17:05:06 -04:00
|
|
|
|
|
|
|
// implement the base class pure virtuals
|
2001-08-01 18:57:11 -04: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 17:05:06 -04:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
2001-08-01 18:57:11 -04:00
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
|
|
|
virtual void DoSetClientSize(int width, int height);
|
2001-06-26 17:05:06 -04:00
|
|
|
|
2002-01-19 14:38:46 -05:00
|
|
|
virtual void DoCaptureMouse();
|
|
|
|
virtual void DoReleaseMouse();
|
|
|
|
|
2001-08-01 18:57:11 -04: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);
|
2002-02-13 19:36:33 -05:00
|
|
|
|
2001-06-26 17:05:06 -04:00
|
|
|
private:
|
2001-08-01 18:57:11 -04:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
// counterpart to SetFocus
|
|
|
|
void KillFocus();
|
|
|
|
|
|
|
|
MGLDevCtx *m_paintMGLDC;
|
|
|
|
friend class wxPaintDC;
|
|
|
|
|
2001-12-03 05:55:58 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxWindowMGL)
|
|
|
|
DECLARE_NO_COPY_CLASS(wxWindowMGL)
|
2001-08-01 18:57:11 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
|
|
|
public:
|
|
|
|
void HandlePaint(MGLDevCtx *dc);
|
|
|
|
// needed by wxWindowPainter
|
2001-08-09 18:40:39 -04:00
|
|
|
MGLDevCtx *GetPaintMGLDC() const { return m_paintMGLDC; }
|
2001-06-26 17:05:06 -04:00
|
|
|
};
|
|
|
|
|
2001-08-01 18:57:11 -04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_WINDOW_H_
|