]> git.saurik.com Git - wxWidgets.git/commitdiff
Usage of common default colours in OGL + minor warning fixes.
authorWłodzimierz Skiba <abx@abx.art.pl>
Thu, 3 Mar 2005 19:37:15 +0000 (19:37 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Thu, 3 Mar 2005 19:37:15 +0000 (19:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32585 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

12 files changed:
contrib/samples/ogl/ogledit/doc.cpp
contrib/samples/ogl/studio/shapes.cpp
contrib/samples/ogl/studio/view.cpp
contrib/src/ogl/basic.cpp
contrib/src/ogl/basic2.cpp
contrib/src/ogl/composit.cpp
contrib/src/ogl/divided.cpp
contrib/src/ogl/drawn.cpp
contrib/src/ogl/lines.cpp
contrib/src/ogl/mfutils.cpp
contrib/src/ogl/ogldiag.cpp
contrib/src/ogl/oglmisc.cpp

index 9c1f91e3b8b37767066ad97ffa5268b186c485d5..97fb2b5a9f72c678e887d625ed228fcf5de489d8 100644 (file)
@@ -56,7 +56,7 @@ bool DiagramDocument::OnCloseDocument(void)
 wxSTD ostream& DiagramDocument::SaveObject(wxSTD ostream& stream)
 {
   wxDocument::SaveObject(stream);
-  
+
   char buf[400];
   (void) wxGetTempFileName("diag", buf);
 
@@ -64,7 +64,7 @@ wxSTD ostream& DiagramDocument::SaveObject(wxSTD ostream& stream)
   wxTransferFileToStream(buf, stream);
 
   wxRemoveFile(buf);
-  
+
   return stream;
 }
 
@@ -199,12 +199,12 @@ bool DiagramCommand::Do(void)
       if (shape)
       {
         deleteShape = true;
-        
+
         shape->Select(false);
-        
+
         // Generate commands to explicitly remove each connected line.
         RemoveLines(shape);
-        
+
         doc->GetDiagram()->RemoveShape(shape);
         if (shape->IsKindOf(CLASSINFO(wxLineShape)))
         {
@@ -213,7 +213,7 @@ bool DiagramCommand::Do(void)
           toShape = lineShape->GetTo();
         }
         shape->Unlink();
-        
+
         doc->Modify(true);
         doc->UpdateAllViews();
       }
@@ -233,7 +233,7 @@ bool DiagramCommand::Do(void)
         theShape->SetCentreResize(false);
         theShape->SetPen(wxBLACK_PEN);
         theShape->SetBrush(wxCYAN_BRUSH);
-      
+
         theShape->SetSize(60, 60);
       }
       doc->GetDiagram()->AddShape(theShape);
@@ -243,7 +243,7 @@ bool DiagramCommand::Do(void)
       theShape->GetCanvas()->PrepareDC(dc);
 
       theShape->Move(dc, x, y);
-      
+
       shape = theShape;
       deleteShape = false;
 
@@ -271,11 +271,11 @@ bool DiagramCommand::Do(void)
         lineShape->MakeLineControlPoints(2);
         lineShape->AddArrow(ARROW_ARROW, ARROW_POSITION_END, 10.0, 0.0, _T("Normal arrowhead"));
       }
-      
+
       doc->GetDiagram()->AddShape(theShape);
-      
+
       fromShape->AddLine((wxLineShape *)theShape, toShape);
-      
+
       theShape->Show(true);
 
       wxClientDC dc(theShape->GetCanvas());
@@ -285,7 +285,7 @@ bool DiagramCommand::Do(void)
       // connected images
       fromShape->Move(dc, fromShape->GetX(), fromShape->GetY());
       toShape->Move(dc, toShape->GetX(), toShape->GetY());
-      
+
       shape = theShape;
       deleteShape = false;
 
@@ -304,7 +304,7 @@ bool DiagramCommand::Do(void)
         shape->SetBrush(shapeBrush);
         shapeBrush = oldBrush;
         shape->Draw(dc);
-        
+
         doc->Modify(true);
         doc->UpdateAllViews();
       }
@@ -325,7 +325,7 @@ bool DiagramCommand::Do(void)
 
         shape->FormatText(dc, /* (char*) (const char*) */ myHandler->label);
         shape->Draw(dc);
-        
+
         doc->Modify(true);
         doc->UpdateAllViews();
       }
@@ -390,7 +390,7 @@ bool DiagramCommand::Undo(void)
         shape->SetBrush(shapeBrush);
         shapeBrush = oldBrush;
         shape->Draw(dc);
-        
+
         doc->Modify(true);
         doc->UpdateAllViews();
       }
@@ -410,7 +410,7 @@ bool DiagramCommand::Undo(void)
 
         shape->FormatText(dc, /* (char*) (const char*) */ myHandler->label);
         shape->Draw(dc);
-        
+
         doc->Modify(true);
         doc->UpdateAllViews();
       }
@@ -429,7 +429,7 @@ void DiagramCommand::RemoveLines(wxShape *shape)
   {
     wxLineShape *line = (wxLineShape *)node->GetData();
     doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line));
-    
+
     node = shape->GetLines().GetFirst();
   }
 }
@@ -437,7 +437,7 @@ void DiagramCommand::RemoveLines(wxShape *shape)
 /*
  * MyEvtHandler: an event handler class for all shapes
  */
+
 void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, int WXUNUSED(attachment))
 {
   wxClientDC dc(GetShape()->GetCanvas());
@@ -495,11 +495,11 @@ void MyEvtHandler::OnBeginDragRight(double x, double y, int WXUNUSED(keys), int
   // Force attachment to be zero for now. Eventually we can deal with
   // the actual attachment point, e.g. a rectangle side if attachment mode is on.
   attachment = 0;
-  
+
   wxClientDC dc(GetShape()->GetCanvas());
   GetShape()->GetCanvas()->PrepareDC(dc);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetLogicalFunction(OGLRBLF);
   dc.SetPen(dottedPen);
   double xp, yp;
@@ -516,7 +516,7 @@ void MyEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUN
   wxClientDC dc(GetShape()->GetCanvas());
   GetShape()->GetCanvas()->PrepareDC(dc);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetLogicalFunction(OGLRBLF);
   dc.SetPen(dottedPen);
   double xp, yp;
@@ -532,7 +532,7 @@ void MyEvtHandler::OnEndDragRight(double x, double y, int WXUNUSED(keys), int WX
   // Check if we're on an object
   int new_attachment;
   wxShape *otherShape = canvas->FindFirstSensitiveShape(x, y, &new_attachment, OP_DRAG_RIGHT);
-  
+
   if (otherShape && !otherShape->IsKindOf(CLASSINFO(wxLineShape)))
   {
     canvas->view->GetDocument()->GetCommandProcessor()->Submit(
@@ -554,7 +554,7 @@ void MyEvtHandler::OnEndSize(double WXUNUSED(x), double WXUNUSED(y))
  */
 
 #if wxUSE_PROLOGIO
+
 bool MyDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
 {
   wxDiagram::OnShapeSave(db, shape, expr);
@@ -570,7 +570,7 @@ bool MyDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
   expr.AssignAttributeValue(_T("label"), &label);
   MyEvtHandler *handler = new MyEvtHandler(&shape, &shape, wxString(label));
   shape.SetEventHandler(handler);
-  
+
   if (label)
     delete[] label;
   return true;
@@ -602,7 +602,7 @@ wxDiamondShape::wxDiamondShape(double w, double h):
     w = 60.0;
   if (h == 0.0)
     h = 60.0;
-    
+
   wxList *thePoints = new wxList;
   wxRealPoint *point = new wxRealPoint(0.0, (-h/2.0));
   thePoints->Append((wxObject*) point);
index 0c21d760d755c5a7eb7d2c30bada760c04685c4d..7ca63c9c90afa5989f7930f390601ca3df90f78b 100644 (file)
@@ -196,7 +196,7 @@ void csEvtHandler::OnBeginDragRight(double x, double y, int WXUNUSED(keys), int
   wxClientDC dc(GetShape()->GetCanvas());
   GetShape()->GetCanvas()->PrepareDC(dc);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetLogicalFunction(OGLRBLF);
   dc.SetPen(dottedPen);
   double xp, yp;
@@ -210,7 +210,7 @@ void csEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUN
   wxClientDC dc(GetShape()->GetCanvas());
   GetShape()->GetCanvas()->PrepareDC(dc);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetLogicalFunction(OGLRBLF);
   dc.SetPen(dottedPen);
   double xp, yp;
@@ -282,7 +282,7 @@ void csEvtHandler::OnDragLeft(bool draw, double x, double y, int keys, int attac
 
   dc.SetLogicalFunction(OGLRBLF);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush(* wxTRANSPARENT_BRUSH);
 
@@ -351,7 +351,7 @@ void csEvtHandler::OnBeginDragLeft(double x, double y, int keys, int attachment)
 
   dc.SetLogicalFunction(OGLRBLF);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush((* wxTRANSPARENT_BRUSH));
 
index f3073fc44a521952eda26724d692da84251b0506..5a157a8704d6fefccc167a45ec832786e2358e5b 100644 (file)
@@ -853,7 +853,7 @@ csCanvas::~csCanvas(void)
 
 void csCanvas::DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2)
 {
-    wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+    wxPen dottedPen(*wxBLACK, 1, wxDOT);
     dc.SetPen(dottedPen);
     dc.SetBrush(* wxTRANSPARENT_BRUSH);
 
index 0e51bd54faaa841e52a66c16154be76a92267352..b4b1b3e125f53ff90cf512b3e9dd153aa7e3c9ff 100644 (file)
@@ -1312,7 +1312,7 @@ void wxShape::OnDragLeft(bool draw, double x, double y, int keys, int attachment
 
   dc.SetLogicalFunction(OGLRBLF);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush(* wxTRANSPARENT_BRUSH);
 
@@ -1357,7 +1357,7 @@ void wxShape::OnBeginDragLeft(double x, double y, int keys, int attachment)
 //  m_xpos = xx; m_ypos = yy;
   dc.SetLogicalFunction(OGLRBLF);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush((* wxTRANSPARENT_BRUSH));
 
@@ -2711,7 +2711,9 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y,
             double left = (double)(m_xpos - w/2.0);
             double right = (double)(m_xpos + w/2.0);
 
+#if 0
             /* bool isEnd = */ (line && line->IsEnd(this));
+#endif
 
             int physicalAttachment = LogicalToPhysicalAttachment(attachment);
 
index 9a7f31f6a7af7fc8b251902fc33ef73d85383028..a5e0fa5e6057c3379ae1d81ec9ba2ee82b8c5b34 100644 (file)
@@ -1298,7 +1298,7 @@ void wxShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), double x
 
   dc.SetLogicalFunction(OGLRBLF);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush((* wxTRANSPARENT_BRUSH));
 
@@ -1433,7 +1433,7 @@ void wxShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int
   pt->sm_controlPointDragStartWidth = bound_x;
   pt->sm_controlPointDragStartHeight = bound_y;
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush((* wxTRANSPARENT_BRUSH));
 
@@ -1633,7 +1633,7 @@ void wxPolygonShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), d
 
   dc.SetLogicalFunction(OGLRBLF);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush((* wxTRANSPARENT_BRUSH));
 
@@ -1685,7 +1685,7 @@ void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double
 
   if (ppt->m_originalDistance == 0.0) ppt->m_originalDistance = (double) 0.0001;
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush((* wxTRANSPARENT_BRUSH));
 
index da0e212d7149426156cbecd312086f9eae7b6d7a..e01f5c1b0f810abd57ece267f2575e9b00cf48d3 100644 (file)
@@ -166,7 +166,7 @@ void wxCompositeShape::OnDragLeft(bool WXUNUSED(draw), double x, double y, int W
   GetCanvas()->PrepareDC(dc);
 
   dc.SetLogicalFunction(OGLRBLF);
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush((* wxTRANSPARENT_BRUSH));
 
@@ -186,7 +186,7 @@ void wxCompositeShape::OnBeginDragLeft(double x, double y, int WXUNUSED(keys), i
 
   dc.SetLogicalFunction(OGLRBLF);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush((* wxTRANSPARENT_BRUSH));
   m_canvas->CaptureMouse();
index 23d246154c065b57402fcfb41d2a955f247b1df7..d4190100c84545e34987baa3f18ef531bd37cb21 100644 (file)
@@ -585,7 +585,7 @@ void wxDividedShapeControlPoint::OnDragLeft(bool WXUNUSED(draw), double WXUNUSED
     GetCanvas()->PrepareDC(dc);
 
     dc.SetLogicalFunction(OGLRBLF);
-    wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+    wxPen dottedPen(*wxBLACK, 1, wxDOT);
     dc.SetPen(dottedPen);
     dc.SetBrush((* wxTRANSPARENT_BRUSH));
 
@@ -604,7 +604,7 @@ void wxDividedShapeControlPoint::OnBeginDragLeft(double WXUNUSED(x), double y, i
 
     wxDividedShape *dividedObject = (wxDividedShape *)m_shape;
     dc.SetLogicalFunction(OGLRBLF);
-    wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+    wxPen dottedPen(*wxBLACK, 1, wxDOT);
     dc.SetPen(dottedPen);
     dc.SetBrush((* wxTRANSPARENT_BRUSH));
 
index 0aeae7fba1a7abe47ce8427ca43b8839ed6859b4..35129107ddb472918b5d48523f1f67134f0fbd97 100644 (file)
@@ -1613,9 +1613,9 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
         {
           int penWidth = (int)expr->Nth(1)->IntegerValue();
           int penStyle = (int)expr->Nth(2)->IntegerValue();
-          int penRed = (int)expr->Nth(3)->IntegerValue();
-          int penGreen = (int)expr->Nth(4)->IntegerValue();
-          int penBlue = (int)expr->Nth(5)->IntegerValue();
+          unsigned char penRed = (unsigned char)expr->Nth(3)->IntegerValue();
+          unsigned char penGreen = (unsigned char)expr->Nth(4)->IntegerValue();
+          unsigned char penBlue = (unsigned char)expr->Nth(5)->IntegerValue();
           wxColour col(penRed, penGreen, penBlue);
           wxPen *p = wxThePenList->FindOrCreatePen(col, penWidth, penStyle);
           if (!p)
@@ -1626,9 +1626,9 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
         case gyTYPE_BRUSH:
         {
           int brushStyle = (int)expr->Nth(1)->IntegerValue();
-          int brushRed = (int)expr->Nth(2)->IntegerValue();
-          int brushGreen = (int)expr->Nth(3)->IntegerValue();
-          int brushBlue = (int)expr->Nth(4)->IntegerValue();
+          unsigned char brushRed = (unsigned char)expr->Nth(2)->IntegerValue();
+          unsigned char brushGreen = (unsigned char)expr->Nth(3)->IntegerValue();
+          unsigned char brushBlue = (unsigned char)expr->Nth(4)->IntegerValue();
           wxColour col(brushRed, brushGreen, brushBlue);
           wxBrush *b = wxTheBrushList->FindOrCreateBrush(col, brushStyle);
           if (!b)
index 7ef12f1b77ea7b8b12e4bed41f094982416e1407..5db7a490462e08cc8d4970c875ed44eeff293948 100644 (file)
@@ -965,7 +965,7 @@ void wxLineShape::OnDrawOutline(wxDC& dc, double WXUNUSED(x), double WXUNUSED(y)
   wxPen *old_pen = m_pen;
   wxBrush *old_brush = m_brush;
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   SetPen(& dottedPen);
   SetBrush( wxTRANSPARENT_BRUSH );
 
@@ -1549,7 +1549,7 @@ void wxLineShape::ReadAttributes(wxExpr *clause)
       wxExpr *spacingExpr = node->Nth(7);
 
       if (type_expr)
-        arrowType = (int)type_expr->IntegerValue();
+          arrowType = (WXTYPE)type_expr->IntegerValue();
       if (end_expr)
         arrowEnd = (int)end_expr->IntegerValue();
       if (dist_expr)
@@ -1733,7 +1733,7 @@ void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), doub
 
   dc.SetLogicalFunction(OGLRBLF);
 
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush((* wxTRANSPARENT_BRUSH));
 
@@ -1749,7 +1749,7 @@ void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), doub
     wxPen *old_pen = lineShape->GetPen();
     wxBrush *old_brush = lineShape->GetBrush();
 
-    wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+    wxPen dottedPen(*wxBLACK, 1, wxDOT);
     lineShape->SetPen(& dottedPen);
     lineShape->SetBrush(wxTRANSPARENT_BRUSH);
 
@@ -1797,7 +1797,7 @@ void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y,
     wxPen *old_pen = lineShape->GetPen();
     wxBrush *old_brush = lineShape->GetBrush();
 
-    wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+    wxPen dottedPen(*wxBLACK, 1, wxDOT);
     lineShape->SetPen(& dottedPen);
     lineShape->SetBrush(wxTRANSPARENT_BRUSH);
 
@@ -2407,7 +2407,7 @@ wxLabelShape::wxLabelShape(wxLineShape *parent, wxShapeRegion *region, double w,
 {
   m_lineShape = parent;
   m_shapeRegion = region;
-  SetPen(wxThePenList->FindOrCreatePen(wxColour(0, 0, 0), 1, wxDOT));
+  SetPen(wxThePenList->FindOrCreatePen(*wxBLACK, 1, wxDOT));
 }
 
 wxLabelShape::~wxLabelShape()
index ce580697f5cc8eb3620169675e2015ce083ce2da..ae084590fed052cfeb9fde66739c1e72a2c49c90 100644 (file)
@@ -560,14 +560,14 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
         /* int lfEsc = */ getshort(handle);       // 2 bytes
         /* int lfOrient = */ getshort(handle);    // 2 bytes
         int lfWeight = getshort(handle);    // 2 bytes
-        char lfItalic = getc(handle);       // 1 byte
-        char lfUnderline = getc(handle);    // 1 byte
+        char lfItalic = (char)getc(handle);       // 1 byte
+        char lfUnderline = (char)getc(handle);    // 1 byte
         /* char lfStrikeout = */ getc(handle);    // 1 byte
         /* char lfCharSet = */ getc(handle);      // 1 byte
         /* char lfOutPrecision = */ getc(handle); // 1 byte
         /* char lfClipPrecision = */ getc(handle); // 1 byte
         /* char lfQuality = */ getc(handle);      // 1 byte
-        char lfPitchAndFamily = getc(handle);   // 1 byte (18th)
+        char lfPitchAndFamily = (char)getc(handle);   // 1 byte (18th)
         char lfFacename[32];
         // Read the rest of the record, which is total record size
         // minus the number of bytes already read (18 record, 6 metarecord
index d883db535b82466c40b2e65f75fab7a4940d4f6a..5c5a23a60f952bfcdc486295a935785a1eea9049 100644 (file)
@@ -175,7 +175,7 @@ void wxDiagram::ShowAll(bool show)
 
 void wxDiagram::DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2)
 {
-  wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+  wxPen dottedPen(*wxBLACK, 1, wxDOT);
   dc.SetPen(dottedPen);
   dc.SetBrush((* wxTRANSPARENT_BRUSH));
 
index 3f63c093177784a4362d74b22cce3b9fc0cff25a..bedff9915d737f0061db0fb80032bc62e72322e8 100644 (file)
@@ -452,7 +452,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double
     wxString oldBuffer(buffer);
 
     wxString s = node->GetData();
-    if (s.IsEmpty())
+    if (s.empty())
     {
       // FORCE NEW LINE
       if (buffer.Length() > 0)
@@ -871,10 +871,12 @@ wxColour oglHexToColour(const wxString& hex)
         hex.Mid(0,2).ToLong(&r, 16);
         hex.Mid(2,2).ToLong(&g, 16);
         hex.Mid(4,2).ToLong(&b, 16);
-        return wxColour(r, g, b);
+        return wxColour((unsigned char)r,
+                        (unsigned char)g,
+                        (unsigned char)b);
     }
     else
-        return wxColour(0,0,0);
+        return *wxBLACK;
 }
 
 // RGB to 3-digit hex