Added mising AddBitmapList in wxBitmap

Added missing deletion of wxFrame's toolbar
  Removed a few superfluous ; (sorry)
  Mentioned dmalloc in INSTALL


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 1998-08-16 19:39:29 +00:00
parent 11026f7b59
commit ff7b1510ea
40 changed files with 786 additions and 779 deletions

View File

@ -133,14 +133,17 @@ The following options handle the kind of library you want to build.
--without-optimise Do not optimise the code.
--with-profile Add profiling info to the
object files. Currently
broken.
--with-profile Add profiling info to the object
files. Currently broken, I think.
--with-mem_tracing Add built-in memory tracing.
--with-mem_tracing Add built-in memory tracing.
This doesn't work well with gcc.
--with-debug_info Add debug info to object
files.
--with-dmalloc Use the dmalloc memory debugger.
Read more at www.letters.com/dmalloc/
--with-debug_info Add debug info to object files and
executables.
--with-debug_flag Define __DEBUG__ and __WXDEBUG__ when
compiling.

View File

@ -30,9 +30,8 @@
#include "bitmaps/save.xpm"
#include "bitmaps/copy.xpm"
#include "bitmaps/cut.xpm"
// #include "bitmaps/paste.xpm"
#include "bitmaps/paste.xpm"
#include "bitmaps/print.xpm"
#include "bitmaps/preview.xpm"
#include "bitmaps/help.xpm"
#endif
@ -322,8 +321,7 @@ void MyFrame::InitToolBar(wxToolBar* toolBar)
bitmaps[2] = new wxBitmap( save_xpm );
bitmaps[3] = new wxBitmap( copy_xpm );
bitmaps[4] = new wxBitmap( cut_xpm );
// bitmaps[5] = new wxBitmap( paste_xpm );
bitmaps[5] = new wxBitmap( preview_xpm );
bitmaps[5] = new wxBitmap( paste_xpm );
bitmaps[6] = new wxBitmap( print_xpm );
bitmaps[7] = new wxBitmap( help_xpm );
#endif
@ -335,7 +333,7 @@ void MyFrame::InitToolBar(wxToolBar* toolBar)
#endif
int currentX = 5;
toolBar->AddTool(0, *bitmaps[0], wxNullBitmap, FALSE, currentX, -1, NULL, "New file");
toolBar->AddTool(0, *(bitmaps[0]), wxNullBitmap, FALSE, currentX, -1, NULL, "New file");
currentX += width + 5;
toolBar->AddTool(1, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, NULL, "Open file");
currentX += width + 5;

View File

@ -52,13 +52,13 @@ extern void wxFlushResources(void);
void wxExit(void)
{
gtk_main_quit();
};
}
bool wxYield(void)
{
while (gtk_events_pending() > 0) gtk_main_iteration();
return TRUE;
};
}
//-----------------------------------------------------------------------------
// wxApp
@ -72,38 +72,38 @@ END_EVENT_TABLE()
gint wxapp_idle_callback( gpointer WXUNUSED(data) )
{
if (wxTheApp) while (wxTheApp->ProcessIdle()) {};
if (wxTheApp) while (wxTheApp->ProcessIdle()) {}
usleep( 10000 );
return TRUE;
};
}
wxApp::wxApp()
{
m_idleTag = 0;
m_topWindow = NULL;
m_exitOnFrameDelete = TRUE;
};
}
wxApp::~wxApp(void)
{
gtk_idle_remove( m_idleTag );
};
}
bool wxApp::OnInit(void)
{
return TRUE;
};
}
bool wxApp::OnInitGui(void)
{
m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL );
return TRUE;
};
}
int wxApp::OnRun(void)
{
return MainLoop();
};
}
bool wxApp::ProcessIdle(void)
{
@ -112,7 +112,7 @@ bool wxApp::ProcessIdle(void)
ProcessEvent( event );
return event.MoreRequested();
};
}
void wxApp::OnIdle( wxIdleEvent &event )
{
@ -139,7 +139,7 @@ void wxApp::OnIdle( wxIdleEvent &event )
event.RequestMore(TRUE);
inOnIdle = FALSE;
};
}
bool wxApp::SendIdleEvents(void)
{
@ -154,7 +154,7 @@ bool wxApp::SendIdleEvents(void)
node = node->Next();
}
return needMore;
};
}
bool wxApp::SendIdleEvents( wxWindow* win )
{
@ -177,37 +177,37 @@ bool wxApp::SendIdleEvents( wxWindow* win )
node = node->Next();
}
return needMore ;
};
}
int wxApp::OnExit(void)
{
return 0;
};
}
int wxApp::MainLoop(void)
{
gtk_main();
return 0;
};
}
void wxApp::ExitMainLoop(void)
{
gtk_main_quit();
};
}
bool wxApp::Initialized(void)
{
return m_initialized;
};
}
bool wxApp::Pending(void)
{
return FALSE;
};
}
void wxApp::Dispatch(void)
{
};
}
void wxApp::DeletePendingObjects(void)
{
@ -222,8 +222,8 @@ void wxApp::DeletePendingObjects(void)
delete node;
node = wxPendingDelete.First();
};
};
}
}
wxWindow *wxApp::GetTopWindow(void)
{
@ -231,12 +231,12 @@ wxWindow *wxApp::GetTopWindow(void)
wxNode *node = wxTopLevelWindows.First();
if (!node) return NULL;
return (wxWindow*)node->Data();
};
}
void wxApp::SetTopWindow( wxWindow *win )
{
m_topWindow = win;
};
}
void wxApp::CommonInit(void)
{
@ -273,7 +273,7 @@ void wxApp::CommonInit(void)
g_globalCursor = new wxCursor;
*/
};
}
void wxApp::CommonCleanUp(void)
{
@ -292,7 +292,7 @@ void wxApp::CommonCleanUp(void)
wxCleanUpResourceSystem();
wxSystemSettings::Done();
};
}
wxLog *wxApp::CreateLogTarget()
{
@ -327,20 +327,20 @@ int wxEntry( int argc, char *argv[] )
{
printf( _("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
return 0;
};
}
wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
wxObject *test_app = app_ini();
wxTheApp = (wxApp*) test_app;
};
}
if (!wxTheApp)
{
printf( _("wxWindows error: wxTheApp == NULL\n") );
return 0;
};
}
wxTheApp->argc = argc;
wxTheApp->argv = argv;
@ -396,7 +396,7 @@ int wxEntry( int argc, char *argv[] )
#endif
return retValue;
};
}
//-----------------------------------------------------------------------------
// main()

View File

@ -28,19 +28,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxMask,wxObject)
wxMask::wxMask(void)
{
m_bitmap = NULL;
};
}
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), const wxColour& WXUNUSED(colour) )
{
};
}
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex) )
{
};
}
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap) )
{
};
}
wxMask::~wxMask(void)
{
@ -49,12 +49,12 @@ wxMask::~wxMask(void)
#else
if (m_bitmap) gdk_bitmap_unref( m_bitmap );
#endif
};
}
GdkBitmap *wxMask::GetBitmap(void) const
{
return m_bitmap;
};
}
//-----------------------------------------------------------------------------
// wxBitmap
@ -92,7 +92,7 @@ wxBitmapRefData::wxBitmapRefData(void)
#ifdef USE_GDK_IMLIB
m_image = NULL;
#endif
};
}
wxBitmapRefData::~wxBitmapRefData(void)
{
@ -105,7 +105,7 @@ wxBitmapRefData::~wxBitmapRefData(void)
if (m_bitmap) gdk_bitmap_unref( m_bitmap );
if (m_mask) delete m_mask;
if (m_palette) delete m_palette;
};
}
//-----------------------------------------------------------------------------
@ -116,7 +116,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxGDIObject)
wxBitmap::wxBitmap(void)
{
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
};
}
wxBitmap::wxBitmap( int width, int height, int depth )
{
@ -129,7 +129,7 @@ wxBitmap::wxBitmap( int width, int height, int depth )
M_BMPDATA->m_bpp = depth;
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
};
}
wxBitmap::wxBitmap( char **bits )
{
@ -146,7 +146,7 @@ wxBitmap::wxBitmap( char **bits )
{
M_BMPDATA->m_mask = new wxMask();
M_BMPDATA->m_mask->m_bitmap = mask;
};
}
gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) );
@ -160,26 +160,28 @@ wxBitmap::wxBitmap( char **bits )
M_BMPDATA->m_bpp = 24; // ?
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
};
}
wxBitmap::wxBitmap( const wxBitmap& bmp )
{
Ref( bmp );
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
};
}
wxBitmap::wxBitmap( const wxBitmap* bmp )
{
if (bmp) Ref( *bmp );
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
};
}
wxBitmap::wxBitmap( const wxString &filename, int type )
{
LoadFile( filename, type );
};
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
// CMB 15/5/98: add constructor for xbm bitmaps
wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth))
@ -199,72 +201,72 @@ wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth
wxBitmap::~wxBitmap(void)
{
if (wxTheBitmapList) wxTheBitmapList->DeleteObject(this);
};
}
wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
{
if (*this == bmp) return (*this);
Ref( bmp );
return *this;
};
}
bool wxBitmap::operator == ( const wxBitmap& bmp )
{
return m_refData == bmp.m_refData;
};
}
bool wxBitmap::operator != ( const wxBitmap& bmp )
{
return m_refData != bmp.m_refData;
};
}
bool wxBitmap::Ok(void) const
{
return m_refData != NULL;
};
}
int wxBitmap::GetHeight(void) const
{
if (!Ok()) return 0;
return M_BMPDATA->m_height;
};
}
int wxBitmap::GetWidth(void) const
{
if (!Ok()) return 0;
return M_BMPDATA->m_width;
};
}
int wxBitmap::GetDepth(void) const
{
if (!Ok()) return 0;
return M_BMPDATA->m_bpp;
};
}
void wxBitmap::SetHeight( int height )
{
if (!Ok()) return;
M_BMPDATA->m_height = height;
};
}
void wxBitmap::SetWidth( int width )
{
if (!Ok()) return;
M_BMPDATA->m_width = width;
};
}
void wxBitmap::SetDepth( int depth )
{
if (!Ok()) return;
M_BMPDATA->m_bpp = depth;
};
}
wxMask *wxBitmap::GetMask(void) const
{
if (!Ok()) return NULL;
return M_BMPDATA->m_mask;
};
}
void wxBitmap::SetMask( wxMask *mask )
{
@ -272,7 +274,7 @@ void wxBitmap::SetMask( wxMask *mask )
if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask;
M_BMPDATA->m_mask = mask;
};
}
void wxBitmap::Resize( int height, int width )
{
@ -296,7 +298,7 @@ void wxBitmap::Resize( int height, int width )
Render();
#endif
};
}
bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
wxPalette *WXUNUSED(palette) )
@ -312,7 +314,7 @@ bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
#endif
return FALSE;
};
}
bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
{
@ -327,7 +329,7 @@ bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
{
UnRef();
return FALSE;
};
}
Render();
@ -338,26 +340,26 @@ bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
#endif
return FALSE;
};
}
wxPalette *wxBitmap::GetPalette(void) const
{
if (!Ok()) return NULL;
return M_BMPDATA->m_palette;
};
}
GdkPixmap *wxBitmap::GetPixmap(void) const
{
if (!Ok()) return NULL;
return M_BMPDATA->m_pixmap;
};
}
GdkBitmap *wxBitmap::GetBitmap(void) const
{
if (!Ok()) return NULL;
return M_BMPDATA->m_bitmap;
};
}
void wxBitmap::DestroyImage(void)
{
@ -367,12 +369,12 @@ void wxBitmap::DestroyImage(void)
{
gdk_imlib_destroy_image( M_BMPDATA->m_image );
M_BMPDATA->m_image = NULL;
};
};
}
}
void wxBitmap::RecreateImage(void)
{
};
}
void wxBitmap::Render(void)
{
@ -389,9 +391,9 @@ void wxBitmap::Render(void)
{
M_BMPDATA->m_mask = new wxMask();
M_BMPDATA->m_mask->m_bitmap = mask;
};
}
#endif
};
}

View File

@ -32,7 +32,7 @@ class wxBrushRefData: public wxObjectRefData
wxBrushRefData::wxBrushRefData(void)
{
m_style = 0;
};
}
//-----------------------------------------------------------------------------
@ -43,7 +43,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBrush,wxGDIObject)
wxBrush::wxBrush(void)
{
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
};
}
wxBrush::wxBrush( const wxColour &colour, int style )
{
@ -52,7 +52,7 @@ wxBrush::wxBrush( const wxColour &colour, int style )
M_BRUSHDATA->m_colour = colour;
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
};
}
wxBrush::wxBrush( const wxString &colourName, int style )
{
@ -61,7 +61,7 @@ wxBrush::wxBrush( const wxString &colourName, int style )
M_BRUSHDATA->m_colour = colourName;
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
};
}
wxBrush::wxBrush( const wxBitmap &stippleBitmap )
{
@ -71,62 +71,62 @@ wxBrush::wxBrush( const wxBitmap &stippleBitmap )
M_BRUSHDATA->m_stipple = stippleBitmap;
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
};
}
wxBrush::wxBrush( const wxBrush &brush )
{
Ref( brush );
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
};
}
wxBrush::wxBrush( const wxBrush *brush )
{
if (brush) Ref( *brush );
if (wxTheBrushList) wxTheBrushList->Append( this );
};
}
wxBrush::~wxBrush(void)
{
if (wxTheBrushList) wxTheBrushList->RemoveBrush( this );
};
}
wxBrush& wxBrush::operator = ( const wxBrush& brush )
{
if (*this == brush) return (*this);
Ref( brush );
return *this;
};
}
bool wxBrush::operator == ( const wxBrush& brush )
{
return m_refData == brush.m_refData;
};
}
bool wxBrush::operator != ( const wxBrush& brush )
{
return m_refData != brush.m_refData;
};
}
bool wxBrush::Ok(void) const
{
return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
};
}
int wxBrush::GetStyle(void) const
{
return M_BRUSHDATA->m_style;
};
}
wxColour &wxBrush::GetColour(void) const
{
return M_BRUSHDATA->m_colour;
};
}
wxBitmap *wxBrush::GetStipple(void) const
{
return &M_BRUSHDATA->m_stipple;
};
}

View File

@ -46,17 +46,17 @@ wxColourRefData::wxColourRefData(void)
m_color.pixel = 0;
m_colormap = NULL;
m_hasPixel = FALSE;
};
}
wxColourRefData::~wxColourRefData(void)
{
FreeColour();
};
}
void wxColourRefData::FreeColour(void)
{
// if (m_hasPixel) gdk_colors_free( m_colormap, &m_color, 1, 0 );
};
}
//-----------------------------------------------------------------------------
@ -68,7 +68,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject)
wxColour::wxColour(void)
{
};
}
wxColour::wxColour( char red, char green, char blue )
{
@ -77,7 +77,7 @@ wxColour::wxColour( char red, char green, char blue )
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
M_COLDATA->m_color.pixel = 0;
};
}
wxColour::wxColour( const wxString &colourName )
{
@ -96,30 +96,30 @@ wxColour::wxColour( const wxString &colourName )
wxFAIL_MSG( "wxColour: couldn't find colour" );
delete m_refData;
m_refData = NULL;
};
};
};
}
}
}
wxColour::wxColour( const wxColour& col )
{
Ref( col );
};
}
wxColour::wxColour( const wxColour* col )
{
if (col) Ref( *col );
};
}
wxColour::~wxColour(void)
{
};
}
wxColour& wxColour::operator = ( const wxColour& col )
{
if (*this == col) return (*this);
Ref( col );
return *this;
};
}
wxColour& wxColour::operator = ( const wxString& colourName )
{
@ -138,20 +138,20 @@ wxColour& wxColour::operator = ( const wxString& colourName )
wxFAIL_MSG( "wxColour: couldn't find colour" );
delete m_refData;
m_refData = NULL;
};
};
}
}
return *this;
};
}
bool wxColour::operator == ( const wxColour& col )
{
return m_refData == col.m_refData;
};
}
bool wxColour::operator != ( const wxColour& col)
{
return m_refData != col.m_refData;
};
}
void wxColour::Set( const unsigned char red, const unsigned char green, const unsigned char blue )
{
@ -161,30 +161,30 @@ void wxColour::Set( const unsigned char red, const unsigned char green, const un
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
M_COLDATA->m_color.pixel = 0;
};
}
unsigned char wxColour::Red(void) const
{
if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
};
}
unsigned char wxColour::Green(void) const
{
if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
};
}
unsigned char wxColour::Blue(void) const
{
if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
};
}
bool wxColour::Ok(void) const
{
return (m_refData);
};
}
void wxColour::CalcPixel( GdkColormap *cmap )
{
@ -208,20 +208,20 @@ void wxColour::CalcPixel( GdkColormap *cmap )
#endif
M_COLDATA->m_colormap = cmap;
};
}
int wxColour::GetPixel(void)
{
if (!Ok()) return 0;
return M_COLDATA->m_color.pixel;
};
}
GdkColor *wxColour::GetColor(void)
{
if (!Ok()) return NULL;
return &M_COLDATA->m_color;
};
}

View File

@ -32,12 +32,12 @@ class wxCursorRefData: public wxObjectRefData
wxCursorRefData::wxCursorRefData(void)
{
m_cursor = NULL;
};
}
wxCursorRefData::~wxCursorRefData(void)
{
if (m_cursor) gdk_cursor_destroy( m_cursor );
};
}
//-----------------------------------------------------------------------------
@ -47,7 +47,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCursor,wxObject)
wxCursor::wxCursor(void)
{
};
}
wxCursor::wxCursor( int cursorId )
{
@ -67,7 +67,7 @@ wxCursor::wxCursor( int cursorId )
case wxCURSOR_IBEAM: gdk_cur = GDK_XTERM; break;
case wxCURSOR_PENCIL: gdk_cur = GDK_PENCIL; break;
case wxCURSOR_NO_ENTRY: gdk_cur = GDK_PIRATE; break;
};
}
M_CURSORDATA->m_cursor = gdk_cursor_new( gdk_cur );
@ -97,49 +97,49 @@ wxCursor::wxCursor( int cursorId )
wxCURSOR_BASED_ARROW_DOWN
*/
};
}
wxCursor::wxCursor( const wxCursor &cursor )
{
Ref( cursor );
};
}
wxCursor::wxCursor( const wxCursor *cursor )
{
UnRef();
if (cursor) Ref( *cursor );
};
}
wxCursor::~wxCursor(void)
{
};
}
wxCursor& wxCursor::operator = ( const wxCursor& cursor )
{
if (*this == cursor) return (*this);
Ref( cursor );
return *this;
};
}
bool wxCursor::operator == ( const wxCursor& cursor )
{
return m_refData == cursor.m_refData;
};
}
bool wxCursor::operator != ( const wxCursor& cursor )
{
return m_refData != cursor.m_refData;
};
}
bool wxCursor::Ok(void) const
{
return TRUE;
};
}
GdkCursor *wxCursor::GetCursor(void) const
{
return M_CURSORDATA->m_cursor;
};
}
//-----------------------------------------------------------------------------
// busy cursor routines
@ -150,24 +150,24 @@ bool g_isBusy = FALSE;
void wxEndBusyCursor(void)
{
g_isBusy = FALSE;
};
}
void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
{
g_isBusy = TRUE;
};
}
bool wxIsBusy(void)
{
return g_isBusy;
};
}
void wxSetCursor( const wxCursor& cursor )
{
extern wxCursor *g_globalCursor;
if (g_globalCursor) (*g_globalCursor) = cursor;
if (cursor.Ok()) {};
};
if (cursor.Ok()) {}
}

View File

@ -77,25 +77,25 @@ wxDC::wxDC(void)
m_backgroundBrush = *wxWHITE_BRUSH;
// m_palette = wxAPP_COLOURMAP;
};
}
wxDC::~wxDC(void)
{
};
}
void wxDC::DrawArc( long WXUNUSED(x1), long WXUNUSED(y1), long WXUNUSED(x2), long WXUNUSED(y2),
double WXUNUSED(xc), double WXUNUSED(yc) )
{
};
}
void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUSED(y), bool WXUNUSED(useMask) )
{
};
}
void wxDC::DrawPoint( wxPoint& point )
{
DrawPoint( point.x, point.y );
};
}
void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle )
{
@ -108,10 +108,10 @@ void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle
wxPoint *point = (wxPoint *)node->Data();
points[i].x = point->x;
points[i++].y = point->y;
};
}
DrawPolygon( n, points, xoffset, yoffset, fillStyle );
delete[] points;
};
}
void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
{
@ -124,10 +124,10 @@ void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
wxPoint *point = (wxPoint *)node->Data();
points[i].x = point->x;
points[i++].y = point->y;
};
}
DrawLines( n, points, xoffset, yoffset );
delete []points;
};
}
void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
{
@ -142,20 +142,20 @@ void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
wxPoint *p = (wxPoint*)node->Data();
delete p;
node = node->Next();
};
};
}
}
void wxDC::DrawSpline( wxList *points )
{
DrawOpenSpline( points );
};
}
void wxDC::DrawSpline( int n, wxPoint points[] )
{
wxList list;
for (int i = 0; i < n; i++) list.Append( (wxObject*)&points[i] );
DrawSpline( &list );
};
}
void wxDC::SetClippingRegion( long x, long y, long width, long height )
{
@ -164,12 +164,12 @@ void wxDC::SetClippingRegion( long x, long y, long width, long height )
m_clipY1 = y;
m_clipX2 = x + width;
m_clipY2 = y + height;
};
}
void wxDC::DestroyClippingRegion(void)
{
m_clipping = FALSE;
};
}
void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const
{
@ -182,13 +182,13 @@ void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const
}
else
*x = *y = *width = *height = 0;
};
}
void wxDC::GetSize( int* width, int* height ) const
{
*width = m_maxX-m_minX;
*height = m_maxY-m_minY;
};
}
void wxDC::GetSizeMM( long* width, long* height ) const
{
@ -197,19 +197,19 @@ void wxDC::GetSizeMM( long* width, long* height ) const
GetSize( &w, &h );
*width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
*height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
};
}
void wxDC::SetTextForeground( const wxColour &col )
{
if (!Ok()) return;
m_textForegroundColour = col;
};
}
void wxDC::SetTextBackground( const wxColour &col )
{
if (!Ok()) return;
m_textBackgroundColour = col;
};
}
void wxDC::SetMapMode( int mode )
{
@ -231,13 +231,13 @@ void wxDC::SetMapMode( int mode )
case MM_TEXT:
SetLogicalScale( 1.0, 1.0 );
break;
};
}
if (mode != MM_TEXT)
{
m_needComputeScaleX = TRUE;
m_needComputeScaleY = TRUE;
};
};
}
}
void wxDC::SetUserScale( double x, double y )
{
@ -245,13 +245,13 @@ void wxDC::SetUserScale( double x, double y )
m_userScaleX = x;
m_userScaleY = y;
ComputeScaleAndOrigin();
};
}
void wxDC::GetUserScale( double *x, double *y )
{
if (x) *x = m_userScaleX;
if (y) *y = m_userScaleY;
};
}
void wxDC::SetLogicalScale( double x, double y )
{
@ -259,86 +259,86 @@ void wxDC::SetLogicalScale( double x, double y )
m_logicalScaleX = x;
m_logicalScaleY = y;
ComputeScaleAndOrigin();
};
}
void wxDC::GetLogicalScale( double *x, double *y )
{
if (x) *x = m_logicalScaleX;
if (y) *y = m_logicalScaleY;
};
}
void wxDC::SetLogicalOrigin( long x, long y )
{
m_logicalOriginX = x * m_signX; // is this still correct ?
m_logicalOriginY = y * m_signY;
ComputeScaleAndOrigin();
};
}
void wxDC::GetLogicalOrigin( long *x, long *y )
{
if (x) *x = m_logicalOriginX;
if (y) *y = m_logicalOriginY;
};
}
void wxDC::SetDeviceOrigin( long x, long y )
{
m_deviceOriginX = x;
m_deviceOriginY = y;
ComputeScaleAndOrigin();
};
}
void wxDC::GetDeviceOrigin( long *x, long *y )
{
if (x) *x = m_deviceOriginX;
if (y) *y = m_deviceOriginY;
};
}
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
{
m_signX = (xLeftRight ? 1 : -1);
m_signY = (yBottomUp ? -1 : 1);
ComputeScaleAndOrigin();
};
}
long wxDC::DeviceToLogicalX(long x) const
{
return XDEV2LOG(x);
};
}
long wxDC::DeviceToLogicalY(long y) const
{
return YDEV2LOG(y);
};
}
long wxDC::DeviceToLogicalXRel(long x) const
{
return XDEV2LOGREL(x);
};
}
long wxDC::DeviceToLogicalYRel(long y) const
{
return YDEV2LOGREL(y);
};
}
long wxDC::LogicalToDeviceX(long x) const
{
return XLOG2DEV(x);
};
}
long wxDC::LogicalToDeviceY(long y) const
{
return YLOG2DEV(y);
};
}
long wxDC::LogicalToDeviceXRel(long x) const
{
return XLOG2DEVREL(x);
};
}
long wxDC::LogicalToDeviceYRel(long y) const
{
return YLOG2DEVREL(y);
};
}
void wxDC::CalcBoundingBox( long x, long y )
{
@ -346,7 +346,7 @@ void wxDC::CalcBoundingBox( long x, long y )
if (y < m_minY) m_minY = y;
if (x > m_maxX) m_maxX = x;
if (y > m_maxY) m_maxY = y;
};
}
void wxDC::ComputeScaleAndOrigin(void)
{
@ -367,5 +367,5 @@ void wxDC::ComputeScaleAndOrigin(void)
m_pen = tempPen;
SetPen(pen);
}
};
}

View File

@ -24,17 +24,17 @@ wxMemoryDC::wxMemoryDC(void)
{
m_ok = FALSE;
m_cmap = gdk_colormap_get_system();
};
}
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
{
m_ok = FALSE;
m_cmap = gdk_colormap_get_system();
};
}
wxMemoryDC::~wxMemoryDC(void)
{
};
}
void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{
@ -58,8 +58,8 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{
m_ok = FALSE;
m_window = NULL;
};
};
}
}
void wxMemoryDC::GetSize( int *width, int *height ) const
{
@ -72,7 +72,7 @@ void wxMemoryDC::GetSize( int *width, int *height ) const
{
if (width) (*width) = 0;
if (height) (*height) = 0;
};
};
}
}

View File

@ -36,12 +36,12 @@ wxScreenDC::wxScreenDC(void)
gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
};
}
wxScreenDC::~wxScreenDC(void)
{
EndDrawingOnTop();
};
}
bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
{
@ -51,7 +51,7 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
{
StartDrawingOnTop();
return;
};
}
wxRectangle rect;
rect.x = 0;
rect.y = 0;
@ -63,7 +63,7 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
StartDrawingOnTop( &rect );
return TRUE;
*/
};
}
bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
{
@ -79,7 +79,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
y = rect->y;
width = rect->width;
height = rect->height;
};
}
GTK cannot set transparent backgrounds. :-(
@ -107,7 +107,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
return TRUE;
*/
};
}
bool wxScreenDC::EndDrawingOnTop(void)
{
@ -118,4 +118,5 @@ bool wxScreenDC::EndDrawingOnTop(void)
m_isOk = FALSE;
return TRUE;
*/
};
}

View File

@ -32,25 +32,25 @@ extern bool g_blockEventsOnDrag;
wxDropTarget::wxDropTarget()
{
};
}
wxDropTarget::~wxDropTarget()
{
};
}
void wxDropTarget::Drop( GdkEvent *event, int x, int y )
{
printf( "Drop data is of type %s.\n", event->dropdataavailable.data_type );
OnDrop( x, y, (char *)event->dropdataavailable.data);
};
}
void wxDropTarget::UnregisterWidget( GtkWidget *widget )
{
if (!widget) return;
gtk_widget_dnd_drop_set( widget, FALSE, NULL, 0, FALSE );
};
}
void wxDropTarget::RegisterWidget( GtkWidget *widget )
{
@ -74,13 +74,13 @@ void wxDropTarget::RegisterWidget( GtkWidget *widget )
break;
default:
break;
};
}
}
char *str = WXSTRINGCAST formats;
gtk_widget_dnd_drop_set( widget, TRUE, &str, valid, FALSE );
};
}
// ----------------------------------------------------------------------------
// wxTextDropTarget
@ -90,14 +90,14 @@ bool wxTextDropTarget::OnDrop( long x, long y, const void *pData )
{
OnDropText( x, y, (const char*)pData );
return TRUE;
};
}
bool wxTextDropTarget::OnDropText( long x, long y, const char *psz )
{
printf( "Got dropped text: %s.\n", psz );
printf( "At x: %d, y: %d.\n", (int)x, (int)y );
return TRUE;
};
}
size_t wxTextDropTarget::GetFormatCount() const
{
@ -159,7 +159,7 @@ void gtk_drag_callback( GtkWidget *widget, GdkEvent *event, wxDropSource *source
delete ptr;
source->m_retValue = wxDropSource::Copy;
};
}
wxDropSource::wxDropSource( wxWindow *win )
{
@ -174,7 +174,7 @@ wxDropSource::wxDropSource( wxWindow *win )
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
};
}
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
{
@ -189,19 +189,19 @@ wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
};
}
void wxDropSource::SetData( wxDataObject &data )
{
m_data = &data;
};
}
wxDropSource::~wxDropSource(void)
{
// if (m_data) delete m_data;
g_blockEventsOnDrag = FALSE;
};
}
wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
{
@ -227,7 +227,7 @@ wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
{
g_free( gdk_dnd.drag_startwindows );
gdk_dnd.drag_startwindows = NULL;
};
}
gdk_dnd.drag_numwindows = gdk_dnd.drag_really = 0;
XWindowAttributes dnd_winattr;
@ -266,7 +266,7 @@ wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
g_blockEventsOnDrag = FALSE;
return m_retValue;
};
}
void wxDropSource::RegisterWindow(void)
{
@ -294,7 +294,7 @@ void wxDropSource::RegisterWindow(void)
gtk_signal_connect( GTK_OBJECT(m_widget), "drag_request_event",
GTK_SIGNAL_FUNC(gtk_drag_callback), (gpointer)this );
};
}
void wxDropSource::UnregisterWindow(void)
{
@ -303,4 +303,4 @@ void wxDropSource::UnregisterWindow(void)
gtk_widget_dnd_drag_set( m_widget, FALSE, NULL, 0 );
gtk_signal_disconnect_by_data( GTK_OBJECT(m_widget), (gpointer)this );
};
}

View File

@ -37,14 +37,14 @@ void gtk_filedialog_ok_callback( GtkWidget *WXUNUSED(widget), gpointer data )
}
dialog->OnOK( event );
};
}
void gtk_filedialog_cancel_callback( GtkWidget *WXUNUSED(widget), gpointer data )
{
wxFileDialog *dialog = (wxFileDialog*)data;
wxCommandEvent event(wxEVT_NULL);
dialog->OnCancel( event );
};
}
IMPLEMENT_DYNAMIC_CLASS(wxFileDialog,wxDialog)
@ -83,7 +83,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
};
}
int wxFileDialog::ShowModal(void)
{
@ -93,9 +93,9 @@ int wxFileDialog::ShowModal(void)
{
m_fileName = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
m_path = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
};
}
return ret;
};
}
char *wxFileSelector(const char *title,
@ -131,7 +131,7 @@ char *wxFileSelector(const char *title,
}
else
return NULL;
};
}
char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name,
wxWindow *parent )
@ -147,7 +147,7 @@ char* wxLoadFileSelector(const char *what, const char *extension, const char *de
sprintf(wild, "*.%s", ext);
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
};
}
char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
wxWindow *parent )
@ -163,5 +163,5 @@ char* wxSaveFileSelector(const char *what, const char *extension, const char *de
sprintf(wild, "*.%s", ext);
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
};
}

View File

@ -24,9 +24,11 @@ static char *wx_font_family [] = {
"wxDEFAULT", "wxDECORATIVE", "wxMODERN", "wxROMAN", "wxSCRIPT",
"wxSWISS", "wxTELETYPE",
};
static char *wx_font_style [] = {
"wxDEFAULT", "wxNORMAL", "wxSLANT", "wxITALIC",
};
static char *wx_font_weight [] = {
"wxDEFAULT", "wxNORMAL", "wxBOLD", "wxLIGHT",
};
@ -68,7 +70,7 @@ wxFontRefData::wxFontRefData(void) : m_scaled_xfonts(wxKEY_INTEGER)
m_fontId = 0;
m_faceName = NULL;
m_font = NULL;
};
}
wxFontRefData::~wxFontRefData(void)
{
@ -79,14 +81,14 @@ wxFontRefData::~wxFontRefData(void)
wxNode *next = node->Next();
gdk_font_unref( font );
node = next;
};
}
if (m_faceName)
{
delete m_faceName;
m_faceName = NULL;
};
}
if (m_font) gdk_font_unref( m_font );
};
}
//-----------------------------------------------------------------------------
@ -97,7 +99,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
wxFont::wxFont(void)
{
if (wxTheFontList) wxTheFontList->Append( this );
};
}
wxFont::wxFont( char *xFontName )
{
@ -107,7 +109,7 @@ wxFont::wxFont( char *xFontName )
M_FONTDATA->m_byXFontName = TRUE;
M_FONTDATA->m_font = gdk_font_load( xFontName );
};
}
wxFont::wxFont(int PointSize, int FontIdOrFamily, int Style, int Weight,
bool Underlined, const char* Face)
@ -123,14 +125,14 @@ wxFont::wxFont(int PointSize, int FontIdOrFamily, int Style, int Weight,
{
M_FONTDATA->m_fontId = FontIdOrFamily;
M_FONTDATA->m_family = wxTheFontNameDirectory->GetFamily( FontIdOrFamily );
};
}
M_FONTDATA->m_style = Style;
M_FONTDATA->m_weight = Weight;
M_FONTDATA->m_pointSize = PointSize;
M_FONTDATA->m_underlined = Underlined;
if (wxTheFontList) wxTheFontList->Append( this );
};
}
wxFont::wxFont(int PointSize, const char *Face, int Family, int Style,
int Weight, bool Underlined)
@ -146,105 +148,105 @@ wxFont::wxFont(int PointSize, const char *Face, int Family, int Style,
M_FONTDATA->m_underlined = Underlined;
if (wxTheFontList) wxTheFontList->Append( this );
};
}
wxFont::wxFont( const wxFont& font )
{
Ref( font );
};
}
wxFont::wxFont( const wxFont* font )
{
UnRef();
if (font) Ref( *font );
};
}
wxFont::~wxFont(void)
{
if (wxTheFontList) wxTheFontList->DeleteObject( this );
};
}
wxFont& wxFont::operator = ( const wxFont& font )
{
if (*this == font) return (*this);
Ref( font );
return *this;
};
}
bool wxFont::operator == ( const wxFont& font )
{
return m_refData == font.m_refData;
};
}
bool wxFont::operator != ( const wxFont& font )
{
return m_refData != font.m_refData;
};
}
bool wxFont::Ok()
{
return (m_refData != NULL);
};
}
int wxFont::GetPointSize(void) const
{
return M_FONTDATA->m_pointSize;
};
}
wxString wxFont::GetFaceString(void) const
{
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
return s;
};
}
wxString wxFont::GetFaceName(void) const
{
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
return s;
};
}
int wxFont::GetFamily(void) const
{
return M_FONTDATA->m_family;
};
}
wxString wxFont::GetFamilyString(void) const
{
wxString s = wx_font_family[M_FONTDATA->m_family];
return s;
};
}
int wxFont::GetFontId(void) const
{
return M_FONTDATA->m_fontId; // stub
};
}
int wxFont::GetStyle(void) const
{
return M_FONTDATA->m_style;
};
}
wxString wxFont::GetStyleString(void) const
{
wxString s = wx_font_style[M_FONTDATA->m_style];
return s;
};
}
int wxFont::GetWeight(void) const
{
return M_FONTDATA->m_weight;
};
}
wxString wxFont::GetWeightString(void) const
{
wxString s = wx_font_weight[M_FONTDATA->m_weight];
return s;
};
}
bool wxFont::GetUnderlined(void) const
{
return M_FONTDATA->m_underlined;
};
}
//-----------------------------------------------------------------------------
// get internal representation of font
@ -273,12 +275,12 @@ GdkFont *wxFont::GetInternalFont(float scale) const
font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style,
M_FONTDATA->m_weight, M_FONTDATA->m_underlined );
M_FONTDATA->m_scaled_xfonts.Append( int_scale, (wxObject*)font );
};
}
if (!font)
printf("could not load any font");
// wxError("could not load any font", "wxFont");
return font;
};
}
//-----------------------------------------------------------------------------
// local utilities to find a X font
@ -448,7 +450,7 @@ static int WCoordinate(int w)
case wxNORMAL:
default: return wxWEIGHT_NORMAL;
}
}
};
static int SCoordinate(int s)
{
@ -458,7 +460,7 @@ static int SCoordinate(int s)
case wxNORMAL:
default: return wxSTYLE_NORMAL;
}
}
};
//-----------------------------------------------------------------------------
// wxSuffixMap

View File

@ -171,6 +171,7 @@ wxFrame::~wxFrame()
{
if (m_frameMenuBar) delete m_frameMenuBar;
if (m_frameStatusBar) delete m_frameStatusBar;
if (m_frameToolBar) delete m_frameToolBar;
// if (m_mainWindow) gtk_widget_destroy( m_mainWindow );

View File

@ -23,5 +23,5 @@ IMPLEMENT_DYNAMIC_CLASS(wxIcon,wxBitmap)
wxIcon::wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
wxBitmap( bits )
{
};
}

View File

@ -34,10 +34,10 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
(win->m_height == alloc->height))
{
return;
};
}
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
};
}
// page change callback
static void gtk_page_change_callback( GtkNotebook *WXUNUSED(widget),
@ -55,7 +55,7 @@ static void gtk_page_change_callback( GtkNotebook *WXUNUSED(widget),
mdi_frame->m_currentChild = child_frame;
mdi_frame->SetMDIMenuBar( child_frame->m_menuBar );
return;
};
}
node = node->Next();
}
}
@ -72,7 +72,7 @@ wxMDIParentFrame::wxMDIParentFrame(void)
m_clientWindow = NULL;
m_currentChild = NULL;
m_parentFrameActive = TRUE;
};
}
wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
wxWindowID id, const wxString& title,
@ -83,11 +83,11 @@ wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
m_currentChild = NULL;
m_parentFrameActive = TRUE;
Create( parent, id, title, pos, size, style, name );
};
}
wxMDIParentFrame::~wxMDIParentFrame(void)
{
};
}
bool wxMDIParentFrame::Create( wxWindow *parent,
wxWindowID id, const wxString& title,
@ -99,7 +99,7 @@ bool wxMDIParentFrame::Create( wxWindow *parent,
OnCreateClient();
return TRUE;
};
}
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
{
@ -112,7 +112,7 @@ void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
GetClientSize( &x, &y );
m_mdiMenuBar->SetSize( 1, 1, x-2, 26 );
}
};
}
void wxMDIParentFrame::SetMDIMenuBar( wxMenuBar *menu_bar )
{
@ -126,48 +126,48 @@ void wxMDIParentFrame::SetMDIMenuBar( wxMenuBar *menu_bar )
m_mdiMenuBar->SetSize( 1, 1, x-2, 26 );
m_mdiMenuBar->Show( TRUE );
}
};
}
void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
{
wxFrame::GetClientSize( width, height );
};
}
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const
{
return m_currentChild;
};
}
wxMDIClientWindow *wxMDIParentFrame::GetClientWindow(void) const
{
return m_clientWindow;
};
}
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient(void)
{
m_clientWindow = new wxMDIClientWindow( this );
return m_clientWindow;
};
}
void wxMDIParentFrame::ActivateNext(void)
{
if (m_clientWindow)
gtk_notebook_next_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
};
}
void wxMDIParentFrame::ActivatePrevious(void)
{
if (m_clientWindow)
gtk_notebook_prev_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
};
}
void wxMDIParentFrame::OnActivate( wxActivateEvent& WXUNUSED(event) )
{
};
}
void wxMDIParentFrame::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(event) )
{
};
}
//-----------------------------------------------------------------------------
// wxMDIChildFrame
@ -183,7 +183,7 @@ wxMDIChildFrame::wxMDIChildFrame(void)
{
m_menuBar = NULL;
m_page = NULL;
};
}
wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title,
@ -193,7 +193,7 @@ wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
m_menuBar = NULL;
m_page = NULL;
Create( parent, id, title, wxDefaultPosition, size, style, name );
};
}
wxMDIChildFrame::~wxMDIChildFrame(void)
{
@ -204,10 +204,10 @@ wxMDIChildFrame::~wxMDIChildFrame(void)
{
mdi_frame->SetMDIMenuBar( NULL );
mdi_frame->m_currentChild = NULL;
};
}
delete m_menuBar;
}
};
}
bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title,
@ -216,7 +216,7 @@ bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
{
m_title = title;
return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
};
}
void wxMDIChildFrame::GetClientSize( int *width, int *height ) const
{
@ -238,8 +238,8 @@ static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
if (menuitem->IsSubMenu())
SetInvokingWindow( menuitem->GetSubMenu(), win );
node = node->Next();
};
};
}
}
void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
{
@ -257,7 +257,7 @@ void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
wxMenu *menu = (wxMenu*)node->Data();
SetInvokingWindow( menu, this );
node = node->Next();
};
}
m_menuBar->m_parent = mdi_frame;
}
@ -266,20 +266,20 @@ void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
gtk_myfixed_put( GTK_MYFIXED(mdi_frame->m_mainWindow),
m_menuBar->m_widget, m_menuBar->m_x, m_menuBar->m_y );
}
};
}
wxMenuBar *wxMDIChildFrame::GetMenuBar()
{
return m_menuBar;
};
}
void wxMDIChildFrame::Activate(void)
{
};
}
void wxMDIChildFrame::OnActivate( wxActivateEvent &WXUNUSED(event) )
{
};
}
//-----------------------------------------------------------------------------
// wxMDIClientWindow
@ -289,16 +289,16 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow,wxWindow)
wxMDIClientWindow::wxMDIClientWindow(void)
{
};
}
wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, long style )
{
CreateClient( parent, style );
};
}
wxMDIClientWindow::~wxMDIClientWindow(void)
{
};
}
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
{
@ -318,7 +318,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
Show( TRUE );
return TRUE;
};
}
void wxMDIClientWindow::AddChild( wxWindow *child )
{
@ -326,7 +326,7 @@ void wxMDIClientWindow::AddChild( wxWindow *child )
{
wxFAIL_MSG("wxNotebook::AddChild: Child has to be wxMDIChildFrame");
return;
};
}
m_children.Append( child );
@ -349,6 +349,6 @@ void wxMDIClientWindow::AddChild( wxWindow *child )
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), m_children.Number()-1 );
gtk_page_change_callback( NULL, mdi_child->m_page, 0, this );
};
}

View File

@ -34,7 +34,7 @@ public:
m_page = NULL;
m_client = NULL;
m_parent = NULL;
};
}
//private:
int m_id;
@ -80,7 +80,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
(win->m_height == alloc->height))
{
return;
};
}
/*
printf( "OnResize from " );
@ -104,7 +104,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
printf( " W: %d H: %d ", win->m_width, win->m_height );
printf( " .\n" );
*/
};
}
//-----------------------------------------------------------------------------
// wxNotebook
@ -122,7 +122,7 @@ void wxNotebook::Init()
wxNotebook::wxNotebook()
{
Init();
};
}
wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
@ -130,7 +130,7 @@ wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id,
{
Init();
Create( parent, id, pos, size, style, name );
};
}
wxNotebook::~wxNotebook()
{
@ -139,7 +139,7 @@ wxNotebook::~wxNotebook()
gtk_signal_disconnect(GTK_OBJECT(m_widget), m_idHandler);
DeleteAllPages();
};
}
bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
@ -165,7 +165,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
Show( TRUE );
return TRUE;
};
}
int wxNotebook::GetSelection() const
{
@ -183,22 +183,22 @@ int wxNotebook::GetSelection() const
if (page->m_page == g_page)
break;
node = node->Next();
};
}
wxCHECK_MSG( node != NULL, -1, "wxNotebook: no selection?" );
return page->m_id;
};
}
int wxNotebook::GetPageCount() const
{
return m_pages.Number();
};
}
int wxNotebook::GetRowCount() const
{
return 1;
};
}
wxString wxNotebook::GetPageText( int page ) const
{
@ -207,7 +207,7 @@ wxString wxNotebook::GetPageText( int page ) const
return nb_page->m_text;
else
return "";
};
}
int wxNotebook::GetPageImage( int page ) const
{
@ -216,7 +216,7 @@ int wxNotebook::GetPageImage( int page ) const
return nb_page->m_image;
else
return 0;
};
}
wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
{
@ -229,12 +229,12 @@ wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
if (nb_page->m_id == page)
return nb_page;
node = node->Next();
};
}
wxLogDebug( "Notebook page %d not found!", page );
return NULL;
};
}
int wxNotebook::SetSelection( int page )
{
@ -251,14 +251,14 @@ int wxNotebook::SetSelection( int page )
break;
page_num++;
child = child->next;
};
}
if (!child) return -1;
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page_num );
return selOld;
};
}
void wxNotebook::AdvanceSelection(bool bForward)
{
@ -276,7 +276,7 @@ void wxNotebook::AdvanceSelection(bool bForward)
void wxNotebook::SetImageList( wxImageList* imageList )
{
m_imageList = imageList;
};
}
bool wxNotebook::SetPageText( int page, const wxString &text )
{
@ -287,7 +287,7 @@ bool wxNotebook::SetPageText( int page, const wxString &text )
nb_page->m_text = text;
return TRUE;
};
}
bool wxNotebook::SetPageImage( int page, int image )
{
@ -298,17 +298,17 @@ bool wxNotebook::SetPageImage( int page, int image )
nb_page->m_image = image;
return TRUE;
};
}
void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
{
wxFAIL_MSG(_("wxNotebook::SetPageSize not implemented"));
};
}
void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
{
wxFAIL_MSG(_("wxNotebook::SetPadding not implemented"));
};
}
bool wxNotebook::DeleteAllPages()
{
@ -320,10 +320,10 @@ bool wxNotebook::DeleteAllPages()
DeletePage( page->m_id );
page_node = m_pages.First();
};
}
return TRUE;
};
}
bool wxNotebook::DeletePage( int page )
{
@ -337,7 +337,7 @@ bool wxNotebook::DeletePage( int page )
if (nb_page->m_page == (GtkNotebookPage*)child->data) break;
page_num++;
child = child->next;
};
}
wxASSERT( child );
@ -349,7 +349,7 @@ bool wxNotebook::DeletePage( int page )
m_pages.DeleteObject( nb_page );
return TRUE;
};
}
bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
bool bSelect, int imageId)
@ -367,7 +367,7 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
if ( page->m_client == win )
break; // found
node = node->Next();
};
}
wxCHECK_MSG(page != NULL, FALSE,
_("Can't add a page whose parent is not the notebook!"));
@ -384,7 +384,7 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
}
return TRUE;
};
}
wxWindow *wxNotebook::GetPage( int page ) const
{
@ -393,7 +393,7 @@ wxWindow *wxNotebook::GetPage( int page ) const
return NULL;
else
return nb_page->m_client;
};
}
void wxNotebook::AddChild( wxWindow *win )
{
@ -423,7 +423,7 @@ void wxNotebook::AddChild( wxWindow *win )
}
m_pages.Append( page );
};
}
// override these 2 functions to do nothing: everything is done in OnSize
void wxNotebook::SetConstraintSizes( bool WXUNUSED(recurse) )

View File

@ -38,7 +38,7 @@ wxPenRefData::wxPenRefData(void)
m_style = wxSOLID;
m_joinStyle = wxJOIN_ROUND;
m_capStyle = wxCAP_ROUND;
};
}
//-----------------------------------------------------------------------------
@ -49,7 +49,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject)
wxPen::wxPen(void)
{
if (wxThePenList) wxThePenList->AddPen( this );
};
}
wxPen::wxPen( const wxColour &colour, int width, int style )
{
@ -58,7 +58,7 @@ wxPen::wxPen( const wxColour &colour, int width, int style )
M_PENDATA->m_style = style;
M_PENDATA->m_colour = colour;
if (wxThePenList) wxThePenList->AddPen( this );
};
}
wxPen::wxPen( const wxString &colourName, int width, int style )
{
@ -67,42 +67,42 @@ wxPen::wxPen( const wxString &colourName, int width, int style )
M_PENDATA->m_style = style;
M_PENDATA->m_colour = colourName;
if (wxThePenList) wxThePenList->AddPen( this );
};
}
wxPen::wxPen( const wxPen& pen )
{
Ref( pen );
if (wxThePenList) wxThePenList->AddPen( this );
};
}
wxPen::wxPen( const wxPen* pen )
{
UnRef();
if (pen) Ref( *pen );
if (wxThePenList) wxThePenList->AddPen( this );
};
}
wxPen::~wxPen(void)
{
if (wxThePenList) wxThePenList->RemovePen( this );
};
}
wxPen& wxPen::operator = ( const wxPen& pen )
{
if (*this == pen) return (*this);
Ref( pen );
return *this;
};
}
bool wxPen::operator == ( const wxPen& pen )
{
return m_refData == pen.m_refData;
};
}
bool wxPen::operator != ( const wxPen& pen )
{
return m_refData != pen.m_refData;
};
}
void wxPen::SetColour( const wxColour &colour )
{
@ -110,7 +110,7 @@ void wxPen::SetColour( const wxColour &colour )
m_refData = new wxPenRefData();
M_PENDATA->m_colour = colour;
};
}
void wxPen::SetColour( const wxString &colourName )
{
@ -118,7 +118,7 @@ void wxPen::SetColour( const wxString &colourName )
m_refData = new wxPenRefData();
M_PENDATA->m_colour = colourName;
};
}
void wxPen::SetColour( int red, int green, int blue )
{
@ -126,7 +126,7 @@ void wxPen::SetColour( int red, int green, int blue )
m_refData = new wxPenRefData();
M_PENDATA->m_colour.Set( red, green, blue );
};
}
void wxPen::SetCap( int capStyle )
{
@ -134,7 +134,7 @@ void wxPen::SetCap( int capStyle )
m_refData = new wxPenRefData();
M_PENDATA->m_capStyle = capStyle;
};
}
void wxPen::SetJoin( int joinStyle )
{
@ -142,7 +142,7 @@ void wxPen::SetJoin( int joinStyle )
m_refData = new wxPenRefData();
M_PENDATA->m_joinStyle = joinStyle;
};
}
void wxPen::SetStyle( int style )
{
@ -150,7 +150,7 @@ void wxPen::SetStyle( int style )
m_refData = new wxPenRefData();
M_PENDATA->m_style = style;
};
}
void wxPen::SetWidth( int width )
{
@ -158,12 +158,12 @@ void wxPen::SetWidth( int width )
m_refData = new wxPenRefData();
M_PENDATA->m_width = width;
};
}
int wxPen::GetCap(void) const
{
return M_PENDATA->m_capStyle;
};
}
int wxPen::GetJoin(void) const
{
@ -171,7 +171,7 @@ int wxPen::GetJoin(void) const
return 0;
else
return M_PENDATA->m_joinStyle;
};
}
int wxPen::GetStyle(void) const
{
@ -179,7 +179,7 @@ int wxPen::GetStyle(void) const
return 0;
else
return M_PENDATA->m_style;
};
}
int wxPen::GetWidth(void) const
{
@ -187,7 +187,7 @@ int wxPen::GetWidth(void) const
return 0;
else
return M_PENDATA->m_width;
};
}
wxColour &wxPen::GetColour(void) const
{
@ -195,10 +195,10 @@ wxColour &wxPen::GetColour(void) const
return wxNullColour;
else
return M_PENDATA->m_colour;
};
}
bool wxPen::Ok(void) const
{
return (m_refData);
};
}

View File

@ -34,12 +34,12 @@ class wxRegionRefData: public wxObjectRefData
wxRegionRefData::wxRegionRefData(void)
{
m_region = NULL;
};
}
wxRegionRefData::~wxRegionRefData(void)
{
if (m_region) gdk_region_destroy( m_region );
};
}
//-----------------------------------------------------------------------------
@ -58,7 +58,7 @@ wxRegion::wxRegion( long x, long y, long w, long h )
rect.height = h;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
gdk_region_destroy( reg );
};
}
wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight )
{
@ -71,7 +71,7 @@ wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight )
rect.height = bottomRight.y - rect.y;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
gdk_region_destroy( reg );
};
}
wxRegion::wxRegion( const wxRect& rect )
{
@ -84,24 +84,24 @@ wxRegion::wxRegion( const wxRect& rect )
g_rect.height = rect.height;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &g_rect );
gdk_region_destroy( reg );
};
}
wxRegion::wxRegion(void)
{
m_refData = new wxRegionRefData();
M_REGIONDATA->m_region = gdk_region_new();
};
}
wxRegion::~wxRegion(void)
{
};
}
void wxRegion::Clear(void)
{
UnRef();
m_refData = new wxRegionRefData();
M_REGIONDATA->m_region = gdk_region_new();
};
}
bool wxRegion::Union( long x, long y, long width, long height )
{
@ -114,7 +114,7 @@ bool wxRegion::Union( long x, long y, long width, long height )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
bool wxRegion::Union( const wxRect& rect )
{
@ -127,7 +127,7 @@ bool wxRegion::Union( const wxRect& rect )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
bool wxRegion::Union( const wxRegion& region )
{
@ -135,21 +135,21 @@ bool wxRegion::Union( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
bool wxRegion::Intersect( long x, long y, long width, long height )
{
wxRegion reg( x, y, width, height );
Intersect( reg );
return TRUE;
};
}
bool wxRegion::Intersect( const wxRect& rect )
{
wxRegion reg( rect );
Intersect( reg );
return TRUE;
};
}
bool wxRegion::Intersect( const wxRegion& region )
{
@ -157,21 +157,21 @@ bool wxRegion::Intersect( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
bool wxRegion::Subtract( long x, long y, long width, long height )
{
wxRegion reg( x, y, width, height );
Subtract( reg );
return TRUE;
};
}
bool wxRegion::Subtract( const wxRect& rect )
{
wxRegion reg( rect );
Subtract( reg );
return TRUE;
};
}
bool wxRegion::Subtract( const wxRegion& region )
{
@ -179,21 +179,21 @@ bool wxRegion::Subtract( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
bool wxRegion::Xor( long x, long y, long width, long height )
{
wxRegion reg( x, y, width, height );
Xor( reg );
return TRUE;
};
}
bool wxRegion::Xor( const wxRect& rect )
{
wxRegion reg( rect );
Xor( reg );
return TRUE;
};
}
bool wxRegion::Xor( const wxRegion& region )
{
@ -201,7 +201,7 @@ bool wxRegion::Xor( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const
{
@ -209,17 +209,17 @@ void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const
y = 0;
w = -1;
h = -1;
};
}
wxRect wxRegion::GetBox(void) const
{
return wxRect( 0, 0, -1, -1 );
};
}
bool wxRegion::Empty(void) const
{
return gdk_region_empty( M_REGIONDATA->m_region );
};
}
wxRegionContain wxRegion::Contains( long x, long y ) const
{
@ -227,7 +227,7 @@ wxRegionContain wxRegion::Contains( long x, long y ) const
return wxInRegion;
else
return wxOutRegion;
};
}
wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const
{
@ -242,12 +242,12 @@ wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const
case GDK_OVERLAP_RECTANGLE_IN: return wxInRegion;
case GDK_OVERLAP_RECTANGLE_OUT: return wxOutRegion;
case GDK_OVERLAP_RECTANGLE_PART: return wxPartRegion;
};
}
return wxOutRegion;
};
}
GdkRegion *wxRegion::GetRegion(void) const
{
return M_REGIONDATA->m_region;
};
}

View File

@ -90,9 +90,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->bg[0].red >> SHIFT,
style->bg[0].green >> SHIFT,
style->bg[0].blue >> SHIFT );
};
}
return *g_systemBtnFaceColour;
};
}
case wxSYS_COLOUR_BTNSHADOW:
{
GtkStyle *style = gtk_widget_get_default_style();
@ -102,9 +102,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->dark[0].red >> SHIFT,
style->dark[0].green >> SHIFT,
style->dark[0].blue >> SHIFT );
};
}
return *g_systemBtnShadowColour;
};
}
case wxSYS_COLOUR_GRAYTEXT:
case wxSYS_COLOUR_BTNHIGHLIGHT:
{
@ -115,9 +115,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->light[0].red >> SHIFT,
style->light[0].green >> SHIFT,
style->light[0].blue >> SHIFT );
};
}
return *g_systemBtnHighlightColour;
};
}
case wxSYS_COLOUR_HIGHLIGHT:
{
GtkStyle *style = gtk_widget_get_default_style();
@ -127,9 +127,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->bg[GTK_STATE_SELECTED].red >> SHIFT,
style->bg[GTK_STATE_SELECTED].green >> SHIFT,
style->bg[GTK_STATE_SELECTED].blue >> SHIFT );
};
}
return *g_systemHighlightColour;
};
}
case wxSYS_COLOUR_MENUTEXT:
case wxSYS_COLOUR_WINDOWTEXT:
case wxSYS_COLOUR_CAPTIONTEXT:
@ -137,19 +137,19 @@ wxColour wxSystemSettings::GetSystemColour( int index )
case wxSYS_COLOUR_INFOTEXT:
{
return *wxBLACK;
};
}
case wxSYS_COLOUR_HIGHLIGHTTEXT:
{
return *wxWHITE;
};
}
case wxSYS_COLOUR_INFOBK:
case wxSYS_COLOUR_APPWORKSPACE:
{
return *wxWHITE; // ?
};
};
}
}
return *wxWHITE;
};
}
wxFont wxSystemSettings::GetSystemFont( int index )
{
@ -160,7 +160,7 @@ wxFont wxSystemSettings::GetSystemFont( int index )
case wxSYS_SYSTEM_FIXED_FONT:
{
return *wxNORMAL_FONT;
};
}
case wxSYS_ANSI_VAR_FONT:
case wxSYS_SYSTEM_FONT:
case wxSYS_DEVICE_DEFAULT_FONT:
@ -169,12 +169,11 @@ wxFont wxSystemSettings::GetSystemFont( int index )
if (!g_systemFont)
g_systemFont = new wxFont( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" );
return *g_systemFont;
};
};
}
}
return wxNullFont;
}
;
int wxSystemSettings::GetSystemMetric( int index )
{
@ -184,8 +183,6 @@ int wxSystemSettings::GetSystemMetric( int index )
return gdk_screen_width();
case wxSYS_SCREEN_Y:
return gdk_screen_height();
};
}
return 0;
}
;
}

View File

@ -27,45 +27,45 @@ gint timeout_callback( gpointer data )
timer->Notify();
if (timer->OneShot()) timer->Stop();
return TRUE;
};
}
wxTimer::wxTimer(void)
{
m_tag = -1;
m_time = 1000;
m_oneShot = FALSE;
};
}
wxTimer::~wxTimer(void)
{
Stop();
};
}
int wxTimer::Interval(void)
{
return m_time;
};
}
bool wxTimer::OneShot(void)
{
return m_oneShot;
};
}
void wxTimer::Notify(void)
{
};
}
void wxTimer::Start( int millisecs, bool oneShot )
{
if (millisecs != -1) m_time = millisecs;
m_oneShot = oneShot;
m_tag = gtk_timeout_add( millisecs, timeout_callback, this );
};
}
void wxTimer::Stop(void)
{
if (m_tag != -1)
gtk_timeout_remove( m_tag );
m_tag = -1;
};
}

View File

@ -52,13 +52,13 @@ extern void wxFlushResources(void);
void wxExit(void)
{
gtk_main_quit();
};
}
bool wxYield(void)
{
while (gtk_events_pending() > 0) gtk_main_iteration();
return TRUE;
};
}
//-----------------------------------------------------------------------------
// wxApp
@ -72,38 +72,38 @@ END_EVENT_TABLE()
gint wxapp_idle_callback( gpointer WXUNUSED(data) )
{
if (wxTheApp) while (wxTheApp->ProcessIdle()) {};
if (wxTheApp) while (wxTheApp->ProcessIdle()) {}
usleep( 10000 );
return TRUE;
};
}
wxApp::wxApp()
{
m_idleTag = 0;
m_topWindow = NULL;
m_exitOnFrameDelete = TRUE;
};
}
wxApp::~wxApp(void)
{
gtk_idle_remove( m_idleTag );
};
}
bool wxApp::OnInit(void)
{
return TRUE;
};
}
bool wxApp::OnInitGui(void)
{
m_idleTag = gtk_idle_add( wxapp_idle_callback, NULL );
return TRUE;
};
}
int wxApp::OnRun(void)
{
return MainLoop();
};
}
bool wxApp::ProcessIdle(void)
{
@ -112,7 +112,7 @@ bool wxApp::ProcessIdle(void)
ProcessEvent( event );
return event.MoreRequested();
};
}
void wxApp::OnIdle( wxIdleEvent &event )
{
@ -139,7 +139,7 @@ void wxApp::OnIdle( wxIdleEvent &event )
event.RequestMore(TRUE);
inOnIdle = FALSE;
};
}
bool wxApp::SendIdleEvents(void)
{
@ -154,7 +154,7 @@ bool wxApp::SendIdleEvents(void)
node = node->Next();
}
return needMore;
};
}
bool wxApp::SendIdleEvents( wxWindow* win )
{
@ -177,37 +177,37 @@ bool wxApp::SendIdleEvents( wxWindow* win )
node = node->Next();
}
return needMore ;
};
}
int wxApp::OnExit(void)
{
return 0;
};
}
int wxApp::MainLoop(void)
{
gtk_main();
return 0;
};
}
void wxApp::ExitMainLoop(void)
{
gtk_main_quit();
};
}
bool wxApp::Initialized(void)
{
return m_initialized;
};
}
bool wxApp::Pending(void)
{
return FALSE;
};
}
void wxApp::Dispatch(void)
{
};
}
void wxApp::DeletePendingObjects(void)
{
@ -222,8 +222,8 @@ void wxApp::DeletePendingObjects(void)
delete node;
node = wxPendingDelete.First();
};
};
}
}
wxWindow *wxApp::GetTopWindow(void)
{
@ -231,12 +231,12 @@ wxWindow *wxApp::GetTopWindow(void)
wxNode *node = wxTopLevelWindows.First();
if (!node) return NULL;
return (wxWindow*)node->Data();
};
}
void wxApp::SetTopWindow( wxWindow *win )
{
m_topWindow = win;
};
}
void wxApp::CommonInit(void)
{
@ -273,7 +273,7 @@ void wxApp::CommonInit(void)
g_globalCursor = new wxCursor;
*/
};
}
void wxApp::CommonCleanUp(void)
{
@ -292,7 +292,7 @@ void wxApp::CommonCleanUp(void)
wxCleanUpResourceSystem();
wxSystemSettings::Done();
};
}
wxLog *wxApp::CreateLogTarget()
{
@ -327,20 +327,20 @@ int wxEntry( int argc, char *argv[] )
{
printf( _("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
return 0;
};
}
wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
wxObject *test_app = app_ini();
wxTheApp = (wxApp*) test_app;
};
}
if (!wxTheApp)
{
printf( _("wxWindows error: wxTheApp == NULL\n") );
return 0;
};
}
wxTheApp->argc = argc;
wxTheApp->argv = argv;
@ -396,7 +396,7 @@ int wxEntry( int argc, char *argv[] )
#endif
return retValue;
};
}
//-----------------------------------------------------------------------------
// main()

View File

@ -28,19 +28,19 @@ IMPLEMENT_DYNAMIC_CLASS(wxMask,wxObject)
wxMask::wxMask(void)
{
m_bitmap = NULL;
};
}
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), const wxColour& WXUNUSED(colour) )
{
};
}
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex) )
{
};
}
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap) )
{
};
}
wxMask::~wxMask(void)
{
@ -49,12 +49,12 @@ wxMask::~wxMask(void)
#else
if (m_bitmap) gdk_bitmap_unref( m_bitmap );
#endif
};
}
GdkBitmap *wxMask::GetBitmap(void) const
{
return m_bitmap;
};
}
//-----------------------------------------------------------------------------
// wxBitmap
@ -92,7 +92,7 @@ wxBitmapRefData::wxBitmapRefData(void)
#ifdef USE_GDK_IMLIB
m_image = NULL;
#endif
};
}
wxBitmapRefData::~wxBitmapRefData(void)
{
@ -105,7 +105,7 @@ wxBitmapRefData::~wxBitmapRefData(void)
if (m_bitmap) gdk_bitmap_unref( m_bitmap );
if (m_mask) delete m_mask;
if (m_palette) delete m_palette;
};
}
//-----------------------------------------------------------------------------
@ -116,7 +116,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxGDIObject)
wxBitmap::wxBitmap(void)
{
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
};
}
wxBitmap::wxBitmap( int width, int height, int depth )
{
@ -129,7 +129,7 @@ wxBitmap::wxBitmap( int width, int height, int depth )
M_BMPDATA->m_bpp = depth;
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
};
}
wxBitmap::wxBitmap( char **bits )
{
@ -146,7 +146,7 @@ wxBitmap::wxBitmap( char **bits )
{
M_BMPDATA->m_mask = new wxMask();
M_BMPDATA->m_mask->m_bitmap = mask;
};
}
gdk_window_get_size( M_BMPDATA->m_pixmap, &(M_BMPDATA->m_width), &(M_BMPDATA->m_height) );
@ -160,26 +160,28 @@ wxBitmap::wxBitmap( char **bits )
M_BMPDATA->m_bpp = 24; // ?
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
};
}
wxBitmap::wxBitmap( const wxBitmap& bmp )
{
Ref( bmp );
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
};
}
wxBitmap::wxBitmap( const wxBitmap* bmp )
{
if (bmp) Ref( *bmp );
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
};
}
wxBitmap::wxBitmap( const wxString &filename, int type )
{
LoadFile( filename, type );
};
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
// CMB 15/5/98: add constructor for xbm bitmaps
wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth))
@ -199,72 +201,72 @@ wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth
wxBitmap::~wxBitmap(void)
{
if (wxTheBitmapList) wxTheBitmapList->DeleteObject(this);
};
}
wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
{
if (*this == bmp) return (*this);
Ref( bmp );
return *this;
};
}
bool wxBitmap::operator == ( const wxBitmap& bmp )
{
return m_refData == bmp.m_refData;
};
}
bool wxBitmap::operator != ( const wxBitmap& bmp )
{
return m_refData != bmp.m_refData;
};
}
bool wxBitmap::Ok(void) const
{
return m_refData != NULL;
};
}
int wxBitmap::GetHeight(void) const
{
if (!Ok()) return 0;
return M_BMPDATA->m_height;
};
}
int wxBitmap::GetWidth(void) const
{
if (!Ok()) return 0;
return M_BMPDATA->m_width;
};
}
int wxBitmap::GetDepth(void) const
{
if (!Ok()) return 0;
return M_BMPDATA->m_bpp;
};
}
void wxBitmap::SetHeight( int height )
{
if (!Ok()) return;
M_BMPDATA->m_height = height;
};
}
void wxBitmap::SetWidth( int width )
{
if (!Ok()) return;
M_BMPDATA->m_width = width;
};
}
void wxBitmap::SetDepth( int depth )
{
if (!Ok()) return;
M_BMPDATA->m_bpp = depth;
};
}
wxMask *wxBitmap::GetMask(void) const
{
if (!Ok()) return NULL;
return M_BMPDATA->m_mask;
};
}
void wxBitmap::SetMask( wxMask *mask )
{
@ -272,7 +274,7 @@ void wxBitmap::SetMask( wxMask *mask )
if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask;
M_BMPDATA->m_mask = mask;
};
}
void wxBitmap::Resize( int height, int width )
{
@ -296,7 +298,7 @@ void wxBitmap::Resize( int height, int width )
Render();
#endif
};
}
bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
wxPalette *WXUNUSED(palette) )
@ -312,7 +314,7 @@ bool wxBitmap::SaveFile( const wxString &name, int WXUNUSED(type),
#endif
return FALSE;
};
}
bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
{
@ -327,7 +329,7 @@ bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
{
UnRef();
return FALSE;
};
}
Render();
@ -338,26 +340,26 @@ bool wxBitmap::LoadFile( const wxString &name, int WXUNUSED(type) )
#endif
return FALSE;
};
}
wxPalette *wxBitmap::GetPalette(void) const
{
if (!Ok()) return NULL;
return M_BMPDATA->m_palette;
};
}
GdkPixmap *wxBitmap::GetPixmap(void) const
{
if (!Ok()) return NULL;
return M_BMPDATA->m_pixmap;
};
}
GdkBitmap *wxBitmap::GetBitmap(void) const
{
if (!Ok()) return NULL;
return M_BMPDATA->m_bitmap;
};
}
void wxBitmap::DestroyImage(void)
{
@ -367,12 +369,12 @@ void wxBitmap::DestroyImage(void)
{
gdk_imlib_destroy_image( M_BMPDATA->m_image );
M_BMPDATA->m_image = NULL;
};
};
}
}
void wxBitmap::RecreateImage(void)
{
};
}
void wxBitmap::Render(void)
{
@ -389,9 +391,9 @@ void wxBitmap::Render(void)
{
M_BMPDATA->m_mask = new wxMask();
M_BMPDATA->m_mask->m_bitmap = mask;
};
}
#endif
};
}

View File

@ -32,7 +32,7 @@ class wxBrushRefData: public wxObjectRefData
wxBrushRefData::wxBrushRefData(void)
{
m_style = 0;
};
}
//-----------------------------------------------------------------------------
@ -43,7 +43,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBrush,wxGDIObject)
wxBrush::wxBrush(void)
{
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
};
}
wxBrush::wxBrush( const wxColour &colour, int style )
{
@ -52,7 +52,7 @@ wxBrush::wxBrush( const wxColour &colour, int style )
M_BRUSHDATA->m_colour = colour;
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
};
}
wxBrush::wxBrush( const wxString &colourName, int style )
{
@ -61,7 +61,7 @@ wxBrush::wxBrush( const wxString &colourName, int style )
M_BRUSHDATA->m_colour = colourName;
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
};
}
wxBrush::wxBrush( const wxBitmap &stippleBitmap )
{
@ -71,62 +71,62 @@ wxBrush::wxBrush( const wxBitmap &stippleBitmap )
M_BRUSHDATA->m_stipple = stippleBitmap;
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
};
}
wxBrush::wxBrush( const wxBrush &brush )
{
Ref( brush );
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
};
}
wxBrush::wxBrush( const wxBrush *brush )
{
if (brush) Ref( *brush );
if (wxTheBrushList) wxTheBrushList->Append( this );
};
}
wxBrush::~wxBrush(void)
{
if (wxTheBrushList) wxTheBrushList->RemoveBrush( this );
};
}
wxBrush& wxBrush::operator = ( const wxBrush& brush )
{
if (*this == brush) return (*this);
Ref( brush );
return *this;
};
}
bool wxBrush::operator == ( const wxBrush& brush )
{
return m_refData == brush.m_refData;
};
}
bool wxBrush::operator != ( const wxBrush& brush )
{
return m_refData != brush.m_refData;
};
}
bool wxBrush::Ok(void) const
{
return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
};
}
int wxBrush::GetStyle(void) const
{
return M_BRUSHDATA->m_style;
};
}
wxColour &wxBrush::GetColour(void) const
{
return M_BRUSHDATA->m_colour;
};
}
wxBitmap *wxBrush::GetStipple(void) const
{
return &M_BRUSHDATA->m_stipple;
};
}

View File

@ -46,17 +46,17 @@ wxColourRefData::wxColourRefData(void)
m_color.pixel = 0;
m_colormap = NULL;
m_hasPixel = FALSE;
};
}
wxColourRefData::~wxColourRefData(void)
{
FreeColour();
};
}
void wxColourRefData::FreeColour(void)
{
// if (m_hasPixel) gdk_colors_free( m_colormap, &m_color, 1, 0 );
};
}
//-----------------------------------------------------------------------------
@ -68,7 +68,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject)
wxColour::wxColour(void)
{
};
}
wxColour::wxColour( char red, char green, char blue )
{
@ -77,7 +77,7 @@ wxColour::wxColour( char red, char green, char blue )
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
M_COLDATA->m_color.pixel = 0;
};
}
wxColour::wxColour( const wxString &colourName )
{
@ -96,30 +96,30 @@ wxColour::wxColour( const wxString &colourName )
wxFAIL_MSG( "wxColour: couldn't find colour" );
delete m_refData;
m_refData = NULL;
};
};
};
}
}
}
wxColour::wxColour( const wxColour& col )
{
Ref( col );
};
}
wxColour::wxColour( const wxColour* col )
{
if (col) Ref( *col );
};
}
wxColour::~wxColour(void)
{
};
}
wxColour& wxColour::operator = ( const wxColour& col )
{
if (*this == col) return (*this);
Ref( col );
return *this;
};
}
wxColour& wxColour::operator = ( const wxString& colourName )
{
@ -138,20 +138,20 @@ wxColour& wxColour::operator = ( const wxString& colourName )
wxFAIL_MSG( "wxColour: couldn't find colour" );
delete m_refData;
m_refData = NULL;
};
};
}
}
return *this;
};
}
bool wxColour::operator == ( const wxColour& col )
{
return m_refData == col.m_refData;
};
}
bool wxColour::operator != ( const wxColour& col)
{
return m_refData != col.m_refData;
};
}
void wxColour::Set( const unsigned char red, const unsigned char green, const unsigned char blue )
{
@ -161,30 +161,30 @@ void wxColour::Set( const unsigned char red, const unsigned char green, const un
M_COLDATA->m_color.green = ((unsigned short)green) << SHIFT;
M_COLDATA->m_color.blue = ((unsigned short)blue) << SHIFT;
M_COLDATA->m_color.pixel = 0;
};
}
unsigned char wxColour::Red(void) const
{
if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
};
}
unsigned char wxColour::Green(void) const
{
if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
};
}
unsigned char wxColour::Blue(void) const
{
if (!Ok()) return 0;
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
};
}
bool wxColour::Ok(void) const
{
return (m_refData);
};
}
void wxColour::CalcPixel( GdkColormap *cmap )
{
@ -208,20 +208,20 @@ void wxColour::CalcPixel( GdkColormap *cmap )
#endif
M_COLDATA->m_colormap = cmap;
};
}
int wxColour::GetPixel(void)
{
if (!Ok()) return 0;
return M_COLDATA->m_color.pixel;
};
}
GdkColor *wxColour::GetColor(void)
{
if (!Ok()) return NULL;
return &M_COLDATA->m_color;
};
}

View File

@ -32,12 +32,12 @@ class wxCursorRefData: public wxObjectRefData
wxCursorRefData::wxCursorRefData(void)
{
m_cursor = NULL;
};
}
wxCursorRefData::~wxCursorRefData(void)
{
if (m_cursor) gdk_cursor_destroy( m_cursor );
};
}
//-----------------------------------------------------------------------------
@ -47,7 +47,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCursor,wxObject)
wxCursor::wxCursor(void)
{
};
}
wxCursor::wxCursor( int cursorId )
{
@ -67,7 +67,7 @@ wxCursor::wxCursor( int cursorId )
case wxCURSOR_IBEAM: gdk_cur = GDK_XTERM; break;
case wxCURSOR_PENCIL: gdk_cur = GDK_PENCIL; break;
case wxCURSOR_NO_ENTRY: gdk_cur = GDK_PIRATE; break;
};
}
M_CURSORDATA->m_cursor = gdk_cursor_new( gdk_cur );
@ -97,49 +97,49 @@ wxCursor::wxCursor( int cursorId )
wxCURSOR_BASED_ARROW_DOWN
*/
};
}
wxCursor::wxCursor( const wxCursor &cursor )
{
Ref( cursor );
};
}
wxCursor::wxCursor( const wxCursor *cursor )
{
UnRef();
if (cursor) Ref( *cursor );
};
}
wxCursor::~wxCursor(void)
{
};
}
wxCursor& wxCursor::operator = ( const wxCursor& cursor )
{
if (*this == cursor) return (*this);
Ref( cursor );
return *this;
};
}
bool wxCursor::operator == ( const wxCursor& cursor )
{
return m_refData == cursor.m_refData;
};
}
bool wxCursor::operator != ( const wxCursor& cursor )
{
return m_refData != cursor.m_refData;
};
}
bool wxCursor::Ok(void) const
{
return TRUE;
};
}
GdkCursor *wxCursor::GetCursor(void) const
{
return M_CURSORDATA->m_cursor;
};
}
//-----------------------------------------------------------------------------
// busy cursor routines
@ -150,24 +150,24 @@ bool g_isBusy = FALSE;
void wxEndBusyCursor(void)
{
g_isBusy = FALSE;
};
}
void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
{
g_isBusy = TRUE;
};
}
bool wxIsBusy(void)
{
return g_isBusy;
};
}
void wxSetCursor( const wxCursor& cursor )
{
extern wxCursor *g_globalCursor;
if (g_globalCursor) (*g_globalCursor) = cursor;
if (cursor.Ok()) {};
};
if (cursor.Ok()) {}
}

View File

@ -77,25 +77,25 @@ wxDC::wxDC(void)
m_backgroundBrush = *wxWHITE_BRUSH;
// m_palette = wxAPP_COLOURMAP;
};
}
wxDC::~wxDC(void)
{
};
}
void wxDC::DrawArc( long WXUNUSED(x1), long WXUNUSED(y1), long WXUNUSED(x2), long WXUNUSED(y2),
double WXUNUSED(xc), double WXUNUSED(yc) )
{
};
}
void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUSED(y), bool WXUNUSED(useMask) )
{
};
}
void wxDC::DrawPoint( wxPoint& point )
{
DrawPoint( point.x, point.y );
};
}
void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle )
{
@ -108,10 +108,10 @@ void wxDC::DrawPolygon( wxList *list, long xoffset, long yoffset, int fillStyle
wxPoint *point = (wxPoint *)node->Data();
points[i].x = point->x;
points[i++].y = point->y;
};
}
DrawPolygon( n, points, xoffset, yoffset, fillStyle );
delete[] points;
};
}
void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
{
@ -124,10 +124,10 @@ void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
wxPoint *point = (wxPoint *)node->Data();
points[i].x = point->x;
points[i++].y = point->y;
};
}
DrawLines( n, points, xoffset, yoffset );
delete []points;
};
}
void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
{
@ -142,20 +142,20 @@ void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
wxPoint *p = (wxPoint*)node->Data();
delete p;
node = node->Next();
};
};
}
}
void wxDC::DrawSpline( wxList *points )
{
DrawOpenSpline( points );
};
}
void wxDC::DrawSpline( int n, wxPoint points[] )
{
wxList list;
for (int i = 0; i < n; i++) list.Append( (wxObject*)&points[i] );
DrawSpline( &list );
};
}
void wxDC::SetClippingRegion( long x, long y, long width, long height )
{
@ -164,12 +164,12 @@ void wxDC::SetClippingRegion( long x, long y, long width, long height )
m_clipY1 = y;
m_clipX2 = x + width;
m_clipY2 = y + height;
};
}
void wxDC::DestroyClippingRegion(void)
{
m_clipping = FALSE;
};
}
void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const
{
@ -182,13 +182,13 @@ void wxDC::GetClippingBox( long *x, long *y, long *width, long *height ) const
}
else
*x = *y = *width = *height = 0;
};
}
void wxDC::GetSize( int* width, int* height ) const
{
*width = m_maxX-m_minX;
*height = m_maxY-m_minY;
};
}
void wxDC::GetSizeMM( long* width, long* height ) const
{
@ -197,19 +197,19 @@ void wxDC::GetSizeMM( long* width, long* height ) const
GetSize( &w, &h );
*width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
*height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
};
}
void wxDC::SetTextForeground( const wxColour &col )
{
if (!Ok()) return;
m_textForegroundColour = col;
};
}
void wxDC::SetTextBackground( const wxColour &col )
{
if (!Ok()) return;
m_textBackgroundColour = col;
};
}
void wxDC::SetMapMode( int mode )
{
@ -231,13 +231,13 @@ void wxDC::SetMapMode( int mode )
case MM_TEXT:
SetLogicalScale( 1.0, 1.0 );
break;
};
}
if (mode != MM_TEXT)
{
m_needComputeScaleX = TRUE;
m_needComputeScaleY = TRUE;
};
};
}
}
void wxDC::SetUserScale( double x, double y )
{
@ -245,13 +245,13 @@ void wxDC::SetUserScale( double x, double y )
m_userScaleX = x;
m_userScaleY = y;
ComputeScaleAndOrigin();
};
}
void wxDC::GetUserScale( double *x, double *y )
{
if (x) *x = m_userScaleX;
if (y) *y = m_userScaleY;
};
}
void wxDC::SetLogicalScale( double x, double y )
{
@ -259,86 +259,86 @@ void wxDC::SetLogicalScale( double x, double y )
m_logicalScaleX = x;
m_logicalScaleY = y;
ComputeScaleAndOrigin();
};
}
void wxDC::GetLogicalScale( double *x, double *y )
{
if (x) *x = m_logicalScaleX;
if (y) *y = m_logicalScaleY;
};
}
void wxDC::SetLogicalOrigin( long x, long y )
{
m_logicalOriginX = x * m_signX; // is this still correct ?
m_logicalOriginY = y * m_signY;
ComputeScaleAndOrigin();
};
}
void wxDC::GetLogicalOrigin( long *x, long *y )
{
if (x) *x = m_logicalOriginX;
if (y) *y = m_logicalOriginY;
};
}
void wxDC::SetDeviceOrigin( long x, long y )
{
m_deviceOriginX = x;
m_deviceOriginY = y;
ComputeScaleAndOrigin();
};
}
void wxDC::GetDeviceOrigin( long *x, long *y )
{
if (x) *x = m_deviceOriginX;
if (y) *y = m_deviceOriginY;
};
}
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
{
m_signX = (xLeftRight ? 1 : -1);
m_signY = (yBottomUp ? -1 : 1);
ComputeScaleAndOrigin();
};
}
long wxDC::DeviceToLogicalX(long x) const
{
return XDEV2LOG(x);
};
}
long wxDC::DeviceToLogicalY(long y) const
{
return YDEV2LOG(y);
};
}
long wxDC::DeviceToLogicalXRel(long x) const
{
return XDEV2LOGREL(x);
};
}
long wxDC::DeviceToLogicalYRel(long y) const
{
return YDEV2LOGREL(y);
};
}
long wxDC::LogicalToDeviceX(long x) const
{
return XLOG2DEV(x);
};
}
long wxDC::LogicalToDeviceY(long y) const
{
return YLOG2DEV(y);
};
}
long wxDC::LogicalToDeviceXRel(long x) const
{
return XLOG2DEVREL(x);
};
}
long wxDC::LogicalToDeviceYRel(long y) const
{
return YLOG2DEVREL(y);
};
}
void wxDC::CalcBoundingBox( long x, long y )
{
@ -346,7 +346,7 @@ void wxDC::CalcBoundingBox( long x, long y )
if (y < m_minY) m_minY = y;
if (x > m_maxX) m_maxX = x;
if (y > m_maxY) m_maxY = y;
};
}
void wxDC::ComputeScaleAndOrigin(void)
{
@ -367,5 +367,5 @@ void wxDC::ComputeScaleAndOrigin(void)
m_pen = tempPen;
SetPen(pen);
}
};
}

View File

@ -24,17 +24,17 @@ wxMemoryDC::wxMemoryDC(void)
{
m_ok = FALSE;
m_cmap = gdk_colormap_get_system();
};
}
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
{
m_ok = FALSE;
m_cmap = gdk_colormap_get_system();
};
}
wxMemoryDC::~wxMemoryDC(void)
{
};
}
void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{
@ -58,8 +58,8 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
{
m_ok = FALSE;
m_window = NULL;
};
};
}
}
void wxMemoryDC::GetSize( int *width, int *height ) const
{
@ -72,7 +72,7 @@ void wxMemoryDC::GetSize( int *width, int *height ) const
{
if (width) (*width) = 0;
if (height) (*height) = 0;
};
};
}
}

View File

@ -36,12 +36,12 @@ wxScreenDC::wxScreenDC(void)
gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
};
}
wxScreenDC::~wxScreenDC(void)
{
EndDrawingOnTop();
};
}
bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
{
@ -51,7 +51,7 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
{
StartDrawingOnTop();
return;
};
}
wxRectangle rect;
rect.x = 0;
rect.y = 0;
@ -63,7 +63,7 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
StartDrawingOnTop( &rect );
return TRUE;
*/
};
}
bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
{
@ -79,7 +79,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
y = rect->y;
width = rect->width;
height = rect->height;
};
}
GTK cannot set transparent backgrounds. :-(
@ -107,7 +107,7 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
return TRUE;
*/
};
}
bool wxScreenDC::EndDrawingOnTop(void)
{
@ -118,4 +118,5 @@ bool wxScreenDC::EndDrawingOnTop(void)
m_isOk = FALSE;
return TRUE;
*/
};
}

View File

@ -32,25 +32,25 @@ extern bool g_blockEventsOnDrag;
wxDropTarget::wxDropTarget()
{
};
}
wxDropTarget::~wxDropTarget()
{
};
}
void wxDropTarget::Drop( GdkEvent *event, int x, int y )
{
printf( "Drop data is of type %s.\n", event->dropdataavailable.data_type );
OnDrop( x, y, (char *)event->dropdataavailable.data);
};
}
void wxDropTarget::UnregisterWidget( GtkWidget *widget )
{
if (!widget) return;
gtk_widget_dnd_drop_set( widget, FALSE, NULL, 0, FALSE );
};
}
void wxDropTarget::RegisterWidget( GtkWidget *widget )
{
@ -74,13 +74,13 @@ void wxDropTarget::RegisterWidget( GtkWidget *widget )
break;
default:
break;
};
}
}
char *str = WXSTRINGCAST formats;
gtk_widget_dnd_drop_set( widget, TRUE, &str, valid, FALSE );
};
}
// ----------------------------------------------------------------------------
// wxTextDropTarget
@ -90,14 +90,14 @@ bool wxTextDropTarget::OnDrop( long x, long y, const void *pData )
{
OnDropText( x, y, (const char*)pData );
return TRUE;
};
}
bool wxTextDropTarget::OnDropText( long x, long y, const char *psz )
{
printf( "Got dropped text: %s.\n", psz );
printf( "At x: %d, y: %d.\n", (int)x, (int)y );
return TRUE;
};
}
size_t wxTextDropTarget::GetFormatCount() const
{
@ -159,7 +159,7 @@ void gtk_drag_callback( GtkWidget *widget, GdkEvent *event, wxDropSource *source
delete ptr;
source->m_retValue = wxDropSource::Copy;
};
}
wxDropSource::wxDropSource( wxWindow *win )
{
@ -174,7 +174,7 @@ wxDropSource::wxDropSource( wxWindow *win )
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
};
}
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
{
@ -189,19 +189,19 @@ wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
};
}
void wxDropSource::SetData( wxDataObject &data )
{
m_data = &data;
};
}
wxDropSource::~wxDropSource(void)
{
// if (m_data) delete m_data;
g_blockEventsOnDrag = FALSE;
};
}
wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
{
@ -227,7 +227,7 @@ wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
{
g_free( gdk_dnd.drag_startwindows );
gdk_dnd.drag_startwindows = NULL;
};
}
gdk_dnd.drag_numwindows = gdk_dnd.drag_really = 0;
XWindowAttributes dnd_winattr;
@ -266,7 +266,7 @@ wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
g_blockEventsOnDrag = FALSE;
return m_retValue;
};
}
void wxDropSource::RegisterWindow(void)
{
@ -294,7 +294,7 @@ void wxDropSource::RegisterWindow(void)
gtk_signal_connect( GTK_OBJECT(m_widget), "drag_request_event",
GTK_SIGNAL_FUNC(gtk_drag_callback), (gpointer)this );
};
}
void wxDropSource::UnregisterWindow(void)
{
@ -303,4 +303,4 @@ void wxDropSource::UnregisterWindow(void)
gtk_widget_dnd_drag_set( m_widget, FALSE, NULL, 0 );
gtk_signal_disconnect_by_data( GTK_OBJECT(m_widget), (gpointer)this );
};
}

View File

@ -37,14 +37,14 @@ void gtk_filedialog_ok_callback( GtkWidget *WXUNUSED(widget), gpointer data )
}
dialog->OnOK( event );
};
}
void gtk_filedialog_cancel_callback( GtkWidget *WXUNUSED(widget), gpointer data )
{
wxFileDialog *dialog = (wxFileDialog*)data;
wxCommandEvent event(wxEVT_NULL);
dialog->OnCancel( event );
};
}
IMPLEMENT_DYNAMIC_CLASS(wxFileDialog,wxDialog)
@ -83,7 +83,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
};
}
int wxFileDialog::ShowModal(void)
{
@ -93,9 +93,9 @@ int wxFileDialog::ShowModal(void)
{
m_fileName = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
m_path = gtk_file_selection_get_filename( GTK_FILE_SELECTION(m_widget) );
};
}
return ret;
};
}
char *wxFileSelector(const char *title,
@ -131,7 +131,7 @@ char *wxFileSelector(const char *title,
}
else
return NULL;
};
}
char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name,
wxWindow *parent )
@ -147,7 +147,7 @@ char* wxLoadFileSelector(const char *what, const char *extension, const char *de
sprintf(wild, "*.%s", ext);
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
};
}
char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
wxWindow *parent )
@ -163,5 +163,5 @@ char* wxSaveFileSelector(const char *what, const char *extension, const char *de
sprintf(wild, "*.%s", ext);
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
};
}

View File

@ -24,9 +24,11 @@ static char *wx_font_family [] = {
"wxDEFAULT", "wxDECORATIVE", "wxMODERN", "wxROMAN", "wxSCRIPT",
"wxSWISS", "wxTELETYPE",
};
static char *wx_font_style [] = {
"wxDEFAULT", "wxNORMAL", "wxSLANT", "wxITALIC",
};
static char *wx_font_weight [] = {
"wxDEFAULT", "wxNORMAL", "wxBOLD", "wxLIGHT",
};
@ -68,7 +70,7 @@ wxFontRefData::wxFontRefData(void) : m_scaled_xfonts(wxKEY_INTEGER)
m_fontId = 0;
m_faceName = NULL;
m_font = NULL;
};
}
wxFontRefData::~wxFontRefData(void)
{
@ -79,14 +81,14 @@ wxFontRefData::~wxFontRefData(void)
wxNode *next = node->Next();
gdk_font_unref( font );
node = next;
};
}
if (m_faceName)
{
delete m_faceName;
m_faceName = NULL;
};
}
if (m_font) gdk_font_unref( m_font );
};
}
//-----------------------------------------------------------------------------
@ -97,7 +99,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
wxFont::wxFont(void)
{
if (wxTheFontList) wxTheFontList->Append( this );
};
}
wxFont::wxFont( char *xFontName )
{
@ -107,7 +109,7 @@ wxFont::wxFont( char *xFontName )
M_FONTDATA->m_byXFontName = TRUE;
M_FONTDATA->m_font = gdk_font_load( xFontName );
};
}
wxFont::wxFont(int PointSize, int FontIdOrFamily, int Style, int Weight,
bool Underlined, const char* Face)
@ -123,14 +125,14 @@ wxFont::wxFont(int PointSize, int FontIdOrFamily, int Style, int Weight,
{
M_FONTDATA->m_fontId = FontIdOrFamily;
M_FONTDATA->m_family = wxTheFontNameDirectory->GetFamily( FontIdOrFamily );
};
}
M_FONTDATA->m_style = Style;
M_FONTDATA->m_weight = Weight;
M_FONTDATA->m_pointSize = PointSize;
M_FONTDATA->m_underlined = Underlined;
if (wxTheFontList) wxTheFontList->Append( this );
};
}
wxFont::wxFont(int PointSize, const char *Face, int Family, int Style,
int Weight, bool Underlined)
@ -146,105 +148,105 @@ wxFont::wxFont(int PointSize, const char *Face, int Family, int Style,
M_FONTDATA->m_underlined = Underlined;
if (wxTheFontList) wxTheFontList->Append( this );
};
}
wxFont::wxFont( const wxFont& font )
{
Ref( font );
};
}
wxFont::wxFont( const wxFont* font )
{
UnRef();
if (font) Ref( *font );
};
}
wxFont::~wxFont(void)
{
if (wxTheFontList) wxTheFontList->DeleteObject( this );
};
}
wxFont& wxFont::operator = ( const wxFont& font )
{
if (*this == font) return (*this);
Ref( font );
return *this;
};
}
bool wxFont::operator == ( const wxFont& font )
{
return m_refData == font.m_refData;
};
}
bool wxFont::operator != ( const wxFont& font )
{
return m_refData != font.m_refData;
};
}
bool wxFont::Ok()
{
return (m_refData != NULL);
};
}
int wxFont::GetPointSize(void) const
{
return M_FONTDATA->m_pointSize;
};
}
wxString wxFont::GetFaceString(void) const
{
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
return s;
};
}
wxString wxFont::GetFaceName(void) const
{
wxString s = wxTheFontNameDirectory->GetFontName( M_FONTDATA->m_fontId );
return s;
};
}
int wxFont::GetFamily(void) const
{
return M_FONTDATA->m_family;
};
}
wxString wxFont::GetFamilyString(void) const
{
wxString s = wx_font_family[M_FONTDATA->m_family];
return s;
};
}
int wxFont::GetFontId(void) const
{
return M_FONTDATA->m_fontId; // stub
};
}
int wxFont::GetStyle(void) const
{
return M_FONTDATA->m_style;
};
}
wxString wxFont::GetStyleString(void) const
{
wxString s = wx_font_style[M_FONTDATA->m_style];
return s;
};
}
int wxFont::GetWeight(void) const
{
return M_FONTDATA->m_weight;
};
}
wxString wxFont::GetWeightString(void) const
{
wxString s = wx_font_weight[M_FONTDATA->m_weight];
return s;
};
}
bool wxFont::GetUnderlined(void) const
{
return M_FONTDATA->m_underlined;
};
}
//-----------------------------------------------------------------------------
// get internal representation of font
@ -273,12 +275,12 @@ GdkFont *wxFont::GetInternalFont(float scale) const
font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style,
M_FONTDATA->m_weight, M_FONTDATA->m_underlined );
M_FONTDATA->m_scaled_xfonts.Append( int_scale, (wxObject*)font );
};
}
if (!font)
printf("could not load any font");
// wxError("could not load any font", "wxFont");
return font;
};
}
//-----------------------------------------------------------------------------
// local utilities to find a X font
@ -448,7 +450,7 @@ static int WCoordinate(int w)
case wxNORMAL:
default: return wxWEIGHT_NORMAL;
}
}
};
static int SCoordinate(int s)
{
@ -458,7 +460,7 @@ static int SCoordinate(int s)
case wxNORMAL:
default: return wxSTYLE_NORMAL;
}
}
};
//-----------------------------------------------------------------------------
// wxSuffixMap

View File

@ -171,6 +171,7 @@ wxFrame::~wxFrame()
{
if (m_frameMenuBar) delete m_frameMenuBar;
if (m_frameStatusBar) delete m_frameStatusBar;
if (m_frameToolBar) delete m_frameToolBar;
// if (m_mainWindow) gtk_widget_destroy( m_mainWindow );

View File

@ -23,5 +23,5 @@ IMPLEMENT_DYNAMIC_CLASS(wxIcon,wxBitmap)
wxIcon::wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
wxBitmap( bits )
{
};
}

View File

@ -34,10 +34,10 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
(win->m_height == alloc->height))
{
return;
};
}
win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
};
}
// page change callback
static void gtk_page_change_callback( GtkNotebook *WXUNUSED(widget),
@ -55,7 +55,7 @@ static void gtk_page_change_callback( GtkNotebook *WXUNUSED(widget),
mdi_frame->m_currentChild = child_frame;
mdi_frame->SetMDIMenuBar( child_frame->m_menuBar );
return;
};
}
node = node->Next();
}
}
@ -72,7 +72,7 @@ wxMDIParentFrame::wxMDIParentFrame(void)
m_clientWindow = NULL;
m_currentChild = NULL;
m_parentFrameActive = TRUE;
};
}
wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
wxWindowID id, const wxString& title,
@ -83,11 +83,11 @@ wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
m_currentChild = NULL;
m_parentFrameActive = TRUE;
Create( parent, id, title, pos, size, style, name );
};
}
wxMDIParentFrame::~wxMDIParentFrame(void)
{
};
}
bool wxMDIParentFrame::Create( wxWindow *parent,
wxWindowID id, const wxString& title,
@ -99,7 +99,7 @@ bool wxMDIParentFrame::Create( wxWindow *parent,
OnCreateClient();
return TRUE;
};
}
void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
{
@ -112,7 +112,7 @@ void wxMDIParentFrame::GtkOnSize( int x, int y, int width, int height )
GetClientSize( &x, &y );
m_mdiMenuBar->SetSize( 1, 1, x-2, 26 );
}
};
}
void wxMDIParentFrame::SetMDIMenuBar( wxMenuBar *menu_bar )
{
@ -126,48 +126,48 @@ void wxMDIParentFrame::SetMDIMenuBar( wxMenuBar *menu_bar )
m_mdiMenuBar->SetSize( 1, 1, x-2, 26 );
m_mdiMenuBar->Show( TRUE );
}
};
}
void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
{
wxFrame::GetClientSize( width, height );
};
}
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const
{
return m_currentChild;
};
}
wxMDIClientWindow *wxMDIParentFrame::GetClientWindow(void) const
{
return m_clientWindow;
};
}
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient(void)
{
m_clientWindow = new wxMDIClientWindow( this );
return m_clientWindow;
};
}
void wxMDIParentFrame::ActivateNext(void)
{
if (m_clientWindow)
gtk_notebook_next_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
};
}
void wxMDIParentFrame::ActivatePrevious(void)
{
if (m_clientWindow)
gtk_notebook_prev_page( GTK_NOTEBOOK(m_clientWindow->m_widget) );
};
}
void wxMDIParentFrame::OnActivate( wxActivateEvent& WXUNUSED(event) )
{
};
}
void wxMDIParentFrame::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(event) )
{
};
}
//-----------------------------------------------------------------------------
// wxMDIChildFrame
@ -183,7 +183,7 @@ wxMDIChildFrame::wxMDIChildFrame(void)
{
m_menuBar = NULL;
m_page = NULL;
};
}
wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title,
@ -193,7 +193,7 @@ wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
m_menuBar = NULL;
m_page = NULL;
Create( parent, id, title, wxDefaultPosition, size, style, name );
};
}
wxMDIChildFrame::~wxMDIChildFrame(void)
{
@ -204,10 +204,10 @@ wxMDIChildFrame::~wxMDIChildFrame(void)
{
mdi_frame->SetMDIMenuBar( NULL );
mdi_frame->m_currentChild = NULL;
};
}
delete m_menuBar;
}
};
}
bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title,
@ -216,7 +216,7 @@ bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
{
m_title = title;
return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
};
}
void wxMDIChildFrame::GetClientSize( int *width, int *height ) const
{
@ -238,8 +238,8 @@ static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
if (menuitem->IsSubMenu())
SetInvokingWindow( menuitem->GetSubMenu(), win );
node = node->Next();
};
};
}
}
void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
{
@ -257,7 +257,7 @@ void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
wxMenu *menu = (wxMenu*)node->Data();
SetInvokingWindow( menu, this );
node = node->Next();
};
}
m_menuBar->m_parent = mdi_frame;
}
@ -266,20 +266,20 @@ void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
gtk_myfixed_put( GTK_MYFIXED(mdi_frame->m_mainWindow),
m_menuBar->m_widget, m_menuBar->m_x, m_menuBar->m_y );
}
};
}
wxMenuBar *wxMDIChildFrame::GetMenuBar()
{
return m_menuBar;
};
}
void wxMDIChildFrame::Activate(void)
{
};
}
void wxMDIChildFrame::OnActivate( wxActivateEvent &WXUNUSED(event) )
{
};
}
//-----------------------------------------------------------------------------
// wxMDIClientWindow
@ -289,16 +289,16 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow,wxWindow)
wxMDIClientWindow::wxMDIClientWindow(void)
{
};
}
wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, long style )
{
CreateClient( parent, style );
};
}
wxMDIClientWindow::~wxMDIClientWindow(void)
{
};
}
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
{
@ -318,7 +318,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
Show( TRUE );
return TRUE;
};
}
void wxMDIClientWindow::AddChild( wxWindow *child )
{
@ -326,7 +326,7 @@ void wxMDIClientWindow::AddChild( wxWindow *child )
{
wxFAIL_MSG("wxNotebook::AddChild: Child has to be wxMDIChildFrame");
return;
};
}
m_children.Append( child );
@ -349,6 +349,6 @@ void wxMDIClientWindow::AddChild( wxWindow *child )
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), m_children.Number()-1 );
gtk_page_change_callback( NULL, mdi_child->m_page, 0, this );
};
}

View File

@ -34,7 +34,7 @@ public:
m_page = NULL;
m_client = NULL;
m_parent = NULL;
};
}
//private:
int m_id;
@ -80,7 +80,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
(win->m_height == alloc->height))
{
return;
};
}
/*
printf( "OnResize from " );
@ -104,7 +104,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
printf( " W: %d H: %d ", win->m_width, win->m_height );
printf( " .\n" );
*/
};
}
//-----------------------------------------------------------------------------
// wxNotebook
@ -122,7 +122,7 @@ void wxNotebook::Init()
wxNotebook::wxNotebook()
{
Init();
};
}
wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
@ -130,7 +130,7 @@ wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id,
{
Init();
Create( parent, id, pos, size, style, name );
};
}
wxNotebook::~wxNotebook()
{
@ -139,7 +139,7 @@ wxNotebook::~wxNotebook()
gtk_signal_disconnect(GTK_OBJECT(m_widget), m_idHandler);
DeleteAllPages();
};
}
bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
@ -165,7 +165,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
Show( TRUE );
return TRUE;
};
}
int wxNotebook::GetSelection() const
{
@ -183,22 +183,22 @@ int wxNotebook::GetSelection() const
if (page->m_page == g_page)
break;
node = node->Next();
};
}
wxCHECK_MSG( node != NULL, -1, "wxNotebook: no selection?" );
return page->m_id;
};
}
int wxNotebook::GetPageCount() const
{
return m_pages.Number();
};
}
int wxNotebook::GetRowCount() const
{
return 1;
};
}
wxString wxNotebook::GetPageText( int page ) const
{
@ -207,7 +207,7 @@ wxString wxNotebook::GetPageText( int page ) const
return nb_page->m_text;
else
return "";
};
}
int wxNotebook::GetPageImage( int page ) const
{
@ -216,7 +216,7 @@ int wxNotebook::GetPageImage( int page ) const
return nb_page->m_image;
else
return 0;
};
}
wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
{
@ -229,12 +229,12 @@ wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
if (nb_page->m_id == page)
return nb_page;
node = node->Next();
};
}
wxLogDebug( "Notebook page %d not found!", page );
return NULL;
};
}
int wxNotebook::SetSelection( int page )
{
@ -251,14 +251,14 @@ int wxNotebook::SetSelection( int page )
break;
page_num++;
child = child->next;
};
}
if (!child) return -1;
gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page_num );
return selOld;
};
}
void wxNotebook::AdvanceSelection(bool bForward)
{
@ -276,7 +276,7 @@ void wxNotebook::AdvanceSelection(bool bForward)
void wxNotebook::SetImageList( wxImageList* imageList )
{
m_imageList = imageList;
};
}
bool wxNotebook::SetPageText( int page, const wxString &text )
{
@ -287,7 +287,7 @@ bool wxNotebook::SetPageText( int page, const wxString &text )
nb_page->m_text = text;
return TRUE;
};
}
bool wxNotebook::SetPageImage( int page, int image )
{
@ -298,17 +298,17 @@ bool wxNotebook::SetPageImage( int page, int image )
nb_page->m_image = image;
return TRUE;
};
}
void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
{
wxFAIL_MSG(_("wxNotebook::SetPageSize not implemented"));
};
}
void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
{
wxFAIL_MSG(_("wxNotebook::SetPadding not implemented"));
};
}
bool wxNotebook::DeleteAllPages()
{
@ -320,10 +320,10 @@ bool wxNotebook::DeleteAllPages()
DeletePage( page->m_id );
page_node = m_pages.First();
};
}
return TRUE;
};
}
bool wxNotebook::DeletePage( int page )
{
@ -337,7 +337,7 @@ bool wxNotebook::DeletePage( int page )
if (nb_page->m_page == (GtkNotebookPage*)child->data) break;
page_num++;
child = child->next;
};
}
wxASSERT( child );
@ -349,7 +349,7 @@ bool wxNotebook::DeletePage( int page )
m_pages.DeleteObject( nb_page );
return TRUE;
};
}
bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
bool bSelect, int imageId)
@ -367,7 +367,7 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
if ( page->m_client == win )
break; // found
node = node->Next();
};
}
wxCHECK_MSG(page != NULL, FALSE,
_("Can't add a page whose parent is not the notebook!"));
@ -384,7 +384,7 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
}
return TRUE;
};
}
wxWindow *wxNotebook::GetPage( int page ) const
{
@ -393,7 +393,7 @@ wxWindow *wxNotebook::GetPage( int page ) const
return NULL;
else
return nb_page->m_client;
};
}
void wxNotebook::AddChild( wxWindow *win )
{
@ -423,7 +423,7 @@ void wxNotebook::AddChild( wxWindow *win )
}
m_pages.Append( page );
};
}
// override these 2 functions to do nothing: everything is done in OnSize
void wxNotebook::SetConstraintSizes( bool WXUNUSED(recurse) )

View File

@ -38,7 +38,7 @@ wxPenRefData::wxPenRefData(void)
m_style = wxSOLID;
m_joinStyle = wxJOIN_ROUND;
m_capStyle = wxCAP_ROUND;
};
}
//-----------------------------------------------------------------------------
@ -49,7 +49,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject)
wxPen::wxPen(void)
{
if (wxThePenList) wxThePenList->AddPen( this );
};
}
wxPen::wxPen( const wxColour &colour, int width, int style )
{
@ -58,7 +58,7 @@ wxPen::wxPen( const wxColour &colour, int width, int style )
M_PENDATA->m_style = style;
M_PENDATA->m_colour = colour;
if (wxThePenList) wxThePenList->AddPen( this );
};
}
wxPen::wxPen( const wxString &colourName, int width, int style )
{
@ -67,42 +67,42 @@ wxPen::wxPen( const wxString &colourName, int width, int style )
M_PENDATA->m_style = style;
M_PENDATA->m_colour = colourName;
if (wxThePenList) wxThePenList->AddPen( this );
};
}
wxPen::wxPen( const wxPen& pen )
{
Ref( pen );
if (wxThePenList) wxThePenList->AddPen( this );
};
}
wxPen::wxPen( const wxPen* pen )
{
UnRef();
if (pen) Ref( *pen );
if (wxThePenList) wxThePenList->AddPen( this );
};
}
wxPen::~wxPen(void)
{
if (wxThePenList) wxThePenList->RemovePen( this );
};
}
wxPen& wxPen::operator = ( const wxPen& pen )
{
if (*this == pen) return (*this);
Ref( pen );
return *this;
};
}
bool wxPen::operator == ( const wxPen& pen )
{
return m_refData == pen.m_refData;
};
}
bool wxPen::operator != ( const wxPen& pen )
{
return m_refData != pen.m_refData;
};
}
void wxPen::SetColour( const wxColour &colour )
{
@ -110,7 +110,7 @@ void wxPen::SetColour( const wxColour &colour )
m_refData = new wxPenRefData();
M_PENDATA->m_colour = colour;
};
}
void wxPen::SetColour( const wxString &colourName )
{
@ -118,7 +118,7 @@ void wxPen::SetColour( const wxString &colourName )
m_refData = new wxPenRefData();
M_PENDATA->m_colour = colourName;
};
}
void wxPen::SetColour( int red, int green, int blue )
{
@ -126,7 +126,7 @@ void wxPen::SetColour( int red, int green, int blue )
m_refData = new wxPenRefData();
M_PENDATA->m_colour.Set( red, green, blue );
};
}
void wxPen::SetCap( int capStyle )
{
@ -134,7 +134,7 @@ void wxPen::SetCap( int capStyle )
m_refData = new wxPenRefData();
M_PENDATA->m_capStyle = capStyle;
};
}
void wxPen::SetJoin( int joinStyle )
{
@ -142,7 +142,7 @@ void wxPen::SetJoin( int joinStyle )
m_refData = new wxPenRefData();
M_PENDATA->m_joinStyle = joinStyle;
};
}
void wxPen::SetStyle( int style )
{
@ -150,7 +150,7 @@ void wxPen::SetStyle( int style )
m_refData = new wxPenRefData();
M_PENDATA->m_style = style;
};
}
void wxPen::SetWidth( int width )
{
@ -158,12 +158,12 @@ void wxPen::SetWidth( int width )
m_refData = new wxPenRefData();
M_PENDATA->m_width = width;
};
}
int wxPen::GetCap(void) const
{
return M_PENDATA->m_capStyle;
};
}
int wxPen::GetJoin(void) const
{
@ -171,7 +171,7 @@ int wxPen::GetJoin(void) const
return 0;
else
return M_PENDATA->m_joinStyle;
};
}
int wxPen::GetStyle(void) const
{
@ -179,7 +179,7 @@ int wxPen::GetStyle(void) const
return 0;
else
return M_PENDATA->m_style;
};
}
int wxPen::GetWidth(void) const
{
@ -187,7 +187,7 @@ int wxPen::GetWidth(void) const
return 0;
else
return M_PENDATA->m_width;
};
}
wxColour &wxPen::GetColour(void) const
{
@ -195,10 +195,10 @@ wxColour &wxPen::GetColour(void) const
return wxNullColour;
else
return M_PENDATA->m_colour;
};
}
bool wxPen::Ok(void) const
{
return (m_refData);
};
}

View File

@ -34,12 +34,12 @@ class wxRegionRefData: public wxObjectRefData
wxRegionRefData::wxRegionRefData(void)
{
m_region = NULL;
};
}
wxRegionRefData::~wxRegionRefData(void)
{
if (m_region) gdk_region_destroy( m_region );
};
}
//-----------------------------------------------------------------------------
@ -58,7 +58,7 @@ wxRegion::wxRegion( long x, long y, long w, long h )
rect.height = h;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
gdk_region_destroy( reg );
};
}
wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight )
{
@ -71,7 +71,7 @@ wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight )
rect.height = bottomRight.y - rect.y;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &rect );
gdk_region_destroy( reg );
};
}
wxRegion::wxRegion( const wxRect& rect )
{
@ -84,24 +84,24 @@ wxRegion::wxRegion( const wxRect& rect )
g_rect.height = rect.height;
M_REGIONDATA->m_region = gdk_region_union_with_rect( reg, &g_rect );
gdk_region_destroy( reg );
};
}
wxRegion::wxRegion(void)
{
m_refData = new wxRegionRefData();
M_REGIONDATA->m_region = gdk_region_new();
};
}
wxRegion::~wxRegion(void)
{
};
}
void wxRegion::Clear(void)
{
UnRef();
m_refData = new wxRegionRefData();
M_REGIONDATA->m_region = gdk_region_new();
};
}
bool wxRegion::Union( long x, long y, long width, long height )
{
@ -114,7 +114,7 @@ bool wxRegion::Union( long x, long y, long width, long height )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
bool wxRegion::Union( const wxRect& rect )
{
@ -127,7 +127,7 @@ bool wxRegion::Union( const wxRect& rect )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
bool wxRegion::Union( const wxRegion& region )
{
@ -135,21 +135,21 @@ bool wxRegion::Union( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
bool wxRegion::Intersect( long x, long y, long width, long height )
{
wxRegion reg( x, y, width, height );
Intersect( reg );
return TRUE;
};
}
bool wxRegion::Intersect( const wxRect& rect )
{
wxRegion reg( rect );
Intersect( reg );
return TRUE;
};
}
bool wxRegion::Intersect( const wxRegion& region )
{
@ -157,21 +157,21 @@ bool wxRegion::Intersect( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
bool wxRegion::Subtract( long x, long y, long width, long height )
{
wxRegion reg( x, y, width, height );
Subtract( reg );
return TRUE;
};
}
bool wxRegion::Subtract( const wxRect& rect )
{
wxRegion reg( rect );
Subtract( reg );
return TRUE;
};
}
bool wxRegion::Subtract( const wxRegion& region )
{
@ -179,21 +179,21 @@ bool wxRegion::Subtract( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
bool wxRegion::Xor( long x, long y, long width, long height )
{
wxRegion reg( x, y, width, height );
Xor( reg );
return TRUE;
};
}
bool wxRegion::Xor( const wxRect& rect )
{
wxRegion reg( rect );
Xor( reg );
return TRUE;
};
}
bool wxRegion::Xor( const wxRegion& region )
{
@ -201,7 +201,7 @@ bool wxRegion::Xor( const wxRegion& region )
gdk_region_destroy( M_REGIONDATA->m_region );
M_REGIONDATA->m_region = reg;
return TRUE;
};
}
void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const
{
@ -209,17 +209,17 @@ void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const
y = 0;
w = -1;
h = -1;
};
}
wxRect wxRegion::GetBox(void) const
{
return wxRect( 0, 0, -1, -1 );
};
}
bool wxRegion::Empty(void) const
{
return gdk_region_empty( M_REGIONDATA->m_region );
};
}
wxRegionContain wxRegion::Contains( long x, long y ) const
{
@ -227,7 +227,7 @@ wxRegionContain wxRegion::Contains( long x, long y ) const
return wxInRegion;
else
return wxOutRegion;
};
}
wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const
{
@ -242,12 +242,12 @@ wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const
case GDK_OVERLAP_RECTANGLE_IN: return wxInRegion;
case GDK_OVERLAP_RECTANGLE_OUT: return wxOutRegion;
case GDK_OVERLAP_RECTANGLE_PART: return wxPartRegion;
};
}
return wxOutRegion;
};
}
GdkRegion *wxRegion::GetRegion(void) const
{
return M_REGIONDATA->m_region;
};
}

View File

@ -90,9 +90,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->bg[0].red >> SHIFT,
style->bg[0].green >> SHIFT,
style->bg[0].blue >> SHIFT );
};
}
return *g_systemBtnFaceColour;
};
}
case wxSYS_COLOUR_BTNSHADOW:
{
GtkStyle *style = gtk_widget_get_default_style();
@ -102,9 +102,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->dark[0].red >> SHIFT,
style->dark[0].green >> SHIFT,
style->dark[0].blue >> SHIFT );
};
}
return *g_systemBtnShadowColour;
};
}
case wxSYS_COLOUR_GRAYTEXT:
case wxSYS_COLOUR_BTNHIGHLIGHT:
{
@ -115,9 +115,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->light[0].red >> SHIFT,
style->light[0].green >> SHIFT,
style->light[0].blue >> SHIFT );
};
}
return *g_systemBtnHighlightColour;
};
}
case wxSYS_COLOUR_HIGHLIGHT:
{
GtkStyle *style = gtk_widget_get_default_style();
@ -127,9 +127,9 @@ wxColour wxSystemSettings::GetSystemColour( int index )
new wxColour( style->bg[GTK_STATE_SELECTED].red >> SHIFT,
style->bg[GTK_STATE_SELECTED].green >> SHIFT,
style->bg[GTK_STATE_SELECTED].blue >> SHIFT );
};
}
return *g_systemHighlightColour;
};
}
case wxSYS_COLOUR_MENUTEXT:
case wxSYS_COLOUR_WINDOWTEXT:
case wxSYS_COLOUR_CAPTIONTEXT:
@ -137,19 +137,19 @@ wxColour wxSystemSettings::GetSystemColour( int index )
case wxSYS_COLOUR_INFOTEXT:
{
return *wxBLACK;
};
}
case wxSYS_COLOUR_HIGHLIGHTTEXT:
{
return *wxWHITE;
};
}
case wxSYS_COLOUR_INFOBK:
case wxSYS_COLOUR_APPWORKSPACE:
{
return *wxWHITE; // ?
};
};
}
}
return *wxWHITE;
};
}
wxFont wxSystemSettings::GetSystemFont( int index )
{
@ -160,7 +160,7 @@ wxFont wxSystemSettings::GetSystemFont( int index )
case wxSYS_SYSTEM_FIXED_FONT:
{
return *wxNORMAL_FONT;
};
}
case wxSYS_ANSI_VAR_FONT:
case wxSYS_SYSTEM_FONT:
case wxSYS_DEVICE_DEFAULT_FONT:
@ -169,12 +169,11 @@ wxFont wxSystemSettings::GetSystemFont( int index )
if (!g_systemFont)
g_systemFont = new wxFont( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" );
return *g_systemFont;
};
};
}
}
return wxNullFont;
}
;
int wxSystemSettings::GetSystemMetric( int index )
{
@ -184,8 +183,6 @@ int wxSystemSettings::GetSystemMetric( int index )
return gdk_screen_width();
case wxSYS_SCREEN_Y:
return gdk_screen_height();
};
}
return 0;
}
;
}

View File

@ -27,45 +27,45 @@ gint timeout_callback( gpointer data )
timer->Notify();
if (timer->OneShot()) timer->Stop();
return TRUE;
};
}
wxTimer::wxTimer(void)
{
m_tag = -1;
m_time = 1000;
m_oneShot = FALSE;
};
}
wxTimer::~wxTimer(void)
{
Stop();
};
}
int wxTimer::Interval(void)
{
return m_time;
};
}
bool wxTimer::OneShot(void)
{
return m_oneShot;
};
}
void wxTimer::Notify(void)
{
};
}
void wxTimer::Start( int millisecs, bool oneShot )
{
if (millisecs != -1) m_time = millisecs;
m_oneShot = oneShot;
m_tag = gtk_timeout_add( millisecs, timeout_callback, this );
};
}
void wxTimer::Stop(void)
{
if (m_tag != -1)
gtk_timeout_remove( m_tag );
m_tag = -1;
};
}