compilation fixes for wxGTK

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2960 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-07-07 15:11:09 +00:00
parent 4e9865026f
commit 232806507b
6 changed files with 182 additions and 169 deletions

View File

@@ -31,6 +31,18 @@
typedef wxObject* (*wxAppInitializerFunction)(); typedef wxObject* (*wxAppInitializerFunction)();
#endif #endif
// ----------------------------------------------------------------------------
// headers we have to include here
// ----------------------------------------------------------------------------
#include "wx/event.h" // for the base class
#include "wx/window.h" // for wxTopLevelWindows
#if wxUSE_LOG
#include "wx/log.h"
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// constants // constants
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -4,7 +4,7 @@
// Author: Robert Roebling // Author: Robert Roebling
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Robert Roebling // Copyright: (c) Robert Roebling
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGE_H_ #ifndef _WX_IMAGE_H_
@@ -18,9 +18,10 @@
#include "wx/object.h" #include "wx/object.h"
#include "wx/string.h" #include "wx/string.h"
#include "wx/gdicmn.h" #include "wx/gdicmn.h"
#include "wx/bitmap.h"
#if wxUSE_STREAMS #if wxUSE_STREAMS
#include "wx/stream.h" #include "wx/stream.h"
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -37,8 +38,6 @@ class WXDLLEXPORT wxJPEGHandler;
class WXDLLEXPORT wxBMPHandler; class WXDLLEXPORT wxBMPHandler;
class WXDLLEXPORT wxImage; class WXDLLEXPORT wxImage;
class WXDLLEXPORT wxBitmap;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxImageHandler // wxImageHandler
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -205,7 +204,7 @@ public:
wxImage Scale( int width, int height ) const; wxImage Scale( int width, int height ) const;
// rescales the image in place // rescales the image in place
wxImage Rescale( int width, int height ) { *this = Scale(width, height); } void Rescale( int width, int height ) { *this = Scale(width, height); }
// these routines are slow but safe // these routines are slow but safe
void SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b ); void SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b );

View File

@@ -8,6 +8,7 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "appbase.h"
#pragma implementation "app.h" #pragma implementation "app.h"
#endif #endif

View File

@@ -191,15 +191,15 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
for ( pc = title; *pc != _T('\0'); pc++ ) for ( pc = title; *pc != _T('\0'); pc++ )
{ {
if (*pc == _T('&')) if (*pc == _T('&'))
{ {
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
str << _T('_'); str << _T('_');
} else } else
if (*pc == _T('/')) if (*pc == _T('/'))
{ {
str << _T('\\'); str << _T('\\');
#endif #endif
} }
else else
str << *pc; str << *pc;
} }
@@ -215,7 +215,7 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
buf << '/' << str.mb_str(); buf << '/' << str.mb_str();
char *cbuf = new char[buf.Length()]; char *cbuf = new char[buf.Length()];
GtkItemFactoryEntry entry; GtkItemFactoryEntry entry;
entry.path = buf.c_str(); entry.path = (gchar *)buf.c_str(); // const_cast
entry.accelerator = (gchar*) NULL; entry.accelerator = (gchar*) NULL;
entry.callback = (GtkItemFactoryCallback) NULL; entry.callback = (GtkItemFactoryCallback) NULL;
entry.callback_action = 0; entry.callback_action = 0;
@@ -565,12 +565,12 @@ void wxMenuItem::SetName( const wxString& str )
for (; (*pc != _T('\0')) && (*pc != _T('\t')); pc++ ) for (; (*pc != _T('\0')) && (*pc != _T('\t')); pc++ )
{ {
if (*pc == _T('&')) if (*pc == _T('&'))
{ {
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
m_text << _T('_'); m_text << _T('_');
} else } else
if (*pc == _T('/')) /* we have to filter out slashes ... */ if (*pc == _T('/')) /* we have to filter out slashes ... */
{ {
m_text << _T('\\'); /* ... and replace them with back slashes */ m_text << _T('\\'); /* ... and replace them with back slashes */
#endif #endif
} }
@@ -684,7 +684,7 @@ wxMenu::Init( const wxString& title, const wxFunction func, long style )
entry.item_type = "<Tearoff>"; entry.item_type = "<Tearoff>";
entry.accelerator = (gchar*) NULL; entry.accelerator = (gchar*) NULL;
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 ? */
GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, "<main>/tearoff" ); //GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, "<main>/tearoff" );
} }
#endif #endif
} }
@@ -739,33 +739,33 @@ static char* GetHotKey( const wxString &hotkey, char *hotbuf )
switch (hotkey[0]) switch (hotkey[0])
{ {
case _T('a'): /* Alt */ case _T('a'): /* Alt */
case _T('A'): case _T('A'):
case _T('m'): /* Meta */ case _T('m'): /* Meta */
case _T('M'): case _T('M'):
{ {
strcpy( hotbuf, "<alt>" ); strcpy( hotbuf, "<alt>" );
wxString last = hotkey.Right(1); wxString last = hotkey.Right(1);
strcat( hotbuf, last.mb_str() ); strcat( hotbuf, last.mb_str() );
return hotbuf;
}
case _T('c'): /* Ctrl */
case _T('C'):
case _T('s'): /* Strg, yeah man, I'm German */
case _T('S'):
{
strcpy( hotbuf, "<control>" );
wxString last = hotkey.Right(1);
strcat( hotbuf, last.mb_str() );
return hotbuf; return hotbuf;
} }
case _T('F'): /* function keys */ case _T('c'): /* Ctrl */
{ case _T('C'):
strcpy( hotbuf, hotkey.mb_str() ); case _T('s'): /* Strg, yeah man, I'm German */
case _T('S'):
{
strcpy( hotbuf, "<control>" );
wxString last = hotkey.Right(1);
strcat( hotbuf, last.mb_str() );
return hotbuf; return hotbuf;
} }
default: case _T('F'): /* function keys */
{ {
} strcpy( hotbuf, hotkey.mb_str() );
return hotbuf;
}
default:
{
}
} }
return (char*) NULL; return (char*) NULL;
} }
@@ -940,8 +940,8 @@ int wxMenu::FindItem( const wxString itemString ) const
for ( const wxChar *pc = itemString; *pc != _T('\0'); pc++ ) for ( const wxChar *pc = itemString; *pc != _T('\0'); pc++ )
{ {
if (*pc == _T('&')) if (*pc == _T('&'))
{ {
pc++; /* skip it */ pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
s << _T('_'); s << _T('_');
#endif #endif

View File

@@ -8,6 +8,7 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "appbase.h"
#pragma implementation "app.h" #pragma implementation "app.h"
#endif #endif

View File

@@ -191,15 +191,15 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
for ( pc = title; *pc != _T('\0'); pc++ ) for ( pc = title; *pc != _T('\0'); pc++ )
{ {
if (*pc == _T('&')) if (*pc == _T('&'))
{ {
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
str << _T('_'); str << _T('_');
} else } else
if (*pc == _T('/')) if (*pc == _T('/'))
{ {
str << _T('\\'); str << _T('\\');
#endif #endif
} }
else else
str << *pc; str << *pc;
} }
@@ -215,7 +215,7 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
buf << '/' << str.mb_str(); buf << '/' << str.mb_str();
char *cbuf = new char[buf.Length()]; char *cbuf = new char[buf.Length()];
GtkItemFactoryEntry entry; GtkItemFactoryEntry entry;
entry.path = buf.c_str(); entry.path = (gchar *)buf.c_str(); // const_cast
entry.accelerator = (gchar*) NULL; entry.accelerator = (gchar*) NULL;
entry.callback = (GtkItemFactoryCallback) NULL; entry.callback = (GtkItemFactoryCallback) NULL;
entry.callback_action = 0; entry.callback_action = 0;
@@ -565,12 +565,12 @@ void wxMenuItem::SetName( const wxString& str )
for (; (*pc != _T('\0')) && (*pc != _T('\t')); pc++ ) for (; (*pc != _T('\0')) && (*pc != _T('\t')); pc++ )
{ {
if (*pc == _T('&')) if (*pc == _T('&'))
{ {
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
m_text << _T('_'); m_text << _T('_');
} else } else
if (*pc == _T('/')) /* we have to filter out slashes ... */ if (*pc == _T('/')) /* we have to filter out slashes ... */
{ {
m_text << _T('\\'); /* ... and replace them with back slashes */ m_text << _T('\\'); /* ... and replace them with back slashes */
#endif #endif
} }
@@ -684,7 +684,7 @@ wxMenu::Init( const wxString& title, const wxFunction func, long style )
entry.item_type = "<Tearoff>"; entry.item_type = "<Tearoff>";
entry.accelerator = (gchar*) NULL; entry.accelerator = (gchar*) NULL;
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 ? */
GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, "<main>/tearoff" ); //GtkWidget *menuItem = gtk_item_factory_get_widget( m_factory, "<main>/tearoff" );
} }
#endif #endif
} }
@@ -739,33 +739,33 @@ static char* GetHotKey( const wxString &hotkey, char *hotbuf )
switch (hotkey[0]) switch (hotkey[0])
{ {
case _T('a'): /* Alt */ case _T('a'): /* Alt */
case _T('A'): case _T('A'):
case _T('m'): /* Meta */ case _T('m'): /* Meta */
case _T('M'): case _T('M'):
{ {
strcpy( hotbuf, "<alt>" ); strcpy( hotbuf, "<alt>" );
wxString last = hotkey.Right(1); wxString last = hotkey.Right(1);
strcat( hotbuf, last.mb_str() ); strcat( hotbuf, last.mb_str() );
return hotbuf;
}
case _T('c'): /* Ctrl */
case _T('C'):
case _T('s'): /* Strg, yeah man, I'm German */
case _T('S'):
{
strcpy( hotbuf, "<control>" );
wxString last = hotkey.Right(1);
strcat( hotbuf, last.mb_str() );
return hotbuf; return hotbuf;
} }
case _T('F'): /* function keys */ case _T('c'): /* Ctrl */
{ case _T('C'):
strcpy( hotbuf, hotkey.mb_str() ); case _T('s'): /* Strg, yeah man, I'm German */
case _T('S'):
{
strcpy( hotbuf, "<control>" );
wxString last = hotkey.Right(1);
strcat( hotbuf, last.mb_str() );
return hotbuf; return hotbuf;
} }
default: case _T('F'): /* function keys */
{ {
} strcpy( hotbuf, hotkey.mb_str() );
return hotbuf;
}
default:
{
}
} }
return (char*) NULL; return (char*) NULL;
} }
@@ -940,8 +940,8 @@ int wxMenu::FindItem( const wxString itemString ) const
for ( const wxChar *pc = itemString; *pc != _T('\0'); pc++ ) for ( const wxChar *pc = itemString; *pc != _T('\0'); pc++ )
{ {
if (*pc == _T('&')) if (*pc == _T('&'))
{ {
pc++; /* skip it */ pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
s << _T('_'); s << _T('_');
#endif #endif