From 6522713c7527e5f683a107dff8f40e3ea19a4745 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 10 Jul 2001 12:25:46 +0000 Subject: [PATCH] wxUniv compilation fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/tmake/filelist.txt | 2 ++ include/wx/frame.h | 10 +++++++- include/wx/gtk/frame.h | 11 ++++---- include/wx/gtk/popupwin.h | 6 ++--- include/wx/gtk/window.h | 4 +-- include/wx/gtk1/frame.h | 11 ++++---- include/wx/gtk1/popupwin.h | 6 ++--- include/wx/gtk1/window.h | 4 +-- include/wx/msw/frame.h | 7 +++-- include/wx/msw/window.h | 8 ------ include/wx/popupwin.h | 2 +- include/wx/univ/menu.h | 4 --- include/wx/window.h | 8 ++++++ src/common/framecmn.cpp | 47 ++++++++++++++++++++++++++++------ src/common/popupcmn.cpp | 2 +- src/files.lst | 2 +- src/generic/listctrl.cpp | 23 +++++++++++------ src/gtk/frame.cpp | 24 +++++++++-------- src/gtk/popupwin.cpp | 6 ++--- src/gtk/window.cpp | 12 +++++---- src/gtk1/frame.cpp | 24 +++++++++-------- src/gtk1/popupwin.cpp | 6 ++--- src/gtk1/window.cpp | 12 +++++---- src/motif/files.lst | 2 +- src/msw/files.lst | 2 +- src/msw/frame.cpp | 30 +++------------------- src/msw/makefile.b32 | 2 +- src/msw/makefile.bcc | 2 +- src/msw/makefile.dos | 2 +- src/msw/makefile.g95 | 2 +- src/msw/makefile.sc | 2 +- src/msw/makefile.vc | 12 ++------- src/msw/makefile.wat | 2 +- src/univ/combobox.cpp | 3 +-- src/univ/files.lst | 3 +++ src/univ/framuniv.cpp | 6 +---- src/univ/menu.cpp | 4 +-- 37 files changed, 169 insertions(+), 146 deletions(-) diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index 86fdcf17f8..7679fa0555 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -256,6 +256,7 @@ dragimag.cpp MSW dropsrc.cpp MSW OLE droptgt.cpp MSW OLE enhmeta.cpp MSW Win32Only +evtloop.cpp MSW LowLevel filedlg.cpp MSW font.cpp MSW fontdlg.cpp MSW @@ -390,6 +391,7 @@ dcmemory.cpp GTK LowLevel dcscreen.cpp GTK LowLevel dialog.cpp GTK LowLevel dnd.cpp GTK LowLevel +evtloop.cpp GTK LowLevel font.cpp GTK LowLevel fontdlg.cpp GTK frame.cpp GTK LowLevel diff --git a/include/wx/frame.h b/include/wx/frame.h index 0667019482..5e5d7aabe5 100644 --- a/include/wx/frame.h +++ b/include/wx/frame.h @@ -105,7 +105,7 @@ public: // ------------------ #if wxUSE_MENUS - virtual void SetMenuBar(wxMenuBar *menubar) = 0; + virtual void SetMenuBar(wxMenuBar *menubar); virtual wxMenuBar *GetMenuBar() const { return m_frameMenuBar; } #endif // wxUSE_MENUS @@ -200,6 +200,14 @@ protected: // override to update menu bar position when the frame size changes virtual void PositionMenuBar() { } + // override to do something special when the menu bar is being removed + // from the frame + virtual void DetachMenuBar(); + + // override to do something special when the menu bar is attached to the + // frame + virtual void AttachMenuBar(wxMenuBar *menubar); + wxMenuBar *m_frameMenuBar; #endif // wxUSE_MENUS diff --git a/include/wx/gtk/frame.h b/include/wx/gtk/frame.h index fd7e72f4d3..8d37644740 100644 --- a/include/wx/gtk/frame.h +++ b/include/wx/gtk/frame.h @@ -70,10 +70,6 @@ public: virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); virtual bool IsFullScreen() const { return m_fsIsShowing; }; -#if wxUSE_MENUS - virtual void SetMenuBar( wxMenuBar *menuBar ); -#endif // wxUSE_MENUS - #if wxUSE_STATUSBAR virtual void PositionStatusBar(); @@ -134,8 +130,13 @@ protected: virtual void DoSetClientSize(int width, int height); virtual void DoGetClientSize( int *width, int *height ) const; +#if wxUSE_MENUS_NATIVE + virtual void DetachMenuBar(); + virtual void AttachMenuBar(wxMenuBar *menubar); +#endif // wxUSE_MENUS_NATIVE + // is the frame currently iconized? - bool m_isIconized; + bool m_isIconized; }; #endif // __GTKFRAMEH__ diff --git a/include/wx/gtk/popupwin.h b/include/wx/gtk/popupwin.h index 4d161eafde..ef0b43b49f 100644 --- a/include/wx/gtk/popupwin.h +++ b/include/wx/gtk/popupwin.h @@ -4,15 +4,15 @@ // Author: Robert Roebling // Created: // Id: $Id$ -// Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Copyright: (c) 2001 Robert Roebling +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __GTKPOPUPWINH__ #define __GTKPOPUPWINH__ #ifdef __GNUG__ -#pragma interface + #pragma interface "popupwin.h" #endif #include "wx/defs.h" diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index cff540d0fd..8fafeca033 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -85,9 +85,9 @@ public: const wxFont *theFont = (const wxFont *) NULL) const; -#if wxUSE_MENUS +#if wxUSE_MENUS_NATIVE virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); -#endif // wxUSE_MENUS +#endif // wxUSE_MENUS_NATIVE virtual void SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh = TRUE ); diff --git a/include/wx/gtk1/frame.h b/include/wx/gtk1/frame.h index fd7e72f4d3..8d37644740 100644 --- a/include/wx/gtk1/frame.h +++ b/include/wx/gtk1/frame.h @@ -70,10 +70,6 @@ public: virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); virtual bool IsFullScreen() const { return m_fsIsShowing; }; -#if wxUSE_MENUS - virtual void SetMenuBar( wxMenuBar *menuBar ); -#endif // wxUSE_MENUS - #if wxUSE_STATUSBAR virtual void PositionStatusBar(); @@ -134,8 +130,13 @@ protected: virtual void DoSetClientSize(int width, int height); virtual void DoGetClientSize( int *width, int *height ) const; +#if wxUSE_MENUS_NATIVE + virtual void DetachMenuBar(); + virtual void AttachMenuBar(wxMenuBar *menubar); +#endif // wxUSE_MENUS_NATIVE + // is the frame currently iconized? - bool m_isIconized; + bool m_isIconized; }; #endif // __GTKFRAMEH__ diff --git a/include/wx/gtk1/popupwin.h b/include/wx/gtk1/popupwin.h index 4d161eafde..ef0b43b49f 100644 --- a/include/wx/gtk1/popupwin.h +++ b/include/wx/gtk1/popupwin.h @@ -4,15 +4,15 @@ // Author: Robert Roebling // Created: // Id: $Id$ -// Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Copyright: (c) 2001 Robert Roebling +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __GTKPOPUPWINH__ #define __GTKPOPUPWINH__ #ifdef __GNUG__ -#pragma interface + #pragma interface "popupwin.h" #endif #include "wx/defs.h" diff --git a/include/wx/gtk1/window.h b/include/wx/gtk1/window.h index cff540d0fd..8fafeca033 100644 --- a/include/wx/gtk1/window.h +++ b/include/wx/gtk1/window.h @@ -85,9 +85,9 @@ public: const wxFont *theFont = (const wxFont *) NULL) const; -#if wxUSE_MENUS +#if wxUSE_MENUS_NATIVE virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); -#endif // wxUSE_MENUS +#endif // wxUSE_MENUS_NATIVE virtual void SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh = TRUE ); diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index 9b76f8b8c0..22509da920 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -50,7 +50,6 @@ public: virtual void Iconize(bool iconize = TRUE); virtual bool IsIconized() const; virtual void Restore(); - virtual void SetMenuBar(wxMenuBar *menubar); virtual void SetIcon(const wxIcon& icon); virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); virtual bool IsFullScreen() const { return m_fsIsShowing; }; @@ -134,10 +133,10 @@ protected: virtual void DoSetClientSize(int width, int height); - // helper - void DetachMenuBar(); - #if wxUSE_MENUS_NATIVE + // perform MSW-specific action when menubar is changed + virtual void AttachMenuBar(wxMenuBar *menubar); + // a plug in for MDI frame classes which need to do something special when // the menubar is set virtual void InternalSetMenuBar(); diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index ccd6f259c4..6bdc49db2a 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -28,14 +28,6 @@ // a better solution should be found later... #define wxUSE_MOUSEEVENT_HACK 0 -// when building wxUniv/MSW we don't want the code for native menu use to be -// compiled in - it should only be used when building real wxMSW -#ifdef __WXUNIVERSAL__ - #define wxUSE_MENUS_NATIVE 0 -#else // __WXMSW__ - #define wxUSE_MENUS_NATIVE wxUSE_MENUS -#endif // __WXUNIVERSAL__/__WXMSW__ - // --------------------------------------------------------------------------- // constants // --------------------------------------------------------------------------- diff --git a/include/wx/popupwin.h b/include/wx/popupwin.h index 4c00cc1ed9..9774f8e23b 100644 --- a/include/wx/popupwin.h +++ b/include/wx/popupwin.h @@ -13,7 +13,7 @@ #define _WX_POPUPWIN_H_BASE_ #ifdef __GNUG__ - #pragma interface "popupwin.h" + #pragma interface "popupwinbase.h" #endif #include "wx/window.h" diff --git a/include/wx/univ/menu.h b/include/wx/univ/menu.h index c8f14231eb..1e75af0763 100644 --- a/include/wx/univ/menu.h +++ b/include/wx/univ/menu.h @@ -278,11 +278,7 @@ private: bool m_shouldShowMenu; // it calls out ProcessMouseEvent() -#ifdef __WXMAC__ friend class wxPopupMenuWindow; -#else - friend wxPopupMenuWindow; -#endif DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxMenuBar) diff --git a/include/wx/window.h b/include/wx/window.h index 5cef6812a1..f425041036 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -36,6 +36,14 @@ #include "wx/accel.h" #endif // wxUSE_ACCEL +// when building wxUniv/Foo we don't want the code for native menu use to be +// compiled in - it should only be used when building real wxFoo +#ifdef __WXUNIVERSAL__ + #define wxUSE_MENUS_NATIVE 0 +#else // __WXMSW__ + #define wxUSE_MENUS_NATIVE wxUSE_MENUS +#endif // __WXUNIVERSAL__/__WXMSW__ + // ---------------------------------------------------------------------------- // forward declarations // ---------------------------------------------------------------------------- diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index 9ec8339d2f..318b662f28 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -321,6 +321,13 @@ bool wxFrameBase::SendIconizeEvent(bool iconized) return GetEventHandler()->ProcessEvent(event); } +void wxFrameBase::OnIdle(wxIdleEvent& WXUNUSED(event) ) +{ +#if wxUSE_MENUS + DoMenuUpdates(); +#endif // wxUSE_MENUS +} + // ---------------------------------------------------------------------------- // status bar stuff // ---------------------------------------------------------------------------- @@ -449,16 +456,9 @@ wxToolBar* wxFrameBase::OnCreateToolBar(long style, #endif // wxUSE_TOOLBAR // ---------------------------------------------------------------------------- -// Menu UI updating +// menus // ---------------------------------------------------------------------------- -void wxFrameBase::OnIdle(wxIdleEvent& WXUNUSED(event) ) -{ -#if wxUSE_MENUS - DoMenuUpdates(); -#endif // wxUSE_MENUS -} - #if wxUSE_MENUS // update all menus @@ -510,4 +510,35 @@ void wxFrameBase::DoMenuUpdates(wxMenu* menu, wxWindow* focusWin) } } +void wxFrameBase::DetachMenuBar() +{ + if ( m_frameMenuBar ) + { + m_frameMenuBar->Detach(); + m_frameMenuBar = NULL; + } +} + +void wxFrameBase::AttachMenuBar(wxMenuBar *menubar) +{ + if ( menubar ) + { + m_frameMenuBar = menubar; + menubar->Attach((wxFrame *)this); + } +} + +void wxFrameBase::SetMenuBar(wxMenuBar *menubar) +{ + if ( menubar == GetMenuBar() ) + { + // nothing to do + return; + } + + DetachMenuBar(); + + AttachMenuBar(menubar); +} + #endif // wxUSE_MENUS diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index b0309296cc..d6319df904 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -18,7 +18,7 @@ // ---------------------------------------------------------------------------- #ifdef __GNUG__ - #pragma implementation "popupwin.h" + #pragma implementation "popupwinbase.h" #endif // For compilers that support precompilation, includes "wx.h". diff --git a/src/files.lst b/src/files.lst index 090f343ea8..909c57198e 100644 --- a/src/files.lst +++ b/src/files.lst @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 21:37, 2001/07/03 +# This file was automatically generated by tmake at 18:07, 2001/07/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BASE.T! ALL_SOURCES = \ common/init.cpp \ diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index a2c0f37a5c..aa69f008ce 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4027,17 +4027,24 @@ void wxListMainWindow::GetVisibleLinesRange(size_t *from, size_t *to) if ( m_lineFrom == (size_t)-1 ) { - m_lineFrom = GetScrollPos(wxVERTICAL); - size_t count = GetItemCount(); + if ( count ) + { + m_lineFrom = GetScrollPos(wxVERTICAL); - wxASSERT_MSG( m_lineFrom < count, _T("invalid scroll position?") ); + wxASSERT_MSG( m_lineFrom < count, _T("invalid scroll position?") ); - // we redraw one extra line but this is needed to make the redrawing - // logic work when there is a fractional number of lines on screen - m_lineTo = m_lineFrom + m_linesPerPage; - if ( m_lineTo >= count ) - m_lineTo = count - 1; + // we redraw one extra line but this is needed to make the redrawing + // logic work when there is a fractional number of lines on screen + m_lineTo = m_lineFrom + m_linesPerPage; + if ( m_lineTo >= count ) + m_lineTo = count - 1; + } + else // empty control + { + m_lineFrom = 0; + m_lineTo = (size_t)-1; + } } wxASSERT_MSG( m_lineFrom <= m_lineTo && m_lineTo < GetItemCount(), diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 9bd428174f..fb364d258e 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -153,7 +153,8 @@ static gint gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WX return TRUE; } -#if wxUSE_MENUS +#if wxUSE_MENUS_NATIVE + //----------------------------------------------------------------------------- // "child_attached" of menu bar //----------------------------------------------------------------------------- @@ -177,7 +178,8 @@ static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget * win->m_menuBarDetached = TRUE; win->GtkUpdateSize(); } -#endif // wxUSE_MENUS + +#endif // wxUSE_MENUS_NATIVE #if wxUSE_TOOLBAR //----------------------------------------------------------------------------- @@ -1050,17 +1052,14 @@ void wxFrameGTK::OnInternalIdle() // menu/tool/status bar stuff // ---------------------------------------------------------------------------- -#if wxUSE_MENUS +#if wxUSE_MENUS_NATIVE -void wxFrameGTK::SetMenuBar( wxMenuBar *menuBar ) +void wxFrameGTK::DetachMenuBar() { wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") ); - if (menuBar == m_frameMenuBar) - return; - - if (m_frameMenuBar) + if ( m_frameMenuBar ) { m_frameMenuBar->UnsetInvokingWindow( this ); @@ -1078,7 +1077,12 @@ void wxFrameGTK::SetMenuBar( wxMenuBar *menuBar ) gtk_widget_unparent( m_frameMenuBar->m_widget ); } - m_frameMenuBar = menuBar; + wxFrameBase::DetachMenuBar(); +} + +void wxFrameGTK::AttachMenuBar( wxMenuBar *menuBar ) +{ + wxFrameBase::AttachMenuBar(menuBar); if (m_frameMenuBar) { @@ -1108,7 +1112,7 @@ void wxFrameGTK::SetMenuBar( wxMenuBar *menuBar ) m_sizeSet = FALSE; } -#endif // wxUSE_MENUS +#endif // wxUSE_MENUS_NATIVE #if wxUSE_TOOLBAR diff --git a/src/gtk/popupwin.cpp b/src/gtk/popupwin.cpp index 36ef2e7b62..1bda6c9850 100644 --- a/src/gtk/popupwin.cpp +++ b/src/gtk/popupwin.cpp @@ -141,11 +141,11 @@ static void wxInsertChildInDialog( wxPopupWindow* parent, wxWindow* child ) // wxPopupWindow //----------------------------------------------------------------------------- -BEGIN_EVENT_TABLE(wxPopupWindow,wxPopupWindowBase) - EVT_SIZE (wxPopupWindow::OnSize) +BEGIN_EVENT_TABLE(wxPopupWindow, wxPopupWindowBase) + EVT_SIZE(wxPopupWindow::OnSize) END_EVENT_TABLE() -IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow,wxPopupWindowBase) +IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow) bool wxPopupWindow::Create( wxWindow *parent, int style ) { diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 292de55f0d..15b54ffc16 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2260,11 +2260,13 @@ wxWindow *wxGetActiveWindow() // wxWindowGTK //----------------------------------------------------------------------------- +// in wxUniv/MSW this class is abstract because it doesn't have DoPopupMenu() +// method #ifdef __WXUNIVERSAL__ - IMPLEMENT_DYNAMIC_CLASS(wxWindowGTK, wxWindowBase) -#else + IMPLEMENT_ABSTRACT_CLASS(wxWindowGTK, wxWindowBase) +#else // __WXGTK__ IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase) -#endif +#endif // __WXUNIVERSAL__/__WXGTK__ void wxWindowGTK::Init() { @@ -3605,7 +3607,7 @@ void wxWindowGTK::ApplyWidgetStyle() // Pop-up menu stuff //----------------------------------------------------------------------------- -#if wxUSE_MENUS +#if wxUSE_MENUS_NATIVE static void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting ) { @@ -3677,7 +3679,7 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y ) return TRUE; } -#endif // wxUSE_MENUS +#endif // wxUSE_MENUS_NATIVE #if wxUSE_DRAG_AND_DROP diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 9bd428174f..fb364d258e 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -153,7 +153,8 @@ static gint gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WX return TRUE; } -#if wxUSE_MENUS +#if wxUSE_MENUS_NATIVE + //----------------------------------------------------------------------------- // "child_attached" of menu bar //----------------------------------------------------------------------------- @@ -177,7 +178,8 @@ static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget * win->m_menuBarDetached = TRUE; win->GtkUpdateSize(); } -#endif // wxUSE_MENUS + +#endif // wxUSE_MENUS_NATIVE #if wxUSE_TOOLBAR //----------------------------------------------------------------------------- @@ -1050,17 +1052,14 @@ void wxFrameGTK::OnInternalIdle() // menu/tool/status bar stuff // ---------------------------------------------------------------------------- -#if wxUSE_MENUS +#if wxUSE_MENUS_NATIVE -void wxFrameGTK::SetMenuBar( wxMenuBar *menuBar ) +void wxFrameGTK::DetachMenuBar() { wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") ); - if (menuBar == m_frameMenuBar) - return; - - if (m_frameMenuBar) + if ( m_frameMenuBar ) { m_frameMenuBar->UnsetInvokingWindow( this ); @@ -1078,7 +1077,12 @@ void wxFrameGTK::SetMenuBar( wxMenuBar *menuBar ) gtk_widget_unparent( m_frameMenuBar->m_widget ); } - m_frameMenuBar = menuBar; + wxFrameBase::DetachMenuBar(); +} + +void wxFrameGTK::AttachMenuBar( wxMenuBar *menuBar ) +{ + wxFrameBase::AttachMenuBar(menuBar); if (m_frameMenuBar) { @@ -1108,7 +1112,7 @@ void wxFrameGTK::SetMenuBar( wxMenuBar *menuBar ) m_sizeSet = FALSE; } -#endif // wxUSE_MENUS +#endif // wxUSE_MENUS_NATIVE #if wxUSE_TOOLBAR diff --git a/src/gtk1/popupwin.cpp b/src/gtk1/popupwin.cpp index 36ef2e7b62..1bda6c9850 100644 --- a/src/gtk1/popupwin.cpp +++ b/src/gtk1/popupwin.cpp @@ -141,11 +141,11 @@ static void wxInsertChildInDialog( wxPopupWindow* parent, wxWindow* child ) // wxPopupWindow //----------------------------------------------------------------------------- -BEGIN_EVENT_TABLE(wxPopupWindow,wxPopupWindowBase) - EVT_SIZE (wxPopupWindow::OnSize) +BEGIN_EVENT_TABLE(wxPopupWindow, wxPopupWindowBase) + EVT_SIZE(wxPopupWindow::OnSize) END_EVENT_TABLE() -IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow,wxPopupWindowBase) +IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow) bool wxPopupWindow::Create( wxWindow *parent, int style ) { diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 292de55f0d..15b54ffc16 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2260,11 +2260,13 @@ wxWindow *wxGetActiveWindow() // wxWindowGTK //----------------------------------------------------------------------------- +// in wxUniv/MSW this class is abstract because it doesn't have DoPopupMenu() +// method #ifdef __WXUNIVERSAL__ - IMPLEMENT_DYNAMIC_CLASS(wxWindowGTK, wxWindowBase) -#else + IMPLEMENT_ABSTRACT_CLASS(wxWindowGTK, wxWindowBase) +#else // __WXGTK__ IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase) -#endif +#endif // __WXUNIVERSAL__/__WXGTK__ void wxWindowGTK::Init() { @@ -3605,7 +3607,7 @@ void wxWindowGTK::ApplyWidgetStyle() // Pop-up menu stuff //----------------------------------------------------------------------------- -#if wxUSE_MENUS +#if wxUSE_MENUS_NATIVE static void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting ) { @@ -3677,7 +3679,7 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y ) return TRUE; } -#endif // wxUSE_MENUS +#endif // wxUSE_MENUS_NATIVE #if wxUSE_DRAG_AND_DROP diff --git a/src/motif/files.lst b/src/motif/files.lst index 84c1b4cb83..63dd6e5e98 100644 --- a/src/motif/files.lst +++ b/src/motif/files.lst @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 21:37, 2001/07/03 +# This file was automatically generated by tmake at 18:07, 2001/07/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE MOTIF.T! ALL_SOURCES = \ generic/busyinfo.cpp \ diff --git a/src/msw/files.lst b/src/msw/files.lst index 13424fd721..1f8f6b056d 100644 --- a/src/msw/files.lst +++ b/src/msw/files.lst @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 21:37, 2001/07/03 +# This file was automatically generated by tmake at 18:07, 2001/07/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE MSW.T! ALL_SOURCES = \ generic/busyinfo.cpp \ diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 0a453aba9a..4304b09fee 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -486,24 +486,10 @@ void wxFrameMSW::PositionStatusBar() } #endif // wxUSE_STATUSBAR -void wxFrameMSW::DetachMenuBar() -{ -#if wxUSE_MENUS - if ( m_frameMenuBar ) - { - m_frameMenuBar->Detach(); - m_frameMenuBar = NULL; - } -#endif // wxUSE_MENUS -} +#if wxUSE_MENUS_NATIVE -void wxFrameMSW::SetMenuBar(wxMenuBar *menubar) +void wxFrameMSW::AttachMenuBar(wxMenuBar *menubar) { -#if wxUSE_MENUS - // detach the old menu bar in any case - DetachMenuBar(); - -#if wxUSE_MENUS_NATIVE if ( !menubar ) { // actually remove the menu from the frame @@ -519,7 +505,7 @@ void wxFrameMSW::SetMenuBar(wxMenuBar *menubar) } else { - if (menubar->IsAttached()) + if ( menubar->IsAttached() ) menubar->Detach(); m_hMenu = menubar->Create(); @@ -530,18 +516,8 @@ void wxFrameMSW::SetMenuBar(wxMenuBar *menubar) InternalSetMenuBar(); } -#endif // wxUSE_MENUS_NATIVE - - if ( menubar ) - { - m_frameMenuBar = menubar; - menubar->Attach((wxFrame *)this); - } -#endif // wxUSE_MENUS } -#if wxUSE_MENUS_NATIVE - void wxFrameMSW::InternalSetMenuBar() { #ifndef __WXMICROWIN__ diff --git a/src/msw/makefile.b32 b/src/msw/makefile.b32 index 5a4bd9dc98..04d933efbc 100644 --- a/src/msw/makefile.b32 +++ b/src/msw/makefile.b32 @@ -1,6 +1,6 @@ -# This file was automatically generated by tmake at 21:37, 2001/07/03 +# This file was automatically generated by tmake at 18:07, 2001/07/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE B32.T! # diff --git a/src/msw/makefile.bcc b/src/msw/makefile.bcc index bb10e7eee7..6ca26a58c6 100644 --- a/src/msw/makefile.bcc +++ b/src/msw/makefile.bcc @@ -1,6 +1,6 @@ -# This file was automatically generated by tmake at 21:37, 2001/07/03 +# This file was automatically generated by tmake at 18:07, 2001/07/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BCC.T! # diff --git a/src/msw/makefile.dos b/src/msw/makefile.dos index 48f475ae3d..296a78c15d 100644 --- a/src/msw/makefile.dos +++ b/src/msw/makefile.dos @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 21:37, 2001/07/03 +# This file was automatically generated by tmake at 18:07, 2001/07/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE DOS.T! # diff --git a/src/msw/makefile.g95 b/src/msw/makefile.g95 index f8c6369172..c93eb1ae62 100644 --- a/src/msw/makefile.g95 +++ b/src/msw/makefile.g95 @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 21:37, 2001/07/03 +# This file was automatically generated by tmake at 18:07, 2001/07/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T! # diff --git a/src/msw/makefile.sc b/src/msw/makefile.sc index 08d4dfd928..63a52568e9 100644 --- a/src/msw/makefile.sc +++ b/src/msw/makefile.sc @@ -1,6 +1,6 @@ -# This file was automatically generated by tmake at 21:37, 2001/07/03 +# This file was automatically generated by tmake at 18:07, 2001/07/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE SC.T! # Symantec C++ makefile for the msw objects diff --git a/src/msw/makefile.vc b/src/msw/makefile.vc index a16ebeedd3..889657ffd3 100644 --- a/src/msw/makefile.vc +++ b/src/msw/makefile.vc @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 21:37, 2001/07/03 +# This file was automatically generated by tmake at 18:07, 2001/07/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE VC.T! # File: makefile.vc @@ -117,12 +117,8 @@ GENERICOBJS= ..\generic\$D\busyinfo.obj \ # These are generic things that don't need to be compiled on MSW, # but sometimes it's useful to do so for testing purposes. -NONESSENTIALOBJS= ..\generic\$D\accel.obj \ - ..\generic\$D\caret.obj \ - ..\generic\$D\colrdlgg.obj \ - ..\generic\$D\dcpsg.obj \ +NONESSENTIALOBJS= ..\generic\$D\colrdlgg.obj \ ..\generic\$D\dirdlgg.obj \ - ..\generic\$D\filedlgg.obj \ ..\generic\$D\fontdlgg.obj \ ..\generic\$D\helpext.obj \ ..\generic\$D\helphtml.obj \ @@ -132,10 +128,6 @@ NONESSENTIALOBJS= ..\generic\$D\accel.obj \ ..\generic\$D\listctrl.obj \ ..\generic\$D\msgdlgg.obj \ ..\generic\$D\notebook.obj \ - ..\generic\$D\paletteg.obj \ - ..\generic\$D\printps.obj \ - ..\generic\$D\prntdlgg.obj \ - ..\generic\$D\statline.obj \ ..\generic\$D\tabg.obj COMMONOBJS = \ diff --git a/src/msw/makefile.wat b/src/msw/makefile.wat index 9679ff2684..f2c59e80ea 100644 --- a/src/msw/makefile.wat +++ b/src/msw/makefile.wat @@ -1,6 +1,6 @@ #!/binb/wmake.exe -# This file was automatically generated by tmake at 21:37, 2001/07/03 +# This file was automatically generated by tmake at 18:07, 2001/07/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T! # diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 92dc487e4e..2a7117c254 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -300,8 +300,7 @@ void wxComboControl::DoMoveWindow(int x, int y, int width, int height) width -= rectBorders.x + rectBorders.width; height -= rectBorders.y + rectBorders.height; - wxSize sizeBtn = m_btn->GetSize(), - sizeText = m_text->GetSize(); + wxSize sizeBtn = m_btn->GetSize(); wxCoord wText = width - sizeBtn.x; m_text->SetSize(x, y, wText, height); diff --git a/src/univ/files.lst b/src/univ/files.lst index afc6bafd99..876773c449 100644 --- a/src/univ/files.lst +++ b/src/univ/files.lst @@ -8,12 +8,15 @@ UNIVOBJS = \ colschem.o \ control.o \ combobox.o \ + evtloop.o \ framuniv.o \ gauge.o \ gtk.o \ inphand.o \ listbox.o \ + menu.o \ notebook.o \ + popupcmn.o \ radiobox.o \ radiobut.o \ renderer.o \ diff --git a/src/univ/framuniv.cpp b/src/univ/framuniv.cpp index 4ae3912a68..951ab8630a 100644 --- a/src/univ/framuniv.cpp +++ b/src/univ/framuniv.cpp @@ -41,11 +41,7 @@ BEGIN_EVENT_TABLE(wxFrame, wxFrameNative) EVT_SIZE(wxFrame::OnSize) END_EVENT_TABLE() -#if defined(__WXMSW__) - IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxFrameMSW) -#elif defined(__WXGTK__) - IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxFrameGTK) -#endif +IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow) // ---------------------------------------------------------------------------- // ctors diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index 1d819ad0fe..ba08a02a6e 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -2038,7 +2038,7 @@ void wxMenuBar::OnKeyDown(wxKeyEvent& event) } else // right { - if ( ++currentNew == (int)count ) + if ( ++currentNew == count ) currentNew = 0; } @@ -2263,7 +2263,7 @@ void wxMenuBar::OnDismissMenu(bool dismissMenuBar) void wxMenuBar::OnDismiss() { - ReleaseCapture(); + ReleaseMouse(); if ( m_current != -1 ) { -- 2.47.2