1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-11-03 20:58:02 +00:00
|
|
|
// Name: wx/motif/window.h
|
1998-09-18 10:19:10 +00:00
|
|
|
// Purpose: wxWindow class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_WINDOW_H_
|
|
|
|
#define _WX_WINDOW_H_
|
|
|
|
|
1999-10-27 08:59:23 +00:00
|
|
|
#include "wx/region.h"
|
1999-06-08 19:10:37 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxWindow class for Motif - see also wxWindowBase
|
|
|
|
// ----------------------------------------------------------------------------
|
1998-09-18 10:19:10 +00:00
|
|
|
|
2005-08-03 00:53:09 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxWindow : public wxWindowBase
|
1998-09-18 10:19:10 +00:00
|
|
|
{
|
2007-07-09 10:09:52 +00:00
|
|
|
friend class WXDLLIMPEXP_FWD_CORE wxDC;
|
|
|
|
friend class WXDLLIMPEXP_FWD_CORE wxWindowDC;
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
public:
|
1999-06-07 18:26:42 +00:00
|
|
|
wxWindow() { Init(); }
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
wxWindow(wxWindow *parent,
|
2005-11-03 20:58:02 +00:00
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxPanelNameStr)
|
1999-02-22 11:01:13 +00:00
|
|
|
{
|
1999-06-07 18:26:42 +00:00
|
|
|
Init();
|
1999-02-22 11:01:13 +00:00
|
|
|
Create(parent, id, pos, size, style, name);
|
|
|
|
}
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual ~wxWindow();
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
bool Create(wxWindow *parent,
|
2005-11-03 20:58:02 +00:00
|
|
|
wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxPanelNameStr);
|
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
// implement base class pure virtuals
|
2005-11-03 20:58:02 +00:00
|
|
|
virtual void SetLabel(const wxString& label);
|
|
|
|
virtual wxString GetLabel() const;
|
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void Raise();
|
|
|
|
virtual void Lower();
|
2005-11-03 20:58:02 +00:00
|
|
|
|
2005-02-06 17:38:33 +00:00
|
|
|
virtual bool Show( bool show = true );
|
|
|
|
virtual bool Enable( bool enable = true );
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
virtual void SetFocus();
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
virtual void WarpPointer(int x, int y);
|
2005-11-03 20:58:02 +00:00
|
|
|
|
2005-02-06 17:38:33 +00:00
|
|
|
virtual void Refresh( bool eraseBackground = true,
|
2002-02-05 16:34:33 +00:00
|
|
|
const wxRect *rect = (const wxRect *) NULL );
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
virtual bool SetBackgroundColour( const wxColour &colour );
|
|
|
|
virtual bool SetForegroundColour( const wxColour &colour );
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
virtual bool SetCursor( const wxCursor &cursor );
|
|
|
|
virtual bool SetFont( const wxFont &font );
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual int GetCharHeight() const;
|
|
|
|
virtual int GetCharWidth() const;
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
2005-02-06 17:38:33 +00:00
|
|
|
int range, bool refresh = true );
|
|
|
|
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
|
1999-06-07 18:26:42 +00:00
|
|
|
virtual int GetScrollPos( int orient ) const;
|
|
|
|
virtual int GetScrollThumb( int orient ) const;
|
|
|
|
virtual int GetScrollRange( int orient ) const;
|
|
|
|
virtual void ScrollWindow( int dx, int dy,
|
2009-01-19 13:55:27 +00:00
|
|
|
const wxRect* rect = NULL );
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1998-09-25 13:28:52 +00:00
|
|
|
#if wxUSE_DRAG_AND_DROP
|
1999-06-07 18:26:42 +00:00
|
|
|
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
|
|
|
#endif // wxUSE_DRAG_AND_DROP
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
// Accept files for dragging
|
|
|
|
virtual void DragAcceptFiles(bool accept);
|
2005-02-26 15:51:46 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
// Get the unique identifier of a window
|
|
|
|
virtual WXWidget GetHandle() const { return GetMainWidget(); }
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
// accessors
|
|
|
|
// ---------
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
// Get main widget for this window, e.g. a text widget
|
|
|
|
virtual WXWidget GetMainWidget() const;
|
2003-04-14 17:27:28 +00:00
|
|
|
// Get the widget that corresponds to the label (for font setting,
|
|
|
|
// label setting etc.)
|
1999-06-08 19:10:37 +00:00
|
|
|
virtual WXWidget GetLabelWidget() const;
|
|
|
|
// Get the client widget for this window (something we can create other
|
|
|
|
// windows on)
|
|
|
|
virtual WXWidget GetClientWidget() const;
|
|
|
|
// Get the top widget for this window, e.g. the scrolled widget parent of a
|
|
|
|
// multi-line text widget. Top means, top in the window hierarchy that
|
|
|
|
// implements this window.
|
|
|
|
virtual WXWidget GetTopWidget() const;
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
// Get the underlying X window and display
|
2003-07-19 22:07:15 +00:00
|
|
|
WXWindow GetClientXWindow() const;
|
1999-06-08 19:10:37 +00:00
|
|
|
WXWindow GetXWindow() const;
|
|
|
|
WXDisplay *GetXDisplay() const;
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
void SetLastClick(int button, long timestamp)
|
2002-02-05 16:34:33 +00:00
|
|
|
{ m_lastButton = button; m_lastTS = timestamp; }
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
int GetLastClickedButton() const { return m_lastButton; }
|
|
|
|
long GetLastClickTime() const { return m_lastTS; }
|
2005-11-03 20:58:02 +00:00
|
|
|
|
2003-04-14 17:27:28 +00:00
|
|
|
// Gives window a chance to do something in response to a size message,
|
|
|
|
// e.g. arrange status bar, toolbar etc.
|
1999-06-08 19:10:37 +00:00
|
|
|
virtual bool PreResize();
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
// Generates a paint event
|
|
|
|
virtual void DoPaint();
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
// update rectangle/region manipulation
|
|
|
|
// (for wxWindowDC and Motif callbacks only)
|
|
|
|
// -----------------------------------------
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
// Adds a recangle to the updates list
|
2003-05-24 19:41:05 +00:00
|
|
|
void AddUpdateRect(int x, int y, int w, int h);
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
void ClearUpdateRegion() { m_updateRegion.Clear(); }
|
|
|
|
void SetUpdateRegion(const wxRegion& region) { m_updateRegion = region; }
|
2005-11-03 20:58:02 +00:00
|
|
|
|
2003-07-09 10:15:21 +00:00
|
|
|
// Process idle (send update events)
|
|
|
|
void OnInternalIdle();
|
2005-11-03 20:58:02 +00:00
|
|
|
|
2007-04-07 21:18:33 +00:00
|
|
|
// post-creation activities
|
|
|
|
void PostCreation();
|
|
|
|
|
|
|
|
// pre-creation activities
|
|
|
|
void PreCreation();
|
|
|
|
|
2001-09-22 11:52:48 +00:00
|
|
|
protected:
|
1999-02-22 11:01:13 +00:00
|
|
|
// Responds to colour changes: passes event on to children.
|
|
|
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
// Motif-specific
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
void SetMainWidget(WXWidget w) { m_mainWidget = w; }
|
2005-11-03 20:58:02 +00:00
|
|
|
|
2002-07-27 20:10:37 +00:00
|
|
|
// See src/motif/window.cpp, near the top, for an explanation
|
|
|
|
// why this is necessary
|
|
|
|
void CanvasSetSizeIntr(int x, int y, int width, int height,
|
|
|
|
int sizeFlags, bool fromCtor);
|
|
|
|
void DoSetSizeIntr(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags, bool fromCtor);
|
2003-03-27 19:34:10 +00:00
|
|
|
|
|
|
|
// for DoMoveWindowIntr flags
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
wxMOVE_X = 1,
|
|
|
|
wxMOVE_Y = 2,
|
|
|
|
wxMOVE_WIDTH = 4,
|
|
|
|
wxMOVE_HEIGHT = 8
|
|
|
|
};
|
|
|
|
|
|
|
|
void DoMoveWindowIntr(int x, int y, int width, int height,
|
|
|
|
int flags);
|
2003-05-24 19:41:05 +00:00
|
|
|
|
|
|
|
// helper function, to remove duplicate code, used in wxScrollBar
|
|
|
|
WXWidget DoCreateScrollBar(WXWidget parent, wxOrientation orientation,
|
|
|
|
void (*callback)());
|
2001-07-09 13:14:28 +00:00
|
|
|
public:
|
1999-06-07 18:26:42 +00:00
|
|
|
WXPixmap GetBackingPixmap() const { return m_backingPixmap; }
|
2001-07-09 13:14:28 +00:00
|
|
|
void SetBackingPixmap(WXPixmap pixmap) { m_backingPixmap = pixmap; }
|
1999-02-22 11:01:13 +00:00
|
|
|
int GetPixmapWidth() const { return m_pixmapWidth; }
|
|
|
|
int GetPixmapHeight() const { return m_pixmapHeight; }
|
2001-07-09 13:14:28 +00:00
|
|
|
void SetPixmapWidth(int w) { m_pixmapWidth = w; }
|
|
|
|
void SetPixmapHeight(int h) { m_pixmapHeight = h; }
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
// Change properties
|
2003-04-14 17:27:28 +00:00
|
|
|
// Change to the current font (often overridden)
|
2005-02-06 17:38:33 +00:00
|
|
|
virtual void ChangeFont(bool keepOriginalSize = true);
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
// Change background and foreground colour using current background colour
|
|
|
|
// setting (Motif generates foreground based on background)
|
|
|
|
virtual void ChangeBackgroundColour();
|
|
|
|
// Change foreground colour using current foreground colour setting
|
|
|
|
virtual void ChangeForegroundColour();
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-23 10:03:44 +00:00
|
|
|
protected:
|
1999-02-22 11:01:13 +00:00
|
|
|
// Adds the widget to the hash table and adds event handlers.
|
1999-06-07 18:26:42 +00:00
|
|
|
bool AttachWidget(wxWindow* parent, WXWidget mainWidget,
|
2002-02-05 16:34:33 +00:00
|
|
|
WXWidget formWidget, int x, int y, int width, int height);
|
1999-02-22 11:01:13 +00:00
|
|
|
bool DetachWidget(WXWidget widget);
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
// How to implement accelerators. If we find a key event, translate to
|
2004-05-23 14:56:36 +00:00
|
|
|
// wxWidgets wxKeyEvent form. Find a widget for the window. Now find a
|
1999-06-07 18:26:42 +00:00
|
|
|
// wxWindow for the widget. If there isn't one, go up the widget hierarchy
|
1999-02-22 11:01:13 +00:00
|
|
|
// trying to find one. Once one is found, call ProcessAccelerator for the
|
2005-02-06 17:38:33 +00:00
|
|
|
// window. If it returns true (processed the event), skip the X event,
|
2004-05-23 14:56:36 +00:00
|
|
|
// otherwise carry on up the wxWidgets window hierarchy calling
|
2005-02-06 17:38:33 +00:00
|
|
|
// ProcessAccelerator. If all return false, process the X event as normal.
|
1999-06-07 18:26:42 +00:00
|
|
|
// Eventually we can implement OnCharHook the same way, but concentrate on
|
|
|
|
// accelerators for now. ProcessAccelerator must look at the current
|
|
|
|
// accelerator table, and try to find what menu id or window (beneath it)
|
|
|
|
// has this ID. Then construct an appropriate command
|
1999-02-22 11:01:13 +00:00
|
|
|
// event and send it.
|
1999-06-21 21:37:49 +00:00
|
|
|
public:
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual bool ProcessAccelerator(wxKeyEvent& event);
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-21 21:37:49 +00:00
|
|
|
protected:
|
1999-06-07 18:26:42 +00:00
|
|
|
// unmanage and destroy an X widget f it's !NULL (passing NULL is ok)
|
|
|
|
void UnmanageAndDestroy(WXWidget widget);
|
2005-11-03 20:58:02 +00:00
|
|
|
|
2003-04-14 17:27:28 +00:00
|
|
|
// map or unmap an X widget (passing NULL is ok),
|
2005-02-06 17:38:33 +00:00
|
|
|
// returns true if widget was mapped/unmapped
|
1999-06-07 18:26:42 +00:00
|
|
|
bool MapOrUnmap(WXWidget widget, bool map);
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
// scrolling stuff
|
|
|
|
// ---------------
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-08 19:10:37 +00:00
|
|
|
// create/destroy window scrollbars
|
|
|
|
void CreateScrollbar(wxOrientation orientation);
|
|
|
|
void DestroyScrollbar(wxOrientation orientation);
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
// get either hor or vert scrollbar widget
|
|
|
|
WXWidget GetScrollbar(wxOrientation orient) const
|
2002-02-05 16:34:33 +00:00
|
|
|
{ return orient == wxHORIZONTAL ? m_hScrollBar : m_vScrollBar; }
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
// set the scroll pos
|
|
|
|
void SetInternalScrollPos(wxOrientation orient, int pos)
|
|
|
|
{
|
|
|
|
if ( orient == wxHORIZONTAL )
|
|
|
|
m_scrollPosX = pos;
|
|
|
|
else
|
|
|
|
m_scrollPosY = pos;
|
|
|
|
}
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
// Motif-specific flags
|
1999-06-08 19:10:37 +00:00
|
|
|
// --------------------
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
bool m_needsRefresh:1; // repaint backing store?
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
// For double-click detection
|
2003-04-14 17:27:28 +00:00
|
|
|
long m_lastTS; // last timestamp
|
|
|
|
unsigned m_lastButton:2; // last pressed button
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
protected:
|
1999-02-22 11:01:13 +00:00
|
|
|
WXWidget m_mainWidget;
|
|
|
|
WXWidget m_hScrollBar;
|
|
|
|
WXWidget m_vScrollBar;
|
|
|
|
WXWidget m_borderWidget;
|
|
|
|
WXWidget m_scrolledWindow;
|
|
|
|
WXWidget m_drawingArea;
|
2003-04-14 17:27:28 +00:00
|
|
|
bool m_winCaptured:1;
|
1999-02-22 11:01:13 +00:00
|
|
|
WXPixmap m_backingPixmap;
|
|
|
|
int m_pixmapWidth;
|
|
|
|
int m_pixmapHeight;
|
|
|
|
int m_pixmapOffsetX;
|
|
|
|
int m_pixmapOffsetY;
|
2005-11-03 20:58:02 +00:00
|
|
|
|
2003-04-14 17:27:28 +00:00
|
|
|
// Store the last scroll pos, since in wxWin the pos isn't set
|
|
|
|
// automatically by system
|
1999-06-07 18:26:42 +00:00
|
|
|
int m_scrollPosX;
|
|
|
|
int m_scrollPosY;
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
// implement the base class pure virtuals
|
2009-06-10 16:41:41 +00:00
|
|
|
virtual void DoGetTextExtent(const wxString& string,
|
|
|
|
int *x, int *y,
|
|
|
|
int *descent = NULL,
|
|
|
|
int *externalLeading = NULL,
|
|
|
|
const wxFont *font = NULL) const;
|
1999-06-07 18:26:42 +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;
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void DoSetSize(int x, int y,
|
2002-02-05 16:34:33 +00:00
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void DoSetClientSize(int width, int height);
|
1999-12-29 19:18:01 +00:00
|
|
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
1999-07-21 16:10:18 +00:00
|
|
|
virtual bool DoPopupMenu(wxMenu *menu, int x, int y);
|
2002-01-19 19:38:46 +00:00
|
|
|
virtual void DoCaptureMouse();
|
|
|
|
virtual void DoReleaseMouse();
|
2005-02-26 15:51:46 +00:00
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
#if wxUSE_TOOLTIPS
|
|
|
|
virtual void DoSetToolTip( wxToolTip *tip );
|
|
|
|
#endif // wxUSE_TOOLTIPS
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
private:
|
1999-06-07 18:26:42 +00:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
2005-11-03 20:58:02 +00:00
|
|
|
|
2001-11-25 15:08:40 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxWindow)
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxWindow);
|
1999-02-22 11:01:13 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-09-18 10:19:10 +00:00
|
|
|
};
|
|
|
|
|
1999-06-07 18:26:42 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
1999-06-08 19:10:37 +00:00
|
|
|
// A little class to switch off `size optimization' while an instance of the
|
|
|
|
// object exists: this may be useful to temporarily disable the optimisation
|
|
|
|
// which consists to do nothing when the new size is equal to the old size -
|
|
|
|
// although quite useful usually to avoid flicker, sometimes it leads to
|
|
|
|
// undesired effects.
|
1999-06-07 18:26:42 +00:00
|
|
|
//
|
1999-06-08 19:10:37 +00:00
|
|
|
// Usage: create an instance of this class on the stack to disable the size
|
2003-04-14 17:27:28 +00:00
|
|
|
// optimisation, it will be reenabled as soon as the object goes out
|
|
|
|
// from scope.
|
1999-06-07 18:26:42 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
1999-06-08 19:10:37 +00:00
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxNoOptimize
|
1998-12-28 21:32:10 +00:00
|
|
|
{
|
|
|
|
public:
|
2002-02-05 16:34:33 +00:00
|
|
|
wxNoOptimize() { ms_count++; }
|
|
|
|
~wxNoOptimize() { ms_count--; }
|
2005-11-03 20:58:02 +00:00
|
|
|
|
2002-02-05 16:34:33 +00:00
|
|
|
static bool CanOptimize() { return ms_count == 0; }
|
2005-11-03 20:58:02 +00:00
|
|
|
|
1998-12-28 21:32:10 +00:00
|
|
|
protected:
|
2002-02-05 16:34:33 +00:00
|
|
|
static int ms_count;
|
1998-12-28 21:32:10 +00:00
|
|
|
};
|
|
|
|
|
2005-11-03 20:58:02 +00:00
|
|
|
#endif // _WX_WINDOW_H_
|