From: <sm...@us...> - 2009-01-16 08:56:13
|
Revision: 9320 http://plplot.svn.sourceforge.net/plplot/?rev=9320&view=rev Author: smekal Date: 2009-01-16 08:56:02 +0000 (Fri, 16 Jan 2009) Log Message: ----------- By default wxGraphicsContext (backend 2) will be used if available, then AGG library (backend 1) if available, then basic backend (which is always available). The title of the plot frame also tells the user which backend is used (basic, AGG, wxGC). Modified Paths: -------------- trunk/drivers/wxwidgets.cpp trunk/drivers/wxwidgets_app.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2009-01-15 23:23:20 UTC (rev 9319) +++ trunk/drivers/wxwidgets.cpp 2009-01-16 08:56:02 UTC (rev 9320) @@ -291,10 +291,22 @@ /* default options */ static PLINT freetype=0; static PLINT smooth_text=1; - static PLINT backend=wxBACKEND_DC; static PLINT text=1; static PLINT hrshsym = 0; + /* default backend uses wxGraphicsContext, if not available + the agg library will be used, if not available the basic + backend will be used. */ + static PLINT backend=wxBACKEND_DC; + #if wxUSE_GRAPHICS_CONTEXT + backend=wxBACKEND_GC; + #else + #ifdef HAVE_AGG + backend=wxBACKEND_AGG; + #endif + #endif + + DrvOpt wx_options[] = { #ifdef HAVE_FREETYPE {"freetype", DRV_INT, &freetype, "Use FreeType library"}, @@ -311,14 +323,18 @@ /* allocate memory for the device storage */ switch( backend ) { + case wxBACKEND_GC: + /* in case wxGraphicsContext isn't available, the next backend (agg + if available) in this list will be used */ #if wxUSE_GRAPHICS_CONTEXT - case wxBACKEND_GC: dev = new wxPLDevGC; - freetype = 0; /* this backend is vector oriented and doesn't now pixels */ + freetype = 0; /* this backend is vector oriented and doesn't know pixels */ break; #endif + case wxBACKEND_AGG: + /* in case the agg library isn't available, the standard backend + will be used */ #ifdef HAVE_AGG - case wxBACKEND_AGG: dev = new wxPLDevAGG; text = 0; /* text processing doesn't work yet for the AGG backend */ break; @@ -332,7 +348,7 @@ exit( 0 ); } pls->dev = (void*)dev; - + /* be verbose and write out debug messages */ #ifdef _DEBUG pls->verbose = 1; @@ -1157,7 +1173,22 @@ initApp=true; } - dev->m_frame = new wxPLplotFrame( wxT("wxWidgets PLplot App"), pls ); + + wxString title=wxT("wxWidgets PLplot App"); + switch(dev->backend) { + case wxBACKEND_DC: + title += wxT(" (basic)"); + break; + case wxBACKEND_GC: + title += wxT(" (wxGC)"); + break; + case wxBACKEND_AGG: + title += wxT(" (AGG)"); + break; + default: + break; + } + dev->m_frame = new wxPLplotFrame( title, pls ); wxPLGetApp().AddFrame( dev->m_frame ); dev->m_frame->SetClientSize( dev->width, dev->height ); if( dev->showGUI ) { Modified: trunk/drivers/wxwidgets_app.cpp =================================================================== --- trunk/drivers/wxwidgets_app.cpp 2009-01-15 23:23:20 UTC (rev 9319) +++ trunk/drivers/wxwidgets_app.cpp 2009-01-16 08:56:02 UTC (rev 9320) @@ -256,7 +256,6 @@ menuBar->Append( plotMenu, wxT("&Plot") ); SetMenuBar( menuBar ); - SetTitle( wxT("wxWidgets PLplot App") ); SetIcon( wxIcon(graph) ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |