Update of /cvsroot/jsbsimcommander/src/mattplot
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6645
Modified Files:
plot.cpp plot.h
Log Message:
compatible with both wx-2.6 and wx-2.8
Index: plot.cpp
===================================================================
RCS file: /cvsroot/jsbsimcommander/src/mattplot/plot.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** plot.cpp 25 Sep 2007 14:07:47 -0000 1.2
--- plot.cpp 27 Sep 2007 15:20:28 -0000 1.3
***************
*** 139,144 ****
{
wxString c = std2wxstr(element->GetDataLine());
colour.Set(c);
! /*
if (c.Length() == 7 && c[0] == wxChar('#'))
{
--- 139,145 ----
{
wxString c = std2wxstr(element->GetDataLine());
+ #if wxCHECK_VERSION(2, 7, 0)
colour.Set(c);
! #else
if (c.Length() == 7 && c[0] == wxChar('#'))
{
***************
*** 150,154 ****
colour.Set((unsigned char)r, (unsigned char)g, (unsigned char)b);
}
! */
}
--- 151,155 ----
colour.Set((unsigned char)r, (unsigned char)g, (unsigned char)b);
}
! #endif
}
***************
*** 236,239 ****
--- 237,241 ----
void LoadFont(Element * element, wxFont &fnt)
{
+ #if wxCHECK_VERSION(2, 7, 0)
{
wxString info = std2wxstr(element->FindElementValue("NativeFontInfo"));
***************
*** 250,254 ****
}
}
!
double size = element->FindElementValueAsNumber("size");
if (size < 9999 && size > 0 )
--- 252,256 ----
}
}
! #endif
double size = element->FindElementValueAsNumber("size");
if (size < 9999 && size > 0 )
***************
*** 355,359 ****
--- 357,365 ----
{
tstream << prefix << _("<!-- Colour Setting. Initial with '#', followd with RGB Hex number. -->\n");
+ #if wxCHECK_VERSION(2, 7, 0)
tstream << prefix << wxT("<") << tag << wxT(">") << color.GetAsString(wxC2S_HTML_SYNTAX) << wxT("</") << tag << wxT(">\n");
+ #else
+ tstream << prefix << wxT("<") << tag << wxT(">") << wxString::Format(wxT("#%.2X%.2X%.2X"), (unsigned int)color.Red(), (unsigned int)color.Green(), (unsigned int)color.Blue()) << wxT("</") << tag << wxT(">\n");
+ #endif
}
***************
*** 7283,7287 ****
--- 7289,7297 ----
break;
}
+ #if wxCHECK_VERSION(2, 7, 0)
main.AppendSubMenu(sub, item);
+ #else
+ main.Append(wxID_ANY, item, sub);
+ #endif
}
}
***************
*** 7332,7337 ****
--- 7342,7352 ----
case Focus::LEGEND :
{
+ #if wxCHECK_VERSION(2, 7, 0)
wxFont font = wxGetFontFromUser(this, f.window->GetLegendList()[f.iter].fnt, _("Choose the font for legend drawing."));
if (font.IsOk())
+ #else
+ wxFont font = wxGetFontFromUser(this, f.window->GetLegendList()[f.iter].fnt);
+ if (font.Ok())
+ #endif
{
f.window->GetLegendList()[f.iter].fnt = font;
***************
*** 7343,7348 ****
--- 7358,7368 ----
case Focus::AXISY :
{
+ #if wxCHECK_VERSION(2, 7, 0)
wxFont font = wxGetFontFromUser(this, f.window->GetAxisFont(), _("Choose the font for axis drawing."));
if (font.IsOk())
+ #else
+ wxFont font = wxGetFontFromUser(this, f.window->GetAxisFont());
+ if (font.Ok())
+ #endif
{
f.window->SetAxisFont(font);
***************
*** 7358,7363 ****
--- 7378,7388 ----
case Focus::TITLE :
{
+ #if wxCHECK_VERSION(2, 7, 0)
wxFont font = wxGetFontFromUser(this, handler->GetTitleFont(), _("Choose the font for title drawing."));
if (font.IsOk())
+ #else
+ wxFont font = wxGetFontFromUser(this, handler->GetTitleFont());
+ if (font.Ok())
+ #endif
{
handler->SetTitleFont(font);
***************
*** 7424,7429 ****
--- 7449,7459 ----
case Focus::TITLE :
{
+ #if wxCHECK_VERSION(2, 7, 0)
wxColour c = wxGetColourFromUser(this, handler->GetTitlePen().GetColour(), _("Colour Setting"));
if (c.IsOk())
+ #else
+ wxColour c = wxGetColourFromUser(this, handler->GetTitlePen().GetColour());
+ if (c.Ok())
+ #endif
{
wxPen p(c);
***************
*** 7860,7865 ****
--- 7890,7900 ----
void PenSettingDialog::OnColour(wxCommandEvent& event)
{
+ #if wxCHECK_VERSION(2, 7, 0)
wxColour c = wxGetColourFromUser(this, pen_ctrl->GetPen().GetColour(), _("Colour Setting"));
if (c.IsOk())
+ #else
+ wxColour c = wxGetColourFromUser(this, pen_ctrl->GetPen().GetColour());
+ if (c.Ok())
+ #endif
{
pen_ctrl->GetPen().SetColour(c);
Index: plot.h
===================================================================
RCS file: /cvsroot/jsbsimcommander/src/mattplot/plot.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** plot.h 25 Sep 2007 14:07:47 -0000 1.2
--- plot.h 27 Sep 2007 15:20:28 -0000 1.3
***************
*** 14,17 ****
--- 14,18 ----
#include <wx/print.h>
+ #include <wx/txtstrm.h>
#include <vector>
|