we no longer need wxFrameNative

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2001-10-19 20:35:05 +00:00
parent af15babd51
commit 0d53fc3442
14 changed files with 264 additions and 300 deletions

View File

@@ -192,50 +192,21 @@ protected:
}; };
// include the real class declaration // include the real class declaration
#ifdef __WXUNIVERSAL__
#include "wx/univ/frame.h"
#else // !__WXUNIVERSAL__
#if defined(__WXMSW__) #if defined(__WXMSW__)
#include "wx/msw/frame.h" #include "wx/msw/frame.h"
#define wxFrameNative wxFrameMSW
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/frame.h" #include "wx/gtk/frame.h"
#define wxFrameNative wxFrameGTK
#elif defined(__WXMOTIF__) #elif defined(__WXMOTIF__)
#include "wx/motif/frame.h" #include "wx/motif/frame.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/frame.h" #include "wx/mac/frame.h"
#define wxFrameNative wxFrameMac
#elif defined(__WXMGL__)
#include "wx/mgl/frame.h"
#define wxFrameNative wxFrameMGL
#elif defined(__WXPM__) #elif defined(__WXPM__)
#include "wx/os2/frame.h" #include "wx/os2/frame.h"
#define wxFrameNative wxFrameOS2
#endif #endif
#endif
#ifdef __WXUNIVERSAL__
#include "wx/univ/frame.h"
#else // !__WXUNIVERSAL__
#ifdef wxFrameNative
class WXDLLEXPORT wxFrame : public wxFrameNative
{
public:
// construction
wxFrame() { Init(); }
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)
{
Init();
Create(parent, id, title, pos, size, style, name);
}
DECLARE_DYNAMIC_CLASS(wxFrame)
};
#endif // wxFrameNative
#endif // __WXUNIVERSAL__/!__WXUNIVERSAL__
#endif #endif
// _WX_FRAME_H_BASE_ // _WX_FRAME_H_BASE_

View File

@@ -27,15 +27,15 @@ class wxToolBar;
class wxStatusBar; class wxStatusBar;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxFrameGTK // wxFrame
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class wxFrameGTK : public wxFrameBase class wxFrame : public wxFrameBase
{ {
public: public:
// construction // construction
wxFrameGTK() { Init(); } wxFrame() { Init(); }
wxFrameGTK(wxWindow *parent, wxFrame(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -56,7 +56,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE, long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr); const wxString& name = wxFrameNameStr);
virtual ~wxFrameGTK(); virtual ~wxFrame();
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
virtual void PositionStatusBar(); virtual void PositionStatusBar();
@@ -98,6 +98,8 @@ protected:
virtual void DetachMenuBar(); virtual void DetachMenuBar();
virtual void AttachMenuBar(wxMenuBar *menubar); virtual void AttachMenuBar(wxMenuBar *menubar);
#endif // wxUSE_MENUS_NATIVE #endif // wxUSE_MENUS_NATIVE
DECLARE_DYNAMIC_CLASS(wxFrame)
}; };
#endif // __GTKFRAMEH__ #endif // __GTKFRAMEH__

View File

@@ -27,15 +27,15 @@ class wxToolBar;
class wxStatusBar; class wxStatusBar;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxFrameGTK // wxFrame
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class wxFrameGTK : public wxFrameBase class wxFrame : public wxFrameBase
{ {
public: public:
// construction // construction
wxFrameGTK() { Init(); } wxFrame() { Init(); }
wxFrameGTK(wxWindow *parent, wxFrame(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -56,7 +56,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE, long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr); const wxString& name = wxFrameNameStr);
virtual ~wxFrameGTK(); virtual ~wxFrame();
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
virtual void PositionStatusBar(); virtual void PositionStatusBar();
@@ -98,6 +98,8 @@ protected:
virtual void DetachMenuBar(); virtual void DetachMenuBar();
virtual void AttachMenuBar(wxMenuBar *menubar); virtual void AttachMenuBar(wxMenuBar *menubar);
#endif // wxUSE_MENUS_NATIVE #endif // wxUSE_MENUS_NATIVE
DECLARE_DYNAMIC_CLASS(wxFrame)
}; };
#endif // __GTKFRAMEH__ #endif // __GTKFRAMEH__

View File

@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: frame.h // Name: frame.h
// Purpose: wxFrameMac class // Purpose: wxFrame class
// Author: AUTHOR // Author: AUTHOR
// Modified by: // Modified by:
// Created: ??/??/98 // Created: ??/??/98
@@ -28,14 +28,14 @@ class WXDLLEXPORT wxMenuBar;
class WXDLLEXPORT wxStatusBar; class WXDLLEXPORT wxStatusBar;
class WXDLLEXPORT wxMacToolTip ; class WXDLLEXPORT wxMacToolTip ;
class WXDLLEXPORT wxFrameMac: public wxFrameBase { class WXDLLEXPORT wxFrame: public wxFrameBase {
DECLARE_DYNAMIC_CLASS(wxFrameMac) DECLARE_DYNAMIC_CLASS(wxFrame)
public: public:
// construction // construction
wxFrameMac() { Init(); } wxFrame() { Init(); }
wxFrameMac(wxWindow *parent, wxFrame(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -56,7 +56,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE, long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr); const wxString& name = wxFrameNameStr);
virtual ~wxFrameMac(); virtual ~wxFrame();
// implementation only from now on // implementation only from now on
// ------------------------------- // -------------------------------
@@ -120,6 +120,7 @@ protected:
private: private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxFrame)
}; };
#endif #endif

View File

@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/frame.h // Name: wx/msw/frame.h
// Purpose: wxFrameMSW class // Purpose: wxFrame class
// Author: Julian Smart // Author: Julian Smart
// Modified by: // Modified by:
// Created: 01/02/97 // Created: 01/02/97
@@ -16,12 +16,12 @@
#pragma interface "frame.h" #pragma interface "frame.h"
#endif #endif
class WXDLLEXPORT wxFrameMSW : public wxFrameBase class WXDLLEXPORT wxFrame : public wxFrameBase
{ {
public: public:
// construction // construction
wxFrameMSW() { Init(); } wxFrame() { Init(); }
wxFrameMSW(wxWindow *parent, wxFrame(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -42,7 +42,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE, long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr); const wxString& name = wxFrameNameStr);
virtual ~wxFrameMSW(); virtual ~wxFrame();
// implement base class pure virtuals // implement base class pure virtuals
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
@@ -156,6 +156,7 @@ private:
#endif // tooltips #endif // tooltips
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxFrame)
}; };
#endif #endif

View File

@@ -17,12 +17,12 @@
// //
#include "wx/os2/wxOs2.h" #include "wx/os2/wxOs2.h"
class WXDLLEXPORT wxFrameOS2 : public wxFrameBase class WXDLLEXPORT wxFrame : public wxFrameBase
{ {
public: public:
// construction // construction
wxFrameOS2() { Init(); } wxFrame() { Init(); }
wxFrameOS2( wxWindow* pParent wxFrame( wxWindow* pParent
,wxWindowID vId ,wxWindowID vId
,const wxString& rsTitle ,const wxString& rsTitle
,const wxPoint& rPos = wxDefaultPosition ,const wxPoint& rPos = wxDefaultPosition
@@ -45,7 +45,7 @@ public:
,const wxString& rsName = wxFrameNameStr ,const wxString& rsName = wxFrameNameStr
); );
virtual ~wxFrameOS2(); virtual ~wxFrame();
// implement base class pure virtuals // implement base class pure virtuals
virtual void Maximize(bool bMaximize = TRUE); virtual void Maximize(bool bMaximize = TRUE);
@@ -246,6 +246,7 @@ private:
SWP m_vSwpToolBar; SWP m_vSwpToolBar;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxFrame)
}; };
#endif #endif

View File

@@ -61,9 +61,7 @@ extern int g_openDialogs;
// event tables // event tables
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifndef __WXUNIVERSAL__
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow) IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow)
#endif
// ============================================================================ // ============================================================================
// implementation // implementation
@@ -79,7 +77,7 @@ extern int g_openDialogs;
// "child_attached" of menu bar // "child_attached" of menu bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrameGTK *win ) static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (!win->m_hasVMT) return; if (!win->m_hasVMT) return;
@@ -91,7 +89,7 @@ static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
// "child_detached" of menu bar // "child_detached" of menu bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrameGTK *win ) static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (!win->m_hasVMT) return; if (!win->m_hasVMT) return;
@@ -106,7 +104,7 @@ static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
// "child_attached" of tool bar // "child_attached" of tool bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrameGTK *win ) static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (!win->m_hasVMT) return; if (!win->m_hasVMT) return;
@@ -119,7 +117,7 @@ static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
// "child_detached" of tool bar // "child_detached" of tool bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrameGTK *win ) static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (g_isIdle) if (g_isIdle)
wxapp_install_idle_handler(); wxapp_install_idle_handler();
@@ -133,26 +131,26 @@ static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxFrameGTK itself // wxFrame itself
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild for wxFrameGTK // InsertChild for wxFrame
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/* Callback for wxFrameGTK. This very strange beast has to be used because /* Callback for wxFrame. This very strange beast has to be used because
* C++ has no virtual methods in a constructor. We have to emulate a * C++ has no virtual methods in a constructor. We have to emulate a
* virtual function here as wxWindows requires different ways to insert * virtual function here as wxWindows requires different ways to insert
* a child in container classes. */ * a child in container classes. */
static void wxInsertChildInFrame( wxFrameGTK* parent, wxWindow* child ) static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
{ {
wxASSERT( GTK_IS_WIDGET(child->m_widget) ); wxASSERT( GTK_IS_WIDGET(child->m_widget) );
if (!parent->m_insertInClientArea) if (!parent->m_insertInClientArea)
{ {
/* these are outside the client area */ /* these are outside the client area */
wxFrameGTK* frame = (wxFrameGTK*) parent; wxFrame* frame = (wxFrame*) parent;
gtk_pizza_put( GTK_PIZZA(frame->m_mainWidget), gtk_pizza_put( GTK_PIZZA(frame->m_mainWidget),
GTK_WIDGET(child->m_widget), GTK_WIDGET(child->m_widget),
child->m_x, child->m_x,
@@ -193,16 +191,16 @@ static void wxInsertChildInFrame( wxFrameGTK* parent, wxWindow* child )
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxFrameGTK creation // wxFrame creation
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxFrameGTK::Init() void wxFrame::Init()
{ {
m_menuBarDetached = FALSE; m_menuBarDetached = FALSE;
m_toolBarDetached = FALSE; m_toolBarDetached = FALSE;
} }
bool wxFrameGTK::Create( wxWindow *parent, bool wxFrame::Create( wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
@@ -216,7 +214,7 @@ bool wxFrameGTK::Create( wxWindow *parent,
return rt; return rt;
} }
wxFrameGTK::~wxFrameGTK() wxFrame::~wxFrame()
{ {
m_isBeingDeleted = TRUE; m_isBeingDeleted = TRUE;
DeleteAllBars(); DeleteAllBars();
@@ -226,7 +224,7 @@ wxFrameGTK::~wxFrameGTK()
// overridden wxWindow methods // overridden wxWindow methods
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxFrameGTK::DoGetClientSize( int *width, int *height ) const void wxFrame::DoGetClientSize( int *width, int *height ) const
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
@@ -277,7 +275,7 @@ void wxFrameGTK::DoGetClientSize( int *width, int *height ) const
} }
} }
void wxFrameGTK::DoSetClientSize( int width, int height ) void wxFrame::DoSetClientSize( int width, int height )
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
@@ -324,7 +322,7 @@ void wxFrameGTK::DoSetClientSize( int width, int height )
wxTopLevelWindow::DoSetClientSize( width, height ); wxTopLevelWindow::DoSetClientSize( width, height );
} }
void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
int width, int height ) int width, int height )
{ {
// due to a bug in gtk, x,y are always 0 // due to a bug in gtk, x,y are always 0
@@ -335,7 +333,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
if (m_resizing) return; if (m_resizing) return;
m_resizing = TRUE; m_resizing = TRUE;
/* this shouldn't happen: wxFrameGTK, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */ /* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") );
m_width = width; m_width = width;
@@ -345,9 +343,9 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
int client_area_x_offset = 0, int client_area_x_offset = 0,
client_area_y_offset = 0; client_area_y_offset = 0;
/* wxMDIChildFrame derives from wxFrameGTK but it _is_ a wxWindow as it uses /* wxMDIChildFrame derives from wxFrame but it _is_ a wxWindow as it uses
wxWindow::Create to create it's GTK equivalent. m_mainWidget is only wxWindow::Create to create it's GTK equivalent. m_mainWidget is only
set in wxFrameGTK::Create so it is used to check what kind of frame we set in wxFrame::Create so it is used to check what kind of frame we
have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we
skip the part which handles m_frameMenuBar, m_frameToolBar and (most skip the part which handles m_frameMenuBar, m_frameToolBar and (most
importantly) m_mainWidget */ importantly) m_mainWidget */
@@ -494,7 +492,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
m_resizing = FALSE; m_resizing = FALSE;
} }
void wxFrameGTK::OnInternalIdle() void wxFrame::OnInternalIdle()
{ {
wxTopLevelWindow::OnInternalIdle(); wxTopLevelWindow::OnInternalIdle();
@@ -515,7 +513,7 @@ void wxFrameGTK::OnInternalIdle()
#if wxUSE_MENUS_NATIVE #if wxUSE_MENUS_NATIVE
void wxFrameGTK::DetachMenuBar() void wxFrame::DetachMenuBar()
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") );
@@ -541,7 +539,7 @@ void wxFrameGTK::DetachMenuBar()
wxFrameBase::DetachMenuBar(); wxFrameBase::DetachMenuBar();
} }
void wxFrameGTK::AttachMenuBar( wxMenuBar *menuBar ) void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
{ {
wxFrameBase::AttachMenuBar(menuBar); wxFrameBase::AttachMenuBar(menuBar);
@@ -577,7 +575,7 @@ void wxFrameGTK::AttachMenuBar( wxMenuBar *menuBar )
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
wxToolBar* wxFrameGTK::CreateToolBar( long style, wxWindowID id, const wxString& name ) wxToolBar* wxFrame::CreateToolBar( long style, wxWindowID id, const wxString& name )
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
@@ -592,7 +590,7 @@ wxToolBar* wxFrameGTK::CreateToolBar( long style, wxWindowID id, const wxString&
return m_frameToolBar; return m_frameToolBar;
} }
void wxFrameGTK::SetToolBar(wxToolBar *toolbar) void wxFrame::SetToolBar(wxToolBar *toolbar)
{ {
wxFrameBase::SetToolBar(toolbar); wxFrameBase::SetToolBar(toolbar);
@@ -614,7 +612,7 @@ void wxFrameGTK::SetToolBar(wxToolBar *toolbar)
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
wxStatusBar* wxFrameGTK::CreateStatusBar(int number, wxStatusBar* wxFrame::CreateStatusBar(int number,
long style, long style,
wxWindowID id, wxWindowID id,
const wxString& name) const wxString& name)
@@ -627,7 +625,7 @@ wxStatusBar* wxFrameGTK::CreateStatusBar(int number,
return wxFrameBase::CreateStatusBar( number, style, id, name ); return wxFrameBase::CreateStatusBar( number, style, id, name );
} }
void wxFrameGTK::PositionStatusBar() void wxFrame::PositionStatusBar()
{ {
if ( !m_frameStatusBar ) if ( !m_frameStatusBar )
return; return;

View File

@@ -594,7 +594,7 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
/* this shouldn't happen: wxFrameGTK, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */ /* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") );
/* avoid recursions */ /* avoid recursions */
@@ -701,9 +701,9 @@ void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
m_width = width; m_width = width;
m_height = height; m_height = height;
/* wxMDIChildFrame derives from wxFrameGTK but it _is_ a wxWindow as it uses /* wxMDIChildFrame derives from wxFrame but it _is_ a wxWindow as it uses
wxWindow::Create to create it's GTK equivalent. m_mainWidget is only wxWindow::Create to create it's GTK equivalent. m_mainWidget is only
set in wxFrameGTK::Create so it is used to check what kind of frame we set in wxFrame::Create so it is used to check what kind of frame we
have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we
skip the part which handles m_frameMenuBar, m_frameToolBar and (most skip the part which handles m_frameMenuBar, m_frameToolBar and (most
importantly) m_mainWidget */ importantly) m_mainWidget */

View File

@@ -61,9 +61,7 @@ extern int g_openDialogs;
// event tables // event tables
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifndef __WXUNIVERSAL__
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow) IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow)
#endif
// ============================================================================ // ============================================================================
// implementation // implementation
@@ -79,7 +77,7 @@ extern int g_openDialogs;
// "child_attached" of menu bar // "child_attached" of menu bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrameGTK *win ) static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (!win->m_hasVMT) return; if (!win->m_hasVMT) return;
@@ -91,7 +89,7 @@ static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
// "child_detached" of menu bar // "child_detached" of menu bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrameGTK *win ) static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (!win->m_hasVMT) return; if (!win->m_hasVMT) return;
@@ -106,7 +104,7 @@ static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *
// "child_attached" of tool bar // "child_attached" of tool bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrameGTK *win ) static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (!win->m_hasVMT) return; if (!win->m_hasVMT) return;
@@ -119,7 +117,7 @@ static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
// "child_detached" of tool bar // "child_detached" of tool bar
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrameGTK *win ) static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
{ {
if (g_isIdle) if (g_isIdle)
wxapp_install_idle_handler(); wxapp_install_idle_handler();
@@ -133,26 +131,26 @@ static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidge
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxFrameGTK itself // wxFrame itself
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// InsertChild for wxFrameGTK // InsertChild for wxFrame
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/* Callback for wxFrameGTK. This very strange beast has to be used because /* Callback for wxFrame. This very strange beast has to be used because
* C++ has no virtual methods in a constructor. We have to emulate a * C++ has no virtual methods in a constructor. We have to emulate a
* virtual function here as wxWindows requires different ways to insert * virtual function here as wxWindows requires different ways to insert
* a child in container classes. */ * a child in container classes. */
static void wxInsertChildInFrame( wxFrameGTK* parent, wxWindow* child ) static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
{ {
wxASSERT( GTK_IS_WIDGET(child->m_widget) ); wxASSERT( GTK_IS_WIDGET(child->m_widget) );
if (!parent->m_insertInClientArea) if (!parent->m_insertInClientArea)
{ {
/* these are outside the client area */ /* these are outside the client area */
wxFrameGTK* frame = (wxFrameGTK*) parent; wxFrame* frame = (wxFrame*) parent;
gtk_pizza_put( GTK_PIZZA(frame->m_mainWidget), gtk_pizza_put( GTK_PIZZA(frame->m_mainWidget),
GTK_WIDGET(child->m_widget), GTK_WIDGET(child->m_widget),
child->m_x, child->m_x,
@@ -193,16 +191,16 @@ static void wxInsertChildInFrame( wxFrameGTK* parent, wxWindow* child )
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxFrameGTK creation // wxFrame creation
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxFrameGTK::Init() void wxFrame::Init()
{ {
m_menuBarDetached = FALSE; m_menuBarDetached = FALSE;
m_toolBarDetached = FALSE; m_toolBarDetached = FALSE;
} }
bool wxFrameGTK::Create( wxWindow *parent, bool wxFrame::Create( wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
@@ -216,7 +214,7 @@ bool wxFrameGTK::Create( wxWindow *parent,
return rt; return rt;
} }
wxFrameGTK::~wxFrameGTK() wxFrame::~wxFrame()
{ {
m_isBeingDeleted = TRUE; m_isBeingDeleted = TRUE;
DeleteAllBars(); DeleteAllBars();
@@ -226,7 +224,7 @@ wxFrameGTK::~wxFrameGTK()
// overridden wxWindow methods // overridden wxWindow methods
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxFrameGTK::DoGetClientSize( int *width, int *height ) const void wxFrame::DoGetClientSize( int *width, int *height ) const
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
@@ -277,7 +275,7 @@ void wxFrameGTK::DoGetClientSize( int *width, int *height ) const
} }
} }
void wxFrameGTK::DoSetClientSize( int width, int height ) void wxFrame::DoSetClientSize( int width, int height )
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
@@ -324,7 +322,7 @@ void wxFrameGTK::DoSetClientSize( int width, int height )
wxTopLevelWindow::DoSetClientSize( width, height ); wxTopLevelWindow::DoSetClientSize( width, height );
} }
void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
int width, int height ) int width, int height )
{ {
// due to a bug in gtk, x,y are always 0 // due to a bug in gtk, x,y are always 0
@@ -335,7 +333,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
if (m_resizing) return; if (m_resizing) return;
m_resizing = TRUE; m_resizing = TRUE;
/* this shouldn't happen: wxFrameGTK, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */ /* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") );
m_width = width; m_width = width;
@@ -345,9 +343,9 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
int client_area_x_offset = 0, int client_area_x_offset = 0,
client_area_y_offset = 0; client_area_y_offset = 0;
/* wxMDIChildFrame derives from wxFrameGTK but it _is_ a wxWindow as it uses /* wxMDIChildFrame derives from wxFrame but it _is_ a wxWindow as it uses
wxWindow::Create to create it's GTK equivalent. m_mainWidget is only wxWindow::Create to create it's GTK equivalent. m_mainWidget is only
set in wxFrameGTK::Create so it is used to check what kind of frame we set in wxFrame::Create so it is used to check what kind of frame we
have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we
skip the part which handles m_frameMenuBar, m_frameToolBar and (most skip the part which handles m_frameMenuBar, m_frameToolBar and (most
importantly) m_mainWidget */ importantly) m_mainWidget */
@@ -494,7 +492,7 @@ void wxFrameGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
m_resizing = FALSE; m_resizing = FALSE;
} }
void wxFrameGTK::OnInternalIdle() void wxFrame::OnInternalIdle()
{ {
wxTopLevelWindow::OnInternalIdle(); wxTopLevelWindow::OnInternalIdle();
@@ -515,7 +513,7 @@ void wxFrameGTK::OnInternalIdle()
#if wxUSE_MENUS_NATIVE #if wxUSE_MENUS_NATIVE
void wxFrameGTK::DetachMenuBar() void wxFrame::DetachMenuBar()
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") );
@@ -541,7 +539,7 @@ void wxFrameGTK::DetachMenuBar()
wxFrameBase::DetachMenuBar(); wxFrameBase::DetachMenuBar();
} }
void wxFrameGTK::AttachMenuBar( wxMenuBar *menuBar ) void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
{ {
wxFrameBase::AttachMenuBar(menuBar); wxFrameBase::AttachMenuBar(menuBar);
@@ -577,7 +575,7 @@ void wxFrameGTK::AttachMenuBar( wxMenuBar *menuBar )
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
wxToolBar* wxFrameGTK::CreateToolBar( long style, wxWindowID id, const wxString& name ) wxToolBar* wxFrame::CreateToolBar( long style, wxWindowID id, const wxString& name )
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
@@ -592,7 +590,7 @@ wxToolBar* wxFrameGTK::CreateToolBar( long style, wxWindowID id, const wxString&
return m_frameToolBar; return m_frameToolBar;
} }
void wxFrameGTK::SetToolBar(wxToolBar *toolbar) void wxFrame::SetToolBar(wxToolBar *toolbar)
{ {
wxFrameBase::SetToolBar(toolbar); wxFrameBase::SetToolBar(toolbar);
@@ -614,7 +612,7 @@ void wxFrameGTK::SetToolBar(wxToolBar *toolbar)
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
wxStatusBar* wxFrameGTK::CreateStatusBar(int number, wxStatusBar* wxFrame::CreateStatusBar(int number,
long style, long style,
wxWindowID id, wxWindowID id,
const wxString& name) const wxString& name)
@@ -627,7 +625,7 @@ wxStatusBar* wxFrameGTK::CreateStatusBar(int number,
return wxFrameBase::CreateStatusBar( number, style, id, name ); return wxFrameBase::CreateStatusBar( number, style, id, name );
} }
void wxFrameGTK::PositionStatusBar() void wxFrame::PositionStatusBar()
{ {
if ( !m_frameStatusBar ) if ( !m_frameStatusBar )
return; return;

View File

@@ -594,7 +594,7 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
{ {
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
/* this shouldn't happen: wxFrameGTK, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */ /* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") );
/* avoid recursions */ /* avoid recursions */
@@ -701,9 +701,9 @@ void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
m_width = width; m_width = width;
m_height = height; m_height = height;
/* wxMDIChildFrame derives from wxFrameGTK but it _is_ a wxWindow as it uses /* wxMDIChildFrame derives from wxFrame but it _is_ a wxWindow as it uses
wxWindow::Create to create it's GTK equivalent. m_mainWidget is only wxWindow::Create to create it's GTK equivalent. m_mainWidget is only
set in wxFrameGTK::Create so it is used to check what kind of frame we set in wxFrame::Create so it is used to check what kind of frame we
have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we
skip the part which handles m_frameMenuBar, m_frameToolBar and (most skip the part which handles m_frameMenuBar, m_frameToolBar and (most
importantly) m_mainWidget */ importantly) m_mainWidget */

View File

@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: frame.cpp // Name: frame.cpp
// Purpose: wxFrameMac // Purpose: wxFrame
// Author: AUTHOR // Author: AUTHOR
// Modified by: // Modified by:
// Created: ??/??/98 // Created: ??/??/98
@@ -29,24 +29,21 @@ extern wxWindowList wxModelessWindows;
extern wxList wxPendingDelete; extern wxList wxPendingDelete;
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
BEGIN_EVENT_TABLE(wxFrameMac, wxFrameBase) BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
EVT_ACTIVATE(wxFrameMac::OnActivate) EVT_ACTIVATE(wxFrame::OnActivate)
// EVT_MENU_HIGHLIGHT_ALL(wxFrameMac::OnMenuHighlight) // EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
EVT_SYS_COLOUR_CHANGED(wxFrameMac::OnSysColourChanged) EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
// EVT_IDLE(wxFrameMac::OnIdle) // EVT_IDLE(wxFrame::OnIdle)
// EVT_CLOSE(wxFrameMac::OnCloseWindow) // EVT_CLOSE(wxFrame::OnCloseWindow)
END_EVENT_TABLE() END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxFrameMac, wxWindow) IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
#endif
#ifndef __WXUNIVERSAL__
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxFrameMac)
#endif #endif
#if wxUSE_NATIVE_STATUSBAR #if wxUSE_NATIVE_STATUSBAR
bool wxFrameMac::m_useNativeStatusBar = TRUE; bool wxFrame::m_useNativeStatusBar = TRUE;
#else #else
bool wxFrameMac::m_useNativeStatusBar = FALSE; bool wxFrame::m_useNativeStatusBar = FALSE;
#endif #endif
#define WX_MAC_STATUSBAR_HEIGHT 15 #define WX_MAC_STATUSBAR_HEIGHT 15
@@ -54,7 +51,7 @@ bool wxFrameMac::m_useNativeStatusBar = FALSE;
// creation/destruction // creation/destruction
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxFrameMac::Init() void wxFrame::Init()
{ {
m_frameMenuBar = NULL; m_frameMenuBar = NULL;
@@ -71,7 +68,7 @@ void wxFrameMac::Init()
#endif #endif
} }
wxPoint wxFrameMac::GetClientAreaOrigin() const wxPoint wxFrame::GetClientAreaOrigin() const
{ {
// on mac we are at position -1,-1 with the control // on mac we are at position -1,-1 with the control
wxPoint pt(0, 0); wxPoint pt(0, 0);
@@ -96,7 +93,7 @@ wxPoint wxFrameMac::GetClientAreaOrigin() const
return pt; return pt;
} }
bool wxFrameMac::Create(wxWindow *parent, bool wxFrame::Create(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
@@ -118,7 +115,7 @@ bool wxFrameMac::Create(wxWindow *parent,
return TRUE; return TRUE;
} }
wxFrameMac::~wxFrameMac() wxFrame::~wxFrame()
{ {
m_isBeingDeleted = TRUE; m_isBeingDeleted = TRUE;
@@ -127,7 +124,7 @@ wxFrameMac::~wxFrameMac()
} }
bool wxFrameMac::Enable(bool enable) bool wxFrame::Enable(bool enable)
{ {
if ( !wxWindow::Enable(enable) ) if ( !wxWindow::Enable(enable) )
return FALSE; return FALSE;
@@ -143,7 +140,7 @@ bool wxFrameMac::Enable(bool enable)
return TRUE; return TRUE;
} }
wxStatusBar *wxFrameMac::OnCreateStatusBar(int number, long style, wxWindowID id, wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
const wxString& name) const wxString& name)
{ {
wxStatusBar *statusBar = NULL; wxStatusBar *statusBar = NULL;
@@ -155,7 +152,7 @@ wxStatusBar *wxFrameMac::OnCreateStatusBar(int number, long style, wxWindowID id
return statusBar; return statusBar;
} }
void wxFrameMac::PositionStatusBar() void wxFrame::PositionStatusBar()
{ {
if (m_frameStatusBar ) if (m_frameStatusBar )
{ {
@@ -171,7 +168,7 @@ void wxFrameMac::PositionStatusBar()
} }
// Responds to colour changes, and passes event on to children. // Responds to colour changes, and passes event on to children.
void wxFrameMac::OnSysColourChanged(wxSysColourChangedEvent& event) void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
{ {
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
Refresh(); Refresh();
@@ -190,7 +187,7 @@ void wxFrameMac::OnSysColourChanged(wxSysColourChangedEvent& event)
// Default activation behaviour - set the focus for the first child // Default activation behaviour - set the focus for the first child
// subwindow found. // subwindow found.
void wxFrameMac::OnActivate(wxActivateEvent& event) void wxFrame::OnActivate(wxActivateEvent& event)
{ {
if ( !event.GetActive() ) if ( !event.GetActive() )
{ {
@@ -235,7 +232,7 @@ void wxFrameMac::OnActivate(wxActivateEvent& event)
} }
} }
void wxFrameMac::DoGetClientSize(int *x, int *y) const void wxFrame::DoGetClientSize(int *x, int *y) const
{ {
wxWindow::DoGetClientSize( x , y ) ; wxWindow::DoGetClientSize( x , y ) ;
@@ -255,7 +252,7 @@ void wxFrameMac::DoGetClientSize(int *x, int *y) const
*x -= pt.x; *x -= pt.x;
} }
void wxFrameMac::DoSetClientSize(int clientwidth, int clientheight) void wxFrame::DoSetClientSize(int clientwidth, int clientheight)
{ {
int currentclientwidth , currentclientheight ; int currentclientwidth , currentclientheight ;
int currentwidth , currentheight ; int currentwidth , currentheight ;
@@ -275,7 +272,7 @@ void wxFrameMac::DoSetClientSize(int clientwidth, int clientheight)
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
wxToolBar* wxFrameMac::CreateToolBar(long style, wxWindowID id, const wxString& name) wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{ {
if ( wxFrameBase::CreateToolBar(style, id, name) ) if ( wxFrameBase::CreateToolBar(style, id, name) )
{ {
@@ -285,7 +282,7 @@ wxToolBar* wxFrameMac::CreateToolBar(long style, wxWindowID id, const wxString&
return m_frameToolBar; return m_frameToolBar;
} }
void wxFrameMac::PositionToolBar() void wxFrame::PositionToolBar()
{ {
int cw, ch; int cw, ch;

View File

@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: frame.cpp // Name: frame.cpp
// Purpose: wxFrameMac // Purpose: wxFrame
// Author: AUTHOR // Author: AUTHOR
// Modified by: // Modified by:
// Created: ??/??/98 // Created: ??/??/98
@@ -29,24 +29,21 @@ extern wxWindowList wxModelessWindows;
extern wxList wxPendingDelete; extern wxList wxPendingDelete;
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
BEGIN_EVENT_TABLE(wxFrameMac, wxFrameBase) BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
EVT_ACTIVATE(wxFrameMac::OnActivate) EVT_ACTIVATE(wxFrame::OnActivate)
// EVT_MENU_HIGHLIGHT_ALL(wxFrameMac::OnMenuHighlight) // EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
EVT_SYS_COLOUR_CHANGED(wxFrameMac::OnSysColourChanged) EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
// EVT_IDLE(wxFrameMac::OnIdle) // EVT_IDLE(wxFrame::OnIdle)
// EVT_CLOSE(wxFrameMac::OnCloseWindow) // EVT_CLOSE(wxFrame::OnCloseWindow)
END_EVENT_TABLE() END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxFrameMac, wxWindow) IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
#endif
#ifndef __WXUNIVERSAL__
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxFrameMac)
#endif #endif
#if wxUSE_NATIVE_STATUSBAR #if wxUSE_NATIVE_STATUSBAR
bool wxFrameMac::m_useNativeStatusBar = TRUE; bool wxFrame::m_useNativeStatusBar = TRUE;
#else #else
bool wxFrameMac::m_useNativeStatusBar = FALSE; bool wxFrame::m_useNativeStatusBar = FALSE;
#endif #endif
#define WX_MAC_STATUSBAR_HEIGHT 15 #define WX_MAC_STATUSBAR_HEIGHT 15
@@ -54,7 +51,7 @@ bool wxFrameMac::m_useNativeStatusBar = FALSE;
// creation/destruction // creation/destruction
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxFrameMac::Init() void wxFrame::Init()
{ {
m_frameMenuBar = NULL; m_frameMenuBar = NULL;
@@ -71,7 +68,7 @@ void wxFrameMac::Init()
#endif #endif
} }
wxPoint wxFrameMac::GetClientAreaOrigin() const wxPoint wxFrame::GetClientAreaOrigin() const
{ {
// on mac we are at position -1,-1 with the control // on mac we are at position -1,-1 with the control
wxPoint pt(0, 0); wxPoint pt(0, 0);
@@ -96,7 +93,7 @@ wxPoint wxFrameMac::GetClientAreaOrigin() const
return pt; return pt;
} }
bool wxFrameMac::Create(wxWindow *parent, bool wxFrame::Create(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
@@ -118,7 +115,7 @@ bool wxFrameMac::Create(wxWindow *parent,
return TRUE; return TRUE;
} }
wxFrameMac::~wxFrameMac() wxFrame::~wxFrame()
{ {
m_isBeingDeleted = TRUE; m_isBeingDeleted = TRUE;
@@ -127,7 +124,7 @@ wxFrameMac::~wxFrameMac()
} }
bool wxFrameMac::Enable(bool enable) bool wxFrame::Enable(bool enable)
{ {
if ( !wxWindow::Enable(enable) ) if ( !wxWindow::Enable(enable) )
return FALSE; return FALSE;
@@ -143,7 +140,7 @@ bool wxFrameMac::Enable(bool enable)
return TRUE; return TRUE;
} }
wxStatusBar *wxFrameMac::OnCreateStatusBar(int number, long style, wxWindowID id, wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
const wxString& name) const wxString& name)
{ {
wxStatusBar *statusBar = NULL; wxStatusBar *statusBar = NULL;
@@ -155,7 +152,7 @@ wxStatusBar *wxFrameMac::OnCreateStatusBar(int number, long style, wxWindowID id
return statusBar; return statusBar;
} }
void wxFrameMac::PositionStatusBar() void wxFrame::PositionStatusBar()
{ {
if (m_frameStatusBar ) if (m_frameStatusBar )
{ {
@@ -171,7 +168,7 @@ void wxFrameMac::PositionStatusBar()
} }
// Responds to colour changes, and passes event on to children. // Responds to colour changes, and passes event on to children.
void wxFrameMac::OnSysColourChanged(wxSysColourChangedEvent& event) void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
{ {
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
Refresh(); Refresh();
@@ -190,7 +187,7 @@ void wxFrameMac::OnSysColourChanged(wxSysColourChangedEvent& event)
// Default activation behaviour - set the focus for the first child // Default activation behaviour - set the focus for the first child
// subwindow found. // subwindow found.
void wxFrameMac::OnActivate(wxActivateEvent& event) void wxFrame::OnActivate(wxActivateEvent& event)
{ {
if ( !event.GetActive() ) if ( !event.GetActive() )
{ {
@@ -235,7 +232,7 @@ void wxFrameMac::OnActivate(wxActivateEvent& event)
} }
} }
void wxFrameMac::DoGetClientSize(int *x, int *y) const void wxFrame::DoGetClientSize(int *x, int *y) const
{ {
wxWindow::DoGetClientSize( x , y ) ; wxWindow::DoGetClientSize( x , y ) ;
@@ -255,7 +252,7 @@ void wxFrameMac::DoGetClientSize(int *x, int *y) const
*x -= pt.x; *x -= pt.x;
} }
void wxFrameMac::DoSetClientSize(int clientwidth, int clientheight) void wxFrame::DoSetClientSize(int clientwidth, int clientheight)
{ {
int currentclientwidth , currentclientheight ; int currentclientwidth , currentclientheight ;
int currentwidth , currentheight ; int currentwidth , currentheight ;
@@ -275,7 +272,7 @@ void wxFrameMac::DoSetClientSize(int clientwidth, int clientheight)
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
wxToolBar* wxFrameMac::CreateToolBar(long style, wxWindowID id, const wxString& name) wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{ {
if ( wxFrameBase::CreateToolBar(style, id, name) ) if ( wxFrameBase::CreateToolBar(style, id, name) )
{ {
@@ -285,7 +282,7 @@ wxToolBar* wxFrameMac::CreateToolBar(long style, wxWindowID id, const wxString&
return m_frameToolBar; return m_frameToolBar;
} }
void wxFrameMac::PositionToolBar() void wxFrame::PositionToolBar()
{ {
int cw, ch; int cw, ch;

View File

@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: msw/frame.cpp // Name: msw/frame.cpp
// Purpose: wxFrameMSW // Purpose: wxFrame
// Author: Julian Smart // Author: Julian Smart
// Modified by: // Modified by:
// Created: 01/02/97 // Created: 01/02/97
@@ -73,14 +73,12 @@ extern wxMenu *wxCurrentPopupMenu;
// event tables // event tables
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxFrameMSW, wxFrameBase) BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
EVT_ACTIVATE(wxFrameMSW::OnActivate) EVT_ACTIVATE(wxFrame::OnActivate)
EVT_SYS_COLOUR_CHANGED(wxFrameMSW::OnSysColourChanged) EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
END_EVENT_TABLE() END_EVENT_TABLE()
#ifndef __WXUNIVERSAL__
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow) IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
#endif
// ============================================================================ // ============================================================================
// implementation // implementation
@@ -92,9 +90,9 @@ END_EVENT_TABLE()
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
#if wxUSE_NATIVE_STATUSBAR #if wxUSE_NATIVE_STATUSBAR
bool wxFrameMSW::m_useNativeStatusBar = TRUE; bool wxFrame::m_useNativeStatusBar = TRUE;
#else #else
bool wxFrameMSW::m_useNativeStatusBar = FALSE; bool wxFrame::m_useNativeStatusBar = FALSE;
#endif #endif
#endif // wxUSE_NATIVE_STATUSBAR #endif // wxUSE_NATIVE_STATUSBAR
@@ -102,7 +100,7 @@ END_EVENT_TABLE()
// creation/destruction // creation/destruction
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxFrameMSW::Init() void wxFrame::Init()
{ {
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
m_hwndToolTip = 0; m_hwndToolTip = 0;
@@ -117,7 +115,7 @@ void wxFrameMSW::Init()
m_winLastFocused = (wxWindow *)NULL; m_winLastFocused = (wxWindow *)NULL;
} }
bool wxFrameMSW::Create(wxWindow *parent, bool wxFrame::Create(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
@@ -135,7 +133,7 @@ bool wxFrameMSW::Create(wxWindow *parent,
return TRUE; return TRUE;
} }
wxFrameMSW::~wxFrameMSW() wxFrame::~wxFrame()
{ {
m_isBeingDeleted = TRUE; m_isBeingDeleted = TRUE;
@@ -143,7 +141,7 @@ wxFrameMSW::~wxFrameMSW()
} }
// Get size *available for subwindows* i.e. excluding menu bar, toolbar etc. // Get size *available for subwindows* i.e. excluding menu bar, toolbar etc.
void wxFrameMSW::DoGetClientSize(int *x, int *y) const void wxFrame::DoGetClientSize(int *x, int *y) const
{ {
RECT rect; RECT rect;
::GetClientRect(GetHwnd(), &rect); ::GetClientRect(GetHwnd(), &rect);
@@ -167,7 +165,7 @@ void wxFrameMSW::DoGetClientSize(int *x, int *y) const
*y = rect.bottom; *y = rect.bottom;
} }
void wxFrameMSW::DoSetClientSize(int width, int height) void wxFrame::DoSetClientSize(int width, int height)
{ {
// leave enough space for the status bar if we have (and show) it // leave enough space for the status bar if we have (and show) it
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
@@ -182,10 +180,10 @@ void wxFrameMSW::DoSetClientSize(int width, int height)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxFrameMSW: various geometry-related functions // wxFrame: various geometry-related functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxFrameMSW::Raise() void wxFrame::Raise()
{ {
#ifdef __WIN16__ #ifdef __WIN16__
// no SetForegroundWindow() in Win16 // no SetForegroundWindow() in Win16
@@ -196,7 +194,7 @@ void wxFrameMSW::Raise()
} }
// generate an artificial resize event // generate an artificial resize event
void wxFrameMSW::SendSizeEvent() void wxFrame::SendSizeEvent()
{ {
if ( !m_iconized ) if ( !m_iconized )
{ {
@@ -209,7 +207,7 @@ void wxFrameMSW::SendSizeEvent()
} }
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
wxStatusBar *wxFrameMSW::OnCreateStatusBar(int number, wxStatusBar *wxFrame::OnCreateStatusBar(int number,
long style, long style,
wxWindowID id, wxWindowID id,
const wxString& name) const wxString& name)
@@ -232,7 +230,7 @@ wxStatusBar *wxFrameMSW::OnCreateStatusBar(int number,
return statusBar; return statusBar;
} }
void wxFrameMSW::PositionStatusBar() void wxFrame::PositionStatusBar()
{ {
if ( !m_frameStatusBar ) if ( !m_frameStatusBar )
return; return;
@@ -250,7 +248,7 @@ void wxFrameMSW::PositionStatusBar()
#if wxUSE_MENUS_NATIVE #if wxUSE_MENUS_NATIVE
void wxFrameMSW::AttachMenuBar(wxMenuBar *menubar) void wxFrame::AttachMenuBar(wxMenuBar *menubar)
{ {
wxFrameBase::AttachMenuBar(menubar); wxFrameBase::AttachMenuBar(menubar);
@@ -282,7 +280,7 @@ void wxFrameMSW::AttachMenuBar(wxMenuBar *menubar)
} }
} }
void wxFrameMSW::InternalSetMenuBar() void wxFrame::InternalSetMenuBar()
{ {
#ifndef __WXMICROWIN__ #ifndef __WXMICROWIN__
if ( !::SetMenu(GetHwnd(), (HMENU)m_hMenu) ) if ( !::SetMenu(GetHwnd(), (HMENU)m_hMenu) )
@@ -295,7 +293,7 @@ void wxFrameMSW::InternalSetMenuBar()
#endif // wxUSE_MENUS_NATIVE #endif // wxUSE_MENUS_NATIVE
// Responds to colour changes, and passes event on to children. // Responds to colour changes, and passes event on to children.
void wxFrameMSW::OnSysColourChanged(wxSysColourChangedEvent& event) void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
{ {
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
Refresh(); Refresh();
@@ -314,7 +312,7 @@ void wxFrameMSW::OnSysColourChanged(wxSysColourChangedEvent& event)
} }
// Pass TRUE to show full screen, FALSE to restore. // Pass TRUE to show full screen, FALSE to restore.
bool wxFrameMSW::ShowFullScreen(bool show, long style) bool wxFrame::ShowFullScreen(bool show, long style)
{ {
if ( IsFullScreen() == show ) if ( IsFullScreen() == show )
return FALSE; return FALSE;
@@ -393,12 +391,12 @@ bool wxFrameMSW::ShowFullScreen(bool show, long style)
// Default activation behaviour - set the focus for the first child // Default activation behaviour - set the focus for the first child
// subwindow found. // subwindow found.
void wxFrameMSW::OnActivate(wxActivateEvent& event) void wxFrame::OnActivate(wxActivateEvent& event)
{ {
if ( event.GetActive() ) if ( event.GetActive() )
{ {
// restore focus to the child which was last focused // restore focus to the child which was last focused
wxLogTrace(_T("focus"), _T("wxFrameMSW %08x activated."), m_hWnd); wxLogTrace(_T("focus"), _T("wxFrame %08x activated."), m_hWnd);
wxWindow *parent = m_winLastFocused ? m_winLastFocused->GetParent() wxWindow *parent = m_winLastFocused ? m_winLastFocused->GetParent()
: NULL; : NULL;
@@ -432,7 +430,7 @@ void wxFrameMSW::OnActivate(wxActivateEvent& event)
} }
wxLogTrace(_T("focus"), wxLogTrace(_T("focus"),
_T("wxFrameMSW %08x deactivated, last focused: %08x."), _T("wxFrame %08x deactivated, last focused: %08x."),
m_hWnd, m_hWnd,
m_winLastFocused ? GetHwndOf(m_winLastFocused) m_winLastFocused ? GetHwndOf(m_winLastFocused)
: NULL); : NULL);
@@ -447,7 +445,7 @@ void wxFrameMSW::OnActivate(wxActivateEvent& event)
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
wxToolBar* wxFrameMSW::CreateToolBar(long style, wxWindowID id, const wxString& name) wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{ {
if ( wxFrameBase::CreateToolBar(style, id, name) ) if ( wxFrameBase::CreateToolBar(style, id, name) )
{ {
@@ -457,7 +455,7 @@ wxToolBar* wxFrameMSW::CreateToolBar(long style, wxWindowID id, const wxString&
return m_frameToolBar; return m_frameToolBar;
} }
void wxFrameMSW::PositionToolBar() void wxFrame::PositionToolBar()
{ {
RECT rect; RECT rect;
::GetClientRect(GetHwnd(), &rect); ::GetClientRect(GetHwnd(), &rect);
@@ -498,7 +496,7 @@ void wxFrameMSW::PositionToolBar()
// propagate our state change to all child frames: this allows us to emulate X // propagate our state change to all child frames: this allows us to emulate X
// Windows behaviour where child frames float independently of the parent one // Windows behaviour where child frames float independently of the parent one
// on the desktop, but are iconized/restored with it // on the desktop, but are iconized/restored with it
void wxFrameMSW::IconizeChildFrames(bool bIconize) void wxFrame::IconizeChildFrames(bool bIconize)
{ {
for ( wxWindowList::Node *node = GetChildren().GetFirst(); for ( wxWindowList::Node *node = GetChildren().GetFirst();
node; node;
@@ -530,7 +528,7 @@ void wxFrameMSW::IconizeChildFrames(bool bIconize)
} }
} }
WXHICON wxFrameMSW::GetDefaultIcon() const WXHICON wxFrame::GetDefaultIcon() const
{ {
return (WXHICON)(wxSTD_FRAME_ICON ? wxSTD_FRAME_ICON return (WXHICON)(wxSTD_FRAME_ICON ? wxSTD_FRAME_ICON
: wxDEFAULT_FRAME_ICON); : wxDEFAULT_FRAME_ICON);
@@ -544,7 +542,7 @@ WXHICON wxFrameMSW::GetDefaultIcon() const
// preprocessing // preprocessing
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
bool wxFrameMSW::MSWTranslateMessage(WXMSG* pMsg) bool wxFrame::MSWTranslateMessage(WXMSG* pMsg)
{ {
if ( wxWindow::MSWTranslateMessage(pMsg) ) if ( wxWindow::MSWTranslateMessage(pMsg) )
return TRUE; return TRUE;
@@ -566,7 +564,7 @@ bool wxFrameMSW::MSWTranslateMessage(WXMSG* pMsg)
// our private (non virtual) message handlers // our private (non virtual) message handlers
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
bool wxFrameMSW::HandlePaint() bool wxFrame::HandlePaint()
{ {
RECT rect; RECT rect;
if ( GetUpdateRect(GetHwnd(), &rect, FALSE) ) if ( GetUpdateRect(GetHwnd(), &rect, FALSE) )
@@ -617,7 +615,7 @@ bool wxFrameMSW::HandlePaint()
} }
} }
bool wxFrameMSW::HandleSize(int x, int y, WXUINT id) bool wxFrame::HandleSize(int x, int y, WXUINT id)
{ {
bool processed = FALSE; bool processed = FALSE;
#ifndef __WXMICROWIN__ #ifndef __WXMICROWIN__
@@ -671,7 +669,7 @@ bool wxFrameMSW::HandleSize(int x, int y, WXUINT id)
return processed; return processed;
} }
bool wxFrameMSW::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control) bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
{ {
if ( control ) if ( control )
{ {
@@ -703,7 +701,7 @@ bool wxFrameMSW::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
return FALSE; return FALSE;
} }
bool wxFrameMSW::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu)
{ {
int item; int item;
if ( flags == 0xFFFF && hMenu == 0 ) if ( flags == 0xFFFF && hMenu == 0 )
@@ -741,10 +739,10 @@ bool wxFrameMSW::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu)
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// the window proc for wxFrameMSW // the window proc for wxFrame
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
long wxFrameMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) long wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{ {
long rc = 0; long rc = 0;
bool processed = FALSE; bool processed = FALSE;

View File

@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: frame.cpp // Name: frame.cpp
// Purpose: wxFrameOS2 // Purpose: wxFrame
// Author: David Webster // Author: David Webster
// Modified by: // Modified by:
// Created: 10/27/99 // Created: 10/27/99
@@ -66,14 +66,12 @@ extern void wxAssociateWinWithHandle( HWND hWnd
// event tables // event tables
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxFrameOS2, wxFrameBase) BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
EVT_ACTIVATE(wxFrameOS2::OnActivate) EVT_ACTIVATE(wxFrame::OnActivate)
EVT_SYS_COLOUR_CHANGED(wxFrameOS2::OnSysColourChanged) EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
END_EVENT_TABLE() END_EVENT_TABLE()
#ifndef __WXUNIVERSAL__
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow) IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
#endif
// ============================================================================ // ============================================================================
// implementation // implementation
@@ -85,9 +83,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
#if wxUSE_NATIVE_STATUSBAR #if wxUSE_NATIVE_STATUSBAR
bool wxFrameOS2::m_bUseNativeStatusBar = TRUE; bool wxFrame::m_bUseNativeStatusBar = TRUE;
#else #else
bool wxFrameOS2::m_bUseNativeStatusBar = FALSE; bool wxFrame::m_bUseNativeStatusBar = FALSE;
#endif #endif
#endif //wxUSE_STATUSBAR #endif //wxUSE_STATUSBAR
@@ -96,7 +94,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
// creation/destruction // creation/destruction
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxFrameOS2::Init() void wxFrame::Init()
{ {
m_bIconized = FALSE; m_bIconized = FALSE;
@@ -130,9 +128,9 @@ void wxFrameOS2::Init()
memset(&m_vSwpVScroll, 0, sizeof(SWP)); memset(&m_vSwpVScroll, 0, sizeof(SWP));
memset(&m_vSwpStatusBar, 0, sizeof(SWP)); memset(&m_vSwpStatusBar, 0, sizeof(SWP));
memset(&m_vSwpToolBar, 0, sizeof(SWP)); memset(&m_vSwpToolBar, 0, sizeof(SWP));
} // end of wxFrameOS2::Init } // end of wxFrame::Init
bool wxFrameOS2::Create( bool wxFrame::Create(
wxWindow* pParent wxWindow* pParent
, wxWindowID vId , wxWindowID vId
, const wxString& rsTitle , const wxString& rsTitle
@@ -192,9 +190,9 @@ bool wxFrameOS2::Create(
wxModelessWindows.Append(this); wxModelessWindows.Append(this);
} }
return(bOk); return(bOk);
} // end of wxFrameOS2::Create } // end of wxFrame::Create
wxFrameOS2::~wxFrameOS2() wxFrame::~wxFrame()
{ {
m_isBeingDeleted = TRUE; m_isBeingDeleted = TRUE;
@@ -236,12 +234,12 @@ wxFrameOS2::~wxFrameOS2()
); );
} }
} }
} // end of wxFrameOS2::~wxFrame } // end of wxFrame::~wxFrame
// //
// Get size *available for subwindows* i.e. excluding menu bar, toolbar etc. // Get size *available for subwindows* i.e. excluding menu bar, toolbar etc.
// //
void wxFrameOS2::DoGetClientSize( void wxFrame::DoGetClientSize(
int* pX int* pX
, int* pY , int* pY
) const ) const
@@ -259,13 +257,13 @@ void wxFrameOS2::DoGetClientSize(
*pX = vRect.xRight - vRect.xLeft; *pX = vRect.xRight - vRect.xLeft;
if (pY) if (pY)
*pY = vRect.yTop - vRect.yBottom; *pY = vRect.yTop - vRect.yBottom;
} // end of wxFrameOS2::DoGetClientSize } // end of wxFrame::DoGetClientSize
// //
// Set the client size (i.e. leave the calculation of borders etc. // Set the client size (i.e. leave the calculation of borders etc.
// to wxWindows) // to wxWindows)
// //
void wxFrameOS2::DoSetClientSize( void wxFrame::DoSetClientSize(
int nWidth int nWidth
, int nHeight , int nHeight
) )
@@ -323,9 +321,9 @@ void wxFrameOS2::DoSetClientSize(
); );
vEvent.SetEventObject(this); vEvent.SetEventObject(this);
GetEventHandler()->ProcessEvent(vEvent); GetEventHandler()->ProcessEvent(vEvent);
} // end of wxFrameOS2::DoSetClientSize } // end of wxFrame::DoSetClientSize
void wxFrameOS2::DoGetSize( void wxFrame::DoGetSize(
int* pWidth int* pWidth
, int* pHeight , int* pHeight
) const ) const
@@ -335,9 +333,9 @@ void wxFrameOS2::DoGetSize(
::WinQueryWindowRect(m_hFrame, &vRect); ::WinQueryWindowRect(m_hFrame, &vRect);
*pWidth = vRect.xRight - vRect.xLeft; *pWidth = vRect.xRight - vRect.xLeft;
*pHeight = vRect.yTop - vRect.yBottom; *pHeight = vRect.yTop - vRect.yBottom;
} // end of wxFrameOS2::DoGetSize } // end of wxFrame::DoGetSize
void wxFrameOS2::DoGetPosition( void wxFrame::DoGetPosition(
int* pX int* pX
, int* pY , int* pY
) const ) const
@@ -349,21 +347,21 @@ void wxFrameOS2::DoGetPosition(
*pX = vRect.xRight - vRect.xLeft; *pX = vRect.xRight - vRect.xLeft;
*pY = vRect.yTop - vRect.yBottom; *pY = vRect.yTop - vRect.yBottom;
} // end of wxFrameOS2::DoGetPosition } // end of wxFrame::DoGetPosition
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// variations around ::ShowWindow() // variations around ::ShowWindow()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxFrameOS2::DoShowWindow( void wxFrame::DoShowWindow(
int bShowCmd int bShowCmd
) )
{ {
::WinShowWindow(m_hFrame, (BOOL)bShowCmd); ::WinShowWindow(m_hFrame, (BOOL)bShowCmd);
m_bIconized = bShowCmd == SWP_MINIMIZE; m_bIconized = bShowCmd == SWP_MINIMIZE;
} // end of wxFrameOS2::DoShowWindow } // end of wxFrame::DoShowWindow
bool wxFrameOS2::Show( bool wxFrame::Show(
bool bShow bool bShow
) )
{ {
@@ -406,27 +404,27 @@ bool wxFrameOS2::Show(
} }
} }
return TRUE; return TRUE;
} // end of wxFrameOS2::Show } // end of wxFrame::Show
void wxFrameOS2::Iconize( void wxFrame::Iconize(
bool bIconize bool bIconize
) )
{ {
DoShowWindow(bIconize ? SWP_MINIMIZE : SWP_RESTORE); DoShowWindow(bIconize ? SWP_MINIMIZE : SWP_RESTORE);
} // end of wxFrameOS2::Iconize } // end of wxFrame::Iconize
void wxFrameOS2::Maximize( void wxFrame::Maximize(
bool bMaximize) bool bMaximize)
{ {
DoShowWindow(bMaximize ? SWP_MAXIMIZE : SWP_RESTORE); DoShowWindow(bMaximize ? SWP_MAXIMIZE : SWP_RESTORE);
} // end of wxFrameOS2::Maximize } // end of wxFrame::Maximize
void wxFrameOS2::Restore() void wxFrame::Restore()
{ {
DoShowWindow(SWP_RESTORE); DoShowWindow(SWP_RESTORE);
} // end of wxFrameOS2::Restore } // end of wxFrame::Restore
bool wxFrameOS2::IsIconized() const bool wxFrame::IsIconized() const
{ {
SWP vSwp; SWP vSwp;
@@ -437,19 +435,19 @@ bool wxFrameOS2::IsIconized() const
else else
((wxFrame*)this)->m_bIconized = FALSE; ((wxFrame*)this)->m_bIconized = FALSE;
return m_bIconized; return m_bIconized;
} // end of wxFrameOS2::IsIconized } // end of wxFrame::IsIconized
// Is it maximized? // Is it maximized?
bool wxFrameOS2::IsMaximized() const bool wxFrame::IsMaximized() const
{ {
SWP vSwp; SWP vSwp;
bool bIconic; bool bIconic;
::WinQueryWindowPos(m_hFrame, &vSwp); ::WinQueryWindowPos(m_hFrame, &vSwp);
return (vSwp.fl & SWP_MAXIMIZE); return (vSwp.fl & SWP_MAXIMIZE);
} // end of wxFrameOS2::IsMaximized } // end of wxFrame::IsMaximized
void wxFrameOS2::SetIcon( void wxFrame::SetIcon(
const wxIcon& rIcon const wxIcon& rIcon
) )
{ {
@@ -468,10 +466,10 @@ void wxFrameOS2::SetIcon(
,(MPARAM)0 ,(MPARAM)0
); );
} }
} // end of wxFrameOS2::SetIcon } // end of wxFrame::SetIcon
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
wxStatusBar* wxFrameOS2::OnCreateStatusBar( wxStatusBar* wxFrame::OnCreateStatusBar(
int nNumber int nNumber
, long lulStyle , long lulStyle
, wxWindowID vId , wxWindowID vId
@@ -506,9 +504,9 @@ wxStatusBar* wxFrameOS2::OnCreateStatusBar(
::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)~0, 0); ::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)~0, 0);
return pStatusBar; return pStatusBar;
} // end of wxFrameOS2::OnCreateStatusBar } // end of wxFrame::OnCreateStatusBar
void wxFrameOS2::PositionStatusBar() void wxFrame::PositionStatusBar()
{ {
SWP vSwp; SWP vSwp;
ERRORID vError; ERRORID vError;
@@ -553,20 +551,20 @@ void wxFrameOS2::PositionStatusBar()
return; return;
} }
} }
} // end of wxFrameOS2::PositionStatusBar } // end of wxFrame::PositionStatusBar
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR
#if wxUSE_MENUS_NATIVE #if wxUSE_MENUS_NATIVE
void wxFrameOS2::DetachMenuBar() void wxFrame::DetachMenuBar()
{ {
if (m_frameMenuBar) if (m_frameMenuBar)
{ {
m_frameMenuBar->Detach(); m_frameMenuBar->Detach();
m_frameMenuBar = NULL; m_frameMenuBar = NULL;
} }
} // end of wxFrameOS2::DetachMenuBar } // end of wxFrame::DetachMenuBar
void wxFrameOS2::SetMenuBar( void wxFrame::SetMenuBar(
wxMenuBar* pMenuBar wxMenuBar* pMenuBar
) )
{ {
@@ -617,9 +615,9 @@ void wxFrameOS2::SetMenuBar(
m_frameMenuBar = pMenuBar; m_frameMenuBar = pMenuBar;
pMenuBar->Attach((wxFrame*)this); pMenuBar->Attach((wxFrame*)this);
} }
} // end of wxFrameOS2::SetMenuBar } // end of wxFrame::SetMenuBar
void wxFrameOS2::AttachMenuBar( void wxFrame::AttachMenuBar(
wxMenuBar* pMenubar wxMenuBar* pMenubar
) )
{ {
@@ -656,9 +654,9 @@ void wxFrameOS2::AttachMenuBar(
} }
InternalSetMenuBar(); InternalSetMenuBar();
} }
} // end of wxFrameOS2::AttachMenuBar } // end of wxFrame::AttachMenuBar
void wxFrameOS2::InternalSetMenuBar() void wxFrame::InternalSetMenuBar()
{ {
ERRORID vError; ERRORID vError;
wxString sError; wxString sError;
@@ -679,13 +677,13 @@ void wxFrameOS2::InternalSetMenuBar()
wxLogError("Error setting parent for submenu. Error: %s\n", sError); wxLogError("Error setting parent for submenu. Error: %s\n", sError);
} }
::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0); ::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
} // end of wxFrameOS2::InternalSetMenuBar } // end of wxFrame::InternalSetMenuBar
#endif // wxUSE_MENUS_NATIVE #endif // wxUSE_MENUS_NATIVE
// //
// Responds to colour changes, and passes event on to children // Responds to colour changes, and passes event on to children
// //
void wxFrameOS2::OnSysColourChanged( void wxFrame::OnSysColourChanged(
wxSysColourChangedEvent& rEvent wxSysColourChangedEvent& rEvent
) )
{ {
@@ -706,10 +704,10 @@ void wxFrameOS2::OnSysColourChanged(
// Propagate the event to the non-top-level children // Propagate the event to the non-top-level children
// //
wxWindow::OnSysColourChanged(rEvent); wxWindow::OnSysColourChanged(rEvent);
} // end of wxFrameOS2::OnSysColourChanged } // end of wxFrame::OnSysColourChanged
// Pass TRUE to show full screen, FALSE to restore. // Pass TRUE to show full screen, FALSE to restore.
bool wxFrameOS2::ShowFullScreen( bool wxFrame::ShowFullScreen(
bool bShow bool bShow
, long lStyle , long lStyle
) )
@@ -896,12 +894,12 @@ bool wxFrameOS2::ShowFullScreen(
); );
return TRUE; return TRUE;
} }
} // end of wxFrameOS2::ShowFullScreen } // end of wxFrame::ShowFullScreen
// //
// Frame window // Frame window
// //
bool wxFrameOS2::OS2Create( bool wxFrame::OS2Create(
int nId int nId
, wxWindow* pParent , wxWindow* pParent
, const wxChar* zWclass , const wxChar* zWclass
@@ -1090,13 +1088,13 @@ bool wxFrameOS2::OS2Create(
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
} // end of wxFrameOS2::OS2Create } // end of wxFrame::OS2Create
// //
// Default activation behaviour - set the focus for the first child // Default activation behaviour - set the focus for the first child
// subwindow found. // subwindow found.
// //
void wxFrameOS2::OnActivate( void wxFrame::OnActivate(
wxActivateEvent& rEvent wxActivateEvent& rEvent
) )
{ {
@@ -1147,7 +1145,7 @@ void wxFrameOS2::OnActivate(
} }
} }
} }
} // end of wxFrameOS2::OnActivate } // end of wxFrame::OnActivate
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxFrame size management: we exclude the areas taken by menu/status/toolbars // wxFrame size management: we exclude the areas taken by menu/status/toolbars
@@ -1156,7 +1154,7 @@ void wxFrameOS2::OnActivate(
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Checks if there is a toolbar, and returns the first free client position // Checks if there is a toolbar, and returns the first free client position
wxPoint wxFrameOS2::GetClientAreaOrigin() const wxPoint wxFrame::GetClientAreaOrigin() const
{ {
wxPoint vPoint(0, 0); wxPoint vPoint(0, 0);
@@ -1182,7 +1180,7 @@ wxPoint wxFrameOS2::GetClientAreaOrigin() const
} }
#endif //wxUSE_TOOLBAR #endif //wxUSE_TOOLBAR
return vPoint; return vPoint;
} // end of wxFrameOS2::GetClientAreaOrigin } // end of wxFrame::GetClientAreaOrigin
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// tool/status bar stuff // tool/status bar stuff
@@ -1190,7 +1188,7 @@ wxPoint wxFrameOS2::GetClientAreaOrigin() const
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
wxToolBar* wxFrameOS2::CreateToolBar( wxToolBar* wxFrame::CreateToolBar(
long lStyle long lStyle
, wxWindowID vId , wxWindowID vId
, const wxString& rName , const wxString& rName
@@ -1204,9 +1202,9 @@ wxToolBar* wxFrameOS2::CreateToolBar(
PositionToolBar(); PositionToolBar();
} }
return m_frameToolBar; return m_frameToolBar;
} // end of wxFrameOS2::CreateToolBar } // end of wxFrame::CreateToolBar
void wxFrameOS2::PositionToolBar() void wxFrame::PositionToolBar()
{ {
HWND hWndClient; HWND hWndClient;
RECTL vRect; RECTL vRect;
@@ -1255,7 +1253,7 @@ void wxFrameOS2::PositionToolBar()
,wxSIZE_NO_ADJUSTMENTS ,wxSIZE_NO_ADJUSTMENTS
); );
} }
} // end of wxFrameOS2::PositionToolBar } // end of wxFrame::PositionToolBar
#endif // wxUSE_TOOLBAR #endif // wxUSE_TOOLBAR
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1267,7 +1265,7 @@ void wxFrameOS2::PositionToolBar()
// Windows behaviour where child frames float independently of the parent one // Windows behaviour where child frames float independently of the parent one
// on the desktop, but are iconized/restored with it // on the desktop, but are iconized/restored with it
// //
void wxFrameOS2::IconizeChildFrames( void wxFrame::IconizeChildFrames(
bool bIconize bool bIconize
) )
{ {
@@ -1282,7 +1280,7 @@ void wxFrameOS2::IconizeChildFrames(
((wxFrame *)pWin)->Iconize(bIconize); ((wxFrame *)pWin)->Iconize(bIconize);
} }
} }
} // end of wxFrameOS2::IconizeChildFrames } // end of wxFrame::IconizeChildFrames
// =========================================================================== // ===========================================================================
// message processing // message processing
@@ -1291,7 +1289,7 @@ void wxFrameOS2::IconizeChildFrames(
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// preprocessing // preprocessing
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
bool wxFrameOS2::OS2TranslateMessage( bool wxFrame::OS2TranslateMessage(
WXMSG* pMsg WXMSG* pMsg
) )
{ {
@@ -1309,12 +1307,12 @@ bool wxFrameOS2::OS2TranslateMessage(
#else #else
return FALSE; return FALSE;
#endif //wxUSE_ACCEL #endif //wxUSE_ACCEL
} // end of wxFrameOS2::OS2TranslateMessage } // end of wxFrame::OS2TranslateMessage
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// our private (non virtual) message handlers // our private (non virtual) message handlers
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
bool wxFrameOS2::HandlePaint() bool wxFrame::HandlePaint()
{ {
RECTL vRect; RECTL vRect;
@@ -1372,9 +1370,9 @@ bool wxFrameOS2::HandlePaint()
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} // end of wxFrameOS2::HandlePaint } // end of wxFrame::HandlePaint
bool wxFrameOS2::HandleSize( bool wxFrame::HandleSize(
int nX int nX
, int nY , int nY
, WXUINT nId , WXUINT nId
@@ -1450,9 +1448,9 @@ bool wxFrameOS2::HandleSize(
bProcessed = GetEventHandler()->ProcessEvent(vEvent); bProcessed = GetEventHandler()->ProcessEvent(vEvent);
} }
return bProcessed; return bProcessed;
} // end of wxFrameOS2::HandleSize } // end of wxFrame::HandleSize
bool wxFrameOS2::HandleCommand( bool wxFrame::HandleCommand(
WXWORD nId WXWORD nId
, WXWORD nCmd , WXWORD nCmd
, WXHWND hControl , WXHWND hControl
@@ -1496,9 +1494,9 @@ bool wxFrameOS2::HandleCommand(
} }
} }
return FALSE; return FALSE;
} // end of wxFrameOS2::HandleCommand } // end of wxFrame::HandleCommand
bool wxFrameOS2::HandleMenuSelect( bool wxFrame::HandleMenuSelect(
WXWORD nItem WXWORD nItem
, WXWORD nFlags , WXWORD nFlags
, WXHMENU hMenu , WXHMENU hMenu
@@ -1520,7 +1518,7 @@ bool wxFrameOS2::HandleMenuSelect(
} }
} }
return TRUE; return TRUE;
} // end of wxFrameOS2::HandleMenuSelect } // end of wxFrame::HandleMenuSelect
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Main Frame window proc // Main Frame window proc
@@ -1656,7 +1654,7 @@ MRESULT EXPENTRY wxFrameWndProc(
return rc; return rc;
} // end of wxFrameWndProc } // end of wxFrameWndProc
MRESULT wxFrameOS2::OS2WindowProc( MRESULT wxFrame::OS2WindowProc(
WXUINT uMessage WXUINT uMessage
, WXWPARAM wParam , WXWPARAM wParam
, WXLPARAM lParam , WXLPARAM lParam
@@ -1766,14 +1764,14 @@ MRESULT wxFrameOS2::OS2WindowProc(
,lParam ,lParam
); );
return (MRESULT)mRc; return (MRESULT)mRc;
} // wxFrameOS2::OS2WindowProc } // wxFrame::OS2WindowProc
void wxFrameOS2::SetClient(WXHWND c_Hwnd) void wxFrame::SetClient(WXHWND c_Hwnd)
{ {
// Duh...nothing to do under OS/2 // Duh...nothing to do under OS/2
} }
void wxFrameOS2::SetClient( void wxFrame::SetClient(
wxWindow* pWindow wxWindow* pWindow
) )
{ {
@@ -1823,7 +1821,7 @@ void wxFrameOS2::SetClient(
} }
} }
wxWindow* wxFrameOS2::GetClient() wxWindow* wxFrame::GetClient()
{ {
return wxFindWinFromHandle((WXHWND)::WinWindowFromID(m_hFrame, FID_CLIENT)); return wxFindWinFromHandle((WXHWND)::WinWindowFromID(m_hFrame, FID_CLIENT));
} }