]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/samples/ogl/ogledit/doc.cpp
File/dir dialog styles and other changes (patch 1488371):
[wxWidgets.git] / contrib / samples / ogl / ogledit / doc.cpp
index 017f34f8687e2fd0e3768e5d54fe8e32dba43803..9133a0844dce4d7a7f20200a01bd851ddbec9c05 100644 (file)
@@ -1,18 +1,14 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        doc.cpp
+// Name:        contrib/samples/ogl/ogledit/doc.cpp
 // Purpose:     Implements document functionality in OGLEdit
 // Author:      Julian Smart
 // Modified by:
 // Created:     12/07/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-// #pragma implementation
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 #endif
 
 #ifndef WX_PRECOMP
-#include <wx/wx.h>
+#include "wx/wx.h"
 #endif
 
+#include "wx/ioswrap.h"
+
 #if !wxUSE_DOC_VIEW_ARCHITECTURE
 #error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in wx_setup.h!
 #endif
 
-#include <wx/wxexpr.h>
 #include "ogledit.h"
 #include "doc.h"
 #include "view.h"
 
-#if wxUSE_STD_IOSTREAM
-#include <ioswrap.h>
-#endif
-
 IMPLEMENT_DYNAMIC_CLASS(DiagramDocument, wxDocument)
 
 DiagramDocument::DiagramDocument(void)
@@ -49,74 +42,86 @@ DiagramDocument::~DiagramDocument(void)
 
 bool DiagramDocument::OnCloseDocument(void)
 {
-  diagram.DeleteAllShapes();
-  return TRUE;
+    diagram.DeleteAllShapes();
+    return true;
 }
 
 #if wxUSE_STD_IOSTREAM
 wxSTD ostream& DiagramDocument::SaveObject(wxSTD ostream& stream)
 {
-  wxDocument::SaveObject(stream);
-  
-  char buf[400];
-  (void) wxGetTempFileName("diag", buf);
+#if wxUSE_PROLOGIO
 
-  diagram.SaveFile(buf);
-  wxTransferFileToStream(buf, stream);
+    wxDocument::SaveObject(stream);
+
+    char buf[400];
+    (void) wxGetTempFileName("diag", buf);
+
+    diagram.SaveFile(buf);
+    wxTransferFileToStream(buf, stream);
+
+    wxRemoveFile(buf);
+
+#endif
 
-  wxRemoveFile(buf);
-  
-  return stream;
+    return stream;
 }
 
 wxSTD istream& DiagramDocument::LoadObject(wxSTD istream& stream)
 {
-  wxDocument::LoadObject(stream);
+#if wxUSE_PROLOGIO
 
-  char buf[400];
-  (void) wxGetTempFileName("diag", buf);
+    wxDocument::LoadObject(stream);
 
-  wxTransferStreamToFile(stream, buf);
+    char buf[400];
+    (void) wxGetTempFileName("diag", buf);
 
-  diagram.DeleteAllShapes();
-  diagram.LoadFile(buf);
-  wxRemoveFile(buf);
+    wxTransferStreamToFile(stream, buf);
 
-  return stream;
+    diagram.DeleteAllShapes();
+    diagram.LoadFile(buf);
+    wxRemoveFile(buf);
+
+#endif
+
+    return stream;
 }
 #else
 
 wxOutputStream& DiagramDocument::SaveObject(wxOutputStream& stream)
 {
-  wxDocument::SaveObject(stream);
-  char buf[400];
-  (void) wxGetTempFileName("diag", buf);
+#if wxUSE_PROLOGIO
 
-  diagram.SaveFile(buf);
+    wxDocument::SaveObject(stream);
+    wxChar buf[400];
+    (void) wxGetTempFileName(_T("diag"), buf);
 
-  wxTransferFileToStream(buf, stream);
+    diagram.SaveFile(buf);
 
-  wxRemoveFile(buf);
-  
+    wxTransferFileToStream(buf, stream);
+
+    wxRemoveFile(buf);
+
+#endif
 
-  return stream;
+    return stream;
 }
 
 wxInputStream& DiagramDocument::LoadObject(wxInputStream& stream)
 {
-  wxDocument::LoadObject(stream);
+#if wxUSE_PROLOGIO
+    wxDocument::LoadObject(stream);
 
+    wxChar buf[400];
+    (void) wxGetTempFileName(_T("diag"), buf);
 
-  char buf[400];
-  (void) wxGetTempFileName("diag", buf);
+    wxTransferStreamToFile(stream, buf);
 
-  wxTransferStreamToFile(stream, buf);
-
-  diagram.DeleteAllShapes();
-  diagram.LoadFile(buf);
-  wxRemoveFile(buf);
+    diagram.DeleteAllShapes();
+    diagram.LoadFile(buf);
+    wxRemoveFile(buf);
+#endif
 
-  return stream;
+    return stream;
 }
 
 #endif
@@ -125,57 +130,57 @@ wxInputStream& DiagramDocument::LoadObject(wxInputStream& stream)
  * Implementation of drawing command
  */
 
-DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, wxClassInfo *info, double xx, double yy,
-  bool sel, wxShape *theShape, wxShape *fs, wxShape *ts):
-  wxCommand(TRUE, name)
+DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, wxClassInfo *info, double xx, double yy,
+                               bool sel, wxShape *theShape, wxShape *fs, wxShape *ts)
+               :wxCommand(true, name)
 {
-  doc = ddoc;
-  cmd = command;
-  shape = theShape;
-  fromShape = fs;
-  toShape = ts;
-  shapeInfo = info;
-  shapeBrush = NULL;
-  shapePen = NULL;
-  x = xx;
-  y = yy;
-  selected = sel;
-  deleteShape = FALSE;
+    doc = ddoc;
+    cmd = command;
+    shape = theShape;
+    fromShape = fs;
+    toShape = ts;
+    shapeInfo = info;
+    shapeBrush = NULL;
+    shapePen = NULL;
+    x = xx;
+    y = yy;
+    selected = sel;
+    deleteShape = false;
 }
 
-DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, wxBrush *backgroundColour, wxShape *theShape):
-  wxCommand(TRUE, name)
+DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, wxBrush *backgroundColour, wxShape *theShape)
+               :wxCommand(true, name)
 {
-  doc = ddoc;
-  cmd = command;
-  shape = theShape;
-  fromShape = NULL;
-  toShape = NULL;
-  shapeInfo = NULL;
-  x = 0.0;
-  y = 0.0;
-  selected = FALSE;
-  deleteShape = FALSE;
-  shapeBrush = backgroundColour;
-  shapePen = NULL;
+    doc = ddoc;
+    cmd = command;
+    shape = theShape;
+    fromShape = NULL;
+    toShape = NULL;
+    shapeInfo = NULL;
+    x = 0.0;
+    y = 0.0;
+    selected = false;
+    deleteShape = false;
+    shapeBrush = backgroundColour;
+    shapePen = NULL;
 }
 
-DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, const wxString& lab, wxShape *theShape):
-  wxCommand(TRUE, name)
+DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, const wxString& lab, wxShape *theShape)
+               :wxCommand(true, name)
 {
-  doc = ddoc;
-  cmd = command;
-  shape = theShape;
-  fromShape = NULL;
-  toShape = NULL;
-  shapeInfo = NULL;
-  x = 0.0;
-  y = 0.0;
-  selected = FALSE;
-  deleteShape = FALSE;
-  shapeBrush = NULL;
-  shapePen = NULL;
-  shapeLabel = lab;
+    doc = ddoc;
+    cmd = command;
+    shape = theShape;
+    fromShape = NULL;
+    toShape = NULL;
+    shapeInfo = NULL;
+    x = 0.0;
+    y = 0.0;
+    selected = false;
+    deleteShape = false;
+    shapeBrush = NULL;
+    shapePen = NULL;
+    shapeLabel = lab;
 }
 
 DiagramCommand::~DiagramCommand(void)
@@ -191,17 +196,17 @@ bool DiagramCommand::Do(void)
 {
   switch (cmd)
   {
-    case OGLEDIT_CUT:
+    case wxID_CUT:
     {
       if (shape)
       {
-        deleteShape = TRUE;
-        
-        shape->Select(FALSE);
-        
+        deleteShape = true;
+
+        shape->Select(false);
+
         // Generate commands to explicitly remove each connected line.
         RemoveLines(shape);
-        
+
         doc->GetDiagram()->RemoveShape(shape);
         if (shape->IsKindOf(CLASSINFO(wxLineShape)))
         {
@@ -210,8 +215,8 @@ bool DiagramCommand::Do(void)
           toShape = lineShape->GetTo();
         }
         shape->Unlink();
-        
-        doc->Modify(TRUE);
+
+        doc->Modify(true);
         doc->UpdateAllViews();
       }
 
@@ -219,45 +224,45 @@ bool DiagramCommand::Do(void)
     }
     case OGLEDIT_ADD_SHAPE:
     {
-      wxShape *theShape = NULL;
+      wxShape *theShape;
       if (shape)
         theShape = shape; // Saved from undoing the shape
       else
       {
         theShape = (wxShape *)shapeInfo->CreateObject();
         theShape->AssignNewIds();
-        theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxString("")));
-        theShape->SetCentreResize(FALSE);
+        theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxEmptyString));
+        theShape->SetCentreResize(false);
         theShape->SetPen(wxBLACK_PEN);
         theShape->SetBrush(wxCYAN_BRUSH);
-      
+
         theShape->SetSize(60, 60);
       }
       doc->GetDiagram()->AddShape(theShape);
-      theShape->Show(TRUE);
+      theShape->Show(true);
 
       wxClientDC dc(theShape->GetCanvas());
       theShape->GetCanvas()->PrepareDC(dc);
 
       theShape->Move(dc, x, y);
-      
+
       shape = theShape;
-      deleteShape = FALSE;
+      deleteShape = false;
 
-      doc->Modify(TRUE);
+      doc->Modify(true);
       doc->UpdateAllViews();
       break;
     }
     case OGLEDIT_ADD_LINE:
     {
-      wxShape *theShape = NULL;
+      wxShape *theShape;
       if (shape)
         theShape = shape; // Saved from undoing the line
       else
       {
         theShape = (wxShape *)shapeInfo->CreateObject();
         theShape->AssignNewIds();
-        theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxString("")));
+        theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxEmptyString));
         theShape->SetPen(wxBLACK_PEN);
         theShape->SetBrush(wxRED_BRUSH);
 
@@ -266,14 +271,14 @@ bool DiagramCommand::Do(void)
         // Yes, you can have more than 2 control points, in which case
         // it becomes a multi-segment line.
         lineShape->MakeLineControlPoints(2);
-        lineShape->AddArrow(ARROW_ARROW, ARROW_POSITION_END, 10.0, 0.0, "Normal arrowhead");
+        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);
+
+      theShape->Show(true);
 
       wxClientDC dc(theShape->GetCanvas());
       theShape->GetCanvas()->PrepareDC(dc);
@@ -282,11 +287,11 @@ bool DiagramCommand::Do(void)
       // connected images
       fromShape->Move(dc, fromShape->GetX(), fromShape->GetY());
       toShape->Move(dc, toShape->GetX(), toShape->GetY());
-      
+
       shape = theShape;
-      deleteShape = FALSE;
+      deleteShape = false;
 
-      doc->Modify(TRUE);
+      doc->Modify(true);
       doc->UpdateAllViews();
       break;
     }
@@ -297,12 +302,12 @@ bool DiagramCommand::Do(void)
         wxClientDC dc(shape->GetCanvas());
         shape->GetCanvas()->PrepareDC(dc);
 
-        wxBrush *oldBrush = shape->GetBrush();
+        const wxBrush *oldBrush = shape->GetBrush();
         shape->SetBrush(shapeBrush);
         shapeBrush = oldBrush;
         shape->Draw(dc);
-        
-        doc->Modify(TRUE);
+
+        doc->Modify(true);
         doc->UpdateAllViews();
       }
 
@@ -320,29 +325,29 @@ bool DiagramCommand::Do(void)
         wxClientDC dc(shape->GetCanvas());
         shape->GetCanvas()->PrepareDC(dc);
 
-        shape->FormatText(dc, (char*) (const char*) myHandler->label);
+        shape->FormatText(dc, /* (char*) (const char*) */ myHandler->label);
         shape->Draw(dc);
-        
-        doc->Modify(TRUE);
+
+        doc->Modify(true);
         doc->UpdateAllViews();
       }
 
       break;
     }
   }
-  return TRUE;
+  return true;
 }
 
 bool DiagramCommand::Undo(void)
 {
   switch (cmd)
   {
-    case OGLEDIT_CUT:
+    case wxID_CUT:
     {
       if (shape)
       {
         doc->GetDiagram()->AddShape(shape);
-        shape->Show(TRUE);
+        shape->Show(true);
 
         if (shape->IsKindOf(CLASSINFO(wxLineShape)))
         {
@@ -351,11 +356,11 @@ bool DiagramCommand::Undo(void)
           fromShape->AddLine(lineShape, toShape);
         }
         if (selected)
-          shape->Select(TRUE);
+          shape->Select(true);
 
-        deleteShape = FALSE;
+        deleteShape = false;
       }
-      doc->Modify(TRUE);
+      doc->Modify(true);
       doc->UpdateAllViews();
       break;
     }
@@ -367,12 +372,12 @@ bool DiagramCommand::Undo(void)
         wxClientDC dc(shape->GetCanvas());
         shape->GetCanvas()->PrepareDC(dc);
 
-        shape->Select(FALSE, &dc);
+        shape->Select(false, &dc);
         doc->GetDiagram()->RemoveShape(shape);
         shape->Unlink();
-        deleteShape = TRUE;
+        deleteShape = true;
       }
-      doc->Modify(TRUE);
+      doc->Modify(true);
       doc->UpdateAllViews();
       break;
     }
@@ -383,12 +388,12 @@ bool DiagramCommand::Undo(void)
         wxClientDC dc(shape->GetCanvas());
         shape->GetCanvas()->PrepareDC(dc);
 
-        wxBrush *oldBrush = shape->GetBrush();
+        const wxBrush *oldBrush = shape->GetBrush();
         shape->SetBrush(shapeBrush);
         shapeBrush = oldBrush;
         shape->Draw(dc);
-        
-        doc->Modify(TRUE);
+
+        doc->Modify(true);
         doc->UpdateAllViews();
       }
       break;
@@ -405,37 +410,37 @@ bool DiagramCommand::Undo(void)
         wxClientDC dc(shape->GetCanvas());
         shape->GetCanvas()->PrepareDC(dc);
 
-        shape->FormatText(dc, (char*) (const char*) myHandler->label);
+        shape->FormatText(dc, /* (char*) (const char*) */ myHandler->label);
         shape->Draw(dc);
-        
-        doc->Modify(TRUE);
+
+        doc->Modify(true);
         doc->UpdateAllViews();
       }
 
       break;
     }
   }
-  return TRUE;
+  return true;
 }
 
 // Remove each individual line connected to a shape by sending a command.
 void DiagramCommand::RemoveLines(wxShape *shape)
 {
-  wxNode *node = shape->GetLines().First();
+  wxObjectList::compatibility_iterator node = shape->GetLines().GetFirst();
   while (node)
   {
-    wxLineShape *line = (wxLineShape *)node->Data();
-    doc->GetCommandProcessor()->Submit(new DiagramCommand("Cut", OGLEDIT_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line));
-    
-    node = shape->GetLines().First();
+    wxLineShape *line = (wxLineShape *)node->GetData();
+    doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), wxID_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line));
+
+    node = shape->GetLines().GetFirst();
   }
 }
 
 /*
  * MyEvtHandler: an event handler class for all shapes
  */
-void MyEvtHandler::OnLeftClick(double x, double y, int keys, int attachment)
+
+void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, int WXUNUSED(attachment))
 {
   wxClientDC dc(GetShape()->GetCanvas());
   GetShape()->GetCanvas()->PrepareDC(dc);
@@ -445,28 +450,28 @@ void MyEvtHandler::OnLeftClick(double x, double y, int keys, int attachment)
     // Selection is a concept the library knows about
     if (GetShape()->Selected())
     {
-      GetShape()->Select(FALSE, &dc);
+      GetShape()->Select(false, &dc);
       GetShape()->GetCanvas()->Redraw(dc); // Redraw because bits of objects will be are missing
     }
     else
     {
       // Ensure no other shape is selected, to simplify Undo/Redo code
-      bool redraw = FALSE;
-      wxNode *node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First();
+      bool redraw = false;
+      wxObjectList::compatibility_iterator node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
       while (node)
       {
-        wxShape *eachShape = (wxShape *)node->Data();
+        wxShape *eachShape = (wxShape *)node->GetData();
         if (eachShape->GetParent() == NULL)
         {
           if (eachShape->Selected())
           {
-            eachShape->Select(FALSE, &dc);
-            redraw = TRUE;
+            eachShape->Select(false, &dc);
+            redraw = true;
           }
         }
-        node = node->Next();
+        node = node->GetNext();
       }
-      GetShape()->Select(TRUE, &dc);
+      GetShape()->Select(true, &dc);
       if (redraw)
         GetShape()->GetCanvas()->Redraw(dc);
     }
@@ -477,7 +482,9 @@ void MyEvtHandler::OnLeftClick(double x, double y, int keys, int attachment)
   }
   else
   {
+#if wxUSE_STATUSBAR
     wxGetApp().frame->SetStatusText(label);
+#endif // wxUSE_STATUSBAR
   }
 }
 
@@ -485,16 +492,16 @@ void MyEvtHandler::OnLeftClick(double x, double y, int keys, int attachment)
  * Implement connection of two shapes by right-dragging between them.
  */
 
-void MyEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment)
+void MyEvtHandler::OnBeginDragRight(double x, double y, int WXUNUSED(keys), int attachment)
 {
   // 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;
@@ -503,7 +510,7 @@ void MyEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment
   GetShape()->GetCanvas()->CaptureMouse();
 }
 
-void MyEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int attachment)
+void MyEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys), int attachment)
 {
   // Force attachment to be zero for now
   attachment = 0;
@@ -511,7 +518,7 @@ void MyEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int atta
   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;
@@ -519,7 +526,7 @@ void MyEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int atta
   dc.DrawLine((long) xp, (long) yp, (long) x, (long) y);
 }
 
-void MyEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment)
+void MyEvtHandler::OnEndDragRight(double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment))
 {
   GetShape()->GetCanvas()->ReleaseMouse();
   MyCanvas *canvas = (MyCanvas *)GetShape()->GetCanvas();
@@ -527,48 +534,52 @@ void MyEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment)
   // 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(
-      new DiagramCommand("wxLineShape", OGLEDIT_ADD_LINE, (DiagramDocument *)canvas->view->GetDocument(), CLASSINFO(wxLineShape),
-      0.0, 0.0, FALSE, NULL, GetShape(), otherShape));
+      new DiagramCommand(_T("wxLineShape"), OGLEDIT_ADD_LINE, (DiagramDocument *)canvas->view->GetDocument(), CLASSINFO(wxLineShape),
+      0.0, 0.0, false, NULL, GetShape(), otherShape));
   }
 }
 
-void MyEvtHandler::OnEndSize(double x, double y)
+void MyEvtHandler::OnEndSize(double WXUNUSED(x), double WXUNUSED(y))
 {
   wxClientDC dc(GetShape()->GetCanvas());
   GetShape()->GetCanvas()->PrepareDC(dc);
 
-  GetShape()->FormatText(dc, (char*) (const char*) label);
+  GetShape()->FormatText(dc, /* (char*) (const char*) */ label);
 }
 
 /*
  * Diagram
  */
+
+#if wxUSE_PROLOGIO
+
 bool MyDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
 {
   wxDiagram::OnShapeSave(db, shape, expr);
   MyEvtHandler *handler = (MyEvtHandler *)shape.GetEventHandler();
-  expr.AddAttributeValueString("label", handler->label);
-  return TRUE;
+  expr.AddAttributeValueString(_T("label"), handler->label);
+  return true;
 }
 
 bool MyDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
 {
   wxDiagram::OnShapeLoad(db, shape, expr);
-  char *label = NULL;
-  expr.AssignAttributeValue("label", &label);
+  wxChar *label = NULL;
+  expr.AssignAttributeValue(_T("label"), &label);
   MyEvtHandler *handler = new MyEvtHandler(&shape, &shape, wxString(label));
   shape.SetEventHandler(handler);
-  
+
   if (label)
     delete[] label;
-  return TRUE;
+  return true;
 }
 
+#endif
+
 /*
  * New shapes
  */
@@ -593,7 +604,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);