Made the RTTI thing an option.
Added submenus to controls sample. Failed at producing tear-off menus. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2819 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
25
configure.in
25
configure.in
@@ -230,6 +230,8 @@ if test $DEBUG_CONFIGURE = 1; then
|
|||||||
|
|
||||||
DEFAULT_wxUSE_OPTIMISE=no
|
DEFAULT_wxUSE_OPTIMISE=no
|
||||||
DEFAULT_wxUSE_PROFILE=no
|
DEFAULT_wxUSE_PROFILE=no
|
||||||
|
DEFAULT_wxUSE_NO_RTTI=no
|
||||||
|
DEFAULT_wxUSE_NO_EXCEPTIONS=no
|
||||||
DEFAULT_wxUSE_DEBUG_FLAG=yes
|
DEFAULT_wxUSE_DEBUG_FLAG=yes
|
||||||
DEFAULT_wxUSE_DEBUG_INFO=yes
|
DEFAULT_wxUSE_DEBUG_INFO=yes
|
||||||
DEFAULT_wxUSE_DEBUG_GDB=yes
|
DEFAULT_wxUSE_DEBUG_GDB=yes
|
||||||
@@ -325,6 +327,8 @@ else
|
|||||||
|
|
||||||
DEFAULT_wxUSE_OPTIMISE=yes
|
DEFAULT_wxUSE_OPTIMISE=yes
|
||||||
DEFAULT_wxUSE_PROFILE=no
|
DEFAULT_wxUSE_PROFILE=no
|
||||||
|
DEFAULT_wxUSE_NO_RTTI=no
|
||||||
|
DEFAULT_wxUSE_NO_EXCEPTIONS=no
|
||||||
DEFAULT_wxUSE_DEBUG_FLAG=no
|
DEFAULT_wxUSE_DEBUG_FLAG=no
|
||||||
DEFAULT_wxUSE_DEBUG_INFO=no
|
DEFAULT_wxUSE_DEBUG_INFO=no
|
||||||
DEFAULT_wxUSE_DEBUG_GDB=no
|
DEFAULT_wxUSE_DEBUG_GDB=no
|
||||||
@@ -480,6 +484,8 @@ WX_ARG_ENABLE(debug_gdb, [ --enable-debug_gdb create code with extra GDB
|
|||||||
WX_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt use wxDebugContext], wxUSE_DEBUG_CONTEXT)
|
WX_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt use wxDebugContext], wxUSE_DEBUG_CONTEXT)
|
||||||
WX_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing create code with memory tracing], wxUSE_MEM_TRACING)
|
WX_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing create code with memory tracing], wxUSE_MEM_TRACING)
|
||||||
WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE)
|
WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE)
|
||||||
|
WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI)
|
||||||
|
WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without exceptions information], wxUSE_NO_EXCEPTIONS)
|
||||||
|
|
||||||
dnl ---------------------------------------------------------------------------
|
dnl ---------------------------------------------------------------------------
|
||||||
dnl --disable-gui will build only non-GUI part of wxWindows
|
dnl --disable-gui will build only non-GUI part of wxWindows
|
||||||
@@ -1379,6 +1385,16 @@ if test "$wxUSE_PROFILE" = "yes" ; then
|
|||||||
PROFILE="-pg"
|
PROFILE="-pg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$GCC" = yes ; then
|
||||||
|
if test "$wxUSE_NO_RTTI" = "yes" ; then
|
||||||
|
WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-rtti"
|
||||||
|
fi
|
||||||
|
if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
|
||||||
|
WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-exceptions"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
CXXFLAGS=`echo "${CXXFLAGS}" | sed "s/\-O.//g" `
|
CXXFLAGS=`echo "${CXXFLAGS}" | sed "s/\-O.//g" `
|
||||||
CFLAGS=`echo "${CFLAGS}" | sed "s/\-O.//g" `
|
CFLAGS=`echo "${CFLAGS}" | sed "s/\-O.//g" `
|
||||||
if test "$wxUSE_OPTIMISE" = "no" ; then
|
if test "$wxUSE_OPTIMISE" = "no" ; then
|
||||||
@@ -1386,15 +1402,6 @@ if test "$wxUSE_OPTIMISE" = "no" ; then
|
|||||||
else
|
else
|
||||||
if test "$GCC" = yes ; then
|
if test "$GCC" = yes ; then
|
||||||
OPTIMISE="-O2"
|
OPTIMISE="-O2"
|
||||||
|
|
||||||
save_CFLAGS="$CFLAGS"
|
|
||||||
CFLAGS="$CFLAGS -fno-rtti -fno-exceptions"
|
|
||||||
AC_TRY_COMPILE(
|
|
||||||
[], [int some_variable = 0;],
|
|
||||||
WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-rtti -fno-exceptions",
|
|
||||||
)
|
|
||||||
CFLAGS="$save_CFLAGS"
|
|
||||||
|
|
||||||
case "${host}" in
|
case "${host}" in
|
||||||
i586-*-*|i686-*-* )
|
i586-*-*|i686-*-* )
|
||||||
OPTIMISE="${OPTIMISE} "
|
OPTIMISE="${OPTIMISE} "
|
||||||
|
@@ -248,6 +248,17 @@ The following options handle the kind of library you want to build.
|
|||||||
--enable-profile Add profiling info to the object
|
--enable-profile Add profiling info to the object
|
||||||
files. Currently broken, I think.
|
files. Currently broken, I think.
|
||||||
|
|
||||||
|
--enable-no_rtti Enable compilation without creation of
|
||||||
|
C++ RTTI information in object files.
|
||||||
|
This will speed-up compilation and reduce
|
||||||
|
binary size.
|
||||||
|
|
||||||
|
--enable-no_rtti Enable compilation without creation of
|
||||||
|
C++ exception information in object files.
|
||||||
|
This will speed-up compilation and reduce
|
||||||
|
binary size. Also fewer crashes during the
|
||||||
|
actual compilation...
|
||||||
|
|
||||||
--enable-mem_tracing Add built-in memory tracing.
|
--enable-mem_tracing Add built-in memory tracing.
|
||||||
|
|
||||||
--enable-dmalloc Use the dmalloc memory debugger.
|
--enable-dmalloc Use the dmalloc memory debugger.
|
||||||
|
@@ -186,6 +186,17 @@ The following options handle the kind of library you want to build.
|
|||||||
--enable-profile Add profiling info to the object
|
--enable-profile Add profiling info to the object
|
||||||
files. Currently broken, I think.
|
files. Currently broken, I think.
|
||||||
|
|
||||||
|
--enable-no_rtti Enable compilation without creation of
|
||||||
|
C++ RTTI information in object files.
|
||||||
|
This will speed-up compilation and reduce
|
||||||
|
binary size.
|
||||||
|
|
||||||
|
--enable-no_rtti Enable compilation without creation of
|
||||||
|
C++ exception information in object files.
|
||||||
|
This will speed-up compilation and reduce
|
||||||
|
binary size. Also fewer crashes during the
|
||||||
|
actual compilation...
|
||||||
|
|
||||||
--enable-mem_tracing Add built-in memory tracing.
|
--enable-mem_tracing Add built-in memory tracing.
|
||||||
|
|
||||||
--enable-dmalloc Use the dmalloc memory debugger.
|
--enable-dmalloc Use the dmalloc memory debugger.
|
||||||
|
@@ -141,6 +141,12 @@ int MyApp::OnExit()
|
|||||||
MyFrame::MyFrame()
|
MyFrame::MyFrame()
|
||||||
: wxFrame((wxFrame *) NULL, -1, "wxConfig Demo")
|
: wxFrame((wxFrame *) NULL, -1, "wxConfig Demo")
|
||||||
{
|
{
|
||||||
|
// submenu
|
||||||
|
wxMenu *sub_menu = new wxMenu( wxMENU_TEAROFF );
|
||||||
|
sub_menu->Append(Minimal_About, "&About", "About this sample");
|
||||||
|
sub_menu->Append(Minimal_About, "&About", "About this sample");
|
||||||
|
sub_menu->Append(Minimal_About, "&About", "About this sample");
|
||||||
|
|
||||||
// menu
|
// menu
|
||||||
wxMenu *file_menu = new wxMenu;
|
wxMenu *file_menu = new wxMenu;
|
||||||
|
|
||||||
|
@@ -164,9 +164,16 @@ bool MyApp::OnInit()
|
|||||||
|
|
||||||
frame->SetIcon( wxICON(mondrian) );
|
frame->SetIcon( wxICON(mondrian) );
|
||||||
|
|
||||||
|
// submenu
|
||||||
|
wxMenu *sub_menu = new wxMenu( wxMENU_TEAROFF );
|
||||||
|
sub_menu->Append(MINIMAL_ABOUT, "&About", "About this sample");
|
||||||
|
sub_menu->Append(MINIMAL_ABOUT, "&About", "About this sample");
|
||||||
|
sub_menu->Append(MINIMAL_ABOUT, "&About", "About this sample");
|
||||||
|
|
||||||
wxMenu *file_menu = new wxMenu;
|
wxMenu *file_menu = new wxMenu;
|
||||||
file_menu->Append(MINIMAL_ABOUT, "&About\tF1");
|
file_menu->Append(MINIMAL_ABOUT, "&About\tF1");
|
||||||
file_menu->Append(MINIMAL_QUIT, "E&xit\tAlt-X", "Quit controls sample");
|
file_menu->Append(MINIMAL_QUIT, "E&xit\tAlt-X", "Quit controls sample");
|
||||||
|
file_menu->Append( 0, "&Submenu", sub_menu );
|
||||||
|
|
||||||
wxMenuBar *menu_bar = new wxMenuBar( wxMB_DOCKABLE );
|
wxMenuBar *menu_bar = new wxMenuBar( wxMB_DOCKABLE );
|
||||||
menu_bar->Append(file_menu, "&File");
|
menu_bar->Append(file_menu, "&File");
|
||||||
|
@@ -44,8 +44,6 @@
|
|||||||
// global data
|
// global data
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
extern wxCursor g_globalCursor;
|
|
||||||
|
|
||||||
wxApp *wxTheApp = (wxApp *) NULL;
|
wxApp *wxTheApp = (wxApp *) NULL;
|
||||||
wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
|
wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
|
||||||
|
|
||||||
@@ -577,9 +575,6 @@ bool wxApp::Initialize()
|
|||||||
|
|
||||||
wxImage::InitStandardHandlers();
|
wxImage::InitStandardHandlers();
|
||||||
|
|
||||||
// Not needed, leave it as default. (KB)
|
|
||||||
// g_globalCursor = wxCursor(wxCURSOR_DEFAULT);
|
|
||||||
|
|
||||||
wxModule::RegisterModules();
|
wxModule::RegisterModules();
|
||||||
if (!wxModule::InitializeModules()) return FALSE;
|
if (!wxModule::InitializeModules()) return FALSE;
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ wxCursor::wxCursor( int cursorId )
|
|||||||
GdkCursorType gdk_cur = GDK_LEFT_PTR;
|
GdkCursorType gdk_cur = GDK_LEFT_PTR;
|
||||||
switch (cursorId)
|
switch (cursorId)
|
||||||
{
|
{
|
||||||
case wxCURSOR_DEFAULT: gdk_cur = GDK_ARROW; break;
|
case wxCURSOR_DEFAULT: gdk_cur = GDK_LEFT_PTR; break;
|
||||||
case wxCURSOR_HAND: gdk_cur = GDK_HAND1; break;
|
case wxCURSOR_HAND: gdk_cur = GDK_HAND1; break;
|
||||||
case wxCURSOR_CROSS: gdk_cur = GDK_CROSSHAIR; break;
|
case wxCURSOR_CROSS: gdk_cur = GDK_CROSSHAIR; break;
|
||||||
case wxCURSOR_SIZEWE: gdk_cur = GDK_SB_H_DOUBLE_ARROW; break;
|
case wxCURSOR_SIZEWE: gdk_cur = GDK_SB_H_DOUBLE_ARROW; break;
|
||||||
|
@@ -218,9 +218,13 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
|||||||
entry.accelerator = (gchar*) NULL;
|
entry.accelerator = (gchar*) NULL;
|
||||||
entry.callback = (GtkItemFactoryCallback) NULL;
|
entry.callback = (GtkItemFactoryCallback) NULL;
|
||||||
entry.callback_action = 0;
|
entry.callback_action = 0;
|
||||||
entry.item_type = (m_style & wxMB_TEAROFF || menu->GetStyle() &
|
|
||||||
wxMENU_TEAROFF) ?
|
/*
|
||||||
"<Tearoff>" : "<Branch>";
|
if ((m_style & wxMB_TEAROFF) || (menu->GetStyle() & wxMENU_TEAROFF))
|
||||||
|
entry.item_type = "<Tearoff>";
|
||||||
|
else
|
||||||
|
*/
|
||||||
|
entry.item_type = "<Branch>";
|
||||||
|
|
||||||
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
|
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
|
||||||
|
|
||||||
@@ -236,6 +240,16 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
|||||||
|
|
||||||
gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu );
|
gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu );
|
||||||
|
|
||||||
|
/*
|
||||||
|
if ((m_style & wxMB_TEAROFF) || (menu->GetStyle() & wxMENU_TEAROFF))
|
||||||
|
{
|
||||||
|
entry.item_type = "<Tearoff>";
|
||||||
|
tmp.Remove( 0, 6 );
|
||||||
|
tmp.Append( _T("/tearoff") );
|
||||||
|
strcpy( buf, tmp.mb_str() );
|
||||||
|
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );
|
||||||
|
}
|
||||||
|
*/
|
||||||
#else
|
#else
|
||||||
|
|
||||||
menu->m_owner = gtk_menu_item_new_with_label( str.mb_str() );
|
menu->m_owner = gtk_menu_item_new_with_label( str.mb_str() );
|
||||||
@@ -845,7 +859,13 @@ void wxMenu::Append( int id, const wxString &item, wxMenu *subMenu, const wxStri
|
|||||||
entry.path = buf;
|
entry.path = buf;
|
||||||
entry.callback = (GtkItemFactoryCallback) 0;
|
entry.callback = (GtkItemFactoryCallback) 0;
|
||||||
entry.callback_action = 0;
|
entry.callback_action = 0;
|
||||||
entry.item_type = (m_style & wxMENU_TEAROFF) ? "<Tearoff>" : "<Branch>";
|
|
||||||
|
/*
|
||||||
|
if (m_style & wxMENU_TEAROFF)
|
||||||
|
entry.item_type = "<Tearoff>";
|
||||||
|
else
|
||||||
|
*/
|
||||||
|
entry.item_type = "<Branch>";
|
||||||
|
|
||||||
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
|
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
|
||||||
|
|
||||||
|
@@ -44,8 +44,6 @@
|
|||||||
// global data
|
// global data
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
extern wxCursor g_globalCursor;
|
|
||||||
|
|
||||||
wxApp *wxTheApp = (wxApp *) NULL;
|
wxApp *wxTheApp = (wxApp *) NULL;
|
||||||
wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
|
wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
|
||||||
|
|
||||||
@@ -577,9 +575,6 @@ bool wxApp::Initialize()
|
|||||||
|
|
||||||
wxImage::InitStandardHandlers();
|
wxImage::InitStandardHandlers();
|
||||||
|
|
||||||
// Not needed, leave it as default. (KB)
|
|
||||||
// g_globalCursor = wxCursor(wxCURSOR_DEFAULT);
|
|
||||||
|
|
||||||
wxModule::RegisterModules();
|
wxModule::RegisterModules();
|
||||||
if (!wxModule::InitializeModules()) return FALSE;
|
if (!wxModule::InitializeModules()) return FALSE;
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ wxCursor::wxCursor( int cursorId )
|
|||||||
GdkCursorType gdk_cur = GDK_LEFT_PTR;
|
GdkCursorType gdk_cur = GDK_LEFT_PTR;
|
||||||
switch (cursorId)
|
switch (cursorId)
|
||||||
{
|
{
|
||||||
case wxCURSOR_DEFAULT: gdk_cur = GDK_ARROW; break;
|
case wxCURSOR_DEFAULT: gdk_cur = GDK_LEFT_PTR; break;
|
||||||
case wxCURSOR_HAND: gdk_cur = GDK_HAND1; break;
|
case wxCURSOR_HAND: gdk_cur = GDK_HAND1; break;
|
||||||
case wxCURSOR_CROSS: gdk_cur = GDK_CROSSHAIR; break;
|
case wxCURSOR_CROSS: gdk_cur = GDK_CROSSHAIR; break;
|
||||||
case wxCURSOR_SIZEWE: gdk_cur = GDK_SB_H_DOUBLE_ARROW; break;
|
case wxCURSOR_SIZEWE: gdk_cur = GDK_SB_H_DOUBLE_ARROW; break;
|
||||||
|
@@ -218,9 +218,13 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
|||||||
entry.accelerator = (gchar*) NULL;
|
entry.accelerator = (gchar*) NULL;
|
||||||
entry.callback = (GtkItemFactoryCallback) NULL;
|
entry.callback = (GtkItemFactoryCallback) NULL;
|
||||||
entry.callback_action = 0;
|
entry.callback_action = 0;
|
||||||
entry.item_type = (m_style & wxMB_TEAROFF || menu->GetStyle() &
|
|
||||||
wxMENU_TEAROFF) ?
|
/*
|
||||||
"<Tearoff>" : "<Branch>";
|
if ((m_style & wxMB_TEAROFF) || (menu->GetStyle() & wxMENU_TEAROFF))
|
||||||
|
entry.item_type = "<Tearoff>";
|
||||||
|
else
|
||||||
|
*/
|
||||||
|
entry.item_type = "<Branch>";
|
||||||
|
|
||||||
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
|
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
|
||||||
|
|
||||||
@@ -236,6 +240,16 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
|||||||
|
|
||||||
gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu );
|
gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu );
|
||||||
|
|
||||||
|
/*
|
||||||
|
if ((m_style & wxMB_TEAROFF) || (menu->GetStyle() & wxMENU_TEAROFF))
|
||||||
|
{
|
||||||
|
entry.item_type = "<Tearoff>";
|
||||||
|
tmp.Remove( 0, 6 );
|
||||||
|
tmp.Append( _T("/tearoff") );
|
||||||
|
strcpy( buf, tmp.mb_str() );
|
||||||
|
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );
|
||||||
|
}
|
||||||
|
*/
|
||||||
#else
|
#else
|
||||||
|
|
||||||
menu->m_owner = gtk_menu_item_new_with_label( str.mb_str() );
|
menu->m_owner = gtk_menu_item_new_with_label( str.mb_str() );
|
||||||
@@ -845,7 +859,13 @@ void wxMenu::Append( int id, const wxString &item, wxMenu *subMenu, const wxStri
|
|||||||
entry.path = buf;
|
entry.path = buf;
|
||||||
entry.callback = (GtkItemFactoryCallback) 0;
|
entry.callback = (GtkItemFactoryCallback) 0;
|
||||||
entry.callback_action = 0;
|
entry.callback_action = 0;
|
||||||
entry.item_type = (m_style & wxMENU_TEAROFF) ? "<Tearoff>" : "<Branch>";
|
|
||||||
|
/*
|
||||||
|
if (m_style & wxMENU_TEAROFF)
|
||||||
|
entry.item_type = "<Tearoff>";
|
||||||
|
else
|
||||||
|
*/
|
||||||
|
entry.item_type = "<Branch>";
|
||||||
|
|
||||||
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
|
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user