m_alignment = wxLAYOUT_TOP;
m_orientation = wxLAYOUT_HORIZONTAL;
}
-// Read by the app
- inline void SetRequestedLength(int length) { m_requestedLength = length; }
- inline int GetRequestedLength() const { return m_requestedLength; }
- inline void SetFlags(int flags) { m_flags = flags; }
- inline int GetFlags() const { return m_flags; }
+ // Read by the app
+ void SetRequestedLength(int length) { m_requestedLength = length; }
+ int GetRequestedLength() const { return m_requestedLength; }
-// Set by the app
- inline void SetSize(const wxSize& size) { m_size = size; }
- inline wxSize GetSize() const { return m_size; }
+ void SetFlags(int flags) { m_flags = flags; }
+ int GetFlags() const { return m_flags; }
+
+ // Set by the app
+ void SetSize(const wxSize& size) { m_size = size; }
+ wxSize GetSize() const { return m_size; }
+
+ void SetOrientation(wxLayoutOrientation orient) { m_orientation = orient; }
+ wxLayoutOrientation GetOrientation() const { return m_orientation; }
- inline void SetOrientation(wxLayoutOrientation orient) { m_orientation = orient; }
- inline wxLayoutOrientation GetOrientation() const { return m_orientation; }
+ void SetAlignment(wxLayoutAlignment align) { m_alignment = align; }
+ wxLayoutAlignment GetAlignment() const { return m_alignment; }
- inline void SetAlignment(wxLayoutAlignment align) { m_alignment = align; }
- inline wxLayoutAlignment GetAlignment() const { return m_alignment; }
protected:
int m_flags;
int m_requestedLength;
~wxTabControl(void);
virtual void OnDraw(wxDC& dc, bool lastInRow);
- inline void SetLabel(const wxString& str) { m_controlLabel = str; }
- inline wxString GetLabel(void) const { return m_controlLabel; }
+ void SetLabel(const wxString& str) { m_controlLabel = str; }
+ wxString GetLabel(void) const { return m_controlLabel; }
- inline void SetFont(const wxFont& f) { m_labelFont = f; }
- inline wxFont *GetFont(void) const { return (wxFont*) & m_labelFont; }
+ void SetFont(const wxFont& f) { m_labelFont = f; }
+ wxFont *GetFont(void) const { return (wxFont*) & m_labelFont; }
- inline void SetSelected(bool sel) { m_isSelected = sel; }
- inline bool IsSelected(void) const { return m_isSelected; }
+ void SetSelected(bool sel) { m_isSelected = sel; }
+ bool IsSelected(void) const { return m_isSelected; }
- inline void SetPosition(int x, int y) { m_offsetX = x; m_offsetY = y; }
- inline void SetSize(int x, int y) { m_width = x; m_height = y; }
+ void SetPosition(int x, int y) { m_offsetX = x; m_offsetY = y; }
+ void SetSize(int x, int y) { m_width = x; m_height = y; }
- inline void SetRowPosition(int r) { m_rowPosition = r; }
- inline int GetRowPosition() const { return m_rowPosition; }
- inline void SetColPosition(int c) { m_colPosition = c; }
- inline int GetColPosition() const { return m_colPosition; }
+ void SetRowPosition(int r) { m_rowPosition = r; }
+ int GetRowPosition() const { return m_rowPosition; }
+ void SetColPosition(int c) { m_colPosition = c; }
+ int GetColPosition() const { return m_colPosition; }
- inline int GetX(void) const { return m_offsetX; }
- inline int GetY(void) const { return m_offsetY; }
- inline int GetWidth(void) const { return m_width; }
- inline int GetHeight(void) const { return m_height; }
+ int GetX(void) const { return m_offsetX; }
+ int GetY(void) const { return m_offsetY; }
+ int GetWidth(void) const { return m_width; }
+ int GetHeight(void) const { return m_height; }
- inline int GetId(void) const { return m_id; }
- inline void SetId(int i) { m_id = i; }
+ int GetId(void) const { return m_id; }
+ void SetId(int i) { m_id = i; }
virtual bool HitTest(int x, int y) const ;
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
- const wxValidator &validator = wxDefaultValidator,
+ const wxValidator &validator = wxDefaultValidator,
const wxString& name = wxTreeCtrlNameStr)
{
Create(parent, id, pos, size, style, validator, name);
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
- const wxValidator &validator = wxDefaultValidator,
+ const wxValidator &validator = wxDefaultValidator,
const wxString& name = wxTreeCtrlNameStr);
// accessors
wxTreeItemId HitTest(const wxPoint& point)
{ int dummy; return HitTest(point, dummy); }
wxTreeItemId HitTest(const wxPoint& point, int& flags);
-
+
// start editing the item label: this (temporarily) replaces the item
// with a one line edit control. The item will be selected if it hadn't
// been before. textCtrlClass parameter allows you to create an edit
class wxDialog: public wxPanel
{
- DECLARE_DYNAMIC_CLASS(wxDialog)
+ DECLARE_DYNAMIC_CLASS(wxDialog)
public:
- wxDialog();
- wxDialog( wxWindow *parent, wxWindowID id,
+ wxDialog();
+ wxDialog( wxWindow *parent, wxWindowID id,
const wxString &title,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr );
- bool Create( wxWindow *parent, wxWindowID id,
- const wxString &title,
- const wxPoint &pos = wxDefaultPosition,
- const wxSize &size = wxDefaultSize,
- long style = wxDEFAULT_DIALOG_STYLE,
- const wxString &name = wxDialogNameStr );
- ~wxDialog();
-
- void SetTitle(const wxString& title);
- wxString GetTitle() const;
-
- void OnApply( wxCommandEvent &event );
- void OnCancel( wxCommandEvent &event );
- void OnOK( wxCommandEvent &event );
- void OnPaint( wxPaintEvent& event );
- void OnSize( wxSizeEvent &event );
- void OnCloseWindow( wxCloseEvent& event );
-/*
- void OnCharHook( wxKeyEvent& event );
-*/
-
- bool Destroy();
-
- virtual void SetSize( int x, int y, int width, int height,
- int sizeFlags = wxSIZE_AUTO );
- virtual void SetSize( int width, int height );
-
- virtual bool Show( bool show );
- virtual int ShowModal();
- virtual void EndModal( int retCode );
- virtual bool IsModal() const;
- void SetModal( bool modal );
-
- virtual void InitDialog(void);
-
- virtual void Centre( int direction = wxHORIZONTAL );
-
- virtual void SetIcon( const wxIcon &icon );
- virtual void Iconize( bool WXUNUSED(iconize)) { }
- virtual bool IsIconized() const { return FALSE; }
- bool Iconized() const { return IsIconized(); }
- virtual void Maximize() { }
- virtual void Restore() { }
-
-// implementation
-
- virtual void GtkOnSize( int x, int y, int width, int height );
- virtual void OnInternalIdle();
-
- bool m_modalShowing;
- wxString m_title;
- wxIcon m_icon;
-
- DECLARE_EVENT_TABLE()
+ bool Create( wxWindow *parent, wxWindowID id,
+ const wxString &title,
+ const wxPoint &pos = wxDefaultPosition,
+ const wxSize &size = wxDefaultSize,
+ long style = wxDEFAULT_DIALOG_STYLE,
+ const wxString &name = wxDialogNameStr );
+ ~wxDialog();
+
+ void SetTitle(const wxString& title);
+ wxString GetTitle() const;
+
+ void OnApply( wxCommandEvent &event );
+ void OnCancel( wxCommandEvent &event );
+ void OnOK( wxCommandEvent &event );
+ void OnPaint( wxPaintEvent& event );
+ void OnSize( wxSizeEvent &event );
+ void OnCloseWindow( wxCloseEvent& event );
+ /*
+ void OnCharHook( wxKeyEvent& event );
+ */
+
+ bool Destroy();
+
+ virtual bool Show( bool show );
+ virtual int ShowModal();
+ virtual void EndModal( int retCode );
+ virtual bool IsModal() const;
+ void SetModal( bool modal );
+
+ virtual void InitDialog(void);
+
+ virtual void Centre( int direction = wxHORIZONTAL );
+
+ virtual void SetIcon( const wxIcon &icon );
+ virtual void Iconize( bool WXUNUSED(iconize)) { }
+ virtual bool IsIconized() const { return FALSE; }
+ bool Iconized() const { return IsIconized(); }
+ virtual void Maximize() { }
+ virtual void Restore() { }
+
+ // implementation
+
+ virtual void GtkOnSize( int x, int y, int width, int height );
+ virtual void OnInternalIdle();
+
+ bool m_modalShowing;
+ wxString m_title;
+ wxIcon m_icon;
+
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+
+private:
+ DECLARE_EVENT_TABLE()
};
#endif // __GTKDIALOGH__
class wxFrame: public wxWindow
{
- DECLARE_DYNAMIC_CLASS(wxFrame)
-public:
+DECLARE_DYNAMIC_CLASS(wxFrame)
- wxFrame();
- wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
- bool Create( wxWindow *parent, wxWindowID id, const wxString &title,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
- ~wxFrame();
- bool Destroy();
-
- virtual bool Show( bool show );
- virtual void Centre( int direction = wxHORIZONTAL );
-
- virtual void GetClientSize( int *width, int *height ) const;
- wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); }
-
- virtual void SetClientSize( int width, int height );
-
- virtual void SetSize( int x, int y, int width, int height,
- int sizeFlags = wxSIZE_AUTO );
- virtual void SetSize( int width, int height );
-
- virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
- const wxString& name = "statusBar");
- virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id,
- const wxString& name );
- virtual wxStatusBar *GetStatusBar() const;
- inline void SetStatusBar(wxStatusBar *statusBar) { m_frameStatusBar = statusBar; }
- virtual void SetStatusText( const wxString &text, int number = 0 );
- virtual void SetStatusWidths( int n, const int widths_field[] );
-
- virtual wxToolBar* CreateToolBar( long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1,
- const wxString& name = wxToolBarNameStr);
- virtual wxToolBar *OnCreateToolBar( long style, wxWindowID id, const wxString& name );
- virtual wxToolBar *GetToolBar() const;
- inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
-
- virtual void SetMenuBar( wxMenuBar *menuBar );
- virtual wxMenuBar *GetMenuBar() const;
-
- virtual void SetTitle( const wxString &title );
- virtual wxString GetTitle() const { return m_title; }
-
- virtual void SetIcon( const wxIcon &icon );
- virtual void Iconize( bool WXUNUSED(iconize)) { }
- virtual bool IsIconized() const { return FALSE; }
- bool Iconized() const { return IsIconized(); }
- virtual void Maximize(bool WXUNUSED(maximize)) {}
- virtual void Restore() {}
-
- void OnCloseWindow( wxCloseEvent& event );
- void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
- void OnSize( wxSizeEvent &event );
-
- void OnMenuHighlight( wxMenuEvent& event );
-
- // implementation
-
- virtual void GtkOnSize( int x, int y, int width, int height );
- virtual wxPoint GetClientAreaOrigin() const;
- void DoMenuUpdates();
- void DoMenuUpdates(wxMenu* menu);
- virtual void OnInternalIdle();
-
- wxMenuBar *m_frameMenuBar;
- wxMenuBar *m_mdiMenuBar;
- wxStatusBar *m_frameStatusBar;
- wxToolBar *m_frameToolBar;
- wxString m_title;
- wxIcon m_icon;
- int m_miniEdge,m_miniTitle;
-
- DECLARE_EVENT_TABLE()
+public:
+ wxFrame();
+ wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
+ const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
+ bool Create( wxWindow *parent, wxWindowID id, const wxString &title,
+ const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
+ ~wxFrame();
+ bool Destroy();
+
+ virtual bool Show( bool show );
+ virtual void Centre( int direction = wxHORIZONTAL );
+
+ virtual void GetClientSize( int *width, int *height ) const;
+
+ virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
+ const wxString& name = "statusBar");
+ virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id,
+ const wxString& name );
+ virtual wxStatusBar *GetStatusBar() const;
+ inline void SetStatusBar(wxStatusBar *statusBar) { m_frameStatusBar = statusBar; }
+ virtual void SetStatusText( const wxString &text, int number = 0 );
+ virtual void SetStatusWidths( int n, const int widths_field[] );
+
+ virtual wxToolBar* CreateToolBar( long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1,
+ const wxString& name = wxToolBarNameStr);
+ virtual wxToolBar *OnCreateToolBar( long style, wxWindowID id, const wxString& name );
+ virtual wxToolBar *GetToolBar() const;
+ inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
+
+ virtual void SetMenuBar( wxMenuBar *menuBar );
+ virtual wxMenuBar *GetMenuBar() const;
+
+ virtual void SetTitle( const wxString &title );
+ virtual wxString GetTitle() const { return m_title; }
+
+ virtual void SetIcon( const wxIcon &icon );
+ virtual void Iconize( bool WXUNUSED(iconize)) { }
+ virtual bool IsIconized() const { return FALSE; }
+ bool Iconized() const { return IsIconized(); }
+ virtual void Maximize(bool WXUNUSED(maximize)) {}
+ virtual void Restore() {}
+
+ void OnCloseWindow( wxCloseEvent& event );
+ void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
+ void OnSize( wxSizeEvent &event );
+
+ void OnMenuHighlight( wxMenuEvent& event );
+
+ // implementation
+
+ virtual void GtkOnSize( int x, int y, int width, int height );
+ virtual wxPoint GetClientAreaOrigin() const;
+ void DoMenuUpdates();
+ void DoMenuUpdates(wxMenu* menu);
+ virtual void OnInternalIdle();
+
+ wxMenuBar *m_frameMenuBar;
+ wxMenuBar *m_mdiMenuBar;
+ wxStatusBar *m_frameStatusBar;
+ wxToolBar *m_frameToolBar;
+ wxString m_title;
+ wxIcon m_icon;
+ int m_miniEdge,m_miniTitle;
+
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+
+ virtual void DoSetClientSize(int width, int height);
+
+private:
+ DECLARE_EVENT_TABLE()
};
#endif // __GTKFRAMEH__
virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {}
// no size hints
- virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW),
- int WXUNUSED(maxH), int WXUNUSED(incW) ) {}
+ virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH),
+ int WXUNUSED(maxW), int WXUNUSED(maxH),
+ int WXUNUSED(incW) )
+ {
+ }
// no toolbar bars
virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id),
#define __GTKWINDOWH__
#ifdef __GNUG__
-#pragma interface
+ #pragma interface
#endif
#include "wx/defs.h"
// global function
//-----------------------------------------------------------------------------
-wxWindow* wxGetActiveWindow();
+extern wxWindow* wxGetActiveWindow();
//-----------------------------------------------------------------------------
// classes
class wxVoidClientData;
class wxWindow;
#if wxUSE_WX_RESOURCES
-class wxResourceTable;
-class wxItemResource;
+ class wxResourceTable;
+ class wxItemResource;
#endif
#if wxUSE_DRAG_AND_DROP
-class wxDropTarget;
+ class wxDropTarget;
#endif
class wxToolTip;
class wxClientData
{
public:
- wxClientData() { }
- virtual ~wxClientData() { }
+ wxClientData() { }
+ virtual ~wxClientData() { }
};
//-----------------------------------------------------------------------------
// wxStringClientData
//-----------------------------------------------------------------------------
-class wxStringClientData: public wxClientData
+class wxStringClientData : public wxClientData
{
public:
wxStringClientData() { }
// wxWindow
//-----------------------------------------------------------------------------
-class wxWindow: public wxEvtHandler
+class wxWindow : public wxEvtHandler
{
- DECLARE_DYNAMIC_CLASS(wxWindow)
+ DECLARE_DYNAMIC_CLASS(wxWindow)
public:
- wxWindow();
- wxWindow(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxPanelNameStr);
- bool Create(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxPanelNameStr);
- virtual ~wxWindow();
+ // creating the window
+ // -------------------
+ wxWindow();
+ wxWindow(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr);
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr);
+ virtual ~wxWindow();
#if wxUSE_WX_RESOURCES
- virtual bool LoadFromResource( wxWindow *parent, const wxString& resourceName,
- const wxResourceTable *table = (const wxResourceTable *) NULL);
- virtual wxControl *CreateItem(const wxItemResource* childResource, const wxItemResource* parentResource,
- const wxResourceTable *table = (const wxResourceTable *) NULL);
-#endif
+ virtual bool LoadFromResource(wxWindow *parent,
+ const wxString& resourceName,
+ const wxResourceTable *table = (const wxResourceTable *) NULL);
+ virtual wxControl *CreateItem(const wxItemResource* childResource,
+ const wxItemResource* parentResource,
+ const wxResourceTable *table = (const wxResourceTable *) NULL);
+#endif // wxUSE_WX_RESOURCES
+
+ // closing the window
+ // ------------------
+ bool Close( bool force = FALSE );
+ virtual bool Destroy();
+ virtual bool DestroyChildren();
+
+ bool IsBeingDeleted();
+
+ // moving/resizing
+ // ---------------
+
+ // set the window size and/or position
+ void SetSize( int x, int y, int width, int height,
+ int sizeFlags = wxSIZE_AUTO )
+ { DoSetSize(x, y, width, height, sizeFlags); }
+
+ void SetSize( int width, int height )
+ { DoSetSize( -1, -1, width, height, wxSIZE_USE_EXISTING ); }
+
+ void SetSize( const wxSize& size )
+ { SetSize( size.x, size.y); }
+
+ void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
+ { DoSetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); }
+
+ void Move( int x, int y )
+ { DoSetSize( x, y, -1, -1, wxSIZE_USE_EXISTING ); }
+
+ void Move(const wxPoint& pt)
+ { Move(pt.x, pt.y); }
+
+ // client size is the size of area available for subwindows
+ void SetClientSize( int width, int height )
+ { DoSetClientSize(width, height); }
+
+ void SetClientSize( const wxSize& size )
+ { DoSetClientSize(size.x, size.y); }
+
+ void SetClientSize(const wxRect& rect)
+ { SetClientSize( rect.width, rect.height ); }
+
+ // get the window position and/or size
+ virtual void GetPosition( int *x, int *y ) const;
+ wxPoint GetPosition() const
+ {
+ int w, h;
+ GetPosition(& w, & h);
+
+ return wxPoint(w, h);
+ }
+
+ virtual void GetSize( int *width, int *height ) const;
+
+ wxSize GetSize() const
+ {
+ int w, h;
+ GetSize(& w, & h);
+ return wxSize(w, h);
+ }
+
+ wxRect GetRect() const
+ {
+ int x, y, w, h;
+ GetPosition(& x, & y);
+ GetSize(& w, & h);
+
+ return wxRect(x, y, w, h);
+ }
- bool Close( bool force = FALSE );
- virtual bool Destroy();
- virtual bool DestroyChildren();
+ virtual void GetClientSize( int *width, int *height ) const;
+ wxSize GetClientSize() const
+ {
+ int w, h;
+ GetClientSize(& w, & h);
+ return wxSize(w, h);
+ }
- virtual void PrepareDC( wxDC &dc );
+ // position with respect to the the parent window
+ virtual void Centre( int direction = wxHORIZONTAL );
+ void Center(int direction = wxHORIZONTAL) { Centre(direction); }
+ virtual void Fit();
- virtual void SetSize( int x, int y, int width, int height,
- int sizeFlags = wxSIZE_AUTO );
- virtual void SetSize( int width, int height );
+ // set min/max size of the window
+ virtual void SetSizeHints( int minW, int minH,
+ int maxW = -1, int maxH = -1,
+ int incW = -1, int incH = -1 );
- virtual void Move( int x, int y );
+ // Dialog units translations. Implemented in wincmn.cpp.
+ // -----------------------------------------------------
- virtual void GetSize( int *width, int *height ) const;
- wxSize GetSize() const { int w, h; GetSize(& w, & h); return wxSize(w, h); }
+ wxPoint ConvertPixelsToDialog( const wxPoint& pt );
+ wxPoint ConvertDialogToPixels( const wxPoint& pt );
+ wxSize ConvertPixelsToDialog( const wxSize& sz )
+ {
+ wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y)));
+
+ return wxSize(pt.x, pt.y);
+ }
- virtual void SetClientSize( int width, int height );
+ wxSize ConvertDialogToPixels( const wxSize& sz )
+ {
+ wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y)));
- virtual void GetClientSize( int *width, int *height ) const;
- wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); }
+ return wxSize(pt.x, pt.y);
+ }
- virtual void GetPosition( int *x, int *y ) const;
- wxPoint GetPosition() const { int w, h; GetPosition(& w, & h); return wxPoint(w, h); }
+ void OnSize( wxSizeEvent &event );
- wxRect GetRect() const
- { int x, y, w, h; GetPosition(& x, & y); GetSize(& w, & h); return wxRect(x, y, w, h); }
+ // window state
+ // ------------
- virtual void Centre( int direction = wxHORIZONTAL );
- inline void Center(int direction = wxHORIZONTAL) { Centre(direction); }
- virtual void Fit();
+ virtual bool Show( bool show );
+ virtual void Enable( bool enable );
+ virtual void MakeModal( bool modal );
+ virtual bool IsEnabled() const { return m_isEnabled; }
+ inline bool Enabled() const { return IsEnabled(); }
- virtual void SetSizeHints( int minW, int minH, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1 );
+ virtual void SetFocus();
+ static wxWindow *FindFocus();
- /* Dialog units translations. Implemented in wincmn.cpp. */
- wxPoint ConvertPixelsToDialog( const wxPoint& pt );
- wxPoint ConvertDialogToPixels( const wxPoint& pt );
- inline wxSize ConvertPixelsToDialog( const wxSize& sz )
- { wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
- inline wxSize ConvertDialogToPixels( const wxSize& sz )
- { wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
+ void SetReturnCode( int retCode );
+ int GetReturnCode();
- void OnSize( wxSizeEvent &event );
+ // parent/children relations
+ // -------------------------
- virtual bool Show( bool show );
- virtual void Enable( bool enable );
- virtual void MakeModal( bool modal );
- virtual bool IsEnabled() const { return m_isEnabled; }
- inline bool Enabled() const { return IsEnabled(); }
+ virtual void AddChild( wxWindow *child );
+ wxList& GetChildren() { return m_children; }
- virtual void SetFocus();
- static wxWindow *FindFocus();
+ virtual void RemoveChild( wxWindow *child );
- virtual void AddChild( wxWindow *child );
- wxList& GetChildren() { return m_children; }
+ wxWindow *GetParent() const
+ { return m_parent; }
+ wxWindow *GetGrandParent() const
+ { return (m_parent ? m_parent->m_parent : (wxWindow*)NULL); }
+ void SetParent( wxWindow *parent )
+ { m_parent = parent; }
+ virtual wxWindow *ReParent( wxWindow *newParent );
- virtual void RemoveChild( wxWindow *child );
- void SetReturnCode( int retCode );
- int GetReturnCode();
+ // event handler stuff
+ // -------------------
- wxWindow *GetParent() const
- { return m_parent; }
- wxWindow *GetGrandParent() const
- { return (m_parent ? m_parent->m_parent : (wxWindow*)NULL); }
- void SetParent( wxWindow *parent )
- { m_parent = parent; }
- virtual wxWindow *ReParent( wxWindow *newParent );
+ wxEvtHandler *GetEventHandler() const;
+ void SetEventHandler( wxEvtHandler *handler );
+ void PushEventHandler( wxEvtHandler *handler );
+ wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
- wxEvtHandler *GetEventHandler() const;
- void SetEventHandler( wxEvtHandler *handler );
- void PushEventHandler( wxEvtHandler *handler );
- wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
+ // validators and client data
+ // --------------------------
- virtual void SetValidator( const wxValidator &validator );
- virtual wxValidator *GetValidator();
+ virtual void SetValidator( const wxValidator &validator );
+ virtual wxValidator *GetValidator();
- virtual void SetClientObject( wxClientData *data );
- virtual wxClientData *GetClientObject();
+ virtual void SetClientObject( wxClientData *data );
+ virtual wxClientData *GetClientObject();
- virtual void SetClientData( void *data );
- virtual void *GetClientData();
+ virtual void SetClientData( void *data );
+ virtual void *GetClientData();
- virtual void SetAcceleratorTable( const wxAcceleratorTable& accel );
- virtual wxAcceleratorTable *GetAcceleratorTable() { return &m_acceleratorTable; }
+ // accelerators
+ // ------------
+ virtual void SetAcceleratorTable( const wxAcceleratorTable& accel );
+ virtual wxAcceleratorTable *GetAcceleratorTable() { return &m_acceleratorTable; }
- bool IsBeingDeleted();
+ void SetId( wxWindowID id );
+ wxWindowID GetId() const;
- void SetId( wxWindowID id );
- wxWindowID GetId() const;
+ void SetCursor( const wxCursor &cursor );
- void SetCursor( const wxCursor &cursor );
+ virtual void PrepareDC( wxDC &dc );
- void WarpPointer(int x, int y);
+ void WarpPointer(int x, int y);
#if wxUSE_TOOLTIPS
- void SetToolTip( const wxString &tip );
- virtual void SetToolTip( wxToolTip *tip );
- wxToolTip* GetToolTip() const { return m_toolTip; }
+ void SetToolTip( const wxString &tip );
+ virtual void SetToolTip( wxToolTip *tip );
+ wxToolTip* GetToolTip() const { return m_toolTip; }
#endif // wxUSE_TOOLTIPS
- virtual void Refresh( bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL );
- virtual void Clear();
+ virtual void Refresh( bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL );
+ virtual void Clear();
+
+ virtual wxRegion GetUpdateRegion() const;
+ virtual bool IsExposed( int x, int y ) const;
+ virtual bool IsExposed( int x, int y, int w, int h ) const;
+ virtual bool IsExposed( const wxPoint& pt ) const;
+ virtual bool IsExposed( const wxRect& rect ) const;
+
+ // colours
+ // -------
- virtual wxRegion GetUpdateRegion() const;
- virtual bool IsExposed( int x, int y ) const;
- virtual bool IsExposed( int x, int y, int w, int h ) const;
- virtual bool IsExposed( const wxPoint& pt ) const;
- virtual bool IsExposed( const wxRect& rect ) const;
+ virtual wxColour GetBackgroundColour() const;
+ virtual void SetBackgroundColour( const wxColour &colour );
+ virtual wxColour GetForegroundColour() const;
+ virtual void SetForegroundColour( const wxColour &colour );
- virtual wxColour GetBackgroundColour() const;
- virtual void SetBackgroundColour( const wxColour &colour );
- virtual wxColour GetForegroundColour() const;
- virtual void SetForegroundColour( const wxColour &colour );
+ // fonts
+ // -----
- virtual int GetCharHeight() const;
- virtual int GetCharWidth() const;
- virtual void GetTextExtent( const wxString& string, int *x, int *y,
- int *descent = (int *) NULL,
- int *externalLeading = (int *) NULL,
- const wxFont *theFont = (const wxFont *) NULL, bool use16 = FALSE) const;
+ virtual int GetCharHeight() const;
+ virtual int GetCharWidth() const;
+ virtual void GetTextExtent( const wxString& string, int *x, int *y,
+ int *descent = (int *) NULL,
+ int *externalLeading = (int *) NULL,
+ const wxFont *theFont = (const wxFont *) NULL, bool use16 = FALSE) const;
- virtual void SetFont( const wxFont &font );
- virtual wxFont& GetFont() { return m_font; }
+ virtual void SetFont( const wxFont &font );
+ virtual wxFont& GetFont() { return m_font; }
// For backward compatibility
- virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
- virtual void SetLabelFont(const wxFont& font) { SetFont(font); }
- virtual wxFont& GetLabelFont() { return GetFont(); };
- virtual wxFont& GetButtonFont() { return GetFont(); };
+ virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
+ virtual void SetLabelFont(const wxFont& font) { SetFont(font); }
+ virtual wxFont& GetLabelFont() { return GetFont(); };
+ virtual wxFont& GetButtonFont() { return GetFont(); };
- virtual void SetWindowStyleFlag( long flag );
- virtual long GetWindowStyleFlag() const;
+ virtual void SetWindowStyleFlag( long flag );
+ virtual long GetWindowStyleFlag() const;
- virtual void CaptureMouse();
- virtual void ReleaseMouse();
+ virtual void CaptureMouse();
+ virtual void ReleaseMouse();
- virtual void SetTitle( const wxString &title );
- virtual wxString GetTitle() const;
- virtual void SetName( const wxString &name );
- virtual wxString GetName() const;
- virtual wxString GetLabel() const;
+ virtual void SetTitle( const wxString &title );
+ virtual wxString GetTitle() const;
+ virtual void SetName( const wxString &name );
+ virtual wxString GetName() const;
+ virtual wxString GetLabel() const;
- void OnSysColourChanged( wxSysColourChangedEvent &WXUNUSED(event) ) { }
- void OnKeyDown( wxKeyEvent &event );
+ void OnSysColourChanged( wxSysColourChangedEvent &WXUNUSED(event) ) { }
+ void OnKeyDown( wxKeyEvent &event );
- virtual bool IsShown() const;
+ virtual bool IsShown() const;
- virtual void Raise();
- virtual void Lower();
+ virtual void Raise();
+ virtual void Lower();
- virtual bool IsRetained();
- virtual wxWindow *FindWindow( long id );
- virtual wxWindow *FindWindow( const wxString& name );
+ virtual bool IsRetained();
+ virtual wxWindow *FindWindow( long id );
+ virtual wxWindow *FindWindow( const wxString& name );
- void AllowDoubleClick( bool WXUNUSED(allow) ) { }
- void SetDoubleClick( bool WXUNUSED(allow) ) { }
+ void AllowDoubleClick( bool WXUNUSED(allow) ) { }
+ void SetDoubleClick( bool WXUNUSED(allow) ) { }
- virtual void ClientToScreen( int *x, int *y );
- virtual void ScreenToClient( int *x, int *y );
+ virtual void ClientToScreen( int *x, int *y );
+ virtual void ScreenToClient( int *x, int *y );
- virtual bool Validate();
- virtual bool TransferDataToWindow();
- virtual bool TransferDataFromWindow();
- void OnInitDialog( wxInitDialogEvent &event );
- virtual void InitDialog();
+ virtual bool Validate();
+ virtual bool TransferDataToWindow();
+ virtual bool TransferDataFromWindow();
+ void OnInitDialog( wxInitDialogEvent &event );
+ virtual void InitDialog();
- virtual bool PopupMenu( wxMenu *menu, int x, int y );
+ virtual bool PopupMenu( wxMenu *menu, int x, int y );
#if wxUSE_DRAG_AND_DROP
- virtual void SetDropTarget( wxDropTarget *dropTarget );
- virtual wxDropTarget *GetDropTarget() const;
+ virtual void SetDropTarget( wxDropTarget *dropTarget );
+ virtual wxDropTarget *GetDropTarget() const;
#endif
- virtual void SetScrollbar( int orient, int pos, int thumbVisible,
- int range, bool refresh = TRUE );
- virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
- 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, const wxRect* rect = (wxRect *) NULL );
+ virtual void SetScrollbar( int orient, int pos, int thumbVisible,
+ int range, bool refresh = TRUE );
+ virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
+ 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, const wxRect* rect = (wxRect *) NULL );
- virtual bool AcceptsFocus() const;
+ virtual bool AcceptsFocus() const;
- void UpdateWindowUI();
+ void UpdateWindowUI();
- // implementation
+ // implementation
- virtual wxPoint GetClientAreaOrigin() const;
- virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
+ virtual wxPoint GetClientAreaOrigin() const;
+ virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
- bool HasVMT();
+ bool HasVMT();
- virtual void OnInternalIdle();
+ virtual void OnInternalIdle();
- /* used by all classes in the widget creation process */
+ /* used by all classes in the widget creation process */
- void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
- const wxSize &size, long style, const wxString &name );
- void PostCreation();
+ void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
+ const wxSize &size, long style, const wxString &name );
+ void PostCreation();
- /* the methods below are required because many native widgets
- are composed of several subwidgets and setting a style for
- the widget means setting it for all subwidgets as well.
- also, it is nor clear, which native widget is the top
- widget where (most of) the input goes. even tooltips have
- to be applied to all subwidgets. */
+ /* the methods below are required because many native widgets
+ are composed of several subwidgets and setting a style for
+ the widget means setting it for all subwidgets as well.
+ also, it is nor clear, which native widget is the top
+ widget where (most of) the input goes. even tooltips have
+ to be applied to all subwidgets. */
- virtual GtkWidget* GetConnectWidget();
- virtual bool IsOwnGtkWindow( GdkWindow *window );
- void ConnectWidget( GtkWidget *widget );
+ virtual GtkWidget* GetConnectWidget();
+ virtual bool IsOwnGtkWindow( GdkWindow *window );
+ void ConnectWidget( GtkWidget *widget );
- GtkStyle *GetWidgetStyle();
- void SetWidgetStyle();
- virtual void ApplyWidgetStyle();
+ GtkStyle *GetWidgetStyle();
+ void SetWidgetStyle();
+ virtual void ApplyWidgetStyle();
#if wxUSE_TOOLTIPS
- virtual void ApplyToolTip( GtkTooltips *tips, const char *tip );
+ virtual void ApplyToolTip( GtkTooltips *tips, const char *tip );
#endif // wxUSE_TOOLTIPS
- /* private member variables */
-
- wxWindow *m_parent;
- wxList m_children;
- int m_x,m_y;
- int m_width,m_height;
- int m_minWidth,m_minHeight;
- int m_maxWidth,m_maxHeight;
- int m_retCode;
- wxEvtHandler *m_eventHandler;
- wxValidator *m_windowValidator;
+ /* private member variables */
+
+ wxWindow *m_parent;
+ wxList m_children;
+ int m_x,m_y;
+ int m_width,m_height;
+ int m_minWidth,m_minHeight;
+ int m_maxWidth,m_maxHeight;
+ int m_retCode;
+ wxEvtHandler *m_eventHandler;
+ wxValidator *m_windowValidator;
#if wxUSE_DRAG_AND_DROP
- wxDropTarget *m_dropTarget;
+ wxDropTarget *m_dropTarget;
#endif
- wxWindowID m_windowId;
- wxCursor *m_cursor;
- wxFont m_font;
- wxColour m_backgroundColour;
- wxColour m_foregroundColour;
- wxRegion m_updateRegion;
- long m_windowStyle;
- bool m_isShown;
- bool m_isEnabled;
- wxString m_windowName;
- wxAcceleratorTable m_acceleratorTable;
- wxClientData *m_clientObject;
- void *m_clientData;
+ wxWindowID m_windowId;
+ wxCursor *m_cursor;
+ wxFont m_font;
+ wxColour m_backgroundColour;
+ wxColour m_foregroundColour;
+ wxRegion m_updateRegion;
+ long m_windowStyle;
+ bool m_isShown;
+ bool m_isEnabled;
+ wxString m_windowName;
+ wxAcceleratorTable m_acceleratorTable;
+ wxClientData *m_clientObject;
+ void *m_clientData;
#if wxUSE_TOOLTIPS
- wxToolTip *m_toolTip;
+ wxToolTip *m_toolTip;
#endif // wxUSE_TOOLTIPS
- GtkWidget *m_widget;
- GtkWidget *m_wxwindow;
- GtkAdjustment *m_hAdjust,*m_vAdjust;
- float m_oldHorizontalPos;
- float m_oldVerticalPos;
- bool m_needParent;
- bool m_hasScrolling;
- bool m_isScrolling;
- bool m_hasVMT;
- bool m_sizeSet;
- bool m_resizing;
- GdkGC *m_scrollGC;
- GtkStyle *m_widgetStyle;
- bool m_isStaticBox;
- bool m_acceptsFocus;
-
- wxInsertChildFunction m_insertCallback;
+ GtkWidget *m_widget;
+ GtkWidget *m_wxwindow;
+ GtkAdjustment *m_hAdjust,*m_vAdjust;
+ float m_oldHorizontalPos;
+ float m_oldVerticalPos;
+ bool m_needParent;
+ bool m_hasScrolling;
+ bool m_isScrolling;
+ bool m_hasVMT;
+ bool m_sizeSet;
+ bool m_resizing;
+ GdkGC *m_scrollGC;
+ GtkStyle *m_widgetStyle;
+ bool m_isStaticBox;
+ bool m_acceptsFocus;
+
+ wxInsertChildFunction m_insertCallback;
public:
- wxLayoutConstraints *m_constraints;
- wxList *m_constraintsInvolvedIn;
- wxSizer *m_windowSizer;
- wxWindow *m_sizerParent;
- bool m_autoLayout;
-
- wxLayoutConstraints *GetConstraints() const;
- void SetConstraints( wxLayoutConstraints *constraints );
- void SetAutoLayout( bool autoLayout );
- bool GetAutoLayout() const;
- bool Layout();
- void SetSizer( wxSizer *sizer );
- wxSizer *GetSizer() const;
- void SetSizerParent( wxWindow *win );
- wxWindow *GetSizerParent() const;
- void UnsetConstraints(wxLayoutConstraints *c);
- inline wxList *GetConstraintsInvolvedIn() const ;
- void AddConstraintReference(wxWindow *otherWin);
- void RemoveConstraintReference(wxWindow *otherWin);
- void DeleteRelatedConstraints();
- virtual void ResetConstraints();
- virtual void SetConstraintSizes(bool recurse = TRUE);
- virtual bool LayoutPhase1(int *noChanges);
- virtual bool LayoutPhase2(int *noChanges);
- virtual bool DoPhase(int);
- virtual void TransformSizerToActual(int *x, int *y) const ;
- virtual void SizerSetSize(int x, int y, int w, int h);
- virtual void SizerMove(int x, int y);
- virtual void SetSizeConstraint(int x, int y, int w, int h);
- virtual void MoveConstraint(int x, int y);
- virtual void GetSizeConstraint(int *w, int *h) const ;
- virtual void GetClientSizeConstraint(int *w, int *h) const ;
- virtual void GetPositionConstraint(int *x, int *y) const ;
+ wxLayoutConstraints *m_constraints;
+ wxList *m_constraintsInvolvedIn;
+ wxSizer *m_windowSizer;
+ wxWindow *m_sizerParent;
+ bool m_autoLayout;
+
+ wxLayoutConstraints *GetConstraints() const;
+ void SetConstraints( wxLayoutConstraints *constraints );
+ void SetAutoLayout( bool autoLayout );
+ bool GetAutoLayout() const;
+ bool Layout();
+ void SetSizer( wxSizer *sizer );
+ wxSizer *GetSizer() const;
+ void SetSizerParent( wxWindow *win );
+ wxWindow *GetSizerParent() const;
+ void UnsetConstraints(wxLayoutConstraints *c);
+ inline wxList *GetConstraintsInvolvedIn() const ;
+ void AddConstraintReference(wxWindow *otherWin);
+ void RemoveConstraintReference(wxWindow *otherWin);
+ void DeleteRelatedConstraints();
+ virtual void ResetConstraints();
+ virtual void SetConstraintSizes(bool recurse = TRUE);
+ virtual bool LayoutPhase1(int *noChanges);
+ virtual bool LayoutPhase2(int *noChanges);
+ virtual bool DoPhase(int);
+ virtual void TransformSizerToActual(int *x, int *y) const ;
+ virtual void SizerSetSize(int x, int y, int w, int h);
+ virtual void SizerMove(int x, int y);
+ virtual void SetSizeConstraint(int x, int y, int w, int h);
+ virtual void MoveConstraint(int x, int y);
+ virtual void GetSizeConstraint(int *w, int *h) const ;
+ virtual void GetClientSizeConstraint(int *w, int *h) const ;
+ virtual void GetPositionConstraint(int *x, int *y) const ;
+
+protected:
+ // this is the virtual function to be overriden in any derived class which
+ // wants to change how SetSize() or Move() works - it is called by all
+ // versions of these functions in the base class
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+
+ // same as DoSetSize() for the client size
+ virtual void DoSetClientSize(int width, int height);
private:
- DECLARE_EVENT_TABLE()
+ DECLARE_EVENT_TABLE()
};
#endif // __GTKWINDOWH__
class wxDialog: public wxPanel
{
- DECLARE_DYNAMIC_CLASS(wxDialog)
+ DECLARE_DYNAMIC_CLASS(wxDialog)
public:
- wxDialog();
- wxDialog( wxWindow *parent, wxWindowID id,
+ wxDialog();
+ wxDialog( wxWindow *parent, wxWindowID id,
const wxString &title,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString &name = wxDialogNameStr );
- bool Create( wxWindow *parent, wxWindowID id,
- const wxString &title,
- const wxPoint &pos = wxDefaultPosition,
- const wxSize &size = wxDefaultSize,
- long style = wxDEFAULT_DIALOG_STYLE,
- const wxString &name = wxDialogNameStr );
- ~wxDialog();
-
- void SetTitle(const wxString& title);
- wxString GetTitle() const;
-
- void OnApply( wxCommandEvent &event );
- void OnCancel( wxCommandEvent &event );
- void OnOK( wxCommandEvent &event );
- void OnPaint( wxPaintEvent& event );
- void OnSize( wxSizeEvent &event );
- void OnCloseWindow( wxCloseEvent& event );
-/*
- void OnCharHook( wxKeyEvent& event );
-*/
-
- bool Destroy();
-
- virtual void SetSize( int x, int y, int width, int height,
- int sizeFlags = wxSIZE_AUTO );
- virtual void SetSize( int width, int height );
-
- virtual bool Show( bool show );
- virtual int ShowModal();
- virtual void EndModal( int retCode );
- virtual bool IsModal() const;
- void SetModal( bool modal );
-
- virtual void InitDialog(void);
-
- virtual void Centre( int direction = wxHORIZONTAL );
-
- virtual void SetIcon( const wxIcon &icon );
- virtual void Iconize( bool WXUNUSED(iconize)) { }
- virtual bool IsIconized() const { return FALSE; }
- bool Iconized() const { return IsIconized(); }
- virtual void Maximize() { }
- virtual void Restore() { }
-
-// implementation
-
- virtual void GtkOnSize( int x, int y, int width, int height );
- virtual void OnInternalIdle();
-
- bool m_modalShowing;
- wxString m_title;
- wxIcon m_icon;
-
- DECLARE_EVENT_TABLE()
+ bool Create( wxWindow *parent, wxWindowID id,
+ const wxString &title,
+ const wxPoint &pos = wxDefaultPosition,
+ const wxSize &size = wxDefaultSize,
+ long style = wxDEFAULT_DIALOG_STYLE,
+ const wxString &name = wxDialogNameStr );
+ ~wxDialog();
+
+ void SetTitle(const wxString& title);
+ wxString GetTitle() const;
+
+ void OnApply( wxCommandEvent &event );
+ void OnCancel( wxCommandEvent &event );
+ void OnOK( wxCommandEvent &event );
+ void OnPaint( wxPaintEvent& event );
+ void OnSize( wxSizeEvent &event );
+ void OnCloseWindow( wxCloseEvent& event );
+ /*
+ void OnCharHook( wxKeyEvent& event );
+ */
+
+ bool Destroy();
+
+ virtual bool Show( bool show );
+ virtual int ShowModal();
+ virtual void EndModal( int retCode );
+ virtual bool IsModal() const;
+ void SetModal( bool modal );
+
+ virtual void InitDialog(void);
+
+ virtual void Centre( int direction = wxHORIZONTAL );
+
+ virtual void SetIcon( const wxIcon &icon );
+ virtual void Iconize( bool WXUNUSED(iconize)) { }
+ virtual bool IsIconized() const { return FALSE; }
+ bool Iconized() const { return IsIconized(); }
+ virtual void Maximize() { }
+ virtual void Restore() { }
+
+ // implementation
+
+ virtual void GtkOnSize( int x, int y, int width, int height );
+ virtual void OnInternalIdle();
+
+ bool m_modalShowing;
+ wxString m_title;
+ wxIcon m_icon;
+
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+
+private:
+ DECLARE_EVENT_TABLE()
};
#endif // __GTKDIALOGH__
class wxFrame: public wxWindow
{
- DECLARE_DYNAMIC_CLASS(wxFrame)
-public:
+DECLARE_DYNAMIC_CLASS(wxFrame)
- wxFrame();
- wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
- bool Create( wxWindow *parent, wxWindowID id, const wxString &title,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
- ~wxFrame();
- bool Destroy();
-
- virtual bool Show( bool show );
- virtual void Centre( int direction = wxHORIZONTAL );
-
- virtual void GetClientSize( int *width, int *height ) const;
- wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); }
-
- virtual void SetClientSize( int width, int height );
-
- virtual void SetSize( int x, int y, int width, int height,
- int sizeFlags = wxSIZE_AUTO );
- virtual void SetSize( int width, int height );
-
- virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
- const wxString& name = "statusBar");
- virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id,
- const wxString& name );
- virtual wxStatusBar *GetStatusBar() const;
- inline void SetStatusBar(wxStatusBar *statusBar) { m_frameStatusBar = statusBar; }
- virtual void SetStatusText( const wxString &text, int number = 0 );
- virtual void SetStatusWidths( int n, const int widths_field[] );
-
- virtual wxToolBar* CreateToolBar( long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1,
- const wxString& name = wxToolBarNameStr);
- virtual wxToolBar *OnCreateToolBar( long style, wxWindowID id, const wxString& name );
- virtual wxToolBar *GetToolBar() const;
- inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
-
- virtual void SetMenuBar( wxMenuBar *menuBar );
- virtual wxMenuBar *GetMenuBar() const;
-
- virtual void SetTitle( const wxString &title );
- virtual wxString GetTitle() const { return m_title; }
-
- virtual void SetIcon( const wxIcon &icon );
- virtual void Iconize( bool WXUNUSED(iconize)) { }
- virtual bool IsIconized() const { return FALSE; }
- bool Iconized() const { return IsIconized(); }
- virtual void Maximize(bool WXUNUSED(maximize)) {}
- virtual void Restore() {}
-
- void OnCloseWindow( wxCloseEvent& event );
- void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
- void OnSize( wxSizeEvent &event );
-
- void OnMenuHighlight( wxMenuEvent& event );
-
- // implementation
-
- virtual void GtkOnSize( int x, int y, int width, int height );
- virtual wxPoint GetClientAreaOrigin() const;
- void DoMenuUpdates();
- void DoMenuUpdates(wxMenu* menu);
- virtual void OnInternalIdle();
-
- wxMenuBar *m_frameMenuBar;
- wxMenuBar *m_mdiMenuBar;
- wxStatusBar *m_frameStatusBar;
- wxToolBar *m_frameToolBar;
- wxString m_title;
- wxIcon m_icon;
- int m_miniEdge,m_miniTitle;
-
- DECLARE_EVENT_TABLE()
+public:
+ wxFrame();
+ wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
+ const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
+ bool Create( wxWindow *parent, wxWindowID id, const wxString &title,
+ const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
+ ~wxFrame();
+ bool Destroy();
+
+ virtual bool Show( bool show );
+ virtual void Centre( int direction = wxHORIZONTAL );
+
+ virtual void GetClientSize( int *width, int *height ) const;
+
+ virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
+ const wxString& name = "statusBar");
+ virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id,
+ const wxString& name );
+ virtual wxStatusBar *GetStatusBar() const;
+ inline void SetStatusBar(wxStatusBar *statusBar) { m_frameStatusBar = statusBar; }
+ virtual void SetStatusText( const wxString &text, int number = 0 );
+ virtual void SetStatusWidths( int n, const int widths_field[] );
+
+ virtual wxToolBar* CreateToolBar( long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1,
+ const wxString& name = wxToolBarNameStr);
+ virtual wxToolBar *OnCreateToolBar( long style, wxWindowID id, const wxString& name );
+ virtual wxToolBar *GetToolBar() const;
+ inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
+
+ virtual void SetMenuBar( wxMenuBar *menuBar );
+ virtual wxMenuBar *GetMenuBar() const;
+
+ virtual void SetTitle( const wxString &title );
+ virtual wxString GetTitle() const { return m_title; }
+
+ virtual void SetIcon( const wxIcon &icon );
+ virtual void Iconize( bool WXUNUSED(iconize)) { }
+ virtual bool IsIconized() const { return FALSE; }
+ bool Iconized() const { return IsIconized(); }
+ virtual void Maximize(bool WXUNUSED(maximize)) {}
+ virtual void Restore() {}
+
+ void OnCloseWindow( wxCloseEvent& event );
+ void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
+ void OnSize( wxSizeEvent &event );
+
+ void OnMenuHighlight( wxMenuEvent& event );
+
+ // implementation
+
+ virtual void GtkOnSize( int x, int y, int width, int height );
+ virtual wxPoint GetClientAreaOrigin() const;
+ void DoMenuUpdates();
+ void DoMenuUpdates(wxMenu* menu);
+ virtual void OnInternalIdle();
+
+ wxMenuBar *m_frameMenuBar;
+ wxMenuBar *m_mdiMenuBar;
+ wxStatusBar *m_frameStatusBar;
+ wxToolBar *m_frameToolBar;
+ wxString m_title;
+ wxIcon m_icon;
+ int m_miniEdge,m_miniTitle;
+
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+
+ virtual void DoSetClientSize(int width, int height);
+
+private:
+ DECLARE_EVENT_TABLE()
};
#endif // __GTKFRAMEH__
virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {}
// no size hints
- virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW),
- int WXUNUSED(maxH), int WXUNUSED(incW) ) {}
+ virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH),
+ int WXUNUSED(maxW), int WXUNUSED(maxH),
+ int WXUNUSED(incW) )
+ {
+ }
// no toolbar bars
virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id),
#define __GTKWINDOWH__
#ifdef __GNUG__
-#pragma interface
+ #pragma interface
#endif
#include "wx/defs.h"
// global function
//-----------------------------------------------------------------------------
-wxWindow* wxGetActiveWindow();
+extern wxWindow* wxGetActiveWindow();
//-----------------------------------------------------------------------------
// classes
class wxVoidClientData;
class wxWindow;
#if wxUSE_WX_RESOURCES
-class wxResourceTable;
-class wxItemResource;
+ class wxResourceTable;
+ class wxItemResource;
#endif
#if wxUSE_DRAG_AND_DROP
-class wxDropTarget;
+ class wxDropTarget;
#endif
class wxToolTip;
class wxClientData
{
public:
- wxClientData() { }
- virtual ~wxClientData() { }
+ wxClientData() { }
+ virtual ~wxClientData() { }
};
//-----------------------------------------------------------------------------
// wxStringClientData
//-----------------------------------------------------------------------------
-class wxStringClientData: public wxClientData
+class wxStringClientData : public wxClientData
{
public:
wxStringClientData() { }
// wxWindow
//-----------------------------------------------------------------------------
-class wxWindow: public wxEvtHandler
+class wxWindow : public wxEvtHandler
{
- DECLARE_DYNAMIC_CLASS(wxWindow)
+ DECLARE_DYNAMIC_CLASS(wxWindow)
public:
- wxWindow();
- wxWindow(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxPanelNameStr);
- bool Create(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxPanelNameStr);
- virtual ~wxWindow();
+ // creating the window
+ // -------------------
+ wxWindow();
+ wxWindow(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr);
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr);
+ virtual ~wxWindow();
#if wxUSE_WX_RESOURCES
- virtual bool LoadFromResource( wxWindow *parent, const wxString& resourceName,
- const wxResourceTable *table = (const wxResourceTable *) NULL);
- virtual wxControl *CreateItem(const wxItemResource* childResource, const wxItemResource* parentResource,
- const wxResourceTable *table = (const wxResourceTable *) NULL);
-#endif
+ virtual bool LoadFromResource(wxWindow *parent,
+ const wxString& resourceName,
+ const wxResourceTable *table = (const wxResourceTable *) NULL);
+ virtual wxControl *CreateItem(const wxItemResource* childResource,
+ const wxItemResource* parentResource,
+ const wxResourceTable *table = (const wxResourceTable *) NULL);
+#endif // wxUSE_WX_RESOURCES
+
+ // closing the window
+ // ------------------
+ bool Close( bool force = FALSE );
+ virtual bool Destroy();
+ virtual bool DestroyChildren();
+
+ bool IsBeingDeleted();
+
+ // moving/resizing
+ // ---------------
+
+ // set the window size and/or position
+ void SetSize( int x, int y, int width, int height,
+ int sizeFlags = wxSIZE_AUTO )
+ { DoSetSize(x, y, width, height, sizeFlags); }
+
+ void SetSize( int width, int height )
+ { DoSetSize( -1, -1, width, height, wxSIZE_USE_EXISTING ); }
+
+ void SetSize( const wxSize& size )
+ { SetSize( size.x, size.y); }
+
+ void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
+ { DoSetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); }
+
+ void Move( int x, int y )
+ { DoSetSize( x, y, -1, -1, wxSIZE_USE_EXISTING ); }
+
+ void Move(const wxPoint& pt)
+ { Move(pt.x, pt.y); }
+
+ // client size is the size of area available for subwindows
+ void SetClientSize( int width, int height )
+ { DoSetClientSize(width, height); }
+
+ void SetClientSize( const wxSize& size )
+ { DoSetClientSize(size.x, size.y); }
+
+ void SetClientSize(const wxRect& rect)
+ { SetClientSize( rect.width, rect.height ); }
+
+ // get the window position and/or size
+ virtual void GetPosition( int *x, int *y ) const;
+ wxPoint GetPosition() const
+ {
+ int w, h;
+ GetPosition(& w, & h);
+
+ return wxPoint(w, h);
+ }
+
+ virtual void GetSize( int *width, int *height ) const;
+
+ wxSize GetSize() const
+ {
+ int w, h;
+ GetSize(& w, & h);
+ return wxSize(w, h);
+ }
+
+ wxRect GetRect() const
+ {
+ int x, y, w, h;
+ GetPosition(& x, & y);
+ GetSize(& w, & h);
+
+ return wxRect(x, y, w, h);
+ }
- bool Close( bool force = FALSE );
- virtual bool Destroy();
- virtual bool DestroyChildren();
+ virtual void GetClientSize( int *width, int *height ) const;
+ wxSize GetClientSize() const
+ {
+ int w, h;
+ GetClientSize(& w, & h);
+ return wxSize(w, h);
+ }
- virtual void PrepareDC( wxDC &dc );
+ // position with respect to the the parent window
+ virtual void Centre( int direction = wxHORIZONTAL );
+ void Center(int direction = wxHORIZONTAL) { Centre(direction); }
+ virtual void Fit();
- virtual void SetSize( int x, int y, int width, int height,
- int sizeFlags = wxSIZE_AUTO );
- virtual void SetSize( int width, int height );
+ // set min/max size of the window
+ virtual void SetSizeHints( int minW, int minH,
+ int maxW = -1, int maxH = -1,
+ int incW = -1, int incH = -1 );
- virtual void Move( int x, int y );
+ // Dialog units translations. Implemented in wincmn.cpp.
+ // -----------------------------------------------------
- virtual void GetSize( int *width, int *height ) const;
- wxSize GetSize() const { int w, h; GetSize(& w, & h); return wxSize(w, h); }
+ wxPoint ConvertPixelsToDialog( const wxPoint& pt );
+ wxPoint ConvertDialogToPixels( const wxPoint& pt );
+ wxSize ConvertPixelsToDialog( const wxSize& sz )
+ {
+ wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y)));
+
+ return wxSize(pt.x, pt.y);
+ }
- virtual void SetClientSize( int width, int height );
+ wxSize ConvertDialogToPixels( const wxSize& sz )
+ {
+ wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y)));
- virtual void GetClientSize( int *width, int *height ) const;
- wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); }
+ return wxSize(pt.x, pt.y);
+ }
- virtual void GetPosition( int *x, int *y ) const;
- wxPoint GetPosition() const { int w, h; GetPosition(& w, & h); return wxPoint(w, h); }
+ void OnSize( wxSizeEvent &event );
- wxRect GetRect() const
- { int x, y, w, h; GetPosition(& x, & y); GetSize(& w, & h); return wxRect(x, y, w, h); }
+ // window state
+ // ------------
- virtual void Centre( int direction = wxHORIZONTAL );
- inline void Center(int direction = wxHORIZONTAL) { Centre(direction); }
- virtual void Fit();
+ virtual bool Show( bool show );
+ virtual void Enable( bool enable );
+ virtual void MakeModal( bool modal );
+ virtual bool IsEnabled() const { return m_isEnabled; }
+ inline bool Enabled() const { return IsEnabled(); }
- virtual void SetSizeHints( int minW, int minH, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1 );
+ virtual void SetFocus();
+ static wxWindow *FindFocus();
- /* Dialog units translations. Implemented in wincmn.cpp. */
- wxPoint ConvertPixelsToDialog( const wxPoint& pt );
- wxPoint ConvertDialogToPixels( const wxPoint& pt );
- inline wxSize ConvertPixelsToDialog( const wxSize& sz )
- { wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
- inline wxSize ConvertDialogToPixels( const wxSize& sz )
- { wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
+ void SetReturnCode( int retCode );
+ int GetReturnCode();
- void OnSize( wxSizeEvent &event );
+ // parent/children relations
+ // -------------------------
- virtual bool Show( bool show );
- virtual void Enable( bool enable );
- virtual void MakeModal( bool modal );
- virtual bool IsEnabled() const { return m_isEnabled; }
- inline bool Enabled() const { return IsEnabled(); }
+ virtual void AddChild( wxWindow *child );
+ wxList& GetChildren() { return m_children; }
- virtual void SetFocus();
- static wxWindow *FindFocus();
+ virtual void RemoveChild( wxWindow *child );
- virtual void AddChild( wxWindow *child );
- wxList& GetChildren() { return m_children; }
+ wxWindow *GetParent() const
+ { return m_parent; }
+ wxWindow *GetGrandParent() const
+ { return (m_parent ? m_parent->m_parent : (wxWindow*)NULL); }
+ void SetParent( wxWindow *parent )
+ { m_parent = parent; }
+ virtual wxWindow *ReParent( wxWindow *newParent );
- virtual void RemoveChild( wxWindow *child );
- void SetReturnCode( int retCode );
- int GetReturnCode();
+ // event handler stuff
+ // -------------------
- wxWindow *GetParent() const
- { return m_parent; }
- wxWindow *GetGrandParent() const
- { return (m_parent ? m_parent->m_parent : (wxWindow*)NULL); }
- void SetParent( wxWindow *parent )
- { m_parent = parent; }
- virtual wxWindow *ReParent( wxWindow *newParent );
+ wxEvtHandler *GetEventHandler() const;
+ void SetEventHandler( wxEvtHandler *handler );
+ void PushEventHandler( wxEvtHandler *handler );
+ wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
- wxEvtHandler *GetEventHandler() const;
- void SetEventHandler( wxEvtHandler *handler );
- void PushEventHandler( wxEvtHandler *handler );
- wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
+ // validators and client data
+ // --------------------------
- virtual void SetValidator( const wxValidator &validator );
- virtual wxValidator *GetValidator();
+ virtual void SetValidator( const wxValidator &validator );
+ virtual wxValidator *GetValidator();
- virtual void SetClientObject( wxClientData *data );
- virtual wxClientData *GetClientObject();
+ virtual void SetClientObject( wxClientData *data );
+ virtual wxClientData *GetClientObject();
- virtual void SetClientData( void *data );
- virtual void *GetClientData();
+ virtual void SetClientData( void *data );
+ virtual void *GetClientData();
- virtual void SetAcceleratorTable( const wxAcceleratorTable& accel );
- virtual wxAcceleratorTable *GetAcceleratorTable() { return &m_acceleratorTable; }
+ // accelerators
+ // ------------
+ virtual void SetAcceleratorTable( const wxAcceleratorTable& accel );
+ virtual wxAcceleratorTable *GetAcceleratorTable() { return &m_acceleratorTable; }
- bool IsBeingDeleted();
+ void SetId( wxWindowID id );
+ wxWindowID GetId() const;
- void SetId( wxWindowID id );
- wxWindowID GetId() const;
+ void SetCursor( const wxCursor &cursor );
- void SetCursor( const wxCursor &cursor );
+ virtual void PrepareDC( wxDC &dc );
- void WarpPointer(int x, int y);
+ void WarpPointer(int x, int y);
#if wxUSE_TOOLTIPS
- void SetToolTip( const wxString &tip );
- virtual void SetToolTip( wxToolTip *tip );
- wxToolTip* GetToolTip() const { return m_toolTip; }
+ void SetToolTip( const wxString &tip );
+ virtual void SetToolTip( wxToolTip *tip );
+ wxToolTip* GetToolTip() const { return m_toolTip; }
#endif // wxUSE_TOOLTIPS
- virtual void Refresh( bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL );
- virtual void Clear();
+ virtual void Refresh( bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL );
+ virtual void Clear();
+
+ virtual wxRegion GetUpdateRegion() const;
+ virtual bool IsExposed( int x, int y ) const;
+ virtual bool IsExposed( int x, int y, int w, int h ) const;
+ virtual bool IsExposed( const wxPoint& pt ) const;
+ virtual bool IsExposed( const wxRect& rect ) const;
+
+ // colours
+ // -------
- virtual wxRegion GetUpdateRegion() const;
- virtual bool IsExposed( int x, int y ) const;
- virtual bool IsExposed( int x, int y, int w, int h ) const;
- virtual bool IsExposed( const wxPoint& pt ) const;
- virtual bool IsExposed( const wxRect& rect ) const;
+ virtual wxColour GetBackgroundColour() const;
+ virtual void SetBackgroundColour( const wxColour &colour );
+ virtual wxColour GetForegroundColour() const;
+ virtual void SetForegroundColour( const wxColour &colour );
- virtual wxColour GetBackgroundColour() const;
- virtual void SetBackgroundColour( const wxColour &colour );
- virtual wxColour GetForegroundColour() const;
- virtual void SetForegroundColour( const wxColour &colour );
+ // fonts
+ // -----
- virtual int GetCharHeight() const;
- virtual int GetCharWidth() const;
- virtual void GetTextExtent( const wxString& string, int *x, int *y,
- int *descent = (int *) NULL,
- int *externalLeading = (int *) NULL,
- const wxFont *theFont = (const wxFont *) NULL, bool use16 = FALSE) const;
+ virtual int GetCharHeight() const;
+ virtual int GetCharWidth() const;
+ virtual void GetTextExtent( const wxString& string, int *x, int *y,
+ int *descent = (int *) NULL,
+ int *externalLeading = (int *) NULL,
+ const wxFont *theFont = (const wxFont *) NULL, bool use16 = FALSE) const;
- virtual void SetFont( const wxFont &font );
- virtual wxFont& GetFont() { return m_font; }
+ virtual void SetFont( const wxFont &font );
+ virtual wxFont& GetFont() { return m_font; }
// For backward compatibility
- virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
- virtual void SetLabelFont(const wxFont& font) { SetFont(font); }
- virtual wxFont& GetLabelFont() { return GetFont(); };
- virtual wxFont& GetButtonFont() { return GetFont(); };
+ virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
+ virtual void SetLabelFont(const wxFont& font) { SetFont(font); }
+ virtual wxFont& GetLabelFont() { return GetFont(); };
+ virtual wxFont& GetButtonFont() { return GetFont(); };
- virtual void SetWindowStyleFlag( long flag );
- virtual long GetWindowStyleFlag() const;
+ virtual void SetWindowStyleFlag( long flag );
+ virtual long GetWindowStyleFlag() const;
- virtual void CaptureMouse();
- virtual void ReleaseMouse();
+ virtual void CaptureMouse();
+ virtual void ReleaseMouse();
- virtual void SetTitle( const wxString &title );
- virtual wxString GetTitle() const;
- virtual void SetName( const wxString &name );
- virtual wxString GetName() const;
- virtual wxString GetLabel() const;
+ virtual void SetTitle( const wxString &title );
+ virtual wxString GetTitle() const;
+ virtual void SetName( const wxString &name );
+ virtual wxString GetName() const;
+ virtual wxString GetLabel() const;
- void OnSysColourChanged( wxSysColourChangedEvent &WXUNUSED(event) ) { }
- void OnKeyDown( wxKeyEvent &event );
+ void OnSysColourChanged( wxSysColourChangedEvent &WXUNUSED(event) ) { }
+ void OnKeyDown( wxKeyEvent &event );
- virtual bool IsShown() const;
+ virtual bool IsShown() const;
- virtual void Raise();
- virtual void Lower();
+ virtual void Raise();
+ virtual void Lower();
- virtual bool IsRetained();
- virtual wxWindow *FindWindow( long id );
- virtual wxWindow *FindWindow( const wxString& name );
+ virtual bool IsRetained();
+ virtual wxWindow *FindWindow( long id );
+ virtual wxWindow *FindWindow( const wxString& name );
- void AllowDoubleClick( bool WXUNUSED(allow) ) { }
- void SetDoubleClick( bool WXUNUSED(allow) ) { }
+ void AllowDoubleClick( bool WXUNUSED(allow) ) { }
+ void SetDoubleClick( bool WXUNUSED(allow) ) { }
- virtual void ClientToScreen( int *x, int *y );
- virtual void ScreenToClient( int *x, int *y );
+ virtual void ClientToScreen( int *x, int *y );
+ virtual void ScreenToClient( int *x, int *y );
- virtual bool Validate();
- virtual bool TransferDataToWindow();
- virtual bool TransferDataFromWindow();
- void OnInitDialog( wxInitDialogEvent &event );
- virtual void InitDialog();
+ virtual bool Validate();
+ virtual bool TransferDataToWindow();
+ virtual bool TransferDataFromWindow();
+ void OnInitDialog( wxInitDialogEvent &event );
+ virtual void InitDialog();
- virtual bool PopupMenu( wxMenu *menu, int x, int y );
+ virtual bool PopupMenu( wxMenu *menu, int x, int y );
#if wxUSE_DRAG_AND_DROP
- virtual void SetDropTarget( wxDropTarget *dropTarget );
- virtual wxDropTarget *GetDropTarget() const;
+ virtual void SetDropTarget( wxDropTarget *dropTarget );
+ virtual wxDropTarget *GetDropTarget() const;
#endif
- virtual void SetScrollbar( int orient, int pos, int thumbVisible,
- int range, bool refresh = TRUE );
- virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
- 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, const wxRect* rect = (wxRect *) NULL );
+ virtual void SetScrollbar( int orient, int pos, int thumbVisible,
+ int range, bool refresh = TRUE );
+ virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
+ 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, const wxRect* rect = (wxRect *) NULL );
- virtual bool AcceptsFocus() const;
+ virtual bool AcceptsFocus() const;
- void UpdateWindowUI();
+ void UpdateWindowUI();
- // implementation
+ // implementation
- virtual wxPoint GetClientAreaOrigin() const;
- virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
+ virtual wxPoint GetClientAreaOrigin() const;
+ virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
- bool HasVMT();
+ bool HasVMT();
- virtual void OnInternalIdle();
+ virtual void OnInternalIdle();
- /* used by all classes in the widget creation process */
+ /* used by all classes in the widget creation process */
- void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
- const wxSize &size, long style, const wxString &name );
- void PostCreation();
+ void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
+ const wxSize &size, long style, const wxString &name );
+ void PostCreation();
- /* the methods below are required because many native widgets
- are composed of several subwidgets and setting a style for
- the widget means setting it for all subwidgets as well.
- also, it is nor clear, which native widget is the top
- widget where (most of) the input goes. even tooltips have
- to be applied to all subwidgets. */
+ /* the methods below are required because many native widgets
+ are composed of several subwidgets and setting a style for
+ the widget means setting it for all subwidgets as well.
+ also, it is nor clear, which native widget is the top
+ widget where (most of) the input goes. even tooltips have
+ to be applied to all subwidgets. */
- virtual GtkWidget* GetConnectWidget();
- virtual bool IsOwnGtkWindow( GdkWindow *window );
- void ConnectWidget( GtkWidget *widget );
+ virtual GtkWidget* GetConnectWidget();
+ virtual bool IsOwnGtkWindow( GdkWindow *window );
+ void ConnectWidget( GtkWidget *widget );
- GtkStyle *GetWidgetStyle();
- void SetWidgetStyle();
- virtual void ApplyWidgetStyle();
+ GtkStyle *GetWidgetStyle();
+ void SetWidgetStyle();
+ virtual void ApplyWidgetStyle();
#if wxUSE_TOOLTIPS
- virtual void ApplyToolTip( GtkTooltips *tips, const char *tip );
+ virtual void ApplyToolTip( GtkTooltips *tips, const char *tip );
#endif // wxUSE_TOOLTIPS
- /* private member variables */
-
- wxWindow *m_parent;
- wxList m_children;
- int m_x,m_y;
- int m_width,m_height;
- int m_minWidth,m_minHeight;
- int m_maxWidth,m_maxHeight;
- int m_retCode;
- wxEvtHandler *m_eventHandler;
- wxValidator *m_windowValidator;
+ /* private member variables */
+
+ wxWindow *m_parent;
+ wxList m_children;
+ int m_x,m_y;
+ int m_width,m_height;
+ int m_minWidth,m_minHeight;
+ int m_maxWidth,m_maxHeight;
+ int m_retCode;
+ wxEvtHandler *m_eventHandler;
+ wxValidator *m_windowValidator;
#if wxUSE_DRAG_AND_DROP
- wxDropTarget *m_dropTarget;
+ wxDropTarget *m_dropTarget;
#endif
- wxWindowID m_windowId;
- wxCursor *m_cursor;
- wxFont m_font;
- wxColour m_backgroundColour;
- wxColour m_foregroundColour;
- wxRegion m_updateRegion;
- long m_windowStyle;
- bool m_isShown;
- bool m_isEnabled;
- wxString m_windowName;
- wxAcceleratorTable m_acceleratorTable;
- wxClientData *m_clientObject;
- void *m_clientData;
+ wxWindowID m_windowId;
+ wxCursor *m_cursor;
+ wxFont m_font;
+ wxColour m_backgroundColour;
+ wxColour m_foregroundColour;
+ wxRegion m_updateRegion;
+ long m_windowStyle;
+ bool m_isShown;
+ bool m_isEnabled;
+ wxString m_windowName;
+ wxAcceleratorTable m_acceleratorTable;
+ wxClientData *m_clientObject;
+ void *m_clientData;
#if wxUSE_TOOLTIPS
- wxToolTip *m_toolTip;
+ wxToolTip *m_toolTip;
#endif // wxUSE_TOOLTIPS
- GtkWidget *m_widget;
- GtkWidget *m_wxwindow;
- GtkAdjustment *m_hAdjust,*m_vAdjust;
- float m_oldHorizontalPos;
- float m_oldVerticalPos;
- bool m_needParent;
- bool m_hasScrolling;
- bool m_isScrolling;
- bool m_hasVMT;
- bool m_sizeSet;
- bool m_resizing;
- GdkGC *m_scrollGC;
- GtkStyle *m_widgetStyle;
- bool m_isStaticBox;
- bool m_acceptsFocus;
-
- wxInsertChildFunction m_insertCallback;
+ GtkWidget *m_widget;
+ GtkWidget *m_wxwindow;
+ GtkAdjustment *m_hAdjust,*m_vAdjust;
+ float m_oldHorizontalPos;
+ float m_oldVerticalPos;
+ bool m_needParent;
+ bool m_hasScrolling;
+ bool m_isScrolling;
+ bool m_hasVMT;
+ bool m_sizeSet;
+ bool m_resizing;
+ GdkGC *m_scrollGC;
+ GtkStyle *m_widgetStyle;
+ bool m_isStaticBox;
+ bool m_acceptsFocus;
+
+ wxInsertChildFunction m_insertCallback;
public:
- wxLayoutConstraints *m_constraints;
- wxList *m_constraintsInvolvedIn;
- wxSizer *m_windowSizer;
- wxWindow *m_sizerParent;
- bool m_autoLayout;
-
- wxLayoutConstraints *GetConstraints() const;
- void SetConstraints( wxLayoutConstraints *constraints );
- void SetAutoLayout( bool autoLayout );
- bool GetAutoLayout() const;
- bool Layout();
- void SetSizer( wxSizer *sizer );
- wxSizer *GetSizer() const;
- void SetSizerParent( wxWindow *win );
- wxWindow *GetSizerParent() const;
- void UnsetConstraints(wxLayoutConstraints *c);
- inline wxList *GetConstraintsInvolvedIn() const ;
- void AddConstraintReference(wxWindow *otherWin);
- void RemoveConstraintReference(wxWindow *otherWin);
- void DeleteRelatedConstraints();
- virtual void ResetConstraints();
- virtual void SetConstraintSizes(bool recurse = TRUE);
- virtual bool LayoutPhase1(int *noChanges);
- virtual bool LayoutPhase2(int *noChanges);
- virtual bool DoPhase(int);
- virtual void TransformSizerToActual(int *x, int *y) const ;
- virtual void SizerSetSize(int x, int y, int w, int h);
- virtual void SizerMove(int x, int y);
- virtual void SetSizeConstraint(int x, int y, int w, int h);
- virtual void MoveConstraint(int x, int y);
- virtual void GetSizeConstraint(int *w, int *h) const ;
- virtual void GetClientSizeConstraint(int *w, int *h) const ;
- virtual void GetPositionConstraint(int *x, int *y) const ;
+ wxLayoutConstraints *m_constraints;
+ wxList *m_constraintsInvolvedIn;
+ wxSizer *m_windowSizer;
+ wxWindow *m_sizerParent;
+ bool m_autoLayout;
+
+ wxLayoutConstraints *GetConstraints() const;
+ void SetConstraints( wxLayoutConstraints *constraints );
+ void SetAutoLayout( bool autoLayout );
+ bool GetAutoLayout() const;
+ bool Layout();
+ void SetSizer( wxSizer *sizer );
+ wxSizer *GetSizer() const;
+ void SetSizerParent( wxWindow *win );
+ wxWindow *GetSizerParent() const;
+ void UnsetConstraints(wxLayoutConstraints *c);
+ inline wxList *GetConstraintsInvolvedIn() const ;
+ void AddConstraintReference(wxWindow *otherWin);
+ void RemoveConstraintReference(wxWindow *otherWin);
+ void DeleteRelatedConstraints();
+ virtual void ResetConstraints();
+ virtual void SetConstraintSizes(bool recurse = TRUE);
+ virtual bool LayoutPhase1(int *noChanges);
+ virtual bool LayoutPhase2(int *noChanges);
+ virtual bool DoPhase(int);
+ virtual void TransformSizerToActual(int *x, int *y) const ;
+ virtual void SizerSetSize(int x, int y, int w, int h);
+ virtual void SizerMove(int x, int y);
+ virtual void SetSizeConstraint(int x, int y, int w, int h);
+ virtual void MoveConstraint(int x, int y);
+ virtual void GetSizeConstraint(int *w, int *h) const ;
+ virtual void GetClientSizeConstraint(int *w, int *h) const ;
+ virtual void GetPositionConstraint(int *x, int *y) const ;
+
+protected:
+ // this is the virtual function to be overriden in any derived class which
+ // wants to change how SetSize() or Move() works - it is called by all
+ // versions of these functions in the base class
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+
+ // same as DoSetSize() for the client size
+ virtual void DoSetClientSize(int width, int height);
private:
- DECLARE_EVENT_TABLE()
+ DECLARE_EVENT_TABLE()
};
#endif // __GTKWINDOWH__
bool Create(wxWindow *parent, wxSizerBehaviour behav = wxSizerNone);
- virtual void SetSize(int x, int y, int w, int h, int flags = wxSIZE_AUTO);
- virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); }
- virtual void SetSize(const wxSize& size)
- { wxWindow::SetSize(size.x, size.y); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
-
virtual void GetSize(int *w, int *h) const;
- wxSize GetSize() const { return wxWindow::GetSize(); }
virtual void GetClientSize(int *w, int *h) const { GetSize(w, h); }
- wxSize GetClientSize() const { return wxWindow::GetClientSize(); }
virtual void GetPosition(int *x, int *y) const;
- wxPoint GetPosition() const { return wxWindow::GetPosition(); }
void SizerSetSize(int x, int y, int w, int h) { SetSize(x, y, w, h); }
void SizerMove(int x, int y) { Move(x, y); }
virtual bool LayoutPhase1(int *);
virtual bool LayoutPhase2(int *);
+
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#define wxSIZER_ROWS TRUE
bool Create(wxWindow *parent, bool rowOrCol = wxSIZER_ROWS,
int rowsOrColSize = 20, wxSizerBehaviour = wxSizerShrink);
- virtual void SetSize(int x, int y, int w, int h, int flags = wxSIZE_AUTO);
virtual void SetRowOrCol(bool rc) { rowOrCol = rc; }
virtual bool GetRowOrCol() { return rowOrCol; }
class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
{
- DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
+ DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
- public:
- int checkWidth ;
- int checkHeight ;
+public:
+ int checkWidth;
+ int checkHeight;
- inline wxBitmapCheckBox() { checkWidth = -1; checkHeight = -1; }
- inline wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxCheckBoxNameStr)
- {
- Create(parent, id, label, pos, size, style, validator, name);
- }
+ inline wxBitmapCheckBox() { checkWidth = -1; checkHeight = -1; }
+ inline wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxCheckBoxNameStr)
+ {
+ Create(parent, id, label, pos, size, style, validator, name);
+ }
- bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxCheckBoxNameStr);
+ bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxCheckBoxNameStr);
- virtual void SetValue(bool);
- virtual bool GetValue() const ;
+ virtual void SetValue(bool value);
+ virtual bool GetValue() const;
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
+ virtual void SetLabel(const wxBitmap& bitmap);
+ virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); };
- virtual void SetLabel(const wxBitmap& bitmap);
- virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); };
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
// _WX_CHECKBOX_H_
// Choice item
class WXDLLEXPORT wxChoice: public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxChoice)
-
- public:
- wxChoice();
- ~wxChoice();
-
- inline wxChoice(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxChoiceNameStr)
- {
- Create(parent, id, pos, size, n, choices, style, validator, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxChoiceNameStr);
-
- virtual void Append(const wxString& item);
- virtual void Delete(int n);
- virtual void Clear();
- virtual int GetSelection() const ;
- virtual void SetSelection(int n);
- virtual int FindString(const wxString& s) const;
- virtual wxString GetString(int n) const ;
-
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
-
- virtual wxString GetStringSelection() const ;
- virtual bool SetStringSelection(const wxString& sel);
-
- virtual inline int Number() const { return m_noStrings; }
- virtual void Command(wxCommandEvent& event);
-
- virtual void SetColumns(int n = 1 );
- virtual int GetColumns() const ;
-
- void SetFocus();
-
-// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
- virtual void ChangeBackgroundColour();
- virtual void ChangeForegroundColour();
- WXWidget GetTopWidget() const { return m_formWidget; }
- WXWidget GetMainWidget() const { return m_buttonWidget; }
+ DECLARE_DYNAMIC_CLASS(wxChoice)
+
+public:
+ wxChoice();
+ ~wxChoice();
+
+ wxChoice(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxChoiceNameStr)
+ {
+ Create(parent, id, pos, size, n, choices, style, validator, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxChoiceNameStr);
+
+ virtual void Append(const wxString& item);
+ virtual void Delete(int n);
+ virtual void Clear();
+ virtual int GetSelection() const ;
+ virtual void SetSelection(int n);
+ virtual int FindString(const wxString& s) const;
+ virtual wxString GetString(int n) const ;
+
+ virtual wxString GetStringSelection() const ;
+ virtual bool SetStringSelection(const wxString& sel);
+
+ virtual int Number() const { return m_noStrings; }
+ virtual void Command(wxCommandEvent& event);
+
+ virtual void SetColumns(int n = 1 );
+ virtual int GetColumns() const ;
+
+ void SetFocus();
+
+ // Implementation
+ virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeBackgroundColour();
+ virtual void ChangeForegroundColour();
+ WXWidget GetTopWidget() const { return m_formWidget; }
+ WXWidget GetMainWidget() const { return m_buttonWidget; }
protected:
- int m_noStrings;
- WXWidget m_menuWidget;
- WXWidget m_buttonWidget;
- WXWidget* m_widgetList ;
- WXWidget m_formWidget;
- wxStringList m_stringList;
+ int m_noStrings;
+ WXWidget m_menuWidget;
+ WXWidget m_buttonWidget;
+ WXWidget* m_widgetList ;
+ WXWidget m_formWidget;
+ wxStringList m_stringList;
+
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
// Combobox item
class WXDLLEXPORT wxComboBox: public wxChoice
{
- DECLARE_DYNAMIC_CLASS(wxComboBox)
+ DECLARE_DYNAMIC_CLASS(wxComboBox)
- public:
- inline wxComboBox() {}
- ~wxComboBox();
+public:
+ inline wxComboBox() {}
+ ~wxComboBox();
- inline wxComboBox(wxWindow *parent, wxWindowID id,
- const wxString& value = wxEmptyString,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxComboBoxNameStr)
- {
- Create(parent, id, value, pos, size, n, choices, style, validator, name);
- }
+ inline wxComboBox(wxWindow *parent, wxWindowID id,
+ const wxString& value = wxEmptyString,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxComboBoxNameStr)
+ {
+ Create(parent, id, value, pos, size, n, choices, style, validator, name);
+ }
- bool Create(wxWindow *parent, wxWindowID id,
- const wxString& value = wxEmptyString,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxComboBoxNameStr);
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxString& value = wxEmptyString,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxComboBoxNameStr);
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
+ // List functions
+ virtual void Append(const wxString& item);
+ virtual void Delete(int n);
+ virtual void Clear();
+ virtual int GetSelection() const ;
+ virtual void SetSelection(int n);
+ virtual int FindString(const wxString& s) const;
+ virtual wxString GetString(int n) const ;
+ virtual wxString GetStringSelection() const ;
+ virtual bool SetStringSelection(const wxString& sel);
+ virtual inline int Number() const { return m_noStrings; }
- // List functions
- virtual void Append(const wxString& item);
- virtual void Delete(int n);
- virtual void Clear();
- virtual int GetSelection() const ;
- virtual void SetSelection(int n);
- virtual int FindString(const wxString& s) const;
- virtual wxString GetString(int n) const ;
- virtual wxString GetStringSelection() const ;
- virtual bool SetStringSelection(const wxString& sel);
- virtual inline int Number() const { return m_noStrings; }
+ // Text field functions
+ virtual wxString GetValue() const ;
+ virtual void SetValue(const wxString& value);
- // Text field functions
- virtual wxString GetValue() const ;
- virtual void SetValue(const wxString& value);
+ // Clipboard operations
+ virtual void Copy();
+ virtual void Cut();
+ virtual void Paste();
+ virtual void SetInsertionPoint(long pos);
+ virtual void SetInsertionPointEnd();
+ virtual long GetInsertionPoint() const ;
+ virtual long GetLastPosition() const ;
+ virtual void Replace(long from, long to, const wxString& value);
+ virtual void Remove(long from, long to);
+ virtual void SetSelection(long from, long to);
+ virtual void SetEditable(bool editable);
- // Clipboard operations
- virtual void Copy();
- virtual void Cut();
- virtual void Paste();
- virtual void SetInsertionPoint(long pos);
- virtual void SetInsertionPointEnd();
- virtual long GetInsertionPoint() const ;
- virtual long GetLastPosition() const ;
- virtual void Replace(long from, long to, const wxString& value);
- virtual void Remove(long from, long to);
- virtual void SetSelection(long from, long to);
- virtual void SetEditable(bool editable);
+ // Implementation
+ virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeBackgroundColour();
+ virtual void ChangeForegroundColour();
+ WXWidget GetTopWidget() const { return m_mainWidget; }
+ WXWidget GetMainWidget() const { return m_mainWidget; }
-// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
- virtual void ChangeBackgroundColour();
- virtual void ChangeForegroundColour();
- WXWidget GetTopWidget() const { return m_mainWidget; }
- WXWidget GetMainWidget() const { return m_mainWidget; }
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
// Dialog boxes
-class WXDLLEXPORT wxDialog: public wxPanel
+class WXDLLEXPORT wxDialog : public wxPanel
{
- DECLARE_DYNAMIC_CLASS(wxDialog)
+DECLARE_DYNAMIC_CLASS(wxDialog)
+
public:
+ wxDialog();
+
+ // Constructor with a modal flag, but no window id - the old convention
+ wxDialog(wxWindow *parent,
+ const wxString& title, bool modal,
+ int x = -1, int y= -1, int width = 500, int height = 500,
+ long style = wxDEFAULT_DIALOG_STYLE,
+ const wxString& name = wxDialogNameStr)
+ {
+ long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
+ Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
+ }
+
+ // Constructor with no modal flag - the new convention.
+ wxDialog(wxWindow *parent, wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_DIALOG_STYLE,
+ const wxString& name = wxDialogNameStr)
+ {
+ Create(parent, id, title, pos, size, style, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxString& title, // bool modal = FALSE, // TODO make this a window style?
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_DIALOG_STYLE,
+ const wxString& name = wxDialogNameStr);
+
+ ~wxDialog();
+
+ virtual bool Destroy();
+
+ bool Show(bool show);
+ void Iconize(bool iconize);
+ void Raise();
+ void Lower();
+
+ virtual bool IsIconized() const;
+ void Fit();
+
+ void SetTitle(const wxString& title);
+ wxString GetTitle() const ;
+
+ // bool OnClose();
+ void OnCharHook(wxKeyEvent& event);
+ void OnCloseWindow(wxCloseEvent& event);
+
+ void SetModal(bool flag);
+
+ virtual void Centre(int direction = wxBOTH);
+ virtual bool IsModal() const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
+
+ virtual int ShowModal();
+ virtual void EndModal(int retCode);
+
+ // Standard buttons
+ void OnOK(wxCommandEvent& event);
+ void OnApply(wxCommandEvent& event);
+ void OnCancel(wxCommandEvent& event);
+
+ // Responds to colour changes
+ void OnSysColourChanged(wxSysColourChangedEvent& event);
+
+ // Implementation
+ virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeBackgroundColour();
+ virtual void ChangeForegroundColour();
+ inline WXWidget GetTopWidget() const { return m_mainWidget; }
+ inline WXWidget GetClientWidget() const { return m_mainWidget; }
- wxDialog();
-
- // Constructor with a modal flag, but no window id - the old convention
- inline wxDialog(wxWindow *parent,
- const wxString& title, bool modal,
- int x = -1, int y= -1, int width = 500, int height = 500,
- long style = wxDEFAULT_DIALOG_STYLE,
- const wxString& name = wxDialogNameStr)
- {
- long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
- Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
- }
-
- // Constructor with no modal flag - the new convention.
- inline wxDialog(wxWindow *parent, wxWindowID id,
- const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_DIALOG_STYLE,
- const wxString& name = wxDialogNameStr)
- {
- Create(parent, id, title, pos, size, style, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id,
- const wxString& title, // bool modal = FALSE, // TODO make this a window style?
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_DIALOG_STYLE,
- const wxString& name = wxDialogNameStr);
-
- ~wxDialog();
-
- virtual bool Destroy();
- void SetClientSize(int width, int height);
- void SetClientSize(const wxSize& size) { wxWindow::SetClientSize(size); }
-
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
-
- bool Show(bool show);
- void Iconize(bool iconize);
- void Raise();
- void Lower();
-
- virtual bool IsIconized() const;
- void Fit();
-
- void SetTitle(const wxString& title);
- wxString GetTitle() const ;
-
-// bool OnClose();
- void OnCharHook(wxKeyEvent& event);
- void OnCloseWindow(wxCloseEvent& event);
-
- void SetModal(bool flag);
-
- virtual void Centre(int direction = wxBOTH);
- virtual bool IsModal() const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
-
- virtual int ShowModal();
- virtual void EndModal(int retCode);
-
- // Standard buttons
- void OnOK(wxCommandEvent& event);
- void OnApply(wxCommandEvent& event);
- void OnCancel(wxCommandEvent& event);
-
- // Responds to colour changes
- void OnSysColourChanged(wxSysColourChangedEvent& event);
-
-// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
- virtual void ChangeBackgroundColour();
- virtual void ChangeForegroundColour();
- inline WXWidget GetTopWidget() const { return m_mainWidget; }
- inline WXWidget GetClientWidget() const { return m_mainWidget; }
+public:
+ //// Motif-specific
+ bool m_modalShowing;
+ wxString m_dialogTitle;
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
-public:
- //// Motif-specific
- bool m_modalShowing;
- wxString m_dialogTitle;
+ virtual void DoSetClientSize(int width, int height);
-DECLARE_EVENT_TABLE()
+private:
+ DECLARE_EVENT_TABLE()
};
#endif
class WXDLLEXPORT wxMenuBar;
class WXDLLEXPORT wxStatusBar;
-class WXDLLEXPORT wxFrame: public wxWindow {
-
- DECLARE_DYNAMIC_CLASS(wxFrame)
+class WXDLLEXPORT wxFrame : public wxWindow
+{
+DECLARE_DYNAMIC_CLASS(wxFrame)
public:
- wxFrame();
- inline wxFrame(wxWindow *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE,
- const wxString& name = wxFrameNameStr)
- {
- Create(parent, id, title, pos, size, style, name);
- }
-
- ~wxFrame();
-
- bool Create(wxWindow *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE,
- const wxString& name = wxFrameNameStr);
-
- virtual bool Destroy();
-
- void SetClientSize(int width, int height);
- void SetClientSize(const wxSize& size) { wxWindow::SetClientSize(size); }
-
- void GetClientSize(int *width, int *height) const;
- wxSize GetClientSize() const { return wxWindow::GetClientSize(); }
-
- void GetSize(int *width, int *height) const ;
- wxSize GetSize() const { return wxWindow::GetSize(); }
-
- void GetPosition(int *x, int *y) const ;
- wxPoint GetPosition() const { return wxWindow::GetPosition(); }
-
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
-
- void ClientToScreen(int *x, int *y) const;
- wxPoint ClientToScreen(const wxPoint& pt) const { return wxWindow::ClientToScreen(pt); }
-
- void ScreenToClient(int *x, int *y) const;
- wxPoint ScreenToClient(const wxPoint& pt) const { return wxWindow::ScreenToClient(pt); }
-
- void OnSize(wxSizeEvent& event);
- void OnMenuHighlight(wxMenuEvent& event);
- void OnActivate(wxActivateEvent& event);
- void OnIdle(wxIdleEvent& event);
- void OnCloseWindow(wxCloseEvent& event);
-
- bool Show(bool show);
-
- // Set menu bar
- void SetMenuBar(wxMenuBar *menu_bar);
- virtual wxMenuBar *GetMenuBar() const ;
-
- // Set title
- void SetTitle(const wxString& title);
- inline wxString GetTitle() const { return m_title; }
-
- void Centre(int direction = wxBOTH);
-
- // Call this to simulate a menu command
- virtual void Command(int id);
- virtual void ProcessCommand(int id);
-
- // Set icon
- virtual void SetIcon(const wxIcon& icon);
-
- // Create status line
- virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
- const wxString& name = "statusBar");
- inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
- virtual void PositionStatusBar();
- virtual wxStatusBar *OnCreateStatusBar(int number, long style, wxWindowID id,
- const wxString& name);
-
- // Create toolbar
+ wxFrame();
+ wxFrame(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE,
+ const wxString& name = wxFrameNameStr)
+ {
+ Create(parent, id, title, pos, size, style, name);
+ }
+
+ ~wxFrame();
+
+ bool Create(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE,
+ const wxString& name = wxFrameNameStr);
+
+ virtual bool Destroy();
+
+ void SetClientSize(int width, int height);
+ void GetClientSize(int *width, int *height) const;
+ void GetSize(int *width, int *height) const ;
+ void GetPosition(int *x, int *y) const ;
+
+ void ClientToScreen(int *x, int *y) const;
+ wxPoint ClientToScreen(const wxPoint& pt) const { return wxWindow::ClientToScreen(pt); }
+
+ void ScreenToClient(int *x, int *y) const;
+ wxPoint ScreenToClient(const wxPoint& pt) const { return wxWindow::ScreenToClient(pt); }
+
+ void OnSize(wxSizeEvent& event);
+ void OnMenuHighlight(wxMenuEvent& event);
+ void OnActivate(wxActivateEvent& event);
+ void OnIdle(wxIdleEvent& event);
+ void OnCloseWindow(wxCloseEvent& event);
+
+ bool Show(bool show);
+
+ // Set menu bar
+ void SetMenuBar(wxMenuBar *menu_bar);
+ virtual wxMenuBar *GetMenuBar() const ;
+
+ // Set title
+ void SetTitle(const wxString& title);
+ wxString GetTitle() const { return m_title; }
+
+ void Centre(int direction = wxBOTH);
+
+ // Call this to simulate a menu command
+ virtual void Command(int id);
+ virtual void ProcessCommand(int id);
+
+ // Set icon
+ virtual void SetIcon(const wxIcon& icon);
+
+ // Create status line
+ virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
+ const wxString& name = "statusBar");
+ wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
+ virtual void PositionStatusBar();
+ virtual wxStatusBar *OnCreateStatusBar(int number, long style, wxWindowID id,
+ const wxString& name);
+
+ // Create toolbar
#if wxUSE_TOOLBAR
- virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name = wxToolBarNameStr);
- virtual wxToolBar *OnCreateToolBar(long style, wxWindowID id, const wxString& name);
- // If made known to the frame, the frame will manage it automatically.
- virtual void SetToolBar(wxToolBar *toolbar) ;
- virtual wxToolBar *GetToolBar() const ;
- virtual void PositionToolBar();
+ virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name = wxToolBarNameStr);
+ virtual wxToolBar *OnCreateToolBar(long style, wxWindowID id, const wxString& name);
+ // If made known to the frame, the frame will manage it automatically.
+ virtual void SetToolBar(wxToolBar *toolbar) ;
+ virtual wxToolBar *GetToolBar() const ;
+ virtual void PositionToolBar();
#endif // wxUSE_TOOLBAR
- // Set status line text
- virtual void SetStatusText(const wxString& text, int number = 0);
+ // Set status line text
+ virtual void SetStatusText(const wxString& text, int number = 0);
- // Set status line widths
- virtual void SetStatusWidths(int n, const int widths_field[]);
+ // Set status line widths
+ virtual void SetStatusWidths(int n, const int widths_field[]);
- // Hint to tell framework which status bar to use
- // TODO: should this go into a wxFrameworkSettings class perhaps?
- static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; };
- static bool UsesNativeStatusBar() { return m_useNativeStatusBar; };
+ // Hint to tell framework which status bar to use
+ // TODO: should this go into a wxFrameworkSettings class perhaps?
+ static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; };
+ static bool UsesNativeStatusBar() { return m_useNativeStatusBar; };
- // Fit frame around subwindows
- virtual void Fit();
+ // Fit frame around subwindows
+ virtual void Fit();
- // Iconize
- virtual void Iconize(bool iconize);
+ // Iconize
+ virtual void Iconize(bool iconize);
- virtual bool IsIconized() const ;
+ virtual bool IsIconized() const ;
- // Compatibility
- inline bool Iconized() const { return IsIconized(); }
+ // Compatibility
+ bool Iconized() const { return IsIconized(); }
- // Is the frame maximized? Returns FALSE under Motif (but TRUE for
- // wxMDIChildFrame due to the tabbed implementation).
- virtual bool IsMaximized(void) const ;
+ // Is the frame maximized? Returns FALSE under Motif (but TRUE for
+ // wxMDIChildFrame due to the tabbed implementation).
+ virtual bool IsMaximized(void) const ;
- virtual void Maximize(bool maximize);
+ virtual void Maximize(bool maximize);
- // Responds to colour changes
- void OnSysColourChanged(wxSysColourChangedEvent& event);
+ // Responds to colour changes
+ void OnSysColourChanged(wxSysColourChangedEvent& event);
- // Query app for menu item updates (called from OnIdle)
- void DoMenuUpdates();
- void DoMenuUpdates(wxMenu* menu);
+ // Query app for menu item updates (called from OnIdle)
+ void DoMenuUpdates();
+ void DoMenuUpdates(wxMenu* menu);
- // Checks if there is a toolbar, and returns the first free client position
- virtual wxPoint GetClientAreaOrigin() const;
+ // Checks if there is a toolbar, and returns the first free client position
+ virtual wxPoint GetClientAreaOrigin() const;
- virtual void Raise();
- virtual void Lower();
+ virtual void Raise();
+ virtual void Lower();
- virtual void CaptureMouse();
- virtual void ReleaseMouse();
+ virtual void CaptureMouse();
+ virtual void ReleaseMouse();
-// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
- virtual void ChangeBackgroundColour();
- virtual void ChangeForegroundColour();
- WXWidget GetMenuBarWidget() const ;
- inline WXWidget GetShellWidget() const { return m_frameShell; }
- inline WXWidget GetWorkAreaWidget() const { return m_workArea; }
- inline WXWidget GetClientAreaWidget() const { return m_clientArea; }
- inline WXWidget GetTopWidget() const { return m_frameShell; }
- inline WXWidget GetMainWindowWidget() const { return m_frameWidget; }
+ // Implementation
+ virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeBackgroundColour();
+ virtual void ChangeForegroundColour();
+ WXWidget GetMenuBarWidget() const ;
+ WXWidget GetShellWidget() const { return m_frameShell; }
+ WXWidget GetWorkAreaWidget() const { return m_workArea; }
+ WXWidget GetClientAreaWidget() const { return m_clientArea; }
+ WXWidget GetTopWidget() const { return m_frameShell; }
+ WXWidget GetMainWindowWidget() const { return m_frameWidget; }
- // The widget that can have children on it
- WXWidget GetClientWidget() const;
- bool GetVisibleStatus() const { return m_visibleStatus; }
+ // The widget that can have children on it
+ WXWidget GetClientWidget() const;
+ bool GetVisibleStatus() const { return m_visibleStatus; }
- bool PreResize();
+ bool PreResize();
protected:
- wxMenuBar * m_frameMenuBar;
- wxStatusBar * m_frameStatusBar;
- wxIcon m_icon;
- bool m_iconized;
- static bool m_useNativeStatusBar;
+ wxMenuBar * m_frameMenuBar;
+ wxStatusBar * m_frameStatusBar;
+ wxIcon m_icon;
+ bool m_iconized;
+ static bool m_useNativeStatusBar;
#if wxUSE_TOOLBAR
- wxToolBar * m_frameToolBar ;
+ wxToolBar * m_frameToolBar ;
#endif // wxUSE_TOOLBAR
- //// Motif-specific
+ //// Motif-specific
+
+ WXWidget m_frameShell;
+ WXWidget m_frameWidget;
+ WXWidget m_workArea;
+ WXWidget m_clientArea;
+ // WXWidget m_menuBarWidget;
+ bool m_visibleStatus;
+ wxString m_title;
+
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
- WXWidget m_frameShell;
- WXWidget m_frameWidget;
- WXWidget m_workArea;
- WXWidget m_clientArea;
-// WXWidget m_menuBarWidget;
- bool m_visibleStatus;
- wxString m_title;
+ virtual void DoSetClientSize(int width, int height);
- DECLARE_EVENT_TABLE()
+private:
+ DECLARE_EVENT_TABLE()
};
#endif
WXDLLEXPORT_DATA(extern const char*) wxGaugeNameStr;
// Group box
-class WXDLLEXPORT wxGauge: public wxControl
+class WXDLLEXPORT wxGauge : public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxGauge)
- public:
- inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; }
+ DECLARE_DYNAMIC_CLASS(wxGauge)
- inline wxGauge(wxWindow *parent, wxWindowID id,
- int range,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxGA_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxGaugeNameStr)
- {
- Create(parent, id, range, pos, size, style, validator, name);
- }
+public:
+ inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; }
- bool Create(wxWindow *parent, wxWindowID id,
- int range,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxGA_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxGaugeNameStr);
+ inline wxGauge(wxWindow *parent, wxWindowID id,
+ int range,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxGA_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxGaugeNameStr)
+ {
+ Create(parent, id, range, pos, size, style, validator, name);
+ }
- void SetShadowWidth(int w);
- void SetBezelFace(int w);
- void SetRange(int r);
- void SetValue(int pos);
+ bool Create(wxWindow *parent, wxWindowID id,
+ int range,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxGA_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxGaugeNameStr);
- int GetShadowWidth() const ;
- int GetBezelFace() const ;
- int GetRange() const ;
- int GetValue() const ;
+ void SetShadowWidth(int w);
+ void SetBezelFace(int w);
+ void SetRange(int r);
+ void SetValue(int pos);
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
+ int GetShadowWidth() const ;
+ int GetBezelFace() const ;
+ int GetRange() const ;
+ int GetValue() const ;
- virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
+ virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
-// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
- virtual void ChangeBackgroundColour();
- virtual void ChangeForegroundColour();
+ // Implementation
+ virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeBackgroundColour();
+ virtual void ChangeForegroundColour();
- protected:
- int m_rangeMax;
- int m_gaugePos;
+protected:
+ int m_rangeMax;
+ int m_gaugePos;
};
#endif
// List box item
class WXDLLEXPORT wxListBox: public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxListBox)
- public:
-
- wxListBox();
- inline wxListBox(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxListBoxNameStr):
- m_clientDataList(wxKEY_INTEGER)
- {
- Create(parent, id, pos, size, n, choices, style, validator, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxListBoxNameStr);
-
- ~wxListBox();
-
- virtual void Append(const wxString& item);
- virtual void Append(const wxString& item, char *clientData);
- virtual void Set(int n, const wxString* choices, char **clientData = NULL);
- virtual int FindString(const wxString& s) const ;
- virtual void Clear();
- virtual void SetSelection(int n, bool select = TRUE);
-
- virtual void Deselect(int n);
-
- // For single choice list item only
- virtual int GetSelection() const ;
- virtual void Delete(int n);
- virtual char *GetClientData(int n) const ;
- virtual void *GetClientData() { return wxWindow::GetClientData(); }
- virtual void SetClientData(int n, char *clientData);
- virtual void SetClientData( void *data ) { wxWindow::SetClientData(data); }
- virtual void SetString(int n, const wxString& s);
-
- // For single or multiple choice list item
- virtual int GetSelections(wxArrayInt& aSelections) const;
- virtual bool Selected(int n) const ;
- virtual wxString GetString(int n) const ;
-
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
-
- // Set the specified item at the first visible item
- // or scroll to max range.
- virtual void SetFirstItem(int n) ;
- virtual void SetFirstItem(const wxString& s) ;
-
- virtual void InsertItems(int nItems, const wxString items[], int pos);
-
- virtual wxString GetStringSelection() const ;
- virtual bool SetStringSelection(const wxString& s, bool flag = TRUE);
- virtual int Number() const ;
-
- void Command(wxCommandEvent& event);
-
-// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
- virtual void ChangeBackgroundColour();
- virtual void ChangeForegroundColour();
- WXWidget GetTopWidget() const;
+DECLARE_DYNAMIC_CLASS(wxListBox)
+
+public:
+ wxListBox();
+ wxListBox(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxListBoxNameStr):
+ m_clientDataList(wxKEY_INTEGER)
+ {
+ Create(parent, id, pos, size, n, choices, style, validator, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxListBoxNameStr);
+
+ ~wxListBox();
+
+ virtual void Append(const wxString& item);
+ virtual void Append(const wxString& item, char *clientData);
+ virtual void Set(int n, const wxString* choices, char **clientData = NULL);
+ virtual int FindString(const wxString& s) const ;
+ virtual void Clear();
+ virtual void SetSelection(int n, bool select = TRUE);
+
+ virtual void Deselect(int n);
+
+ // For single choice list item only
+ virtual int GetSelection() const ;
+ virtual void Delete(int n);
+ virtual char *GetClientData(int n) const ;
+ virtual void *GetClientData() { return wxWindow::GetClientData(); }
+ virtual void SetClientData(int n, char *clientData);
+ virtual void SetClientData( void *data ) { wxWindow::SetClientData(data); }
+ virtual void SetString(int n, const wxString& s);
+
+ // For single or multiple choice list item
+ virtual int GetSelections(wxArrayInt& aSelections) const;
+ virtual bool Selected(int n) const ;
+ virtual wxString GetString(int n) const ;
+
+ // Set the specified item at the first visible item
+ // or scroll to max range.
+ virtual void SetFirstItem(int n) ;
+ virtual void SetFirstItem(const wxString& s) ;
+
+ virtual void InsertItems(int nItems, const wxString items[], int pos);
+
+ virtual wxString GetStringSelection() const ;
+ virtual bool SetStringSelection(const wxString& s, bool flag = TRUE);
+ virtual int Number() const ;
+
+ void Command(wxCommandEvent& event);
+
+ // Implementation
+ virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeBackgroundColour();
+ virtual void ChangeForegroundColour();
+ WXWidget GetTopWidget() const;
protected:
- int m_noItems;
- int m_selected;
+ int m_noItems;
+ int m_selected;
- // List mapping positions->client data
- wxList m_clientDataList;
+ // List mapping positions->client data
+ wxList m_clientDataList;
+
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
class WXDLLEXPORT wxMDIChildFrame: public wxFrame
{
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
-public:
-
- wxMDIChildFrame();
- inline wxMDIChildFrame(wxMDIParentFrame *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE,
- const wxString& name = wxFrameNameStr)
- {
- Create(parent, id, title, pos, size, style, name);
- }
-
- ~wxMDIChildFrame();
-
- bool Create(wxMDIParentFrame *parent,
- wxWindowID id,
- const wxString& title,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE,
- const wxString& name = wxFrameNameStr);
-
- // Set menu bar
- void SetMenuBar(wxMenuBar *menu_bar);
- void SetTitle(const wxString& title);
-
- void SetClientSize(int width, int height);
- void SetClientSize(const wxSize& size) { wxWindow::SetClientSize(size); }
-
- void GetClientSize(int *width, int *height) const;
- wxSize GetClientSize() const { return wxWindow::GetClientSize(); }
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
-
- void GetSize(int *width, int *height) const;
- wxSize GetSize() const { return wxWindow::GetSize(); }
-
- void GetPosition(int *x, int *y) const ;
- wxPoint GetPosition() const { return wxWindow::GetPosition(); }
-
- // Set icon
- virtual void SetIcon(const wxIcon& icon);
-
- // Override wxFrame operations
- void CaptureMouse();
- void ReleaseMouse();
- void Raise();
- void Lower(void);
- void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1);
-
- // MDI operations
- virtual void Maximize();
- virtual void Maximize(bool WXUNUSED(maximize)) { };
- inline void Minimize() { Iconize(TRUE); };
- virtual void Iconize(bool iconize);
- virtual void Restore();
- virtual void Activate();
- virtual bool IsIconized() const ;
-
- // Is the frame maximized? Returns TRUE for
- // wxMDIChildFrame due to the tabbed implementation.
- virtual bool IsMaximized(void) const ;
-
- bool Show(bool show);
-
- inline WXWidget GetMainWidget() const { return m_mainWidget; };
- inline WXWidget GetTopWidget() const { return m_mainWidget; };
- inline WXWidget GetClientWidget() const { return m_mainWidget; };
-
-/*
- virtual void OnRaise();
- virtual void OnLower();
-*/
-
- inline void SetMDIParentFrame(wxMDIParentFrame* parentFrame) { m_mdiParentFrame = parentFrame; }
- inline wxMDIParentFrame* GetMDIParentFrame() const { return m_mdiParentFrame; }
+public:
+ wxMDIChildFrame();
+ wxMDIChildFrame(wxMDIParentFrame *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE,
+ const wxString& name = wxFrameNameStr)
+ {
+ Create(parent, id, title, pos, size, style, name);
+ }
+
+ ~wxMDIChildFrame();
+
+ bool Create(wxMDIParentFrame *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE,
+ const wxString& name = wxFrameNameStr);
+
+ // Set menu bar
+ void SetMenuBar(wxMenuBar *menu_bar);
+ void SetTitle(const wxString& title);
+
+ void SetClientSize(int width, int height);
+ void GetClientSize(int *width, int *height);
+ void GetSize(int *width, int *height) const;
+ void GetPosition(int *x, int *y) const ;
+
+ // Set icon
+ virtual void SetIcon(const wxIcon& icon);
+
+ // Override wxFrame operations
+ void CaptureMouse();
+ void ReleaseMouse();
+ void Raise();
+ void Lower(void);
+ void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1);
+
+ // MDI operations
+ virtual void Maximize();
+ virtual void Maximize(bool WXUNUSED(maximize)) { };
+ inline void Minimize() { Iconize(TRUE); };
+ virtual void Iconize(bool iconize);
+ virtual void Restore();
+ virtual void Activate();
+ virtual bool IsIconized() const ;
+
+ // Is the frame maximized? Returns TRUE for
+ // wxMDIChildFrame due to the tabbed implementation.
+ virtual bool IsMaximized(void) const ;
+
+ bool Show(bool show);
+
+ WXWidget GetMainWidget() const { return m_mainWidget; };
+ WXWidget GetTopWidget() const { return m_mainWidget; };
+ WXWidget GetClientWidget() const { return m_mainWidget; };
+
+ /*
+ virtual void OnRaise();
+ virtual void OnLower();
+ */
+
+ void SetMDIParentFrame(wxMDIParentFrame* parentFrame) { m_mdiParentFrame = parentFrame; }
+ wxMDIParentFrame* GetMDIParentFrame() const { return m_mdiParentFrame; }
protected:
- wxMDIParentFrame* m_mdiParentFrame;
+ wxMDIParentFrame* m_mdiParentFrame;
+
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+ virtual void DoSetClientSize(int width, int height);
};
/* The client window is a child of the parent MDI frame, and itself
class WXDLLEXPORT wxMDIClientWindow: public wxNotebook
{
- DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
- public:
-
- wxMDIClientWindow() ;
- inline wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0)
- {
- CreateClient(parent, style);
- }
+DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
- ~wxMDIClientWindow();
-
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
-
- void SetClientSize(int width, int height);
- void SetClientSize(const wxSize& size) { wxWindow::SetClientSize(size); }
-
- void GetClientSize(int *width, int *height) const;
- wxSize GetClientSize() const { return wxWindow::GetClientSize(); }
+public:
+ wxMDIClientWindow() ;
+ wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0)
+ {
+ CreateClient(parent, style);
+ }
- void GetSize(int *width, int *height) const ;
- wxSize GetSize() const { return wxWindow::GetSize(); }
+ ~wxMDIClientWindow();
- void GetPosition(int *x, int *y) const ;
- wxPoint GetPosition() const { return wxWindow::GetPosition(); }
+ void GetClientSize(int *width, int *height) const;
+ void GetSize(int *width, int *height) const ;
+ void GetPosition(int *x, int *y) const ;
- // Note: this is virtual, to allow overridden behaviour.
- virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL);
+ // Note: this is virtual, to allow overridden behaviour.
+ virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL);
- // Explicitly call default scroll behaviour
- void OnScroll(wxScrollEvent& event);
+ // Explicitly call default scroll behaviour
+ void OnScroll(wxScrollEvent& event);
- // Implementation
- void OnPageChanged(wxNotebookEvent& event);
+ // Implementation
+ void OnPageChanged(wxNotebookEvent& event);
protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+ virtual void DoSetClientSize(int width, int height);
-DECLARE_EVENT_TABLE()
+private:
+ DECLARE_EVENT_TABLE()
};
#endif
// List box item
class WXDLLEXPORT wxBitmap ;
-class WXDLLEXPORT wxRadioBox: public wxControl
+class WXDLLEXPORT wxRadioBox : public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxRadioBox)
+DECLARE_DYNAMIC_CLASS(wxRadioBox)
+
public:
- wxRadioBox();
-
- inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- int majorDim = 0, long style = wxRA_HORIZONTAL,
- const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
- {
- Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
- }
-
- ~wxRadioBox();
-
- bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- int majorDim = 0, long style = wxRA_HORIZONTAL,
- const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
-
- int FindString(const wxString& s) const;
- void SetSelection(int N);
- int GetSelection() const;
- wxString GetString(int N) const;
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
-
- void SetLabel(const wxString& label) { wxControl::SetLabel(label); };
- void SetLabel(int item, const wxString& label) ;
- wxString GetLabel(int item) const;
- wxString GetLabel() const { return wxControl::GetLabel(); };
- void Enable(bool enable);
- void Enable(int item, bool enable);
- void Show(int item, bool show) ;
- bool Show(bool show) ;
-
- virtual wxString GetStringSelection() const;
- virtual bool SetStringSelection(const wxString& s);
- inline virtual int Number() const { return m_noItems; } ;
- void Command(wxCommandEvent& event);
-
- inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
- inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
-
-// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
- virtual void ChangeBackgroundColour();
- virtual void ChangeForegroundColour();
- WXWidget GetTopWidget() const { return m_formWidget; }
- WXWidget GetLabelWidget() const { return m_labelWidget; }
- WXWidget GetFrameWidget() const { return m_frameWidget; }
- inline WXWidget* GetRadioButtons() const { return m_radioButtons; }
- inline void SetSel(int i) { m_selectedButton = i; }
+ wxRadioBox();
+
+ wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL,
+ const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
+ {
+ Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
+ }
+
+ ~wxRadioBox();
+
+ bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL,
+ const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
+
+ int FindString(const wxString& s) const;
+ void SetSelection(int N);
+ int GetSelection() const;
+ wxString GetString(int N) const;
+
+ void SetLabel(const wxString& label) { wxControl::SetLabel(label); };
+ void SetLabel(int item, const wxString& label) ;
+ wxString GetLabel(int item) const;
+ wxString GetLabel() const { return wxControl::GetLabel(); };
+ void Enable(bool enable);
+ void Enable(int item, bool enable);
+ void Show(int item, bool show) ;
+ bool Show(bool show) ;
+
+ virtual wxString GetStringSelection() const;
+ virtual bool SetStringSelection(const wxString& s);
+ virtual int Number() const { return m_noItems; } ;
+ void Command(wxCommandEvent& event);
+
+ int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
+ void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
+
+ // Implementation
+ virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeBackgroundColour();
+ virtual void ChangeForegroundColour();
+ WXWidget GetTopWidget() const { return m_formWidget; }
+ WXWidget GetLabelWidget() const { return m_labelWidget; }
+ WXWidget GetFrameWidget() const { return m_frameWidget; }
+ inline WXWidget* GetRadioButtons() const { return m_radioButtons; }
+ inline void SetSel(int i) { m_selectedButton = i; }
protected:
- int m_majorDim ;
- int m_noItems;
- int m_noRowsOrCols;
- int m_selectedButton;
-
- WXWidget m_formWidget;
- WXWidget m_labelWidget;
- WXWidget m_frameWidget;
- WXWidget* m_radioButtons;
- wxString* m_radioButtonLabels;
+ int m_majorDim ;
+ int m_noItems;
+ int m_noRowsOrCols;
+ int m_selectedButton;
+
+ WXWidget m_formWidget;
+ WXWidget m_labelWidget;
+ WXWidget m_frameWidget;
+ WXWidget* m_radioButtons;
+ wxString* m_radioButtonLabels;
+
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
// Slider
class WXDLLEXPORT wxSlider: public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxSlider)
+DECLARE_DYNAMIC_CLASS(wxSlider)
public:
- wxSlider();
-
- inline wxSlider(wxWindow *parent, wxWindowID id,
- int value, int minValue, int maxValue,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxSL_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxSliderNameStr)
- {
- Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
- }
-
- ~wxSlider();
-
- bool Create(wxWindow *parent, wxWindowID id,
- int value, int minValue, int maxValue,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxSL_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxSliderNameStr);
-
- virtual int GetValue() const ;
- virtual void SetValue(int);
- void GetSize(int *x, int *y) const ;
- wxSize GetSize() const { return wxWindow::GetSize(); }
-
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
-
- void SetRange(int minValue, int maxValue);
-
- inline int GetMin() const { return m_rangeMin; }
- inline int GetMax() const { return m_rangeMax; }
-
- // For trackbars only
- void SetTickFreq(int n, int pos);
- inline int GetTickFreq() const { return m_tickFreq; }
- void SetPageSize(int pageSize);
- int GetPageSize() const ;
- void ClearSel() ;
- void ClearTicks() ;
- void SetLineSize(int lineSize);
- int GetLineSize() const ;
- int GetSelEnd() const ;
- int GetSelStart() const ;
- void SetSelection(int minPos, int maxPos);
- void SetThumbLength(int len) ;
- int GetThumbLength() const ;
- void SetTick(int tickPos) ;
-
- void Command(wxCommandEvent& event);
-
-// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
- virtual void ChangeBackgroundColour();
- virtual void ChangeForegroundColour();
-
- protected:
- int m_rangeMin;
- int m_rangeMax;
- int m_pageSize;
- int m_lineSize;
- int m_tickFreq;
-DECLARE_EVENT_TABLE()
+ wxSlider();
+
+ wxSlider(wxWindow *parent, wxWindowID id,
+ int value, int minValue, int maxValue,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxSL_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxSliderNameStr)
+ {
+ Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
+ }
+
+ ~wxSlider();
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ int value, int minValue, int maxValue,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxSL_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxSliderNameStr);
+
+ virtual int GetValue() const ;
+ virtual void SetValue(int);
+
+ void GetSize(int *x, int *y) const ;
+
+ void SetRange(int minValue, int maxValue);
+
+ inline int GetMin() const { return m_rangeMin; }
+ inline int GetMax() const { return m_rangeMax; }
+
+ // For trackbars only
+ void SetTickFreq(int n, int pos);
+ inline int GetTickFreq() const { return m_tickFreq; }
+ void SetPageSize(int pageSize);
+ int GetPageSize() const ;
+ void ClearSel() ;
+ void ClearTicks() ;
+ void SetLineSize(int lineSize);
+ int GetLineSize() const ;
+ int GetSelEnd() const ;
+ int GetSelStart() const ;
+ void SetSelection(int minPos, int maxPos);
+ void SetThumbLength(int len) ;
+ int GetThumbLength() const ;
+ void SetTick(int tickPos) ;
+
+ void Command(wxCommandEvent& event);
+
+ // Implementation
+ virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeBackgroundColour();
+ virtual void ChangeForegroundColour();
+
+protected:
+ int m_rangeMin;
+ int m_rangeMax;
+ int m_pageSize;
+ int m_lineSize;
+ int m_tickFreq;
+
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+
+private:
+ DECLARE_EVENT_TABLE()
};
#endif
WXDLLEXPORT_DATA(extern const char*) wxStaticBitmapNameStr;
-class WXDLLEXPORT wxStaticBitmap: public wxControl
+class WXDLLEXPORT wxStaticBitmap : public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
- public:
- inline wxStaticBitmap() { }
- ~wxStaticBitmap();
-
- inline wxStaticBitmap(wxWindow *parent, wxWindowID id,
- const wxBitmap& label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxStaticBitmapNameStr)
- {
- Create(parent, id, label, pos, size, style, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id,
- const wxBitmap& label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxStaticBitmapNameStr);
-
- virtual void SetBitmap(const wxBitmap& bitmap);
-
- virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
- virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
-
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
-
- inline wxBitmap& GetBitmap() const { return (wxBitmap&) m_messageBitmap; }
-
- // overriden base class virtuals
- virtual bool AcceptsFocus() const { return FALSE; }
-
-// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
- virtual void ChangeBackgroundColour();
- virtual void ChangeForegroundColour();
-
- protected:
- wxBitmap m_messageBitmap;
-
+DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
+
+public:
+ wxStaticBitmap() { }
+ ~wxStaticBitmap();
+
+ wxStaticBitmap(wxWindow *parent, wxWindowID id,
+ const wxBitmap& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxStaticBitmapNameStr)
+ {
+ Create(parent, id, label, pos, size, style, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxBitmap& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxStaticBitmapNameStr);
+
+ virtual void SetBitmap(const wxBitmap& bitmap);
+
+ virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
+ virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
+
+ wxBitmap& GetBitmap() const { return (wxBitmap&) m_messageBitmap; }
+
+ // overriden base class virtuals
+ virtual bool AcceptsFocus() const { return FALSE; }
+
+ // Implementation
+ virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeBackgroundColour();
+ virtual void ChangeForegroundColour();
+
+protected:
+ wxBitmap m_messageBitmap;
};
#endif
// Group box
class WXDLLEXPORT wxStaticBox: public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxStaticBox)
+DECLARE_DYNAMIC_CLASS(wxStaticBox)
- public:
- wxStaticBox();
- inline wxStaticBox(wxWindow *parent, wxWindowID id,
- const wxString& label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxStaticBoxNameStr)
- {
- Create(parent, id, label, pos, size, style, name);
- }
- ~wxStaticBox();
+public:
+ wxStaticBox();
+ wxStaticBox(wxWindow *parent, wxWindowID id,
+ const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxStaticBoxNameStr)
+ {
+ Create(parent, id, label, pos, size, style, name);
+ }
+ ~wxStaticBox();
- bool Create(wxWindow *parent, wxWindowID id,
- const wxString& label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxStaticBoxNameStr);
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxStaticBoxNameStr);
- virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
- virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
+ virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
+ virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
+ void SetLabel(const wxString& label);
+ wxString GetLabel() const;
- void SetLabel(const wxString& label);
- wxString GetLabel() const;
+ // Implementation
+ virtual void ChangeFont(bool keepOriginalSize = TRUE);
+ virtual void ChangeBackgroundColour();
+ virtual void ChangeForegroundColour();
+ WXWidget GetTopWidget() const { return m_formWidget; }
+ WXWidget GetLabelWidget() const { return m_labelWidget; }
-// Implementation
- virtual void ChangeFont(bool keepOriginalSize = TRUE);
- virtual void ChangeBackgroundColour();
- virtual void ChangeForegroundColour();
- WXWidget GetTopWidget() const { return m_formWidget; }
- WXWidget GetLabelWidget() const { return m_labelWidget; }
+protected:
+ // Motif-specific
+ WXWidget m_formWidget;
+ WXWidget m_labelWidget;
-DECLARE_EVENT_TABLE()
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
-protected:
- // Motif-specific
- WXWidget m_formWidget;
- WXWidget m_labelWidget;
+private:
+ DECLARE_EVENT_TABLE()
};
#endif
wxString m_data;
};
-class WXDLLEXPORT wxWindow: public wxEvtHandler
+class WXDLLEXPORT wxWindow : public wxEvtHandler
{
- DECLARE_ABSTRACT_CLASS(wxWindow)
+ DECLARE_ABSTRACT_CLASS(wxWindow)
- friend class WXDLLEXPORT wxDC;
- friend class WXDLLEXPORT wxWindowDC;
+ friend class WXDLLEXPORT wxDC;
+ friend class WXDLLEXPORT wxWindowDC;
public:
- wxWindow();
- inline wxWindow(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxPanelNameStr)
- {
- m_children = new wxList;
- Create(parent, id, pos, size, style, name);
- }
-
- virtual ~wxWindow();
-
- bool Create(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxPanelNameStr);
-
- // Fit the window around the items
- virtual void Fit();
-
- // Show or hide the window
- virtual bool Show(bool show);
-
- // Is the window shown?
- virtual bool IsShown() const;
-
- // Raise the window to the top of the Z order
- virtual void Raise();
-
- // Lower the window to the bottom of the Z order
- virtual void Lower();
-
- // Is the window enabled?
- virtual bool IsEnabled() const;
-
- // For compatibility
- inline bool Enabled() const { return IsEnabled(); }
-
- // Dialog support: override these and call
- // base class members to add functionality
- // that can't be done using validators.
-
- // Transfer values to controls. If returns FALSE,
- // it's an application error (pops up a dialog)
- virtual bool TransferDataToWindow();
-
- // Transfer values from controls. If returns FALSE,
- // transfer failed: don't quit
- virtual bool TransferDataFromWindow();
-
- // Validate controls. If returns FALSE,
- // validation failed: don't quit
- virtual bool Validate();
-
- // Return code for dialogs
- inline void SetReturnCode(int retCode);
- inline int GetReturnCode();
-
- // Set the cursor
- virtual void SetCursor(const wxCursor& cursor);
- inline virtual wxCursor *GetCursor() const { return (wxCursor *)& m_windowCursor; };
-
- // Get the window with the focus
- static wxWindow *FindFocus();
-
- // Get character size
- virtual int GetCharHeight() const;
- virtual int GetCharWidth() const;
-
- // Get overall window size
- virtual void GetSize(int *width, int *height) const;
- virtual wxSize GetSize() const { int w, h; GetSize(& w, & h); return wxSize(w, h); }
- virtual wxRect GetRect() const { int w, h; int x, y; GetPosition(& x, & y); GetSize(& w, & h); return wxRect(x, y, w, h); }
-
- // Get window position, relative to parent (or screen if no parent)
- virtual void GetPosition(int *x, int *y) const;
- virtual wxPoint GetPosition() const { int x, y; GetPosition(&x, &y); return wxPoint(x, y); }
-
- // Get client (application-useable) size
- virtual void GetClientSize(int *width, int *height) const;
- virtual wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); }
-
- // Set overall size and position
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
- virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { SetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); }
- virtual void SetSize(const wxSize& size) { SetSize(-1, -1, size.x, size.y, wxSIZE_USE_EXISTING); }
-
- virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); }
- virtual void Move(const wxPoint& pt) { SetSize(pt.x, pt.y, -1, -1, wxSIZE_USE_EXISTING); }
-
- // Set client size
- virtual void SetClientSize(int width, int size);
- virtual void SetClientSize(const wxSize& sz) { SetClientSize(sz.x, sz.y); }
-
- // Convert client to screen coordinates
- virtual void ClientToScreen(int *x, int *y) const;
- virtual wxPoint ClientToScreen(const wxPoint& pt) const
+ wxWindow();
+ wxWindow(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr)
+ {
+ m_children = new wxList;
+ Create(parent, id, pos, size, style, name);
+ }
+
+ virtual ~wxWindow();
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr);
+
+ // Fit the window around the items
+ virtual void Fit();
+
+ // Show or hide the window
+ virtual bool Show(bool show);
+
+ // Is the window shown?
+ virtual bool IsShown() const;
+
+ // Raise the window to the top of the Z order
+ virtual void Raise();
+
+ // Lower the window to the bottom of the Z order
+ virtual void Lower();
+
+ // Is the window enabled?
+ virtual bool IsEnabled() const;
+
+ // For compatibility
+ bool Enabled() const { return IsEnabled(); }
+
+ // Dialog support: override these and call
+ // base class members to add functionality
+ // that can't be done using validators.
+
+ // Transfer values to controls. If returns FALSE,
+ // it's an application error (pops up a dialog)
+ virtual bool TransferDataToWindow();
+
+ // Transfer values from controls. If returns FALSE,
+ // transfer failed: don't quit
+ virtual bool TransferDataFromWindow();
+
+ // Validate controls. If returns FALSE,
+ // validation failed: don't quit
+ virtual bool Validate();
+
+ // Return code for dialogs
+ inline void SetReturnCode(int retCode);
+ inline int GetReturnCode();
+
+ // Set the cursor
+ virtual void SetCursor(const wxCursor& cursor);
+ virtual wxCursor *GetCursor() const { return (wxCursor *)& m_windowCursor; };
+
+ // Get the window with the focus
+ static wxWindow *FindFocus();
+
+ // Get character size
+ virtual int GetCharHeight() const;
+ virtual int GetCharWidth() const;
+
+ // moving/resizing
+ // ---------------
+
+ // set the window size and/or position
+ void SetSize( int x, int y, int width, int height,
+ int sizeFlags = wxSIZE_AUTO )
+ { DoSetSize(x, y, width, height, sizeFlags); }
+
+ void SetSize( int width, int height )
+ { DoSetSize( -1, -1, width, height, wxSIZE_USE_EXISTING ); }
+
+ void SetSize( const wxSize& size )
+ { SetSize( size.x, size.y); }
+
+ void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
+ { DoSetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); }
+
+ void Move( int x, int y )
+ { DoSetSize( x, y, -1, -1, wxSIZE_USE_EXISTING ); }
+
+ void Move(const wxPoint& pt)
+ { Move(pt.x, pt.y); }
+
+ // client size is the size of area available for subwindows
+ void SetClientSize( int width, int height )
+ { DoSetClientSize(width, height); }
+
+ void SetClientSize( const wxSize& size )
+ { DoSetClientSize(size.x, size.y); }
+
+ void SetClientSize(const wxRect& rect)
+ { SetClientSize( rect.width, rect.height ); }
+
+ // get the window position and/or size
+ virtual void GetPosition( int *x, int *y ) const;
+ wxPoint GetPosition() const
+ {
+ int w, h;
+ GetPosition(& w, & h);
+
+ return wxPoint(w, h);
+ }
+
+ virtual void GetSize( int *width, int *height ) const;
+
+ wxSize GetSize() const
+ {
+ int w, h;
+ GetSize(& w, & h);
+ return wxSize(w, h);
+ }
+
+ wxRect GetRect() const
+ {
+ int x, y, w, h;
+ GetPosition(& x, & y);
+ GetSize(& w, & h);
+
+ return wxRect(x, y, w, h);
+ }
+
+ virtual void GetClientSize( int *width, int *height ) const;
+ wxSize GetClientSize() const
+ {
+ int w, h;
+ GetClientSize(& w, & h);
+ return wxSize(w, h);
+ }
+
+ // Convert client to screen coordinates
+ virtual void ClientToScreen(int *x, int *y) const;
+ virtual wxPoint ClientToScreen(const wxPoint& pt) const
{ int x = pt.x; int y = pt.y; ClientToScreen(& x, & y); return wxPoint(x, y); }
- // Convert screen to client coordinates
- virtual void ScreenToClient(int *x, int *y) const;
- virtual wxPoint ScreenToClient(const wxPoint& pt) const
+ // Convert screen to client coordinates
+ virtual void ScreenToClient(int *x, int *y) const;
+ virtual wxPoint ScreenToClient(const wxPoint& pt) const
{ int x = pt.x; int y = pt.y; ScreenToClient(& x, & y); return wxPoint(x, y); }
- // Set the focus to this window
- virtual void SetFocus();
+ // Set the focus to this window
+ virtual void SetFocus();
- // Capture/release mouse
- virtual void CaptureMouse();
- virtual void ReleaseMouse();
+ // Capture/release mouse
+ virtual void CaptureMouse();
+ virtual void ReleaseMouse();
- // Enable or disable the window
- virtual void Enable(bool enable);
+ // Enable or disable the window
+ virtual void Enable(bool enable);
#if wxUSE_DRAG_AND_DROP
- // Associate a drop target with this window (if the window already had a drop
- // target, it's deleted!) and return the current drop target (may be NULL).
- void SetDropTarget(wxDropTarget *pDropTarget);
- wxDropTarget *GetDropTarget() const { return m_pDropTarget; }
+ // Associate a drop target with this window (if the window already had a drop
+ // target, it's deleted!) and return the current drop target (may be NULL).
+ void SetDropTarget(wxDropTarget *pDropTarget);
+ wxDropTarget *GetDropTarget() const { return m_pDropTarget; }
#endif
- // Accept files for dragging
- virtual void DragAcceptFiles(bool accept);
+ // Accept files for dragging
+ virtual void DragAcceptFiles(bool accept);
- // tooltips
+ // tooltips
// create a tooltip with this text
- void SetToolTip(const wxString& tip);
+ void SetToolTip(const wxString& tip);
- // TODO
+ // TODO
#if wxUSE_TOOLTIPS
// pointer may be NULL to remove the tooltip
- void SetToolTip(wxToolTip *tooltip);
+ void SetToolTip(wxToolTip *tooltip);
// get the current tooltip (may return NULL if none)
- wxToolTip* GetToolTip() const { return m_tooltip; }
+ wxToolTip* GetToolTip() const { return m_tooltip; }
#endif
- // Update region access
- virtual wxRegion& GetUpdateRegion() const;
- virtual bool IsExposed(int x, int y, int w, int h) const;
- virtual bool IsExposed(const wxPoint& pt) const;
- virtual bool IsExposed(const wxRect& rect) const;
-
- // Set/get the window title
- virtual inline void SetTitle(const wxString& WXUNUSED(title)) {};
- inline virtual wxString GetTitle() const { return wxString(""); };
- // Most windows have the concept of a label; for frames, this is the
- // title; for items, this is the label or button text.
- inline virtual wxString GetLabel() const { return GetTitle(); }
-
- // Set/get the window name (used for resource setting in X)
- inline virtual wxString GetName() const;
- inline virtual void SetName(const wxString& name);
-
- // Centre the window
- virtual void Centre(int direction) ;
- inline void Center(int direction = wxHORIZONTAL) { Centre(direction); }
-
- // Popup a menu
- virtual bool PopupMenu(wxMenu *menu, int x, int y);
-
- // Send the window a refresh event
- virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL);
-
- // New functions that will replace the above.
- virtual void SetScrollbar(int orient, int pos, int thumbVisible,
- int range, bool refresh = TRUE);
-
- // Helper functions for Motif
- void CreateScrollbar(int orientation);
- void DestroyScrollbar(int orientation);
-
- virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE);
- virtual int GetScrollPos(int orient) const;
- virtual int GetScrollRange(int orient) const;
- virtual int GetScrollThumb(int orient) const;
-
- virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL);
-
- // Caret manipulation
- virtual void CreateCaret(int w, int h);
- virtual void CreateCaret(const wxBitmap *bitmap);
- virtual void DestroyCaret();
- virtual void ShowCaret(bool show);
- virtual void SetCaretPos(int x, int y);
- virtual void GetCaretPos(int *x, int *y) const;
-
- // Tell window how much it can be sized
- virtual void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1);
-
- // Set/get the window's identifier
- inline int GetId() const;
- inline void SetId(int id);
-
- virtual void SetAcceleratorTable(const wxAcceleratorTable& accel);
- inline virtual wxAcceleratorTable& GetAcceleratorTable() const { return (wxAcceleratorTable&) m_acceleratorTable; }
-
- // Make the window modal (all other windows unresponsive)
- virtual void MakeModal(bool modal);
-
- // Get the private handle (platform-dependent)
- inline void *GetHandle() const;
-
- // Set/get the window's relatives
- inline wxWindow *GetParent() const;
- inline void SetParent(wxWindow *p) ;
- inline wxWindow *GetGrandParent() const;
- inline wxList& GetChildren() const;
- // Reparents this window to have the new parent.
- virtual bool Reparent(wxWindow* parent);
-
- // Set/get the window's font
- virtual void SetFont(const wxFont& f);
- inline virtual wxFont& GetFont() const;
-
- // Set/get the window's validator
- void SetValidator(const wxValidator& validator);
- inline wxValidator *GetValidator() const;
-
- virtual void SetClientObject( wxClientData *data );
- virtual wxClientData *GetClientObject();
-
- virtual void SetClientData( void *data );
- virtual void *GetClientData();
-
- // Set/get the window's style
- inline void SetWindowStyleFlag(long flag);
- inline long GetWindowStyleFlag() const;
-
- // Handle a control command
- virtual void OnCommand(wxWindow& win, wxCommandEvent& event);
-
- // Set/get event handler
- inline void SetEventHandler(wxEvtHandler *handler);
- inline wxEvtHandler *GetEventHandler() const;
-
- // Push/pop event handler (i.e. allow a chain of event handlers
- // be searched)
- void PushEventHandler(wxEvtHandler *handler) ;
- wxEvtHandler *PopEventHandler(bool deleteHandler = FALSE) ;
-
- // Close the window by calling OnClose, posting a deletion
- virtual bool Close(bool force = FALSE);
-
- // Destroy the window (delayed, if a managed window)
- virtual bool Destroy() ;
-
- // Mode for telling default OnSize members to
- // call Layout(), if not using Sizers, just top-down constraints
- inline void SetAutoLayout(bool a);
- inline bool GetAutoLayout() const;
-
- // Set/get constraints
- inline wxLayoutConstraints *GetConstraints() const;
- void SetConstraints(wxLayoutConstraints *c);
-
- // Set/get window background colour
- virtual void SetBackgroundColour(const wxColour& col);
- inline virtual wxColour GetBackgroundColour() const;
-
- // Set/get window foreground colour
- virtual void SetForegroundColour(const wxColour& col);
- inline virtual wxColour GetForegroundColour() const;
-
- // Get the default button, if there is one
- inline virtual wxButton *GetDefaultItem() const;
- inline virtual void SetDefaultItem(wxButton *but);
-
- // Override to define new behaviour for default action (e.g. double clicking
- // on a listbox)
- virtual void OnDefaultAction(wxControl *initiatingItem);
-
- // Resource loading
+ // Update region access
+ virtual wxRegion& GetUpdateRegion() const;
+ virtual bool IsExposed(int x, int y, int w, int h) const;
+ virtual bool IsExposed(const wxPoint& pt) const;
+ virtual bool IsExposed(const wxRect& rect) const;
+
+ // Set/get the window title
+ virtual void SetTitle(const wxString& WXUNUSED(title)) {};
+ virtual wxString GetTitle() const { return wxString(""); };
+ // Most windows have the concept of a label; for frames, this is the
+ // title; for items, this is the label or button text.
+ virtual wxString GetLabel() const { return GetTitle(); }
+
+ // Set/get the window name (used for resource setting in X)
+ virtual wxString GetName() const;
+ virtual void SetName(const wxString& name);
+
+ // Centre the window
+ virtual void Centre(int direction) ;
+ void Center(int direction = wxHORIZONTAL) { Centre(direction); }
+
+ // Popup a menu
+ virtual bool PopupMenu(wxMenu *menu, int x, int y);
+
+ // Send the window a refresh event
+ virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL);
+
+ // New functions that will replace the above.
+ virtual void SetScrollbar(int orient, int pos, int thumbVisible,
+ int range, bool refresh = TRUE);
+
+ // Helper functions for Motif
+ void CreateScrollbar(int orientation);
+ void DestroyScrollbar(int orientation);
+
+ virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE);
+ virtual int GetScrollPos(int orient) const;
+ virtual int GetScrollRange(int orient) const;
+ virtual int GetScrollThumb(int orient) const;
+
+ virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL);
+
+ // Caret manipulation
+ virtual void CreateCaret(int w, int h);
+ virtual void CreateCaret(const wxBitmap *bitmap);
+ virtual void DestroyCaret();
+ virtual void ShowCaret(bool show);
+ virtual void SetCaretPos(int x, int y);
+ virtual void GetCaretPos(int *x, int *y) const;
+
+ // Tell window how much it can be sized
+ virtual void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1);
+
+ // Set/get the window's identifier
+ inline int GetId() const;
+ inline void SetId(int id);
+
+ virtual void SetAcceleratorTable(const wxAcceleratorTable& accel);
+ virtual wxAcceleratorTable& GetAcceleratorTable() const { return (wxAcceleratorTable&) m_acceleratorTable; }
+
+ // Make the window modal (all other windows unresponsive)
+ virtual void MakeModal(bool modal);
+
+ // Get the private handle (platform-dependent)
+ inline void *GetHandle() const;
+
+ // Set/get the window's relatives
+ inline wxWindow *GetParent() const;
+ inline void SetParent(wxWindow *p) ;
+ inline wxWindow *GetGrandParent() const;
+ inline wxList& GetChildren() const;
+ // Reparents this window to have the new parent.
+ virtual bool Reparent(wxWindow* parent);
+
+ // Set/get the window's font
+ virtual void SetFont(const wxFont& f);
+ virtual wxFont& GetFont() const;
+
+ // Set/get the window's validator
+ void SetValidator(const wxValidator& validator);
+ inline wxValidator *GetValidator() const;
+
+ virtual void SetClientObject( wxClientData *data );
+ virtual wxClientData *GetClientObject();
+
+ virtual void SetClientData( void *data );
+ virtual void *GetClientData();
+
+ // Set/get the window's style
+ inline void SetWindowStyleFlag(long flag);
+ inline long GetWindowStyleFlag() const;
+
+ // Handle a control command
+ virtual void OnCommand(wxWindow& win, wxCommandEvent& event);
+
+ // Set/get event handler
+ inline void SetEventHandler(wxEvtHandler *handler);
+ inline wxEvtHandler *GetEventHandler() const;
+
+ // Push/pop event handler (i.e. allow a chain of event handlers
+ // be searched)
+ void PushEventHandler(wxEvtHandler *handler) ;
+ wxEvtHandler *PopEventHandler(bool deleteHandler = FALSE) ;
+
+ // Close the window by calling OnClose, posting a deletion
+ virtual bool Close(bool force = FALSE);
+
+ // Destroy the window (delayed, if a managed window)
+ virtual bool Destroy() ;
+
+ // Mode for telling default OnSize members to
+ // call Layout(), if not using Sizers, just top-down constraints
+ inline void SetAutoLayout(bool a);
+ inline bool GetAutoLayout() const;
+
+ // Set/get constraints
+ inline wxLayoutConstraints *GetConstraints() const;
+ void SetConstraints(wxLayoutConstraints *c);
+
+ // Set/get window background colour
+ virtual void SetBackgroundColour(const wxColour& col);
+ virtual wxColour GetBackgroundColour() const;
+
+ // Set/get window foreground colour
+ virtual void SetForegroundColour(const wxColour& col);
+ virtual wxColour GetForegroundColour() const;
+
+ // Get the default button, if there is one
+ virtual wxButton *GetDefaultItem() const;
+ virtual void SetDefaultItem(wxButton *but);
+
+ // Override to define new behaviour for default action (e.g. double clicking
+ // on a listbox)
+ virtual void OnDefaultAction(wxControl *initiatingItem);
+
+ // Resource loading
#if wxUSE_WX_RESOURCES
- virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
- virtual wxControl *CreateItem(const wxItemResource* childResource, const wxItemResource* parentResource,
- const wxResourceTable *table = (const wxResourceTable *) NULL);
+ virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
+ virtual wxControl *CreateItem(const wxItemResource* childResource, const wxItemResource* parentResource,
+ const wxResourceTable *table = (const wxResourceTable *) NULL);
#endif
- virtual void GetTextExtent(const wxString& string, int *x, int *y,
- int *descent = NULL,
- int *externalLeading = NULL,
- const wxFont *theFont = NULL, bool use16 = FALSE) const;
+ virtual void GetTextExtent(const wxString& string, int *x, int *y,
+ int *descent = NULL,
+ int *externalLeading = NULL,
+ const wxFont *theFont = NULL, bool use16 = FALSE) const;
- // Is the window retained?
- inline bool IsRetained() const;
+ // Is the window retained?
+ inline bool IsRetained() const;
- // Warp the pointer the given position
- virtual void WarpPointer(int x_pos, int y_pos) ;
+ // Warp the pointer the given position
+ virtual void WarpPointer(int x_pos, int y_pos) ;
- // Clear the window
- virtual void Clear();
+ // Clear the window
+ virtual void Clear();
- // Find a window by id or name
- virtual wxWindow *FindWindow(long id);
- virtual wxWindow *FindWindow(const wxString& name);
+ // Find a window by id or name
+ virtual wxWindow *FindWindow(long id);
+ virtual wxWindow *FindWindow(const wxString& name);
- // Constraint operations
- bool Layout();
- void SetSizer(wxSizer *sizer); // Adds sizer child to this window
- inline wxSizer *GetSizer() const ;
- inline wxWindow *GetSizerParent() const ;
- inline void SetSizerParent(wxWindow *win);
+ // Constraint operations
+ bool Layout();
+ void SetSizer(wxSizer *sizer); // Adds sizer child to this window
+ inline wxSizer *GetSizer() const ;
+ inline wxWindow *GetSizerParent() const ;
+ inline void SetSizerParent(wxWindow *win);
- // Do Update UI processing for controls
- void UpdateWindowUI();
+ // Do Update UI processing for controls
+ void UpdateWindowUI();
- void OnEraseBackground(wxEraseEvent& event);
- void OnChar(wxKeyEvent& event);
- void OnKeyDown(wxKeyEvent& event);
- void OnKeyUp(wxKeyEvent& event);
- void OnPaint(wxPaintEvent& event);
- void OnIdle(wxIdleEvent& event);
+ void OnEraseBackground(wxEraseEvent& event);
+ void OnChar(wxKeyEvent& event);
+ void OnKeyDown(wxKeyEvent& event);
+ void OnKeyUp(wxKeyEvent& event);
+ void OnPaint(wxPaintEvent& event);
+ void OnIdle(wxIdleEvent& event);
- // Does this window want to accept keyboard focus?
- virtual bool AcceptsFocus() const;
+ // Does this window want to accept keyboard focus?
+ virtual bool AcceptsFocus() const;
- virtual void PrepareDC( wxDC & WXUNUSED(dc) ) {};
+ virtual void PrepareDC( wxDC & WXUNUSED(dc) ) {};
public:
- ////////////////////////////////////////////////////////////////////////
- //// IMPLEMENTATION
-
- // For implementation purposes - sometimes decorations make the client area
- // smaller
- virtual wxPoint GetClientAreaOrigin() const;
-
- // Makes an adjustment to the window position (for example, a frame that has
- // a toolbar that it manages itself).
- virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
-
- // Executes the default message
- virtual long Default();
-
-/* TODO: you may need something like this
- // Determine whether 3D effects are wanted
- virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D);
-*/
-
- virtual void AddChild(wxWindow *child); // Adds reference to the child object
- virtual void RemoveChild(wxWindow *child); // Removes reference to child
- // (but doesn't delete the child object)
- virtual void DestroyChildren(); // Removes and destroys all children
-
- inline bool IsBeingDeleted() const { return FALSE; } // TODO: Should probably eliminate this
-
- // Constraint implementation
- void UnsetConstraints(wxLayoutConstraints *c);
- inline wxList *GetConstraintsInvolvedIn() const ;
- // Back-pointer to other windows we're involved with, so if we delete
- // this window, we must delete any constraints we're involved with.
- void AddConstraintReference(wxWindow *otherWin);
- void RemoveConstraintReference(wxWindow *otherWin);
- void DeleteRelatedConstraints();
-
- virtual void ResetConstraints();
- virtual void SetConstraintSizes(bool recurse = TRUE);
- virtual bool LayoutPhase1(int *noChanges);
- virtual bool LayoutPhase2(int *noChanges);
- virtual bool DoPhase(int);
- // Transforms from sizer coordinate space to actual
- // parent coordinate space
- virtual void TransformSizerToActual(int *x, int *y) const ;
-
- // Set size with transformation to actual coordinates if nec.
- virtual void SizerSetSize(int x, int y, int w, int h);
- virtual void SizerMove(int x, int y);
-
- // Only set/get the size/position of the constraint (if any)
- virtual void SetSizeConstraint(int x, int y, int w, int h);
- virtual void MoveConstraint(int x, int y);
- virtual void GetSizeConstraint(int *w, int *h) const ;
- virtual void GetClientSizeConstraint(int *w, int *h) const ;
- virtual void GetPositionConstraint(int *x, int *y) const ;
-
- // Dialog units translations. Implemented in wincmn.cpp.
- wxPoint ConvertPixelsToDialog(const wxPoint& pt) ;
- wxPoint ConvertDialogToPixels(const wxPoint& pt) ;
- inline wxSize ConvertPixelsToDialog(const wxSize& sz)
- { wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
- inline wxSize ConvertDialogToPixels(const wxSize& sz)
- { wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
-
- wxObject *GetChild(int number) const ;
-
- // Generates a new id for controls
- static int NewControlId();
-
- // Responds to colour changes: passes event on to children.
- void OnSysColourChanged(wxSysColourChangedEvent& event);
-
- // Transfers data to any child controls
- void OnInitDialog(wxInitDialogEvent& event);
-
- // Sends an OnInitDialog event, which in turns transfers data to
- // to the window via validators.
- virtual void InitDialog();
-
- /// Motif-specific
-
- void ClearUpdateRects();
- void CanvasGetSize(int* width, int* height) const; // If have drawing area
- void CanvasGetClientSize(int *width, int *height) const;
- void CanvasGetPosition(int *x, int *y) const; // If have drawing area
- void CanvasSetClientSize(int width, int size);
- void CanvasSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
-
- // Gives window a chance to do something in response to a size
- // message, e.g. arrange status bar, toolbar etc.
- virtual bool PreResize() { return TRUE; }
-
- // Get main widget for this window, e.g. a text widget
- virtual WXWidget GetMainWidget() const;
- // Get the widget that corresponds to the label (for font setting, label setting etc.)
- virtual WXWidget GetLabelWidget() const { return GetMainWidget(); }
- // 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;
- virtual void SetMainWidget(WXWidget w) { m_mainWidget = w; }
- bool CanAddEventHandler() const { return m_canAddEventHandler; }
- void SetCanAddEventHandler(bool flag) { m_canAddEventHandler = flag; }
-
- // Get the underlying X window and display
- virtual WXWindow GetXWindow() const;
- virtual WXDisplay *GetXDisplay() const;
-
- virtual WXPixmap GetBackingPixmap() const { return m_backingPixmap; }
- inline int GetPixmapWidth() const { return m_pixmapWidth; }
- inline int GetPixmapHeight() const { return m_pixmapHeight; }
-
- // Change properties
- virtual void ChangeFont(bool keepOriginalSize = TRUE); // Change to the current font (often overridden)
- virtual void DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour);
- virtual void DoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE);
- // These to be overridden as needed (may change several widgets)
- virtual void ChangeBackgroundColour(); // Change background and foreground colour using current
- // background colour setting (Motif generates
- // foreground based on background)
- virtual void ChangeForegroundColour(); // Change foreground colour using current
- // foreground colour setting
-
- // Adds the widget to the hash table and adds event handlers.
- bool AttachWidget (wxWindow* parent, WXWidget mainWidget,
- WXWidget formWidget, int x, int y, int width, int height);
- bool DetachWidget(WXWidget widget);
-
- // Generates a paint event
- virtual void DoPaint();
-
- // How to implement accelerators. If we find a key event,
- // translate to wxWindows wxKeyEvent form. Find a widget for the window.
- // Now find a wxWindow for the widget. If there isn't one, go up the widget hierarchy
- // trying to find one. Once one is found, call ProcessAccelerator for the
- // window. If it returns TRUE (processed the event), skip the X event,
- // otherwise carry on up the wxWindows window hierarchy calling ProcessAccelerator.
- // If all return FALSE, process the X event as normal.
- // 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
- // event and send it.
- virtual bool ProcessAccelerator(wxKeyEvent& event);
-
- ////////////////////////////////////////////////////////////////////////
- //// PROTECTED DATA
+ ////////////////////////////////////////////////////////////////////////
+ //// IMPLEMENTATION
+
+ // For implementation purposes - sometimes decorations make the client area
+ // smaller
+ virtual wxPoint GetClientAreaOrigin() const;
+
+ // Makes an adjustment to the window position (for example, a frame that has
+ // a toolbar that it manages itself).
+ virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
+
+ // Executes the default message
+ virtual long Default();
+
+ /* TODO: you may need something like this
+ // Determine whether 3D effects are wanted
+ virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D);
+ */
+
+ virtual void AddChild(wxWindow *child); // Adds reference to the child object
+ virtual void RemoveChild(wxWindow *child); // Removes reference to child
+ // (but doesn't delete the child object)
+ virtual void DestroyChildren(); // Removes and destroys all children
+
+ bool IsBeingDeleted() const { return FALSE; } // TODO: Should probably eliminate this
+
+ // Constraint implementation
+ void UnsetConstraints(wxLayoutConstraints *c);
+ inline wxList *GetConstraintsInvolvedIn() const ;
+ // Back-pointer to other windows we're involved with, so if we delete
+ // this window, we must delete any constraints we're involved with.
+ void AddConstraintReference(wxWindow *otherWin);
+ void RemoveConstraintReference(wxWindow *otherWin);
+ void DeleteRelatedConstraints();
+
+ virtual void ResetConstraints();
+ virtual void SetConstraintSizes(bool recurse = TRUE);
+ virtual bool LayoutPhase1(int *noChanges);
+ virtual bool LayoutPhase2(int *noChanges);
+ virtual bool DoPhase(int);
+ // Transforms from sizer coordinate space to actual
+ // parent coordinate space
+ virtual void TransformSizerToActual(int *x, int *y) const ;
+
+ // Set size with transformation to actual coordinates if nec.
+ virtual void SizerSetSize(int x, int y, int w, int h);
+ virtual void SizerMove(int x, int y);
+
+ // Only set/get the size/position of the constraint (if any)
+ virtual void SetSizeConstraint(int x, int y, int w, int h);
+ virtual void MoveConstraint(int x, int y);
+ virtual void GetSizeConstraint(int *w, int *h) const ;
+ virtual void GetClientSizeConstraint(int *w, int *h) const ;
+ virtual void GetPositionConstraint(int *x, int *y) const ;
+
+ // Dialog units translations. Implemented in wincmn.cpp.
+ wxPoint ConvertPixelsToDialog(const wxPoint& pt) ;
+ wxPoint ConvertDialogToPixels(const wxPoint& pt) ;
+ inline wxSize ConvertPixelsToDialog(const wxSize& sz)
+ { wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
+ inline wxSize ConvertDialogToPixels(const wxSize& sz)
+ { wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
+
+ wxObject *GetChild(int number) const ;
+
+ // Generates a new id for controls
+ static int NewControlId();
+
+ // Responds to colour changes: passes event on to children.
+ void OnSysColourChanged(wxSysColourChangedEvent& event);
+
+ // Transfers data to any child controls
+ void OnInitDialog(wxInitDialogEvent& event);
+
+ // Sends an OnInitDialog event, which in turns transfers data to
+ // to the window via validators.
+ virtual void InitDialog();
+
+ /// Motif-specific
+
+ void ClearUpdateRects();
+ void CanvasGetSize(int* width, int* height) const; // If have drawing area
+ void CanvasGetClientSize(int *width, int *height) const;
+ void CanvasGetPosition(int *x, int *y) const; // If have drawing area
+ void CanvasSetClientSize(int width, int size);
+ void CanvasSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
+
+ // Gives window a chance to do something in response to a size
+ // message, e.g. arrange status bar, toolbar etc.
+ virtual bool PreResize() { return TRUE; }
+
+ // Get main widget for this window, e.g. a text widget
+ virtual WXWidget GetMainWidget() const;
+ // Get the widget that corresponds to the label (for font setting, label setting etc.)
+ virtual WXWidget GetLabelWidget() const { return GetMainWidget(); }
+ // 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;
+ virtual void SetMainWidget(WXWidget w) { m_mainWidget = w; }
+ bool CanAddEventHandler() const { return m_canAddEventHandler; }
+ void SetCanAddEventHandler(bool flag) { m_canAddEventHandler = flag; }
+
+ // Get the underlying X window and display
+ virtual WXWindow GetXWindow() const;
+ virtual WXDisplay *GetXDisplay() const;
+
+ virtual WXPixmap GetBackingPixmap() const { return m_backingPixmap; }
+ int GetPixmapWidth() const { return m_pixmapWidth; }
+ int GetPixmapHeight() const { return m_pixmapHeight; }
+
+ // Change properties
+ virtual void ChangeFont(bool keepOriginalSize = TRUE); // Change to the current font (often overridden)
+ virtual void DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour);
+ virtual void DoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE);
+ // These to be overridden as needed (may change several widgets)
+ virtual void ChangeBackgroundColour(); // Change background and foreground colour using current
+ // background colour setting (Motif generates
+ // foreground based on background)
+ virtual void ChangeForegroundColour(); // Change foreground colour using current
+ // foreground colour setting
+
+ // Adds the widget to the hash table and adds event handlers.
+ bool AttachWidget (wxWindow* parent, WXWidget mainWidget,
+ WXWidget formWidget, int x, int y, int width, int height);
+ bool DetachWidget(WXWidget widget);
+
+ // Generates a paint event
+ virtual void DoPaint();
+
+ // How to implement accelerators. If we find a key event,
+ // translate to wxWindows wxKeyEvent form. Find a widget for the window.
+ // Now find a wxWindow for the widget. If there isn't one, go up the widget hierarchy
+ // trying to find one. Once one is found, call ProcessAccelerator for the
+ // window. If it returns TRUE (processed the event), skip the X event,
+ // otherwise carry on up the wxWindows window hierarchy calling ProcessAccelerator.
+ // If all return FALSE, process the X event as normal.
+ // 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
+ // event and send it.
+ virtual bool ProcessAccelerator(wxKeyEvent& event);
+
+ ////////////////////////////////////////////////////////////////////////
+ //// PROTECTED DATA
protected:
- int m_windowId;
- long m_windowStyle; // Store the window's style
- wxEvtHandler * m_windowEventHandler; // Usually is 'this'
- wxLayoutConstraints * m_constraints; // Constraints for this window
- wxList * m_constraintsInvolvedIn; // List of constraints we're involved in
- wxSizer * m_windowSizer; // Window's top-level sizer (if any)
- wxWindow * m_sizerParent; // Window's parent sizer (if any)
- bool m_autoLayout; // Whether to call Layout() in OnSize
- wxWindow * m_windowParent; // Each window always knows its parent
- wxValidator * m_windowValidator;
- int m_minSizeX;
- int m_minSizeY;
- int m_maxSizeX;
- int m_maxSizeY;
-
- // Caret data
- int m_caretWidth;
- int m_caretHeight;
- bool m_caretEnabled;
- bool m_caretShown;
- wxFont m_windowFont; // Window's font
- wxCursor m_windowCursor; // Window's cursor
- wxString m_windowName; // Window name
-
- wxButton * m_defaultItem;
-
- wxColour m_backgroundColour ;
- wxColour m_foregroundColour ;
- wxAcceleratorTable m_acceleratorTable;
- wxClientData* m_clientObject;
- void* m_clientData;
+ int m_windowId;
+ long m_windowStyle; // Store the window's style
+ wxEvtHandler * m_windowEventHandler; // Usually is 'this'
+ wxLayoutConstraints * m_constraints; // Constraints for this window
+ wxList * m_constraintsInvolvedIn; // List of constraints we're involved in
+ wxSizer * m_windowSizer; // Window's top-level sizer (if any)
+ wxWindow * m_sizerParent; // Window's parent sizer (if any)
+ bool m_autoLayout; // Whether to call Layout() in OnSize
+ wxWindow * m_windowParent; // Each window always knows its parent
+ wxValidator * m_windowValidator;
+ int m_minSizeX;
+ int m_minSizeY;
+ int m_maxSizeX;
+ int m_maxSizeY;
+
+ // Caret data
+ int m_caretWidth;
+ int m_caretHeight;
+ bool m_caretEnabled;
+ bool m_caretShown;
+ wxFont m_windowFont; // Window's font
+ wxCursor m_windowCursor; // Window's cursor
+ wxString m_windowName; // Window name
+
+ wxButton * m_defaultItem;
+
+ wxColour m_backgroundColour ;
+ wxColour m_foregroundColour ;
+ wxAcceleratorTable m_acceleratorTable;
+ wxClientData* m_clientObject;
+ void* m_clientData;
#if wxUSE_DRAG_AND_DROP
- wxDropTarget *m_pDropTarget; // the current drop target or NULL
+ wxDropTarget *m_pDropTarget; // the current drop target or NULL
#endif //USE_DRAG_AND_DROP
public:
- wxRegion m_updateRegion;
- wxList * m_children; // Window's children
- int m_returnCode;
+ wxRegion m_updateRegion;
+ wxList * m_children; // Window's children
+ int m_returnCode;
public:
- /// Motif-specific
- bool m_needsRefresh; // Do we need to repaint the backing store?
- bool m_canAddEventHandler;
- bool m_button1Pressed;
- bool m_button2Pressed;
- bool m_button3Pressed;
- // For double-click detection
- long m_lastTS; // last timestamp
- int m_lastButton; // last pressed button
- wxList m_updateRects; // List of wxRects representing damaged region
- bool m_isShown;
+ /// Motif-specific
+ bool m_needsRefresh; // Do we need to repaint the backing store?
+ bool m_canAddEventHandler;
+ bool m_button1Pressed;
+ bool m_button2Pressed;
+ bool m_button3Pressed;
+ // For double-click detection
+ long m_lastTS; // last timestamp
+ int m_lastButton; // last pressed button
+ wxList m_updateRects; // List of wxRects representing damaged region
+ bool m_isShown;
protected:
- WXWidget m_mainWidget;
- WXWidget m_hScrollBar;
- WXWidget m_vScrollBar;
- WXWidget m_borderWidget;
- WXWidget m_scrolledWindow;
- WXWidget m_drawingArea;
- bool m_winCaptured;
- bool m_hScroll;
- bool m_vScroll;
- WXPixmap m_backingPixmap;
- int m_pixmapWidth;
- int m_pixmapHeight;
- int m_pixmapOffsetX;
- int m_pixmapOffsetY;
- int m_scrollPosX; // Store the last scroll pos,
- int m_scrollPosY; // since in wxWin the pos isn't
- // set automatically by system
-
-DECLARE_EVENT_TABLE()
+ WXWidget m_mainWidget;
+ WXWidget m_hScrollBar;
+ WXWidget m_vScrollBar;
+ WXWidget m_borderWidget;
+ WXWidget m_scrolledWindow;
+ WXWidget m_drawingArea;
+ bool m_winCaptured;
+ bool m_hScroll;
+ bool m_vScroll;
+ WXPixmap m_backingPixmap;
+ int m_pixmapWidth;
+ int m_pixmapHeight;
+ int m_pixmapOffsetX;
+ int m_pixmapOffsetY;
+ int m_scrollPosX; // Store the last scroll pos,
+ int m_scrollPosY; // since in wxWin the pos isn't
+ // set automatically by system
+
+ // this is the virtual function to be overriden in any derived class which
+ // wants to change how SetSize() or Move() works - it is called by all
+ // versions of these functions in the base class
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+
+ // same as DoSetSize() for the client size
+ virtual void DoSetClientSize(int width, int height);
+
+private:
+ DECLARE_EVENT_TABLE()
};
////////////////////////////////////////////////////////////////////////
WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
// Pushbutton
-class WXDLLEXPORT wxButton: public wxControl
+class WXDLLEXPORT wxButton : public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxButton)
- public:
- inline wxButton(void) {}
- inline wxButton(wxWindow *parent, wxWindowID id, const wxString& label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxButtonNameStr)
- {
- Create(parent, id, label, pos, size, style, validator, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxButtonNameStr);
-
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
-
- virtual void SetDefault(void);
- virtual void SetLabel(const wxString& label);
- virtual wxString GetLabel(void) const ;
- virtual void Command(wxCommandEvent& event);
- virtual bool MSWCommand(WXUINT param, WXWORD id);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+DECLARE_DYNAMIC_CLASS(wxButton)
+
+public:
+ wxButton() { }
+ wxButton(wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr)
+ {
+ Create(parent, id, label, pos, size, style, validator, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxButtonNameStr);
+
+ virtual void SetDefault();
+ virtual void SetLabel(const wxString& label);
+ virtual wxString GetLabel() const ;
+ virtual void Command(wxCommandEvent& event);
+ virtual bool MSWCommand(WXUINT param, WXWORD id);
+ virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
// Checkbox item (single checkbox)
class WXDLLEXPORT wxBitmap;
-class WXDLLEXPORT wxCheckBox: public wxControl
+class WXDLLEXPORT wxCheckBox : public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxCheckBox)
-
- public:
- inline wxCheckBox(void) { }
- inline wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxCheckBoxNameStr)
- {
- Create(parent, id, label, pos, size, style, validator, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxCheckBoxNameStr);
- virtual void SetValue(bool);
- virtual bool GetValue(void) const ;
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
-
- virtual bool MSWCommand(WXUINT param, WXWORD id);
- virtual void SetLabel(const wxString& label);
- virtual void Command(wxCommandEvent& event);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+DECLARE_DYNAMIC_CLASS(wxCheckBox)
+
+public:
+ wxCheckBox() { }
+ wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxCheckBoxNameStr)
+ {
+ Create(parent, id, label, pos, size, style, validator, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxCheckBoxNameStr);
+
+ virtual void SetValue(bool value);
+ virtual bool GetValue() const ;
+
+ virtual bool MSWCommand(WXUINT param, WXWORD id);
+ virtual void SetLabel(const wxString& label);
+ virtual void Command(wxCommandEvent& event);
+ virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
{
- DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
-
- public:
- int checkWidth ;
- int checkHeight ;
-
- inline wxBitmapCheckBox(void) { checkWidth = -1; checkHeight = -1; }
- inline wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxCheckBoxNameStr)
- {
- Create(parent, id, label, pos, size, style, validator, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxCheckBoxNameStr);
- virtual void SetValue(bool);
- virtual bool GetValue(void) const ;
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
-
- virtual void SetLabel(const wxBitmap& bitmap);
+DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
+
+public:
+ int checkWidth ;
+ int checkHeight ;
+
+ wxBitmapCheckBox() { checkWidth = -1; checkHeight = -1; }
+ wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxCheckBoxNameStr)
+ {
+ Create(parent, id, label, pos, size, style, validator, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxCheckBoxNameStr);
+
+ virtual void SetValue(bool value);
+ virtual bool GetValue() const ;
+
+ virtual void SetLabel(const wxBitmap& bitmap);
+
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
// _WX_CHECKBOX_H_
// Choice item
class WXDLLEXPORT wxChoice: public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxChoice)
-
- public:
- inline wxChoice(void) { m_noStrings = 0; }
-
- inline wxChoice(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxChoiceNameStr)
- {
- Create(parent, id, pos, size, n, choices, style, validator, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxChoiceNameStr);
-
- virtual void Append(const wxString& item);
- virtual void Delete(int n);
- virtual void Clear(void);
- virtual int GetSelection(void) const ;
- virtual void SetSelection(int n);
- virtual int FindString(const wxString& s) const;
- virtual wxString GetString(int n) const ;
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual wxString GetStringSelection(void) const ;
- virtual bool SetStringSelection(const wxString& sel);
-
- virtual inline int Number(void) const { return m_noStrings; }
- virtual void Command(wxCommandEvent& event);
-
- virtual bool MSWCommand(WXUINT param, WXWORD id);
-
- virtual inline void SetColumns(int WXUNUSED(n) = 1 ) { /* No effect */ } ;
- virtual inline int GetColumns(void) const { return 1 ; };
-
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
-
- long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+ DECLARE_DYNAMIC_CLASS(wxChoice)
+
+public:
+ wxChoice() { m_noStrings = 0; }
+
+ wxChoice(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxChoiceNameStr)
+ {
+ Create(parent, id, pos, size, n, choices, style, validator, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxChoiceNameStr);
+
+ virtual void Append(const wxString& item);
+ virtual void Delete(int n);
+ virtual void Clear();
+ virtual int GetSelection() const ;
+ virtual void SetSelection(int n);
+ virtual int FindString(const wxString& s) const;
+ virtual wxString GetString(int n) const ;
+ virtual wxString GetStringSelection() const ;
+ virtual bool SetStringSelection(const wxString& sel);
+
+ virtual int Number() const { return m_noStrings; }
+ virtual void Command(wxCommandEvent& event);
+
+ virtual bool MSWCommand(WXUINT param, WXWORD id);
+
+ virtual void SetColumns(int WXUNUSED(n) = 1 ) { /* No effect */ }
+ virtual int GetColumns() const { return 1 ; }
+
+ virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+
+ long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
protected:
- int m_noStrings;
+ int m_noStrings;
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
virtual bool Destroy();
- void SetClientSize(int width, int height);
- void SetClientSize(const wxSize& sz) { wxWindow::SetClientSize(sz); }
-
void GetClientSize(int *width, int *height) const;
- wxSize GetClientSize() const { return wxWindow::GetClientSize(); }
-
void GetSize(int *width, int *height) const ;
- wxSize GetSize() const { return wxWindow::GetSize(); }
-
void GetPosition(int *x, int *y) const ;
- wxPoint GetPosition() const { return wxWindow::GetPosition(); }
-
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
- virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
virtual void ClientToScreen(int *x, int *y) const;
WXHWND m_hwndToolTip;
#endif // tooltips
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+ virtual void DoSetClientSize(int width, int height);
+
private:
DECLARE_EVENT_TABLE()
};
WXDLLEXPORT_DATA(extern const char*) wxGaugeNameStr;
// Group box
-class WXDLLEXPORT wxGauge95: public wxControl
+class WXDLLEXPORT wxGauge95 : public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxGauge95)
- public:
- inline wxGauge95(void) { m_rangeMax = 0; m_gaugePos = 0; }
-
- inline wxGauge95(wxWindow *parent, wxWindowID id,
- int range,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxGA_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxGaugeNameStr)
- {
- Create(parent, id, range, pos, size, style, validator, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id,
- int range,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxGA_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxGaugeNameStr);
-
- void SetShadowWidth(int w);
- void SetBezelFace(int w);
- void SetRange(int r);
- void SetValue(int pos);
-
- int GetShadowWidth(void) const ;
- int GetBezelFace(void) const ;
- int GetRange(void) const ;
- int GetValue(void) const ;
-
- void SetForegroundColour(const wxColour& col);
- void SetBackgroundColour(const wxColour& col);
-
- // Backward compatibility
+ DECLARE_DYNAMIC_CLASS(wxGauge95)
+
+public:
+ wxGauge95(void) { m_rangeMax = 0; m_gaugePos = 0; }
+
+ wxGauge95(wxWindow *parent, wxWindowID id,
+ int range,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxGA_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxGaugeNameStr)
+ {
+ Create(parent, id, range, pos, size, style, validator, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ int range,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxGA_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxGaugeNameStr);
+
+ void SetShadowWidth(int w);
+ void SetBezelFace(int w);
+ void SetRange(int r);
+ void SetValue(int pos);
+
+ int GetShadowWidth(void) const ;
+ int GetBezelFace(void) const ;
+ int GetRange(void) const ;
+ int GetValue(void) const ;
+
+ void SetForegroundColour(const wxColour& col);
+ void SetBackgroundColour(const wxColour& col);
+
+ // Backward compatibility
#if WXWIN_COMPATIBILITY
- inline void SetButtonColour(const wxColour& col) { SetForegroundColour(col); }
+ void SetButtonColour(const wxColour& col) { SetForegroundColour(col); }
#endif
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
+ virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
- virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
+protected:
+ int m_rangeMax;
+ int m_gaugePos;
- protected:
- int m_rangeMax;
- int m_gaugePos;
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
// Group box
class WXDLLEXPORT wxGaugeMSW: public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxGaugeMSW)
- public:
- inline wxGaugeMSW(void) { m_rangeMax = 0; m_gaugePos = 0; }
-
- inline wxGaugeMSW(wxWindow *parent, wxWindowID id,
- int range,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxGA_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxGaugeNameStr)
- {
- Create(parent, id, range, pos, size, style, validator, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id,
- int range,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxGA_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxGaugeNameStr);
-
- void SetShadowWidth(int w);
- void SetBezelFace(int w);
- void SetRange(int r);
- void SetValue(int pos);
-
- int GetShadowWidth(void) const ;
- int GetBezelFace(void) const ;
- int GetRange(void) const ;
- int GetValue(void) const ;
-
- void SetForegroundColour(const wxColour& col);
- void SetBackgroundColour(const wxColour& col);
-
- // Backward compatibility
+ DECLARE_DYNAMIC_CLASS(wxGaugeMSW)
+
+public:
+ wxGaugeMSW(void) { m_rangeMax = 0; m_gaugePos = 0; }
+
+ wxGaugeMSW(wxWindow *parent, wxWindowID id,
+ int range,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxGA_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxGaugeNameStr)
+ {
+ Create(parent, id, range, pos, size, style, validator, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ int range,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxGA_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxGaugeNameStr);
+
+ void SetShadowWidth(int w);
+ void SetBezelFace(int w);
+ void SetRange(int r);
+ void SetValue(int pos);
+
+ int GetShadowWidth(void) const ;
+ int GetBezelFace(void) const ;
+ int GetRange(void) const ;
+ int GetValue(void) const ;
+
+ void SetForegroundColour(const wxColour& col);
+ void SetBackgroundColour(const wxColour& col);
+
+ // Backward compatibility
#if WXWIN_COMPATIBILITY
- inline void SetButtonColour(const wxColour& col) { SetForegroundColour(col); }
+ void SetButtonColour(const wxColour& col) { SetForegroundColour(col); }
#endif
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
+ virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
- virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
+protected:
+ int m_rangeMax;
+ int m_gaugePos;
- protected:
- int m_rangeMax;
- int m_gaugePos;
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
// List box item
-class WXDLLEXPORT wxListBox: public wxControl
+class WXDLLEXPORT wxListBox : public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxListBox)
- public:
-
- wxListBox(void);
- inline wxListBox(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxListBoxNameStr)
- {
- Create(parent, id, pos, size, n, choices, style, validator, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxListBoxNameStr);
-
- ~wxListBox();
-
- bool MSWCommand(WXUINT param, WXWORD id);
+ DECLARE_DYNAMIC_CLASS(wxListBox)
+
+public:
+ wxListBox();
+ wxListBox(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxListBoxNameStr)
+ {
+ Create(parent, id, pos, size, n, choices, style, validator, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxListBoxNameStr);
+
+ ~wxListBox();
+
+ bool MSWCommand(WXUINT param, WXWORD id);
#if wxUSE_OWNER_DRAWN
- bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
- bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
+ bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
+ bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
- // plug-in for derived classes
- virtual wxOwnerDrawn *CreateItem(size_t n);
+ // plug-in for derived classes
+ virtual wxOwnerDrawn *CreateItem(size_t n);
- // allows to get the item and use SetXXX functions to set it's appearance
- wxOwnerDrawn *GetItem(size_t n) const { return m_aItems[n]; }
-#endif
+ // allows to get the item and use SetXXX functions to set it's appearance
+ wxOwnerDrawn *GetItem(size_t n) const { return m_aItems[n]; }
+#endif // wxUSE_OWNER_DRAWN
- virtual void Append(const wxString& item);
- virtual void Append(const wxString& item, char *clientData);
- virtual void Set(int n, const wxString* choices, char **clientData = NULL);
- virtual int FindString(const wxString& s) const ;
- virtual void Clear(void);
- virtual void SetSelection(int n, bool select = TRUE);
+ virtual void Append(const wxString& item);
+ virtual void Append(const wxString& item, char *clientData);
+ virtual void Set(int n, const wxString* choices, char **clientData = NULL);
+ virtual int FindString(const wxString& s) const ;
+ virtual void Clear();
+ virtual void SetSelection(int n, bool select = TRUE);
- virtual void Deselect(int n);
+ virtual void Deselect(int n);
- // For single choice list item only
- virtual int GetSelection() const ;
- virtual void Delete(int n);
- virtual char *GetClientData(int n) const ;
- virtual void SetClientData(int n, char *clientData);
- virtual void SetString(int n, const wxString& s);
+ // For single choice list item only
+ virtual int GetSelection() const ;
+ virtual void Delete(int n);
+ virtual char *GetClientData(int n) const ;
+ virtual void SetClientData(int n, char *clientData);
+ virtual void SetString(int n, const wxString& s);
- // For single or multiple choice list item
- virtual int GetSelections(wxArrayInt& aSelections) const;
- virtual bool Selected(int n) const ;
- virtual wxString GetString(int n) const ;
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
+ // For single or multiple choice list item
+ virtual int GetSelections(wxArrayInt& aSelections) const;
+ virtual bool Selected(int n) const ;
+ virtual wxString GetString(int n) const ;
- // Set the specified item at the first visible item
- // or scroll to max range.
- virtual void SetFirstItem(int n) ;
- virtual void SetFirstItem(const wxString& s) ;
+ // Set the specified item at the first visible item
+ // or scroll to max range.
+ virtual void SetFirstItem(int n) ;
+ virtual void SetFirstItem(const wxString& s) ;
- virtual void InsertItems(int nItems, const wxString items[], int pos);
+ virtual void InsertItems(int nItems, const wxString items[], int pos);
- virtual wxString GetStringSelection(void) const ;
- virtual bool SetStringSelection(const wxString& s, bool flag = TRUE);
- virtual int Number(void) const ;
+ virtual wxString GetStringSelection() const ;
+ virtual bool SetStringSelection(const wxString& s, bool flag = TRUE);
+ virtual int Number() const ;
- void Command(wxCommandEvent& event);
+ void Command(wxCommandEvent& event);
- // Windows-specific code to set the horizontal extent of
- // the listbox, if necessary. If s is non-NULL, it's
- // used to calculate the horizontal extent.
- // Otherwise, all strings are used.
- virtual void SetHorizontalExtent(const wxString& s = wxEmptyString);
+ // Windows-specific code to set the horizontal extent of
+ // the listbox, if necessary. If s is non-NULL, it's
+ // used to calculate the horizontal extent.
+ // Otherwise, all strings are used.
+ virtual void SetHorizontalExtent(const wxString& s = wxEmptyString);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+ virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
- virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
- virtual void SetupColours(void);
+ virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+ virtual void SetupColours();
- protected:
- int m_noItems;
- int m_selected;
+protected:
+ int m_noItems;
+ int m_selected;
#if wxUSE_OWNER_DRAWN
- // control items
- wxListBoxItemsArray m_aItems;
+ // control items
+ wxListBoxItemsArray m_aItems;
#endif
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
#endif
#if wxUSE_PENWIN
-WXDLLEXPORT void wxRegisterPenWin(void);
-WXDLLEXPORT void wxCleanUpPenWin(void);
+WXDLLEXPORT void wxRegisterPenWin();
+WXDLLEXPORT void wxCleanUpPenWin();
WXDLLEXPORT void wxEnablePenAppHooks (bool hook);
#endif
* - NULL any extra child window pointers not created for this item
* (e.g. label control that wasn't needed)
* - delete any extra child windows in the destructor (e.g. label control)
- * - implement GetSize and SetSize
+ * - implement DoSetSize
* - to find panel position if coordinates are (-1, -1), use GetPosition
* - call AdvanceCursor after creation, for panel layout mechanism.
*
// List box item
class WXDLLEXPORT wxBitmap ;
-class WXDLLEXPORT wxRadioBox: public wxControl
+class WXDLLEXPORT wxRadioBox : public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxRadioBox)
+ DECLARE_DYNAMIC_CLASS(wxRadioBox)
+
public:
- wxRadioBox(void);
+ wxRadioBox();
#if WXWIN_COMPATIBILITY
- wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
- int x = -1, int y = -1, int width = -1, int height = -1,
- int n = 0, char **choices = NULL,
- int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr);
-
-/*
- inline wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
- int x, int y, int width, int height,
- int n, wxBitmap **choices,
- int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr)
- {
- Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), n, (const wxBitmap **)choices, majorDim, style,
- wxDefaultValidator, name);
- Callback(func);
- }
-*/
-
-#endif
-
- inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- int majorDim = 0, long style = wxRA_HORIZONTAL,
- const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
- {
- Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
- }
-
-/*
- wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- int n = 0, const wxBitmap *choices[] = NULL,
- int majorDim = 0, long style = wxRA_HORIZONTAL,
- const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
- {
- Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
- }
-*/
-
- ~wxRadioBox(void);
-
- bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL,
- int majorDim = 0, long style = wxRA_HORIZONTAL,
- const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
-
-/*
- bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
- const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- int n = 0, const wxBitmap *choices[] = NULL,
- int majorDim = 0, long style = wxRA_HORIZONTAL,
- const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
-*/
-
- virtual bool MSWCommand(WXUINT param, WXWORD id);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
-
- int FindString(const wxString& s) const;
- void SetSelection(int N);
- int GetSelection(void) const;
- wxString GetString(int N) const;
-
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
-
- void GetSize(int *x, int *y) const;
- wxSize GetSize() const { return wxWindow::GetSize(); }
-
- void GetPosition(int *x, int *y) const;
- wxPoint GetPosition() const { return wxWindow::GetPosition(); }
-
- wxString GetLabel(void) const;
- void SetLabel(const wxString& label);
- void SetLabel(int item, const wxString& label) ;
- void SetLabel(int item, wxBitmap *bitmap) ;
- wxString GetLabel(int item) const;
- bool Show(bool show);
- void SetFocus(void);
- void Enable(bool enable);
- void Enable(int item, bool enable);
- void Show(int item, bool show) ;
- inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
- inline void SetButtonFont(const wxFont& font) { SetFont(font); }
-
- virtual wxString GetStringSelection(void) const;
- virtual bool SetStringSelection(const wxString& s);
- inline virtual int Number(void) const { return m_noItems; } ;
- void Command(wxCommandEvent& event);
-
- inline int GetNumberOfRowsOrCols(void) const { return m_noRowsOrCols; }
- inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
-
- // Implementation
- inline WXHWND *GetRadioButtons(void) const { return m_radioButtons; }
- bool ContainsHWND(WXHWND hWnd) const ;
-
- long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+ wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
+ int x = -1, int y = -1, int width = -1, int height = -1,
+ int n = 0, char **choices = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr);
+
+ /*
+ inline wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
+ int x, int y, int width, int height,
+ int n, wxBitmap **choices,
+ int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr)
+ {
+ Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), n, (const wxBitmap **)choices, majorDim, style,
+ wxDefaultValidator, name);
+ Callback(func);
+ }
+ */
+#endif // WXWIN_COMPATIBILITY
+
+ wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL,
+ const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
+ {
+ Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
+ }
+
+ /*
+ wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ int n = 0, const wxBitmap *choices[] = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL,
+ const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
+ {
+ Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
+ }
+ */
+
+ ~wxRadioBox();
+
+ bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL,
+ const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
+
+ /*
+ bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
+ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
+ int n = 0, const wxBitmap *choices[] = NULL,
+ int majorDim = 0, long style = wxRA_HORIZONTAL,
+ const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
+ */
+
+ virtual bool MSWCommand(WXUINT param, WXWORD id);
+ virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+
+ int FindString(const wxString& s) const;
+ void SetSelection(int N);
+ int GetSelection() const;
+ wxString GetString(int N) const;
+
+ void GetSize(int *x, int *y) const;
+ void GetPosition(int *x, int *y) const;
+
+ wxString GetLabel() const;
+ void SetLabel(const wxString& label);
+ void SetLabel(int item, const wxString& label) ;
+ void SetLabel(int item, wxBitmap *bitmap) ;
+ wxString GetLabel(int item) const;
+ bool Show(bool show);
+ void SetFocus();
+ void Enable(bool enable);
+ void Enable(int item, bool enable);
+ void Show(int item, bool show) ;
+ void SetLabelFont(const wxFont& WXUNUSED(font)) {};
+ void SetButtonFont(const wxFont& font) { SetFont(font); }
+
+ virtual wxString GetStringSelection() const;
+ virtual bool SetStringSelection(const wxString& s);
+ virtual int Number() const { return m_noItems; } ;
+ void Command(wxCommandEvent& event);
+
+ int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
+ void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
+
+ // Implementation
+ WXHWND *GetRadioButtons() const { return m_radioButtons; }
+ bool ContainsHWND(WXHWND hWnd) const ;
+
+ long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
protected:
- WXHWND * m_radioButtons;
- int m_majorDim ;
- int * m_radioWidth ; // for bitmaps
- int * m_radioHeight ;
-
- int m_noItems;
- int m_noRowsOrCols;
- int m_selectedButton;
-
+ WXHWND * m_radioButtons;
+ int m_majorDim ;
+ int * m_radioWidth ; // for bitmaps
+ int * m_radioHeight ;
+
+ int m_noItems;
+ int m_noRowsOrCols;
+ int m_selectedButton;
+
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
// Slider
-class WXDLLEXPORT wxSlider95: public wxControl
+class WXDLLEXPORT wxSlider95 : public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxSlider95)
+ DECLARE_DYNAMIC_CLASS(wxSlider95)
public:
- wxSlider95(void);
-
- inline wxSlider95(wxWindow *parent, wxWindowID id,
- int value, int minValue, int maxValue,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxSL_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxSliderNameStr)
- {
- Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
- }
-
- ~wxSlider95(void);
-
- bool Create(wxWindow *parent, wxWindowID id,
- int value, int minValue, int maxValue,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxSL_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxSliderNameStr);
-
- virtual int GetValue(void) const ;
- virtual void SetValue(int);
-
- void GetSize(int *x, int *y) const ;
- wxSize GetSize() const { return wxWindow::GetSize(); }
-
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
-
- void GetPosition(int *x, int *y) const ;
- wxPoint GetPosition() const { return wxWindow::GetPosition(); }
-
- bool Show(bool show);
-
- void SetRange(int minValue, int maxValue);
-
- inline int GetMin(void) const { return m_rangeMin; }
- inline int GetMax(void) const { return m_rangeMax; }
-
- // For trackbars only
- void SetTickFreq(int n, int pos);
- inline int GetTickFreq(void) const { return m_tickFreq; }
- void SetPageSize(int pageSize);
- int GetPageSize(void) const ;
- void ClearSel(void) ;
- void ClearTicks(void) ;
- void SetLineSize(int lineSize);
- int GetLineSize(void) const ;
- int GetSelEnd(void) const ;
- int GetSelStart(void) const ;
- void SetSelection(int minPos, int maxPos);
- void SetThumbLength(int len) ;
- int GetThumbLength(void) const ;
- void SetTick(int tickPos) ;
-
- // IMPLEMENTATION
- inline WXHWND GetStaticMin() const { return m_staticMin; }
- inline WXHWND GetStaticMax() const { return m_staticMax; }
- inline WXHWND GetEditValue() const { return m_staticValue; }
- virtual bool ContainsHWND(WXHWND hWnd) const;
-
- void Command(wxCommandEvent& event);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
- void MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control);
- void MSWOnHScroll(WXWORD wParam, WXWORD pos, WXHWND control);
-
- protected:
- WXHWND m_staticMin;
- WXHWND m_staticMax;
- WXHWND m_staticValue;
- int m_rangeMin;
- int m_rangeMax;
- int m_pageSize;
- int m_lineSize;
- int m_tickFreq;
+ wxSlider95();
+
+ wxSlider95(wxWindow *parent, wxWindowID id,
+ int value, int minValue, int maxValue,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxSL_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxSliderNameStr)
+ {
+ Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
+ }
+
+ ~wxSlider95();
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ int value, int minValue, int maxValue,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxSL_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxSliderNameStr);
+
+ virtual int GetValue() const ;
+ virtual void SetValue(int);
+
+ void GetSize(int *x, int *y) const ;
+ void GetPosition(int *x, int *y) const ;
+
+ bool Show(bool show);
+
+ void SetRange(int minValue, int maxValue);
+
+ int GetMin() const { return m_rangeMin; }
+ int GetMax() const { return m_rangeMax; }
+
+ // For trackbars only
+ void SetTickFreq(int n, int pos);
+ int GetTickFreq() const { return m_tickFreq; }
+ void SetPageSize(int pageSize);
+ int GetPageSize() const ;
+ void ClearSel() ;
+ void ClearTicks() ;
+ void SetLineSize(int lineSize);
+ int GetLineSize() const ;
+ int GetSelEnd() const ;
+ int GetSelStart() const ;
+ void SetSelection(int minPos, int maxPos);
+ void SetThumbLength(int len) ;
+ int GetThumbLength() const ;
+ void SetTick(int tickPos) ;
+
+ // IMPLEMENTATION
+ WXHWND GetStaticMin() const { return m_staticMin; }
+ WXHWND GetStaticMax() const { return m_staticMax; }
+ WXHWND GetEditValue() const { return m_staticValue; }
+ virtual bool ContainsHWND(WXHWND hWnd) const;
+
+ void Command(wxCommandEvent& event);
+ virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+ void MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control);
+ void MSWOnHScroll(WXWORD wParam, WXWORD pos, WXHWND control);
+
+protected:
+ WXHWND m_staticMin;
+ WXHWND m_staticMax;
+ WXHWND m_staticValue;
+ int m_rangeMin;
+ int m_rangeMax;
+ int m_pageSize;
+ int m_lineSize;
+ int m_tickFreq;
+
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
// Slider
-class WXDLLEXPORT wxSliderMSW: public wxControl
+class WXDLLEXPORT wxSliderMSW : public wxControl
{
- DECLARE_DYNAMIC_CLASS(wxSliderMSW)
+ DECLARE_DYNAMIC_CLASS(wxSliderMSW)
public:
- wxSliderMSW(void);
-
- inline wxSliderMSW(wxWindow *parent, wxWindowID id,
- int value, int minValue, int maxValue,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxSL_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxSliderNameStr)
- {
- Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
- }
-
- ~wxSliderMSW(void);
-
- bool Create(wxWindow *parent, wxWindowID id,
- int value, int minValue, int maxValue,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxSL_HORIZONTAL,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxSliderNameStr);
-
- virtual int GetValue(void) const ;
- virtual void SetValue(int);
-
- void GetSize(int *x, int *y) const ;
- wxSize GetSize() const { return wxWindow::GetSize(); }
-
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
-
- void GetPosition(int *x, int *y) const ;
- wxPoint GetPosition() const { return wxWindow::GetPosition(); }
-
- bool Show(bool show);
-
- void SetRange(int minValue, int maxValue);
-
- inline int GetMin(void) const { return m_rangeMin; }
- inline int GetMax(void) const { return m_rangeMax; }
-
- // For trackbars only
- void SetTickFreq(int n, int pos);
- inline int GetTickFreq(void) const { return m_tickFreq; }
- void SetPageSize(int pageSize);
- int GetPageSize(void) const ;
- void ClearSel(void) ;
- void ClearTicks(void) ;
- void SetLineSize(int lineSize);
- int GetLineSize(void) const ;
- int GetSelEnd(void) const ;
- int GetSelStart(void) const ;
- void SetSelection(int minPos, int maxPos);
- void SetThumbLength(int len) ;
- int GetThumbLength(void) const ;
- void SetTick(int tickPos) ;
-
- // IMPLEMENTATION
- inline WXHWND GetStaticMin() const { return m_staticMin; }
- inline WXHWND GetStaticMax() const { return m_staticMax; }
- inline WXHWND GetEditValue() const { return m_staticValue; }
- virtual bool ContainsHWND(WXHWND hWnd) const;
-
- void Command(wxCommandEvent& event);
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
- void MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control);
- void MSWOnHScroll(WXWORD wParam, WXWORD pos, WXHWND control);
-
- protected:
- WXHWND m_staticMin;
- WXHWND m_staticMax;
- WXHWND m_staticValue;
- int m_rangeMin;
- int m_rangeMax;
- int m_pageSize;
- int m_lineSize;
- int m_tickFreq;
+ wxSliderMSW();
+
+ wxSliderMSW(wxWindow *parent, wxWindowID id,
+ int value, int minValue, int maxValue,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxSL_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxSliderNameStr)
+ {
+ Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
+ }
+
+ ~wxSliderMSW();
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ int value, int minValue, int maxValue,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxSL_HORIZONTAL,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxSliderNameStr);
+
+ virtual int GetValue() const ;
+ virtual void SetValue(int);
+
+ void GetSize(int *x, int *y) const ;
+ void GetPosition(int *x, int *y) const ;
+
+ bool Show(bool show);
+
+ void SetRange(int minValue, int maxValue);
+
+ int GetMin() const { return m_rangeMin; }
+ int GetMax() const { return m_rangeMax; }
+
+ // For trackbars only
+ void SetTickFreq(int n, int pos);
+ int GetTickFreq() const { return m_tickFreq; }
+ void SetPageSize(int pageSize);
+ int GetPageSize() const ;
+ void ClearSel() ;
+ void ClearTicks() ;
+ void SetLineSize(int lineSize);
+ int GetLineSize() const ;
+ int GetSelEnd() const ;
+ int GetSelStart() const ;
+ void SetSelection(int minPos, int maxPos);
+ void SetThumbLength(int len) ;
+ int GetThumbLength() const ;
+ void SetTick(int tickPos) ;
+
+ // IMPLEMENTATION
+ WXHWND GetStaticMin() const { return m_staticMin; }
+ WXHWND GetStaticMax() const { return m_staticMax; }
+ WXHWND GetEditValue() const { return m_staticValue; }
+ virtual bool ContainsHWND(WXHWND hWnd) const;
+
+ void Command(wxCommandEvent& event);
+ virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+ void MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control);
+ void MSWOnHScroll(WXWORD wParam, WXWORD pos, WXHWND control);
+
+protected:
+ WXHWND m_staticMin;
+ WXHWND m_staticMax;
+ WXHWND m_staticValue;
+ int m_rangeMin;
+ int m_rangeMax;
+ int m_pageSize;
+ int m_lineSize;
+ int m_tickFreq;
+
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
class WXDLLEXPORT wxStaticBitmap : public wxControl
{
-DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
+ DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
public:
wxStaticBitmap() { }
virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) { }
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size)
- { wxWindow::SetSize(size); }
-
wxBitmap& GetBitmap(void) const { return (wxBitmap&) m_messageBitmap; }
// overriden base class virtuals
protected:
wxBitmap m_messageBitmap;
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
DECLARE_DYNAMIC_CLASS(wxStaticBox)
public:
- wxStaticBox() {}
+ wxStaticBox() { }
wxStaticBox(wxWindow *parent, wxWindowID id,
const wxString& label,
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size)
- { wxWindow::SetSize(size); }
void SetLabel(const wxString& label);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+
private:
DECLARE_EVENT_TABLE()
};
const wxString& name = wxStaticTextNameStr);
// accessors
- void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size)
- { wxWindow::SetSize(size); }
void SetLabel(const wxString& label);
// operations
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+
+protected:
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
};
#endif
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
// Single-line text item
-class WXDLLEXPORT wxTextCtrl: public wxControl
+class WXDLLEXPORT wxTextCtrl : public wxControl
// 16-bit Borland 4.0 doesn't seem to allow multiple inheritance with wxWindow and streambuf:
// it complains about deriving a huge class from the huge class streambuf. !!
DECLARE_DYNAMIC_CLASS(wxTextCtrl)
public:
- // creation
- // --------
- wxTextCtrl();
- inline wxTextCtrl(wxWindow *parent, wxWindowID id,
- const wxString& value = wxEmptyString,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = 0,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxTextCtrlNameStr)
+ // creation
+ // --------
+ wxTextCtrl();
+ wxTextCtrl(wxWindow *parent, wxWindowID id,
+ const wxString& value = wxEmptyString,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxTextCtrlNameStr)
#ifndef NO_TEXT_WINDOW_STREAM
- :streambuf()
+ :streambuf()
#endif
- {
- Create(parent, id, value, pos, size, style, validator, name);
- }
-
- bool Create(wxWindow *parent, wxWindowID id,
- const wxString& value = wxEmptyString,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = wxTE_PROCESS_TAB,
- const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxTextCtrlNameStr);
-
- // accessors
- // ---------
- virtual wxString GetValue() const ;
- virtual void SetValue(const wxString& value);
-
- virtual int GetLineLength(long lineNo) const;
- virtual wxString GetLineText(long lineNo) const;
- virtual int GetNumberOfLines() const;
-
- // operations
- // ----------
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { wxWindow::SetSize(rect, sizeFlags); }
- void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
-
- // Clipboard operations
- virtual void Copy();
- virtual void Cut();
- virtual void Paste();
-
- virtual void SetInsertionPoint(long pos);
- virtual void SetInsertionPointEnd();
- virtual long GetInsertionPoint() const ;
- virtual long GetLastPosition() const ;
- virtual void Replace(long from, long to, const wxString& value);
- virtual void Remove(long from, long to);
- virtual void SetSelection(long from, long to);
- virtual void SetEditable(bool editable);
-
- // streambuf implementation
+ {
+ Create(parent, id, value, pos, size, style, validator, name);
+ }
+
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxString& value = wxEmptyString,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize, long style = wxTE_PROCESS_TAB,
+ const wxValidator& validator = wxDefaultValidator,
+ const wxString& name = wxTextCtrlNameStr);
+
+ // accessors
+ // ---------
+ virtual wxString GetValue() const ;
+ virtual void SetValue(const wxString& value);
+
+ virtual int GetLineLength(long lineNo) const;
+ virtual wxString GetLineText(long lineNo) const;
+ virtual int GetNumberOfLines() const;
+
+ // operations
+ // ----------
+
+ // Clipboard operations
+ virtual void Copy();
+ virtual void Cut();
+ virtual void Paste();
+
+ virtual void SetInsertionPoint(long pos);
+ virtual void SetInsertionPointEnd();
+ virtual long GetInsertionPoint() const ;
+ virtual long GetLastPosition() const ;
+ virtual void Replace(long from, long to, const wxString& value);
+ virtual void Remove(long from, long to);
+ virtual void SetSelection(long from, long to);
+ virtual void SetEditable(bool editable);
+
+ // streambuf implementation
#ifndef NO_TEXT_WINDOW_STREAM
- int overflow(int i);
- int sync();
- int underflow();
+ int overflow(int i);
+ int sync();
+ int underflow();
#endif
- wxTextCtrl& operator<<(const wxString& s);
- wxTextCtrl& operator<<(int i);
- wxTextCtrl& operator<<(long i);
- wxTextCtrl& operator<<(float f);
- wxTextCtrl& operator<<(double d);
- wxTextCtrl& operator<<(const char c);
+ wxTextCtrl& operator<<(const wxString& s);
+ wxTextCtrl& operator<<(int i);
+ wxTextCtrl& operator<<(long i);
+ wxTextCtrl& operator<<(float f);
+ wxTextCtrl& operator<<(double d);
+ wxTextCtrl& operator<<(const char c);
- virtual bool LoadFile(const wxString& file);
- virtual bool SaveFile(const wxString& file);
- virtual void WriteText(const wxString& text);
- virtual void AppendText(const wxString& text);
- virtual void DiscardEdits();
- virtual bool IsModified() const;
+ virtual bool LoadFile(const wxString& file);
+ virtual bool SaveFile(const wxString& file);
+ virtual void WriteText(const wxString& text);
+ virtual void AppendText(const wxString& text);
+ virtual void DiscardEdits();
+ virtual bool IsModified() const;
#if WXWIN_COMPATIBILITY
- inline bool Modified() const { return IsModified(); }
+ inline bool Modified() const { return IsModified(); }
#endif
- virtual long XYToPosition(long x, long y) const ;
- virtual void PositionToXY(long pos, long *x, long *y) const ;
- virtual void ShowPosition(long pos);
- virtual void Clear();
+ virtual long XYToPosition(long x, long y) const ;
+ virtual void PositionToXY(long pos, long *x, long *y) const ;
+ virtual void ShowPosition(long pos);
+ virtual void Clear();
- // callbacks
- // ---------
- void OnDropFiles(wxDropFilesEvent& event);
- void OnChar(wxKeyEvent& event); // Process 'enter' if required
- void OnEraseBackground(wxEraseEvent& event);
+ // callbacks
+ // ---------
+ void OnDropFiles(wxDropFilesEvent& event);
+ void OnChar(wxKeyEvent& event); // Process 'enter' if required
+ void OnEraseBackground(wxEraseEvent& event);
- // Implementation
- // --------------
- virtual void Command(wxCommandEvent& event);
- virtual bool MSWCommand(WXUINT param, WXWORD id);
+ // Implementation
+ // --------------
+ virtual void Command(wxCommandEvent& event);
+ virtual bool MSWCommand(WXUINT param, WXWORD id);
#if wxUSE_RICHEDIT
- bool IsRich() const { return m_isRich; }
- void SetRichEdit(bool isRich) { m_isRich = isRich; }
+ bool IsRich() const { return m_isRich; }
+ void SetRichEdit(bool isRich) { m_isRich = isRich; }
#endif
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam,
- WXLPARAM lParam);
+ virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam,
+ WXLPARAM lParam);
- virtual void AdoptAttributesFromHWND();
- virtual void SetupColours();
- virtual long MSWGetDlgCode();
+ virtual void AdoptAttributesFromHWND();
+ virtual void SetupColours();
+ virtual long MSWGetDlgCode();
protected:
#if wxUSE_RICHEDIT
- bool m_isRich; // Are we using rich text edit to implement this?
+ bool m_isRich; // Are we using rich text edit to implement this?
#endif
- wxString m_fileName;
+ wxString m_fileName;
- DECLARE_EVENT_TABLE()
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+
+private:
+ DECLARE_EVENT_TABLE()
};
#endif
class WXDLLEXPORT wxWindow : public wxEvtHandler
{
- DECLARE_ABSTRACT_CLASS(wxWindow)
+ DECLARE_ABSTRACT_CLASS(wxWindow)
- friend class wxDC;
- friend class wxPaintDC;
+ friend class wxDC;
+ friend class wxPaintDC;
public:
- wxWindow();
- wxWindow(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxPanelNameStr)
- {
- Init();
- Create(parent, id, pos, size, style, name);
- }
+ wxWindow();
+ wxWindow(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr)
+ {
+ Init();
+ Create(parent, id, pos, size, style, name);
+ }
- virtual ~wxWindow();
-
- bool Create(wxWindow *parent, wxWindowID id,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = wxPanelNameStr);
-
- // Fit the window around the items
- virtual void Fit();
-
- // Show or hide the window
- virtual bool Show(bool show);
-
- // Is the window shown?
- virtual bool IsShown() const;
-
- // Raise the window to the top of the Z order
- virtual void Raise();
-
- // Lower the window to the bottom of the Z order
- virtual void Lower();
-
- // Is the window enabled?
- virtual bool IsEnabled() const;
-
- // For compatibility
- inline bool Enabled() const { return IsEnabled(); }
-
- // Dialog support: override these and call
- // base class members to add functionality
- // that can't be done using validators.
-
- // Transfer values to controls. If returns FALSE,
- // it's an application error (pops up a dialog)
- virtual bool TransferDataToWindow();
-
- // Transfer values from controls. If returns FALSE,
- // transfer failed: don't quit
- virtual bool TransferDataFromWindow();
-
- // Validate controls. If returns FALSE,
- // validation failed: don't quit
- virtual bool Validate();
-
- // Return code for dialogs
- inline void SetReturnCode(int retCode);
- inline int GetReturnCode();
-
- // Set the cursor
- virtual void SetCursor(const wxCursor& cursor);
- inline virtual wxCursor& GetCursor() const { return (wxCursor& ) m_windowCursor; };
-
- // Get the window with the focus
- static wxWindow *FindFocus();
-
- // Get character size
- virtual int GetCharHeight() const;
- virtual int GetCharWidth() const;
-
- // Get overall window size
- virtual void GetSize(int *width, int *height) const;
- wxSize GetSize() const { int w, h; GetSize(& w, & h); return wxSize(w, h); }
-
- // Get window position, relative to parent (or screen if no parent)
- virtual void GetPosition(int *x, int *y) const;
- wxPoint GetPosition() const
- { int x, y; GetPosition(&x, &y); return wxPoint(x, y); }
-
- // Get size and position
- wxRect GetRect() const
- { int x, y, w, h; GetPosition(& x, & y); GetSize(& w, & h); return wxRect(x, y, w, h); }
-
- // Get client (application-useable) size
- virtual void GetClientSize(int *width, int *height) const;
- wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); }
-
- // Set overall size and position
- // generic function, may be overriden in derived classes
- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
-
- void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
- { SetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); }
-
- // set size only
- void SetSize(int width, int height)
- { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
- void SetSize(const wxSize& size)
- { SetSize(-1, -1, size.x, size.y, wxSIZE_USE_EXISTING); }
-
- // set position only
- virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); }
- void Move(const wxPoint& pt) { SetSize(pt.x, pt.y, -1, -1, wxSIZE_USE_EXISTING); }
+ virtual ~wxWindow();
- // Set client size
- virtual void SetClientSize(int width, int height);
- void SetClientSize(const wxSize& sz) { SetClientSize(sz.x, sz.y); }
+ bool Create(wxWindow *parent, wxWindowID id,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = wxPanelNameStr);
- // Convert client to screen coordinates
- virtual void ClientToScreen(int *x, int *y) const;
- wxPoint ClientToScreen(const wxPoint& pt) const
+ // Fit the window around the items
+ virtual void Fit();
+
+ // Show or hide the window
+ virtual bool Show(bool show);
+
+ // Is the window shown?
+ virtual bool IsShown() const;
+
+ // Raise the window to the top of the Z order
+ virtual void Raise();
+
+ // Lower the window to the bottom of the Z order
+ virtual void Lower();
+
+ // Is the window enabled?
+ virtual bool IsEnabled() const;
+
+ // For compatibility
+ inline bool Enabled() const { return IsEnabled(); }
+
+ // Dialog support: override these and call
+ // base class members to add functionality
+ // that can't be done using validators.
+
+ // Transfer values to controls. If returns FALSE,
+ // it's an application error (pops up a dialog)
+ virtual bool TransferDataToWindow();
+
+ // Transfer values from controls. If returns FALSE,
+ // transfer failed: don't quit
+ virtual bool TransferDataFromWindow();
+
+ // Validate controls. If returns FALSE,
+ // validation failed: don't quit
+ virtual bool Validate();
+
+ // Return code for dialogs
+ inline void SetReturnCode(int retCode);
+ inline int GetReturnCode();
+
+ // Set the cursor
+ virtual void SetCursor(const wxCursor& cursor);
+ inline virtual wxCursor& GetCursor() const { return (wxCursor& ) m_windowCursor; };
+
+ // Get the window with the focus
+ static wxWindow *FindFocus();
+
+ // Get character size
+ virtual int GetCharHeight() const;
+ virtual int GetCharWidth() const;
+
+ // moving/resizing
+ // ---------------
+
+ // set the window size and/or position
+ void SetSize( int x, int y, int width, int height,
+ int sizeFlags = wxSIZE_AUTO )
+ { DoSetSize(x, y, width, height, sizeFlags); }
+
+ void SetSize( int width, int height )
+ { DoSetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
+
+ void SetSize( const wxSize& size )
+ { SetSize(size.x, size.y); }
+
+ void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
+ { DoSetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); }
+
+ void Move( int x, int y )
+ { DoSetSize( x, y, -1, -1, wxSIZE_USE_EXISTING ); }
+
+ void Move(const wxPoint& pt)
+ { Move(pt.x, pt.y); }
+
+ // client size is the size of area available for subwindows
+ void SetClientSize( int width, int height )
+ { DoSetClientSize(width, height); }
+
+ void SetClientSize( const wxSize& size )
+ { DoSetClientSize(size.x, size.y); }
+
+ void SetClientSize(const wxRect& rect)
+ { SetClientSize( rect.width, rect.height ); }
+
+ // get the window position and/or size
+ virtual void GetPosition( int *x, int *y ) const;
+ wxPoint GetPosition() const
+ {
+ int w, h;
+ GetPosition(& w, & h);
+
+ return wxPoint(w, h);
+ }
+
+ virtual void GetSize( int *width, int *height ) const;
+
+ wxSize GetSize() const
+ {
+ int w, h;
+ GetSize(& w, & h);
+ return wxSize(w, h);
+ }
+
+ wxRect GetRect() const
+ {
+ int x, y, w, h;
+ GetPosition(& x, & y);
+ GetSize(& w, & h);
+
+ return wxRect(x, y, w, h);
+ }
+
+ virtual void GetClientSize( int *width, int *height ) const;
+ wxSize GetClientSize() const
+ {
+ int w, h;
+ GetClientSize(& w, & h);
+ return wxSize(w, h);
+ }
+
+ wxRect GetClientRect() const
+ {
+ int w, h;
+ GetSize(& w, & h);
+
+ return wxRect(0, 0, w, h);
+ }
+
+ // Convert client to screen coordinates
+ virtual void ClientToScreen(int *x, int *y) const;
+ wxPoint ClientToScreen(const wxPoint& pt) const
{ int x = pt.x; int y = pt.y; ClientToScreen(& x, & y); return wxPoint(x, y); }
- // Convert screen to client coordinates
- virtual void ScreenToClient(int *x, int *y) const;
- wxPoint ScreenToClient(const wxPoint& pt) const
+ // Convert screen to client coordinates
+ virtual void ScreenToClient(int *x, int *y) const;
+ wxPoint ScreenToClient(const wxPoint& pt) const
{ int x = pt.x; int y = pt.y; ScreenToClient(& x, & y); return wxPoint(x, y); }
- // Set the focus to this window
- virtual void SetFocus();
+ // Set the focus to this window
+ virtual void SetFocus();
- // Capture/release mouse
- virtual void CaptureMouse();
- virtual void ReleaseMouse();
+ // Capture/release mouse
+ virtual void CaptureMouse();
+ virtual void ReleaseMouse();
- // Enable or disable the window
- virtual void Enable(bool enable);
+ // Enable or disable the window
+ virtual void Enable(bool enable);
#if wxUSE_DRAG_AND_DROP
- // Associate a drop target with this window (if the window already had a drop
- // target, it's deleted!) and return the current drop target (may be NULL).
- void SetDropTarget(wxDropTarget *pDropTarget);
- wxDropTarget *GetDropTarget() const { return m_pDropTarget; }
+ // Associate a drop target with this window (if the window already had a drop
+ // target, it's deleted!) and return the current drop target (may be NULL).
+ void SetDropTarget(wxDropTarget *pDropTarget);
+ wxDropTarget *GetDropTarget() const { return m_pDropTarget; }
#endif
#if wxUSE_TOOLTIPS
- // tooltips
+ // tooltips
// create a tooltip with this text
- void SetToolTip(const wxString &tip);
+ void SetToolTip(const wxString &tip);
// pointer may be NULL to remove the tooltip
- void SetToolTip(wxToolTip *tooltip);
+ void SetToolTip(wxToolTip *tooltip);
// get the current tooltip (may return NULL if none)
- wxToolTip* GetToolTip() const { return m_tooltip; }
+ wxToolTip* GetToolTip() const { return m_tooltip; }
#endif // wxUSE_TOOLTIPS
- // Accept files for dragging
- virtual void DragAcceptFiles(bool accept);
+ // Accept files for dragging
+ virtual void DragAcceptFiles(bool accept);
- // Update region access
- virtual wxRegion GetUpdateRegion() const;
- virtual bool IsExposed(int x, int y, int w, int h) const;
- virtual bool IsExposed(const wxPoint& pt) const;
- virtual bool IsExposed(const wxRect& rect) const;
+ // Update region access
+ virtual wxRegion GetUpdateRegion() const;
+ virtual bool IsExposed(int x, int y, int w, int h) const;
+ virtual bool IsExposed(const wxPoint& pt) const;
+ virtual bool IsExposed(const wxRect& rect) const;
- // Set/get the window title
- virtual inline void SetTitle(const wxString& WXUNUSED(title)) {};
- inline virtual wxString GetTitle() const { return wxString(""); };
- // Most windows have the concept of a label; for frames, this is the
- // title; for items, this is the label or button text.
- inline virtual wxString GetLabel() const { return GetTitle(); }
+ // Set/get the window title
+ virtual inline void SetTitle(const wxString& WXUNUSED(title)) {};
+ inline virtual wxString GetTitle() const { return wxString(""); };
+ // Most windows have the concept of a label; for frames, this is the
+ // title; for items, this is the label or button text.
+ inline virtual wxString GetLabel() const { return GetTitle(); }
- // Set/get the window name (used for resource setting in X)
- inline virtual wxString GetName() const;
- inline virtual void SetName(const wxString& name);
+ // Set/get the window name (used for resource setting in X)
+ inline virtual wxString GetName() const;
+ inline virtual void SetName(const wxString& name);
- // Centre the window
- virtual void Centre(int direction) ;
- inline void Center(int direction = wxHORIZONTAL) { Centre(direction); }
+ // Centre the window
+ virtual void Centre(int direction) ;
+ inline void Center(int direction = wxHORIZONTAL) { Centre(direction); }
- // Popup a menu
- virtual bool PopupMenu(wxMenu *menu, int x, int y);
+ // Popup a menu
+ virtual bool PopupMenu(wxMenu *menu, int x, int y);
- // Send the window a refresh event
- virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL);
+ // Send the window a refresh event
+ virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL);
#if WXWIN_COMPATIBILITY
- // Set/get scroll attributes
- virtual void SetScrollRange(int orient, int range, bool refresh = TRUE);
- virtual void SetScrollPage(int orient, int page, bool refresh = TRUE);
- virtual int OldGetScrollRange(int orient) const;
- virtual int GetScrollPage(int orient) const;
+ // Set/get scroll attributes
+ virtual void SetScrollRange(int orient, int range, bool refresh = TRUE);
+ virtual void SetScrollPage(int orient, int page, bool refresh = TRUE);
+ virtual int OldGetScrollRange(int orient) const;
+ virtual int GetScrollPage(int orient) const;
#endif
- // New functions that will replace the above.
- virtual void SetScrollbar(int orient, int pos, int thumbVisible,
- int range, bool refresh = TRUE);
-
- virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE);
- virtual int GetScrollPos(int orient) const;
- virtual int GetScrollRange(int orient) const;
- virtual int GetScrollThumb(int orient) const;
-
- virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL);
-
- // Caret manipulation
- virtual void CreateCaret(int w, int h);
- virtual void CreateCaret(const wxBitmap *bitmap);
- virtual void DestroyCaret();
- virtual void ShowCaret(bool show);
- virtual void SetCaretPos(int x, int y);
- virtual void GetCaretPos(int *x, int *y) const;
-
- // Tell window how much it can be sized
- virtual void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1);
-
- // Set/get the window's identifier
- inline int GetId() const;
- inline void SetId(int id);
-
- // Make the window modal (all other windows unresponsive)
- virtual void MakeModal(bool modal);
-
- // Get the private handle (platform-dependent)
- inline void *GetHandle() const;
-
- // Set/get the window's relatives
- inline wxWindow *GetParent() const;
- inline void SetParent(wxWindow *p) ;
- inline wxWindow *GetGrandParent() const;
- inline wxList& GetChildren() const;
- // Set this window to be the child of 'parent'.
- // Returns FALSE it's not possible (some systems
- // won't allow it)
- virtual bool Reparent(wxWindow *parent);
-
- // Set/get the window's font
- virtual void SetFont(const wxFont& f);
- inline virtual wxFont& GetFont() const;
-
- // Set/get the window's validator
- void SetValidator(const wxValidator& validator);
- inline wxValidator *GetValidator() const;
-
- // Set/get the window's style
- inline void SetWindowStyleFlag(long flag);
- inline long GetWindowStyleFlag() const;
-
- // Set/get double-clickability
- // TODO: we probably wish to get rid of this, and
- // always allow double clicks.
- inline void SetDoubleClick(bool flag);
- inline bool GetDoubleClick() const;
- inline void AllowDoubleClick(bool value) { SetDoubleClick(value); }
-
- // Handle a control command
- virtual void OnCommand(wxWindow& win, wxCommandEvent& event);
-
- // Set/get event handler
- inline void SetEventHandler(wxEvtHandler *handler);
- inline wxEvtHandler *GetEventHandler() const;
-
- // Push/pop event handler (i.e. allow a chain of event handlers
- // be searched)
- void PushEventHandler(wxEvtHandler *handler) ;
- wxEvtHandler *PopEventHandler(bool deleteHandler = FALSE) ;
-
- // Close the window by calling OnClose, posting a deletion
- virtual bool Close(bool force = FALSE);
-
- // Destroy the window (delayed, if a managed window)
- virtual bool Destroy() ;
-
- // Mode for telling default OnSize members to
- // call Layout(), if not using Sizers, just top-down constraints
- inline void SetAutoLayout(bool a);
- inline bool GetAutoLayout() const;
-
- // Set/get constraints
- inline wxLayoutConstraints *GetConstraints() const;
- void SetConstraints(wxLayoutConstraints *c);
-
- // Set/get window background colour
- inline virtual void SetBackgroundColour(const wxColour& col);
- inline virtual wxColour GetBackgroundColour() const;
-
- // Set/get window foreground colour
- inline virtual void SetForegroundColour(const wxColour& col);
- inline virtual wxColour GetForegroundColour() const;
-
- // For backward compatibility
- inline virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
- inline virtual void SetLabelFont(const wxFont& font) { SetFont(font); }
- inline virtual wxFont& GetLabelFont() const { return GetFont(); };
- inline virtual wxFont& GetButtonFont() const { return GetFont(); };
-
- // Get the default button, if there is one
- inline virtual wxButton *GetDefaultItem() const;
- inline virtual void SetDefaultItem(wxButton *but);
-
- virtual void SetAcceleratorTable(const wxAcceleratorTable& accel);
- inline virtual wxAcceleratorTable& GetAcceleratorTable() const { return (wxAcceleratorTable&) m_acceleratorTable; }
-
- // Override to define new behaviour for default action (e.g. double clicking
- // on a listbox)
- virtual void OnDefaultAction(wxControl *initiatingItem);
-
- // Resource loading
+ // New functions that will replace the above.
+ virtual void SetScrollbar(int orient, int pos, int thumbVisible,
+ int range, bool refresh = TRUE);
+
+ virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE);
+ virtual int GetScrollPos(int orient) const;
+ virtual int GetScrollRange(int orient) const;
+ virtual int GetScrollThumb(int orient) const;
+
+ virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL);
+
+ // Caret manipulation
+ virtual void CreateCaret(int w, int h);
+ virtual void CreateCaret(const wxBitmap *bitmap);
+ virtual void DestroyCaret();
+ virtual void ShowCaret(bool show);
+ virtual void SetCaretPos(int x, int y);
+ virtual void GetCaretPos(int *x, int *y) const;
+
+ // Tell window how much it can be sized
+ virtual void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1);
+
+ // Set/get the window's identifier
+ inline int GetId() const;
+ inline void SetId(int id);
+
+ // Make the window modal (all other windows unresponsive)
+ virtual void MakeModal(bool modal);
+
+ // Get the private handle (platform-dependent)
+ inline void *GetHandle() const;
+
+ // Set/get the window's relatives
+ inline wxWindow *GetParent() const;
+ inline void SetParent(wxWindow *p) ;
+ inline wxWindow *GetGrandParent() const;
+ inline wxList& GetChildren() const;
+ // Set this window to be the child of 'parent'.
+ // Returns FALSE it's not possible (some systems
+ // won't allow it)
+ virtual bool Reparent(wxWindow *parent);
+
+ // Set/get the window's font
+ virtual void SetFont(const wxFont& f);
+ inline virtual wxFont& GetFont() const;
+
+ // Set/get the window's validator
+ void SetValidator(const wxValidator& validator);
+ inline wxValidator *GetValidator() const;
+
+ // Set/get the window's style
+ inline void SetWindowStyleFlag(long flag);
+ inline long GetWindowStyleFlag() const;
+
+ // Set/get double-clickability
+ // TODO: we probably wish to get rid of this, and
+ // always allow double clicks.
+ inline void SetDoubleClick(bool flag);
+ inline bool GetDoubleClick() const;
+ inline void AllowDoubleClick(bool value) { SetDoubleClick(value); }
+
+ // Handle a control command
+ virtual void OnCommand(wxWindow& win, wxCommandEvent& event);
+
+ // Set/get event handler
+ inline void SetEventHandler(wxEvtHandler *handler);
+ inline wxEvtHandler *GetEventHandler() const;
+
+ // Push/pop event handler (i.e. allow a chain of event handlers
+ // be searched)
+ void PushEventHandler(wxEvtHandler *handler) ;
+ wxEvtHandler *PopEventHandler(bool deleteHandler = FALSE) ;
+
+ // Close the window by calling OnClose, posting a deletion
+ virtual bool Close(bool force = FALSE);
+
+ // Destroy the window (delayed, if a managed window)
+ virtual bool Destroy() ;
+
+ // Mode for telling default OnSize members to
+ // call Layout(), if not using Sizers, just top-down constraints
+ inline void SetAutoLayout(bool a);
+ inline bool GetAutoLayout() const;
+
+ // Set/get constraints
+ inline wxLayoutConstraints *GetConstraints() const;
+ void SetConstraints(wxLayoutConstraints *c);
+
+ // Set/get window background colour
+ inline virtual void SetBackgroundColour(const wxColour& col);
+ inline virtual wxColour GetBackgroundColour() const;
+
+ // Set/get window foreground colour
+ inline virtual void SetForegroundColour(const wxColour& col);
+ inline virtual wxColour GetForegroundColour() const;
+
+ // For backward compatibility
+ inline virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
+ inline virtual void SetLabelFont(const wxFont& font) { SetFont(font); }
+ inline virtual wxFont& GetLabelFont() const { return GetFont(); };
+ inline virtual wxFont& GetButtonFont() const { return GetFont(); };
+
+ // Get the default button, if there is one
+ inline virtual wxButton *GetDefaultItem() const;
+ inline virtual void SetDefaultItem(wxButton *but);
+
+ virtual void SetAcceleratorTable(const wxAcceleratorTable& accel);
+ inline virtual wxAcceleratorTable& GetAcceleratorTable() const { return (wxAcceleratorTable&) m_acceleratorTable; }
+
+ // Override to define new behaviour for default action (e.g. double clicking
+ // on a listbox)
+ virtual void OnDefaultAction(wxControl *initiatingItem);
+
+ // Resource loading
#if wxUSE_WX_RESOURCES
- virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
- virtual wxControl *CreateItem(const wxItemResource* childResource, const wxItemResource* parentResource, const wxResourceTable *table = NULL);
+ virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
+ virtual wxControl *CreateItem(const wxItemResource* childResource, const wxItemResource* parentResource, const wxResourceTable *table = NULL);
#endif
- // Native resource loading
- virtual bool LoadNativeDialog(wxWindow* parent, wxWindowID& id);
- virtual bool LoadNativeDialog(wxWindow* parent, const wxString& name);
- virtual wxWindow* GetWindowChild1(wxWindowID& id);
- virtual wxWindow* GetWindowChild(wxWindowID& id);
+ // Native resource loading
+ virtual bool LoadNativeDialog(wxWindow* parent, wxWindowID& id);
+ virtual bool LoadNativeDialog(wxWindow* parent, const wxString& name);
+ virtual wxWindow* GetWindowChild1(wxWindowID& id);
+ virtual wxWindow* GetWindowChild(wxWindowID& id);
- virtual void GetTextExtent(const wxString& string, int *x, int *y,
- int *descent = NULL,
- int *externalLeading = NULL,
- const wxFont *theFont = NULL, bool use16 = FALSE) const;
+ virtual void GetTextExtent(const wxString& string, int *x, int *y,
+ int *descent = NULL,
+ int *externalLeading = NULL,
+ const wxFont *theFont = NULL, bool use16 = FALSE) const;
- // Is the window retained?
- inline bool IsRetained() const;
+ // Is the window retained?
+ inline bool IsRetained() const;
- // Warp the pointer the given position
- virtual void WarpPointer(int x_pos, int y_pos) ;
+ // Warp the pointer the given position
+ virtual void WarpPointer(int x_pos, int y_pos) ;
- // Clear the window
- virtual void Clear();
+ // Clear the window
+ virtual void Clear();
- // Find a window by id or name
- virtual wxWindow *FindWindow(long id);
- virtual wxWindow *FindWindow(const wxString& name);
+ // Find a window by id or name
+ virtual wxWindow *FindWindow(long id);
+ virtual wxWindow *FindWindow(const wxString& name);
- // Constraint operations
- bool Layout();
- void SetSizer(wxSizer *sizer); // Adds sizer child to this window
- inline wxSizer *GetSizer() const ;
- inline wxWindow *GetSizerParent() const ;
- inline void SetSizerParent(wxWindow *win);
+ // Constraint operations
+ bool Layout();
+ void SetSizer(wxSizer *sizer); // Adds sizer child to this window
+ inline wxSizer *GetSizer() const ;
+ inline wxWindow *GetSizerParent() const ;
+ inline void SetSizerParent(wxWindow *win);
- // Do Update UI processing for controls
- void UpdateWindowUI();
+ // Do Update UI processing for controls
+ void UpdateWindowUI();
- void OnEraseBackground(wxEraseEvent& event);
- void OnKeyDown(wxKeyEvent& event);
- void OnKeyUp(wxKeyEvent& event);
- void OnPaint(wxPaintEvent& event);
- void OnChar(wxKeyEvent& event);
- void OnIdle(wxIdleEvent& event);
+ void OnEraseBackground(wxEraseEvent& event);
+ void OnKeyDown(wxKeyEvent& event);
+ void OnKeyUp(wxKeyEvent& event);
+ void OnPaint(wxPaintEvent& event);
+ void OnChar(wxKeyEvent& event);
+ void OnIdle(wxIdleEvent& event);
- // Does this window want to accept keyboard focus?
- virtual bool AcceptsFocus() const;
+ // Does this window want to accept keyboard focus?
+ virtual bool AcceptsFocus() const;
- virtual void PrepareDC( wxDC& WXUNUSED(dc) ) {};
+ virtual void PrepareDC( wxDC& WXUNUSED(dc) ) {};
public:
- ////////////////////////////////////////////////////////////////////////
- //// IMPLEMENTATION
-
- // For implementation purposes - sometimes decorations make the client area
- // smaller
- virtual wxPoint GetClientAreaOrigin() const;
-
- // Makes an adjustment to the window position (for example, a frame that has
- // a toolbar that it manages itself).
- virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
-
- // Windows subclassing
- void SubclassWin(WXHWND hWnd);
- void UnsubclassWin();
- virtual long Default();
- virtual bool MSWCommand(WXUINT param, WXWORD id);
-
- // returns TRUE if the event was processed
- virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
-
- virtual wxWindow *FindItem(int id) const;
- virtual wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const ;
- virtual void PreDelete(WXHDC dc); // Allows system cleanup
- // TO DO: how many of these need to be virtual?
- virtual WXHWND GetHWND() const ;
- virtual void SetHWND(WXHWND hWnd);
-
- // Make a Windows extended style from the given wxWindows window style
- virtual WXDWORD MakeExtendedStyle(long style, bool eliminateBorders = TRUE);
- // Determine whether 3D effects are wanted
- virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D);
-
- virtual void AddChild(wxWindow *child); // Adds reference to the child object
- virtual void RemoveChild(wxWindow *child); // Removes reference to child
- // (but doesn't delete the child object)
- virtual void DestroyChildren(); // Removes and destroys all children
-
- inline bool IsBeingDeleted();
-
- // MSW only: TRUE if this control is part of the main control
- virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
-
- // Constraint implementation
- void UnsetConstraints(wxLayoutConstraints *c);
- inline wxList *GetConstraintsInvolvedIn() const ;
- // Back-pointer to other windows we're involved with, so if we delete
- // this window, we must delete any constraints we're involved with.
- void AddConstraintReference(wxWindow *otherWin);
- void RemoveConstraintReference(wxWindow *otherWin);
- void DeleteRelatedConstraints();
-
- virtual void ResetConstraints();
- virtual void SetConstraintSizes(bool recurse = TRUE);
- virtual bool LayoutPhase1(int *noChanges);
- virtual bool LayoutPhase2(int *noChanges);
- virtual bool DoPhase(int);
- // Transforms from sizer coordinate space to actual
- // parent coordinate space
- virtual void TransformSizerToActual(int *x, int *y) const ;
-
- // Set size with transformation to actual coordinates if nec.
- virtual void SizerSetSize(int x, int y, int w, int h);
- virtual void SizerMove(int x, int y);
-
- // Only set/get the size/position of the constraint (if any)
- virtual void SetSizeConstraint(int x, int y, int w, int h);
- virtual void MoveConstraint(int x, int y);
- virtual void GetSizeConstraint(int *w, int *h) const ;
- virtual void GetClientSizeConstraint(int *w, int *h) const ;
- virtual void GetPositionConstraint(int *x, int *y) const ;
-
- // Dialog units translations. Implemented in wincmn.cpp.
- wxPoint ConvertPixelsToDialog(const wxPoint& pt) ;
- wxPoint ConvertDialogToPixels(const wxPoint& pt) ;
- inline wxSize ConvertPixelsToDialog(const wxSize& sz)
- { wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
- inline wxSize ConvertDialogToPixels(const wxSize& sz)
- { wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
-
- wxObject *GetChild(int number) const ;
-
- void MSWCreate(int id, wxWindow *parent, const char *wclass, wxWindow *wx_win, const char *title,
- int x, int y, int width, int height,
- WXDWORD style, const char *dialog_template = NULL,
- WXDWORD exendedStyle = 0);
-
- // Actually defined in wx_canvs.cc since requires wxCanvas declaration
- virtual void MSWDeviceToLogical(float *x, float *y) const ;
-
- // Create an appropriate wxWindow from a HWND
- virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd);
-
- // Make sure the window style reflects the HWND style (roughly)
- virtual void AdoptAttributesFromHWND();
-
- // Setup background and foreground colours correctly
- virtual void SetupColours();
-
- // Saves the last message information before calling base version
- virtual bool ProcessEvent(wxEvent& event);
-
- // Handlers
- virtual void MSWOnCreate(WXLPCREATESTRUCT cs);
- virtual bool MSWOnPaint();
- virtual WXHICON MSWOnQueryDragIcon() { return 0; }
- virtual void MSWOnSize(int x, int y, WXUINT flag);
- virtual void MSWOnWindowPosChanging(void *lpPos);
- virtual void MSWOnHScroll(WXWORD nSBCode, WXWORD pos, WXHWND control);
- virtual void MSWOnVScroll(WXWORD nSBCode, WXWORD pos, WXHWND control);
- virtual bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
- virtual long MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam);
- virtual long MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam);
- virtual WXHBRUSH MSWOnCtlColor(WXHDC dc, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
- virtual bool MSWOnColorChange(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
- virtual long MSWOnPaletteChanged(WXHWND hWndPalChange);
- virtual long MSWOnQueryNewPalette();
- virtual bool MSWOnEraseBkgnd(WXHDC pDC);
- virtual void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
- virtual void MSWOnInitMenuPopup(WXHMENU menu, int pos, bool isSystem);
- virtual bool MSWOnClose();
- // Return TRUE to end session, FALSE to veto end session.
- virtual bool MSWOnQueryEndSession(long logOff);
- virtual bool MSWOnEndSession(bool endSession, long logOff);
- virtual bool MSWOnDestroy();
- virtual bool MSWOnSetFocus(WXHWND wnd);
- virtual bool MSWOnKillFocus(WXHWND wnd);
- virtual void MSWOnDropFiles(WXWPARAM wParam);
- virtual bool MSWOnInitDialog(WXHWND hWndFocus);
- virtual void MSWOnShow(bool show, int status);
-
- // TODO: rationalise these functions into 1 or 2 which take the
- // event type as argument.
- virtual void MSWOnLButtonDown(int x, int y, WXUINT flags);
- virtual void MSWOnLButtonUp(int x, int y, WXUINT flags);
- virtual void MSWOnLButtonDClick(int x, int y, WXUINT flags);
-
- virtual void MSWOnMButtonDown(int x, int y, WXUINT flags);
- virtual void MSWOnMButtonUp(int x, int y, WXUINT flags);
- virtual void MSWOnMButtonDClick(int x, int y, WXUINT flags);
-
- virtual void MSWOnRButtonDown(int x, int y, WXUINT flags);
- virtual void MSWOnRButtonUp(int x, int y, WXUINT flags);
- virtual void MSWOnRButtonDClick(int x, int y, WXUINT flags);
-
- virtual void MSWOnMouseMove(int x, int y, WXUINT flags);
- virtual void MSWOnMouseEnter(int x, int y, WXUINT flags);
- virtual void MSWOnMouseLeave(int x, int y, WXUINT flags);
-
- // These return TRUE if an event handler was found, FALSE otherwise (not processed)
- virtual bool MSWOnChar(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE);
- virtual bool MSWOnKeyDown(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE);
- virtual bool MSWOnKeyUp(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE);
-
- virtual bool MSWOnActivate(int flag, bool minimized, WXHWND activate);
- virtual long MSWOnMDIActivate(long flag, WXHWND activate, WXHWND deactivate);
-
- virtual bool MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *item);
- virtual bool MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *item);
-
- virtual void MSWOnJoyDown(int joystick, int x, int y, WXUINT flags);
- virtual void MSWOnJoyUp(int joystick, int x, int y, WXUINT flags);
- virtual void MSWOnJoyMove(int joystick, int x, int y, WXUINT flags);
- virtual void MSWOnJoyZMove(int joystick, int z, WXUINT flags);
-
- virtual long MSWGetDlgCode();
-
- // Window procedure
- virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
-
- // Calls an appropriate default window procedure
- virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
- virtual bool MSWProcessMessage(WXMSG* pMsg);
- virtual bool MSWTranslateMessage(WXMSG* pMsg);
- virtual void MSWDestroyWindow();
-
- // Detach "Window" menu from menu bar so it doesn't get deleted
- void MSWDetachWindowMenu();
-
- inline WXFARPROC MSWGetOldWndProc() const;
- inline void MSWSetOldWndProc(WXFARPROC proc);
-
- // Define for each class of dialog and control
- virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
- WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
-
- inline void SetShowing(bool show);
- inline bool IsUserEnabled() const;
- inline bool GetUseCtl3D() const ;
- inline bool GetTransparentBackground() const ;
-
- // Responds to colour changes: passes event on to children.
- void OnSysColourChanged(wxSysColourChangedEvent& event);
-
- // Transfers data to any child controls
- void OnInitDialog(wxInitDialogEvent& event);
-
- // Sends an OnInitDialog event, which in turns transfers data to
- // to the window via validators.
- virtual void InitDialog();
-
- ////////////////////////////////////////////////////////////////////////
- //// PROTECTED DATA
+ ////////////////////////////////////////////////////////////////////////
+ //// IMPLEMENTATION
+
+ // For implementation purposes - sometimes decorations make the client area
+ // smaller
+ virtual wxPoint GetClientAreaOrigin() const;
+
+ // Makes an adjustment to the window position (for example, a frame that has
+ // a toolbar that it manages itself).
+ virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
+
+ // Windows subclassing
+ void SubclassWin(WXHWND hWnd);
+ void UnsubclassWin();
+ virtual long Default();
+ virtual bool MSWCommand(WXUINT param, WXWORD id);
+
+ // returns TRUE if the event was processed
+ virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result);
+
+ virtual wxWindow *FindItem(int id) const;
+ virtual wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const ;
+ virtual void PreDelete(WXHDC dc); // Allows system cleanup
+ // TO DO: how many of these need to be virtual?
+ virtual WXHWND GetHWND() const ;
+ virtual void SetHWND(WXHWND hWnd);
+
+ // Make a Windows extended style from the given wxWindows window style
+ virtual WXDWORD MakeExtendedStyle(long style, bool eliminateBorders = TRUE);
+ // Determine whether 3D effects are wanted
+ virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D);
+
+ virtual void AddChild(wxWindow *child); // Adds reference to the child object
+ virtual void RemoveChild(wxWindow *child); // Removes reference to child
+ // (but doesn't delete the child object)
+ virtual void DestroyChildren(); // Removes and destroys all children
+
+ inline bool IsBeingDeleted();
+
+ // MSW only: TRUE if this control is part of the main control
+ virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
+
+ // Constraint implementation
+ void UnsetConstraints(wxLayoutConstraints *c);
+ inline wxList *GetConstraintsInvolvedIn() const ;
+ // Back-pointer to other windows we're involved with, so if we delete
+ // this window, we must delete any constraints we're involved with.
+ void AddConstraintReference(wxWindow *otherWin);
+ void RemoveConstraintReference(wxWindow *otherWin);
+ void DeleteRelatedConstraints();
+
+ virtual void ResetConstraints();
+ virtual void SetConstraintSizes(bool recurse = TRUE);
+ virtual bool LayoutPhase1(int *noChanges);
+ virtual bool LayoutPhase2(int *noChanges);
+ virtual bool DoPhase(int);
+ // Transforms from sizer coordinate space to actual
+ // parent coordinate space
+ virtual void TransformSizerToActual(int *x, int *y) const ;
+
+ // Set size with transformation to actual coordinates if nec.
+ virtual void SizerSetSize(int x, int y, int w, int h);
+ virtual void SizerMove(int x, int y);
+
+ // Only set/get the size/position of the constraint (if any)
+ virtual void SetSizeConstraint(int x, int y, int w, int h);
+ virtual void MoveConstraint(int x, int y);
+ virtual void GetSizeConstraint(int *w, int *h) const ;
+ virtual void GetClientSizeConstraint(int *w, int *h) const ;
+ virtual void GetPositionConstraint(int *x, int *y) const ;
+
+ // Dialog units translations. Implemented in wincmn.cpp.
+ wxPoint ConvertPixelsToDialog(const wxPoint& pt) ;
+ wxPoint ConvertDialogToPixels(const wxPoint& pt) ;
+ inline wxSize ConvertPixelsToDialog(const wxSize& sz)
+ { wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
+ inline wxSize ConvertDialogToPixels(const wxSize& sz)
+ { wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); }
+
+ wxObject *GetChild(int number) const ;
+
+ void MSWCreate(int id, wxWindow *parent, const char *wclass, wxWindow *wx_win, const char *title,
+ int x, int y, int width, int height,
+ WXDWORD style, const char *dialog_template = NULL,
+ WXDWORD exendedStyle = 0);
+
+ // Actually defined in wx_canvs.cc since requires wxCanvas declaration
+ virtual void MSWDeviceToLogical(float *x, float *y) const ;
+
+ // Create an appropriate wxWindow from a HWND
+ virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd);
+
+ // Make sure the window style reflects the HWND style (roughly)
+ virtual void AdoptAttributesFromHWND();
+
+ // Setup background and foreground colours correctly
+ virtual void SetupColours();
+
+ // Saves the last message information before calling base version
+ virtual bool ProcessEvent(wxEvent& event);
+
+ // Handlers
+ virtual void MSWOnCreate(WXLPCREATESTRUCT cs);
+ virtual bool MSWOnPaint();
+ virtual WXHICON MSWOnQueryDragIcon() { return 0; }
+ virtual void MSWOnSize(int x, int y, WXUINT flag);
+ virtual void MSWOnWindowPosChanging(void *lpPos);
+ virtual void MSWOnHScroll(WXWORD nSBCode, WXWORD pos, WXHWND control);
+ virtual void MSWOnVScroll(WXWORD nSBCode, WXWORD pos, WXHWND control);
+ virtual bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
+ virtual long MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam);
+ virtual long MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam);
+ virtual WXHBRUSH MSWOnCtlColor(WXHDC dc, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+ virtual bool MSWOnColorChange(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+ virtual long MSWOnPaletteChanged(WXHWND hWndPalChange);
+ virtual long MSWOnQueryNewPalette();
+ virtual bool MSWOnEraseBkgnd(WXHDC pDC);
+ virtual void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
+ virtual void MSWOnInitMenuPopup(WXHMENU menu, int pos, bool isSystem);
+ virtual bool MSWOnClose();
+ // Return TRUE to end session, FALSE to veto end session.
+ virtual bool MSWOnQueryEndSession(long logOff);
+ virtual bool MSWOnEndSession(bool endSession, long logOff);
+ virtual bool MSWOnDestroy();
+ virtual bool MSWOnSetFocus(WXHWND wnd);
+ virtual bool MSWOnKillFocus(WXHWND wnd);
+ virtual void MSWOnDropFiles(WXWPARAM wParam);
+ virtual bool MSWOnInitDialog(WXHWND hWndFocus);
+ virtual void MSWOnShow(bool show, int status);
+
+ // TODO: rationalise these functions into 1 or 2 which take the
+ // event type as argument.
+ virtual void MSWOnLButtonDown(int x, int y, WXUINT flags);
+ virtual void MSWOnLButtonUp(int x, int y, WXUINT flags);
+ virtual void MSWOnLButtonDClick(int x, int y, WXUINT flags);
+
+ virtual void MSWOnMButtonDown(int x, int y, WXUINT flags);
+ virtual void MSWOnMButtonUp(int x, int y, WXUINT flags);
+ virtual void MSWOnMButtonDClick(int x, int y, WXUINT flags);
+
+ virtual void MSWOnRButtonDown(int x, int y, WXUINT flags);
+ virtual void MSWOnRButtonUp(int x, int y, WXUINT flags);
+ virtual void MSWOnRButtonDClick(int x, int y, WXUINT flags);
+
+ virtual void MSWOnMouseMove(int x, int y, WXUINT flags);
+ virtual void MSWOnMouseEnter(int x, int y, WXUINT flags);
+ virtual void MSWOnMouseLeave(int x, int y, WXUINT flags);
+
+ // These return TRUE if an event handler was found, FALSE otherwise (not processed)
+ virtual bool MSWOnChar(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE);
+ virtual bool MSWOnKeyDown(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE);
+ virtual bool MSWOnKeyUp(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE);
+
+ virtual bool MSWOnActivate(int flag, bool minimized, WXHWND activate);
+ virtual long MSWOnMDIActivate(long flag, WXHWND activate, WXHWND deactivate);
+
+ virtual bool MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *item);
+ virtual bool MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *item);
+
+ virtual void MSWOnJoyDown(int joystick, int x, int y, WXUINT flags);
+ virtual void MSWOnJoyUp(int joystick, int x, int y, WXUINT flags);
+ virtual void MSWOnJoyMove(int joystick, int x, int y, WXUINT flags);
+ virtual void MSWOnJoyZMove(int joystick, int z, WXUINT flags);
+
+ virtual long MSWGetDlgCode();
+
+ // Window procedure
+ virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+
+ // Calls an appropriate default window procedure
+ virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+ virtual bool MSWProcessMessage(WXMSG* pMsg);
+ virtual bool MSWTranslateMessage(WXMSG* pMsg);
+ virtual void MSWDestroyWindow();
+
+ // Detach "Window" menu from menu bar so it doesn't get deleted
+ void MSWDetachWindowMenu();
+
+ inline WXFARPROC MSWGetOldWndProc() const;
+ inline void MSWSetOldWndProc(WXFARPROC proc);
+
+ // Define for each class of dialog and control
+ virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
+
+ inline void SetShowing(bool show);
+ inline bool IsUserEnabled() const;
+ inline bool GetUseCtl3D() const ;
+ inline bool GetTransparentBackground() const ;
+
+ // Responds to colour changes: passes event on to children.
+ void OnSysColourChanged(wxSysColourChangedEvent& event);
+
+ // Transfers data to any child controls
+ void OnInitDialog(wxInitDialogEvent& event);
+
+ // Sends an OnInitDialog event, which in turns transfers data to
+ // to the window via validators.
+ virtual void InitDialog();
+
+ ////////////////////////////////////////////////////////////////////////
+ //// PROTECTED DATA
protected:
- wxAcceleratorTable m_acceleratorTable;
- int m_windowId;
- long m_windowStyle; // Store the window's style
- wxEvtHandler * m_windowEventHandler; // Usually is 'this'
- wxLayoutConstraints * m_constraints; // Constraints for this window
- wxList * m_constraintsInvolvedIn; // List of constraints we're involved in
- wxSizer * m_windowSizer; // Window's top-level sizer (if any)
- wxWindow * m_sizerParent; // Window's parent sizer (if any)
- bool m_autoLayout; // Whether to call Layout() in OnSize
- wxWindow * m_windowParent; // Each window always knows its parent
- wxValidator * m_windowValidator;
- // Old window proc, for subclassed controls
- WXFARPROC m_oldWndProc;
- bool m_useCtl3D; // Using CTL3D for this control
-
- bool m_inOnSize; // Protection against OnSize reentry
+ wxAcceleratorTable m_acceleratorTable;
+ int m_windowId;
+ long m_windowStyle; // Store the window's style
+ wxEvtHandler * m_windowEventHandler; // Usually is 'this'
+ wxLayoutConstraints * m_constraints; // Constraints for this window
+ wxList * m_constraintsInvolvedIn; // List of constraints we're involved in
+ wxSizer * m_windowSizer; // Window's top-level sizer (if any)
+ wxWindow * m_sizerParent; // Window's parent sizer (if any)
+ bool m_autoLayout; // Whether to call Layout() in OnSize
+ wxWindow * m_windowParent; // Each window always knows its parent
+ wxValidator * m_windowValidator;
+ // Old window proc, for subclassed controls
+ WXFARPROC m_oldWndProc;
+ bool m_useCtl3D; // Using CTL3D for this control
+
+ bool m_inOnSize; // Protection against OnSize reentry
#ifndef _WX_WIN32__
- // Pointer to global memory, for EDIT controls that need
- // special treatment to reduce USER area consumption.
- WXHGLOBAL m_globalHandle;
+ // Pointer to global memory, for EDIT controls that need
+ // special treatment to reduce USER area consumption.
+ WXHGLOBAL m_globalHandle;
#endif
- bool m_winEnabled;
- int m_minSizeX;
- int m_minSizeY;
- int m_maxSizeX;
- int m_maxSizeY;
-
- // Caret data
- int m_caretWidth;
- int m_caretHeight;
- bool m_caretEnabled;
- bool m_caretShown;
- wxFont m_windowFont; // Window's font
- bool m_isShown;
- bool m_doubleClickAllowed ;
- wxCursor m_windowCursor; // Window's cursor
- bool m_winCaptured;
- wxString m_windowName; // Window name
+ bool m_winEnabled;
+ int m_minSizeX;
+ int m_minSizeY;
+ int m_maxSizeX;
+ int m_maxSizeY;
+
+ // Caret data
+ int m_caretWidth;
+ int m_caretHeight;
+ bool m_caretEnabled;
+ bool m_caretShown;
+ wxFont m_windowFont; // Window's font
+ bool m_isShown;
+ bool m_doubleClickAllowed ;
+ wxCursor m_windowCursor; // Window's cursor
+ bool m_winCaptured;
+ wxString m_windowName; // Window name
#if wxUSE_EXTENDED_STATICS
- wxList m_staticItems;
+ wxList m_staticItems;
#endif
- wxButton * m_defaultItem;
- wxColour m_backgroundColour ;
- wxColour m_foregroundColour ;
- bool m_backgroundTransparent;
+ wxButton * m_defaultItem;
+ wxColour m_backgroundColour ;
+ wxColour m_foregroundColour ;
+ bool m_backgroundTransparent;
- int m_xThumbSize;
- int m_yThumbSize;
+ int m_xThumbSize;
+ int m_yThumbSize;
- float m_lastXPos;
- float m_lastYPos;
- int m_lastEvent;
+ float m_lastXPos;
+ float m_lastYPos;
+ int m_lastEvent;
- bool m_mouseInWindow;
+ bool m_mouseInWindow;
#if wxUSE_DRAG_AND_DROP
- wxDropTarget *m_pDropTarget; // the current drop target or NULL
+ wxDropTarget *m_pDropTarget; // the current drop target or NULL
#endif //USE_DRAG_AND_DROP
public:
- WXHWND m_hWnd; // MS Windows window handle
- WXUINT m_lastMsg;
- WXWPARAM m_lastWParam;
- WXLPARAM m_lastLParam;
-
- wxRegion m_updateRegion;
-/*
- wxRect m_updateRect; // Bounding box for screen damage area
+ WXHWND m_hWnd; // MS Windows window handle
+ WXUINT m_lastMsg;
+ WXWPARAM m_lastWParam;
+ WXLPARAM m_lastLParam;
+
+ wxRegion m_updateRegion;
+ /*
+ wxRect m_updateRect; // Bounding box for screen damage area
#ifdef __WIN32__
- WXHRGN m_updateRgn; // NT allows access to the rectangle list
+WXHRGN m_updateRgn; // NT allows access to the rectangle list
#endif
-*/
-
-// WXHANDLE m_acceleratorTable;
- WXHMENU m_hMenu; // Menu, if any
- wxList * m_children; // Window's children
- int m_returnCode;
- bool m_isBeingDeleted; // Fudge because can't access parent
- // when being deleted
+ */
+
+ // WXHANDLE m_acceleratorTable;
+ WXHMENU m_hMenu; // Menu, if any
+ wxList * m_children; // Window's children
+ int m_returnCode;
+ bool m_isBeingDeleted; // Fudge because can't access parent
+ // when being deleted
+
+ // this is the virtual function to be overriden in any derived class which
+ // wants to change how SetSize() or Move() works - it is called by all
+ // versions of these functions in the base class
+ virtual void DoSetSize(int x, int y,
+ int width, int height,
+ int sizeFlags = wxSIZE_AUTO);
+
+ // same as DoSetSize() for the client size
+ virtual void DoSetClientSize(int width, int height);
private:
// common part of all ctors
wxInputStream *wxFTP::GetInputStream(const wxString& path)
{
wxString tmp_str;
- size_t calc_size;
if (!SendCommand("TYPE I", '2'))
return NULL;
GetChildren().DeleteObject(child);
}
-void wxSizer::SetSize(int x, int y, int w, int h, int WXUNUSED(flags))
+void wxSizer::DoSetSize(int x, int y, int w, int h, int WXUNUSED(flags))
{
wxLayoutConstraints *constr = GetConstraints();
if (x != -1)
{
}
-void wxRowColSizer::SetSize(int x, int y, int w, int h, int flags)
-{
- wxSizer::SetSize(x, y, w, h, flags);
-}
-
bool wxRowColSizer::LayoutPhase1(int *noChanges)
{
*noChanges = 0;
// make life easier for people using VC++ IDE: clicking on the message will
// take us immediately to the place of the failed assert
#ifdef __VISUALC__
- sprintf(szBuf, _("%s(%d): assert failed"), szFile, nLine);
+ sprintf(szBuf, "%s(%d): assert failed", szFile, nLine);
#else // !VC++
// make the error message more clear for all the others
- sprintf(szBuf, _("Assert failed in file %s at line %d"), szFile, nLine);
+ sprintf(szBuf, "Assert failed in file %s at line %d", szFile, nLine);
#endif // VC/!VC
if ( szMsg != NULL ) {
#if wxUSE_NOGUI
Trap();
#else
- strcat(szBuf, _("\nDo you want to stop the program?"
- "\nYou can also choose [Cancel] to suppress "
- "further warnings."));
+ strcat(szBuf, "\nDo you want to stop the program?"
+ "\nYou can also choose [Cancel] to suppress "
+ "further warnings.");
switch ( wxMessageBox(szBuf, _("Debug"),
wxYES_NO | wxCANCEL | wxICON_STOP ) ) {
m_serialObj->LoadObject(stream);
}
-#endif
+#endif // wxUSE_SERIAL
/*
* wxObject: cloning of objects
#include "wx/utils.h"
#include "wx/intl.h"
#include "wx/wx.h"
+#include "wx/dynarray.h"
#endif
#ifndef __WIN16__
}
}
-void wxDialog::SetSize( int x, int y, int width, int height, int sizeFlags )
+void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid dialog" );
wxASSERT_MSG( (m_wxwindow != NULL), "invalid dialog" );
m_resizing = FALSE;
}
-void wxDialog::SetSize( int width, int height )
-{
- SetSize( -1, -1, width, height, wxSIZE_USE_EXISTING );
-}
-
void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height )
{
// due to a bug in gtk, x,y are always 0
{
int style = dialog->GetStyle();
- if ((style&wxSAVE)&&(style&wxOVERWRITE_PROMPT))
- {
- char *filename = gtk_file_selection_get_filename(
- GTK_FILE_SELECTION(dialog->m_widget) );
+ GtkFileSelection *filedlg = GTK_FILE_SELECTION(dialog->m_widget);
+ char *filename = gtk_file_selection_get_filename(filedlg);
+ if ( (style & wxSAVE) && ( style & wxOVERWRITE_PROMPT ) )
+ {
if (wxFileExists( filename ))
{
wxString msg;
return;
}
}
+ else if ( (style & wxOPEN) && ( style & wxFILE_MUST_EXIST) )
+ {
+ if ( !wxFileExists( filename ) )
+ {
+ wxMessageBox(_("Please choose an existing file."), _("Error"), wxOK);
+
+ return;
+ }
+ }
- dialog->SetPath( gtk_file_selection_get_filename( GTK_FILE_SELECTION(dialog->m_widget) ) );
+ dialog->SetPath( filename );
- wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_OK);
+ wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event );
}
static
void gtk_filedialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFileDialog *dialog )
{
- wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL);
+ wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event );
}
return pt;
}
-void wxFrame::SetSize( int x, int y, int width, int height, int sizeFlags )
+void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
m_resizing = FALSE;
}
-void wxFrame::SetSize( int width, int height )
-{
- SetSize( -1, -1, width, height, wxSIZE_USE_EXISTING );
-}
-
void wxFrame::Centre( int direction )
{
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
}
}
-void wxFrame::SetClientSize( int width, int height )
+void wxFrame::DoSetClientSize( int width, int height )
{
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
#ifdef __GNUG__
-#pragma implementation "window.h"
+ #pragma implementation "window.h"
#endif
#include "wx/defs.h"
#include "wx/utils.h"
#include "wx/dialog.h"
#include "wx/msgdlg.h"
+
#if wxUSE_DRAG_AND_DROP
-#include "wx/dnd.h"
+ #include "wx/dnd.h"
#endif
+
#if wxUSE_TOOLTIPS
-#include "wx/tooltip.h"
+ #include "wx/tooltip.h"
#endif
+
#include "wx/menu.h"
#include "wx/statusbr.h"
#include "wx/intl.h"
}
}
-void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
+void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxASSERT_MSG( (m_parent != NULL), "wxWindow::SetSize requires parent.\n" );
UpdateWindowUI();
}
-void wxWindow::SetSize( int width, int height )
-{
- SetSize( -1, -1, width, height, wxSIZE_USE_EXISTING );
-}
-
-void wxWindow::Move( int x, int y )
-{
- SetSize( x, y, -1, -1, wxSIZE_USE_EXISTING );
-}
-
void wxWindow::GetSize( int *width, int *height ) const
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
if (height) (*height) = m_height;
}
-void wxWindow::SetClientSize( int width, int height )
+void wxWindow::DoSetClientSize( int width, int height )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
}
}
-void wxDialog::SetSize( int x, int y, int width, int height, int sizeFlags )
+void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid dialog" );
wxASSERT_MSG( (m_wxwindow != NULL), "invalid dialog" );
m_resizing = FALSE;
}
-void wxDialog::SetSize( int width, int height )
-{
- SetSize( -1, -1, width, height, wxSIZE_USE_EXISTING );
-}
-
void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height )
{
// due to a bug in gtk, x,y are always 0
{
int style = dialog->GetStyle();
- if ((style&wxSAVE)&&(style&wxOVERWRITE_PROMPT))
- {
- char *filename = gtk_file_selection_get_filename(
- GTK_FILE_SELECTION(dialog->m_widget) );
+ GtkFileSelection *filedlg = GTK_FILE_SELECTION(dialog->m_widget);
+ char *filename = gtk_file_selection_get_filename(filedlg);
+ if ( (style & wxSAVE) && ( style & wxOVERWRITE_PROMPT ) )
+ {
if (wxFileExists( filename ))
{
wxString msg;
return;
}
}
+ else if ( (style & wxOPEN) && ( style & wxFILE_MUST_EXIST) )
+ {
+ if ( !wxFileExists( filename ) )
+ {
+ wxMessageBox(_("Please choose an existing file."), _("Error"), wxOK);
+
+ return;
+ }
+ }
- dialog->SetPath( gtk_file_selection_get_filename( GTK_FILE_SELECTION(dialog->m_widget) ) );
+ dialog->SetPath( filename );
- wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_OK);
+ wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event );
}
static
void gtk_filedialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFileDialog *dialog )
{
- wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL);
+ wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event );
}
return pt;
}
-void wxFrame::SetSize( int x, int y, int width, int height, int sizeFlags )
+void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
m_resizing = FALSE;
}
-void wxFrame::SetSize( int width, int height )
-{
- SetSize( -1, -1, width, height, wxSIZE_USE_EXISTING );
-}
-
void wxFrame::Centre( int direction )
{
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
}
}
-void wxFrame::SetClientSize( int width, int height )
+void wxFrame::DoSetClientSize( int width, int height )
{
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
#ifdef __GNUG__
-#pragma implementation "window.h"
+ #pragma implementation "window.h"
#endif
#include "wx/defs.h"
#include "wx/utils.h"
#include "wx/dialog.h"
#include "wx/msgdlg.h"
+
#if wxUSE_DRAG_AND_DROP
-#include "wx/dnd.h"
+ #include "wx/dnd.h"
#endif
+
#if wxUSE_TOOLTIPS
-#include "wx/tooltip.h"
+ #include "wx/tooltip.h"
#endif
+
#include "wx/menu.h"
#include "wx/statusbr.h"
#include "wx/intl.h"
}
}
-void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
+void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxASSERT_MSG( (m_parent != NULL), "wxWindow::SetSize requires parent.\n" );
UpdateWindowUI();
}
-void wxWindow::SetSize( int width, int height )
-{
- SetSize( -1, -1, width, height, wxSIZE_USE_EXISTING );
-}
-
-void wxWindow::Move( int x, int y )
-{
- SetSize( x, y, -1, -1, wxSIZE_USE_EXISTING );
-}
-
void wxWindow::GetSize( int *width, int *height ) const
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
if (height) (*height) = m_height;
}
-void wxWindow::SetClientSize( int width, int height )
+void wxWindow::DoSetClientSize( int width, int height )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
// TODO
}
-void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxBitmapCheckBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
// TODO
}
XmProcessTraversal(XtParent((Widget)m_mainWidget), XmTRAVERSE_CURRENT);
}
-void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxChoice::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
XtVaSetValues((Widget) m_formWidget, XmNresizePolicy, XmRESIZE_ANY, NULL);
bool managed = XtIsManaged((Widget) m_formWidget);
XtManageChild ((Widget) m_formWidget);
XtVaSetValues((Widget) m_formWidget, XmNresizePolicy, XmRESIZE_NONE, NULL);
- wxControl::SetSize (x, y, width, height, sizeFlags);
+ wxControl::DoSetSize (x, y, width, height, sizeFlags);
}
wxString wxChoice::GetStringSelection () const
m_mainWidget = (WXWidget) 0;
}
-void wxComboBox::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxComboBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
// Necessary so it doesn't call wxChoice::SetSize
- wxWindow::SetSize(x, y, width, height, sizeFlags);
+ wxWindow::DoSetSize(x, y, width, height, sizeFlags);
}
wxString wxComboBox::GetValue() const
return FALSE;
}
-void wxDialog::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxDialog::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
XtVaSetValues((Widget) m_mainWidget, XmNresizePolicy, XmRESIZE_ANY, NULL);
- wxWindow::SetSize(x, y, width, height, sizeFlags);
+ wxWindow::DoSetSize(x, y, width, height, sizeFlags);
XtVaSetValues((Widget) m_mainWidget, XmNresizePolicy, XmRESIZE_NONE, NULL);
}
-void wxDialog::SetClientSize(int width, int height)
-{
- SetSize(-1, -1, width, height);
-}
-
-
void wxDialog::SetTitle(const wxString& title)
{
m_dialogTitle = title;
// Set the client size (i.e. leave the calculation of borders etc.
// to wxWindows)
-void wxFrame::SetClientSize(int width, int height)
+void wxFrame::DoSetClientSize(int width, int height)
{
// Calculate how large the new main window should be
// by finding the difference between the client area and the
if (y) *y = yy;
}
-void wxFrame::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
if (x > -1)
XtVaSetValues((Widget) m_frameShell, XmNx, x, NULL);
return TRUE;
}
-void wxGauge::SetSize(int x, int y, int width, int height, int sizeFlags)
-{
- wxControl::SetSize(x, y, width, height, sizeFlags);
-}
-
void wxGauge::SetShadowWidth(int w)
{
if (w == 0)
return wxEmptyString;
}
-void wxListBox::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxListBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
- wxWindow::SetSize(x, y, width, height, sizeFlags);
+ wxWindow::DoSetSize(x, y, width, height, sizeFlags);
// Check resulting size is correct
int tempW, tempH;
m_clientWindow = NULL;
}
-// Get size *available for subwindows* i.e. excluding menu bar.
-void wxMDIParentFrame::GetClientSize(int *x, int *y) const
-{
- wxFrame::GetClientSize(x, y);
-}
-
void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar)
{
m_frameMenuBar = menu_bar;
// to wxWindows)
void wxMDIChildFrame::SetClientSize(int width, int height)
{
- wxWindow::SetClientSize(width, height);
+ wxWindow::DoSetClientSize(width, height);
}
void wxMDIChildFrame::GetClientSize(int* width, int* height) const
wxWindow::GetSize(width, height);
}
-void wxMDIChildFrame::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxMDIChildFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
- wxWindow::SetSize(x, y, width, height, sizeFlags);
+ wxWindow::DoSetSize(x, y, width, height, sizeFlags);
}
void wxMDIChildFrame::GetSize(int* width, int* height) const
return FALSE;
}
-void wxMDIClientWindow::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxMDIClientWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
- wxWindow::SetSize(x, y, width, height, sizeFlags);
+ wxWindow::DoSetSize(x, y, width, height, sizeFlags);
}
-void wxMDIClientWindow::SetClientSize(int width, int height)
+void wxMDIClientWindow::DoSetClientSize(int width, int height)
{
- wxWindow::SetClientSize(width, height);
+ wxWindow::DoSetClientSize(width, height);
}
void wxMDIClientWindow::GetClientSize(int *width, int *height) const
return m_radioButtonLabels[n];
}
-void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
bool managed = XtIsManaged((Widget) m_formWidget);
wxControl::GetSize(width, height);
}
-void wxSlider::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxSlider::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
Widget widget = (Widget) m_mainWidget;
SetBitmap(wxNullBitmap);
}
-void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags)
-{
- wxControl::SetSize(x, y, width, height, sizeFlags);
-}
-
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
{
m_messageBitmap = bitmap;
}
}
-void wxStaticBox::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxStaticBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
- wxControl::SetSize (x, y, width, height, sizeFlags);
+ wxControl::DoSetSize (x, y, width, height, sizeFlags);
if (m_labelWidget)
{
return TRUE;
}
-void wxButton::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxButton::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
SetWindowText((HWND)GetHWND(), label);
}
-void wxCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxCheckBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
#define BST_CHECKED 0x0001
#endif
-bool wxCheckBox::GetValue(void) const
+bool wxCheckBox::GetValue() const
{
#ifdef __WIN32__
return (SendMessage((HWND) GetHWND(), BM_GETCHECK, 0, 0) == BST_CHECKED);
{
}
-void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxBitmapCheckBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
SendMessage((HWND) GetHWND(), BM_SETCHECK, val, 0);
}
-bool wxBitmapCheckBox::GetValue(void) const
+bool wxBitmapCheckBox::GetValue() const
{
return ((0x003 & SendMessage((HWND) GetHWND(), BM_GETCHECK, 0, 0)) == 0x003);
}
return wxString(wxBuffer);
}
-void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxChoice::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
bool wxFrame::m_useNativeStatusBar = FALSE;
#endif
-wxFrame::wxFrame(void)
+wxFrame::wxFrame()
{
m_frameToolBar = NULL ;
m_frameMenuBar = NULL;
return TRUE;
}
-wxFrame::~wxFrame(void)
+wxFrame::~wxFrame()
{
m_isBeingDeleted = TRUE;
wxTopLevelWindows.DeleteObject(this);
::BringWindowToTop((HWND) GetParent()->GetHWND());
}
-WXHMENU wxFrame::GetWinMenu(void) const
+WXHMENU wxFrame::GetWinMenu() const
{
return m_hMenu;
}
// Set the client size (i.e. leave the calculation of borders etc.
// to wxWindows)
-void wxFrame::SetClientSize(int width, int height)
+void wxFrame::DoSetClientSize(int width, int height)
{
HWND hWnd = (HWND) GetHWND();
*y = point.y;
}
-void wxFrame::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
int x1 = x;
m_iconized = FALSE;
}
-bool wxFrame::IsIconized(void) const
+bool wxFrame::IsIconized() const
{
((wxFrame *)this)->m_iconized = (::IsIconic((HWND) GetHWND()) != 0);
return m_iconized;
}
// Is it maximized?
-bool wxFrame::IsMaximized(void) const
+bool wxFrame::IsMaximized() const
{
return (::IsZoomed((HWND) GetHWND()) != 0) ;
}
SetWindowText((HWND) GetHWND(), (const char *)title);
}
-wxString wxFrame::GetTitle(void) const
+wxString wxFrame::GetTitle() const
{
GetWindowText((HWND) GetHWND(), wxBuffer, 1000);
return wxString(wxBuffer);
PositionStatusBar();
}
-void wxFrame::PositionStatusBar(void)
+void wxFrame::PositionStatusBar()
{
// native status bar positions itself
if (m_frameStatusBar
}
#endif
-void wxFrame::Fit(void)
+void wxFrame::Fit()
{
// Work out max. size
wxNode *node = GetChildren().First();
::PostMessage((HWND) GetHWND(), WM_SIZE, SIZE_RESTORED, MAKELPARAM(width, height));
}
-bool wxFrame::MSWOnPaint(void)
+bool wxFrame::MSWOnPaint()
{
RECT rect;
if (GetUpdateRect((HWND) GetHWND(), &rect, FALSE))
return 1;
}
-WXHICON wxFrame::MSWOnQueryDragIcon(void)
+WXHICON wxFrame::MSWOnQueryDragIcon()
{
if (m_icon.Ok() && (m_icon.GetHICON() != 0))
return m_icon.GetHICON();
}
}
-bool wxFrame::MSWOnClose(void)
+bool wxFrame::MSWOnClose()
{
return Close();
}
}
// Destroy the window (delayed, if a managed window)
-bool wxFrame::Destroy(void)
+bool wxFrame::Destroy()
{
if (!wxPendingDelete.Member(this))
wxPendingDelete.Append(this);
}
}
-wxMenuBar *wxFrame::GetMenuBar(void) const
+wxMenuBar *wxFrame::GetMenuBar() const
{
return m_frameMenuBar;
}
return new wxToolBar(this, id, wxDefaultPosition, wxDefaultSize, style, name);
}
-void wxFrame::PositionToolBar(void)
+void wxFrame::PositionToolBar()
{
RECT rect;
::GetClientRect((HWND) GetHWND(), &rect);
return TRUE;
}
-void wxGauge95::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxGauge95::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
return TRUE;
}
-void wxGaugeMSW::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxGaugeMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
}
// Listbox item
-wxListBox::wxListBox(void)
+wxListBox::wxListBox()
{
m_noItems = 0;
m_selected = 0;
return TRUE;
}
-wxListBox::~wxListBox(void)
+wxListBox::~wxListBox()
{
#if wxUSE_OWNER_DRAWN
size_t uiCount = m_aItems.Count();
#endif
}
-void wxListBox::SetupColours(void)
+void wxListBox::SetupColours()
{
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
SetForegroundColour(GetParent()->GetForegroundColour());
return pos;
}
-void wxListBox::Clear(void)
+void wxListBox::Clear()
{
ListBox_ResetContent(hwnd);
return wxString(wxBuffer);
}
-void wxListBox::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxListBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
#endif //USE_OWNER_DRAWN
}
-int wxListBox::Number (void) const
+int wxListBox::Number () const
{
return m_noItems;
}
// For single selection items only
-wxString wxListBox::GetStringSelection (void) const
+wxString wxListBox::GetStringSelection () const
{
int sel = GetSelection ();
if (sel > -1)
#endif
// Restored old code.
-void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
#endif
// Slider
-wxSlider95::wxSlider95(void)
+wxSlider95::wxSlider95()
{
m_staticValue = 0;
m_staticMin = 0;
MSWOnVScroll(wParam, pos, control);
}
-wxSlider95::~wxSlider95(void)
+wxSlider95::~wxSlider95()
{
if (m_staticMin)
DestroyWindow((HWND) m_staticMin);
DestroyWindow((HWND) m_staticValue);
}
-int wxSlider95::GetValue(void) const
+int wxSlider95::GetValue() const
{
return ::SendMessage((HWND) GetHWND(), TBM_GETPOS, 0, 0);
}
*y = point.y;
}
-void wxSlider95::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxSlider95::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int x1 = x;
int y1 = y;
m_pageSize = pageSize;
}
-int wxSlider95::GetPageSize(void) const
+int wxSlider95::GetPageSize() const
{
return m_pageSize;
}
-void wxSlider95::ClearSel(void)
+void wxSlider95::ClearSel()
{
::SendMessage( (HWND) GetHWND(), TBM_CLEARSEL, (WPARAM) TRUE, (LPARAM) 0 );
}
-void wxSlider95::ClearTicks(void)
+void wxSlider95::ClearTicks()
{
::SendMessage( (HWND) GetHWND(), TBM_CLEARTICS, (WPARAM) TRUE, (LPARAM) 0 );
}
::SendMessage( (HWND) GetHWND(), TBM_SETLINESIZE, (WPARAM) 0, (LPARAM) lineSize );
}
-int wxSlider95::GetLineSize(void) const
+int wxSlider95::GetLineSize() const
{
return (int) ::SendMessage( (HWND) GetHWND(), TBM_GETLINESIZE, (WPARAM) 0, (LPARAM) 0 );
}
-int wxSlider95::GetSelEnd(void) const
+int wxSlider95::GetSelEnd() const
{
return (int) ::SendMessage( (HWND) GetHWND(), TBM_SETSELEND, (WPARAM) 0, (LPARAM) 0 );
}
-int wxSlider95::GetSelStart(void) const
+int wxSlider95::GetSelStart() const
{
return (int) ::SendMessage( (HWND) GetHWND(), TBM_GETSELSTART, (WPARAM) 0, (LPARAM) 0 );
}
::SendMessage( (HWND) GetHWND(), TBM_SETTHUMBLENGTH, (WPARAM) len, (LPARAM) 0 );
}
-int wxSlider95::GetThumbLength(void) const
+int wxSlider95::GetThumbLength() const
{
return (int) ::SendMessage( (HWND) GetHWND(), TBM_GETTHUMBLENGTH, (WPARAM) 0, (LPARAM) 0 );
}
#endif
// Slider
-wxSliderMSW::wxSliderMSW(void)
+wxSliderMSW::wxSliderMSW()
{
m_staticValue = 0;
m_staticMin = 0;
MSWOnVScroll(wParam, pos, control);
}
-wxSliderMSW::~wxSliderMSW(void)
+wxSliderMSW::~wxSliderMSW()
{
if (m_staticMin)
DestroyWindow((HWND) m_staticMin);
DestroyWindow((HWND) m_staticValue);
}
-int wxSliderMSW::GetValue(void) const
+int wxSliderMSW::GetValue() const
{
return ::GetScrollPos((HWND) GetHWND(), SB_CTL);
}
*y = point.y;
}
-void wxSliderMSW::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxSliderMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int x1 = x;
int y1 = y;
m_pageSize = pageSize;
}
-int wxSliderMSW::GetPageSize(void) const
+int wxSliderMSW::GetPageSize() const
{
return m_pageSize;
}
-void wxSliderMSW::ClearSel(void)
+void wxSliderMSW::ClearSel()
{
}
-void wxSliderMSW::ClearTicks(void)
+void wxSliderMSW::ClearTicks()
{
}
m_lineSize = lineSize;
}
-int wxSliderMSW::GetLineSize(void) const
+int wxSliderMSW::GetLineSize() const
{
return m_lineSize;
}
-int wxSliderMSW::GetSelEnd(void) const
+int wxSliderMSW::GetSelEnd() const
{
return 0;
}
-int wxSliderMSW::GetSelStart(void) const
+int wxSliderMSW::GetSelStart() const
{
return 0;
}
{
}
-int wxSliderMSW::GetThumbLength(void) const
+int wxSliderMSW::GetThumbLength() const
{
return 0;
}
return TRUE;
}
-void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxStaticBitmap::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
SetWindowText((HWND)m_hWnd, (const char *)label);
}
-void wxStaticBox::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxStaticBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
return TRUE;
}
-void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxStaticText::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);
SetWindowText((HWND) GetHWND(), (const char *)value);
}
-void wxTextCtrl::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxTextCtrl::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int currentX, currentY;
GetPosition(¤tX, ¤tY);