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
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
// ------------------
#if wxUSE_MENUS
- virtual void SetMenuBar(wxMenuBar *menubar) = 0;
+ virtual void SetMenuBar(wxMenuBar *menubar);
virtual wxMenuBar *GetMenuBar() const { return m_frameMenuBar; }
#endif // wxUSE_MENUS
// 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
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();
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__
// 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"
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 );
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();
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__
// 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"
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 );
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; };
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();
// 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
// ---------------------------------------------------------------------------
#define _WX_POPUPWIN_H_BASE_
#ifdef __GNUG__
- #pragma interface "popupwin.h"
+ #pragma interface "popupwinbase.h"
#endif
#include "wx/window.h"
bool m_shouldShowMenu;
// it calls out ProcessMouseEvent()
-#ifdef __WXMAC__
friend class wxPopupMenuWindow;
-#else
- friend wxPopupMenuWindow;
-#endif
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxMenuBar)
#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
// ----------------------------------------------------------------------------
return GetEventHandler()->ProcessEvent(event);
}
+void wxFrameBase::OnIdle(wxIdleEvent& WXUNUSED(event) )
+{
+#if wxUSE_MENUS
+ DoMenuUpdates();
+#endif // wxUSE_MENUS
+}
+
// ----------------------------------------------------------------------------
// status bar stuff
// ----------------------------------------------------------------------------
#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
}
}
+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
// ----------------------------------------------------------------------------
#ifdef __GNUG__
- #pragma implementation "popupwin.h"
+ #pragma implementation "popupwinbase.h"
#endif
// For compilers that support precompilation, includes "wx.h".
-# 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 \
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(),
return TRUE;
}
-#if wxUSE_MENUS
+#if wxUSE_MENUS_NATIVE
+
//-----------------------------------------------------------------------------
// "child_attached" of menu bar
//-----------------------------------------------------------------------------
win->m_menuBarDetached = TRUE;
win->GtkUpdateSize();
}
-#endif // wxUSE_MENUS
+
+#endif // wxUSE_MENUS_NATIVE
#if wxUSE_TOOLBAR
//-----------------------------------------------------------------------------
// 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 );
gtk_widget_unparent( m_frameMenuBar->m_widget );
}
- m_frameMenuBar = menuBar;
+ wxFrameBase::DetachMenuBar();
+}
+
+void wxFrameGTK::AttachMenuBar( wxMenuBar *menuBar )
+{
+ wxFrameBase::AttachMenuBar(menuBar);
if (m_frameMenuBar)
{
m_sizeSet = FALSE;
}
-#endif // wxUSE_MENUS
+#endif // wxUSE_MENUS_NATIVE
#if wxUSE_TOOLBAR
// 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 )
{
// 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()
{
// Pop-up menu stuff
//-----------------------------------------------------------------------------
-#if wxUSE_MENUS
+#if wxUSE_MENUS_NATIVE
static void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting )
{
return TRUE;
}
-#endif // wxUSE_MENUS
+#endif // wxUSE_MENUS_NATIVE
#if wxUSE_DRAG_AND_DROP
return TRUE;
}
-#if wxUSE_MENUS
+#if wxUSE_MENUS_NATIVE
+
//-----------------------------------------------------------------------------
// "child_attached" of menu bar
//-----------------------------------------------------------------------------
win->m_menuBarDetached = TRUE;
win->GtkUpdateSize();
}
-#endif // wxUSE_MENUS
+
+#endif // wxUSE_MENUS_NATIVE
#if wxUSE_TOOLBAR
//-----------------------------------------------------------------------------
// 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 );
gtk_widget_unparent( m_frameMenuBar->m_widget );
}
- m_frameMenuBar = menuBar;
+ wxFrameBase::DetachMenuBar();
+}
+
+void wxFrameGTK::AttachMenuBar( wxMenuBar *menuBar )
+{
+ wxFrameBase::AttachMenuBar(menuBar);
if (m_frameMenuBar)
{
m_sizeSet = FALSE;
}
-#endif // wxUSE_MENUS
+#endif // wxUSE_MENUS_NATIVE
#if wxUSE_TOOLBAR
// 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 )
{
// 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()
{
// Pop-up menu stuff
//-----------------------------------------------------------------------------
-#if wxUSE_MENUS
+#if wxUSE_MENUS_NATIVE
static void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting )
{
return TRUE;
}
-#endif // wxUSE_MENUS
+#endif // wxUSE_MENUS_NATIVE
#if wxUSE_DRAG_AND_DROP
-# 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 \
-# 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 \
}
#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
}
else
{
- if (menubar->IsAttached())
+ if ( menubar->IsAttached() )
menubar->Detach();
m_hMenu = menubar->Create();
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__
-# 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!
#
-# 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!
#
-# 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!
#
-# 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!
#
-# 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
-# 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
# 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 \
..\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 = \
#!/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!
#
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);
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 \
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
}
else // right
{
- if ( ++currentNew == (int)count )
+ if ( ++currentNew == count )
currentNew = 0;
}
void wxMenuBar::OnDismiss()
{
- ReleaseCapture();
+ ReleaseMouse();
if ( m_current != -1 )
{