Some OGl updates:

uses wxINVERT instead of wxXOR

	a couple minor tweaks

	VC makefiles now use Debug and Release for object files
	depending on FINAL


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
1999-09-13 03:08:57 +00:00
parent 93c95e18f4
commit a097c93d4f
11 changed files with 167 additions and 135 deletions

View File

@@ -11,7 +11,7 @@
\input psbox.tex \input psbox.tex
\parindent 0pt \parindent 0pt
\parskip 11pt \parskip 11pt
\title{Manual for Object Graphics Library 3.0} \title{Object Graphics Library 3.0}
\author{Julian Smart} \author{Julian Smart}
\date{September 1998} \date{September 1998}

View File

@@ -24,3 +24,12 @@ combineSubSections = yes
\const [0] {{\bf const}} \const [0] {{\bf const}}
\constfunc [3] {{\bf #1} {\bf #2}(#3) {\bf const}\index{#2}} \constfunc [3] {{\bf #1} {\bf #2}(#3) {\bf const}\index{#2}}
\windowstyle [1] {{\bf #1}\index{#1}} \windowstyle [1] {{\bf #1}\index{#1}}
;;
;; These two are for generating MS HTML Help project, contents and index files.
;;
htmlWorkshopFiles = true
htmlIndex = true
\pythonnote [1] {{\bf \fcol{blue}{wxPython note:}} #1}
%\pythonnote [1] {}

View File

@@ -2,7 +2,7 @@
# File: makefile.vc # File: makefile.vc
# Author: Julian Smart # Author: Julian Smart
# Created: 1993 # Created: 1993
# Updated: # Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh # Copyright: (c) 1993, AIAI, University of Edinburgh
# #
# "%W% %G%" # "%W% %G%"
@@ -20,7 +20,7 @@ THISDIR = $(WXDIR)\utils\ogl\samples\ogledit
OGLDIR = $(WXDIR)\utils\ogl OGLDIR = $(WXDIR)\utils\ogl
OGLINC = $(OGLDIR)\src OGLINC = $(OGLDIR)\src
OGLLIB = $(WXDIR)\lib\ogl.lib OGLLIB = $(WXDIR)\lib\ogl$(LIBEXT).lib
PROGRAM=ogledit PROGRAM=ogledit

View File

@@ -2,7 +2,7 @@
# File: makefile.vc # File: makefile.vc
# Author: Julian Smart # Author: Julian Smart
# Created: 1999 # Created: 1999
# Updated: # Updated:
# Copyright: (c) Julian Smart # Copyright: (c) Julian Smart
# #
# "%W% %G%" # "%W% %G%"
@@ -20,7 +20,7 @@ THISDIR = $(STUDIODIR)
OGLDIR = $(WXDIR)\utils\ogl OGLDIR = $(WXDIR)\utils\ogl
OGLINC = $(OGLDIR)\src OGLINC = $(OGLDIR)\src
OGLLIB = $(WXDIR)\lib\ogl.lib OGLLIB = $(WXDIR)\lib\ogl$(LIBEXT).lib
!include $(WXDIR)\src\makevc.env !include $(WXDIR)\src\makevc.env
@@ -32,7 +32,7 @@ PROGRAM=studio
OBJECTS = $(PROGRAM).obj doc.obj shapes.obj symbols.obj view.obj cspalette.obj\ OBJECTS = $(PROGRAM).obj doc.obj shapes.obj symbols.obj view.obj cspalette.obj\
mainfrm.obj project.obj dialogs.obj csprint.obj mainfrm.obj project.obj dialogs.obj csprint.obj
all: wx ogl $(PROGRAM).exe all: ogl $(PROGRAM).exe
$(PROGRAM): $(PROGRAM).exe $(PROGRAM): $(PROGRAM).exe

View File

@@ -602,7 +602,7 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i)
wxNode *node = m_regions.Nth(i); wxNode *node = m_regions.Nth(i);
if (!node) if (!node)
return; return;
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->Data();
region->SetText(s); region->SetText(s);
dc.SetFont(* region->GetFont()); dc.SetFont(* region->GetFont());
@@ -709,7 +709,7 @@ wxShape *wxShape::GetTopAncestor()
{ {
if (!GetParent()) if (!GetParent())
return this; return this;
if (GetParent()->IsKindOf(CLASSINFO(wxDivisionShape))) if (GetParent()->IsKindOf(CLASSINFO(wxDivisionShape)))
return this; return this;
else return GetParent()->GetTopAncestor(); else return GetParent()->GetTopAncestor();
@@ -1182,7 +1182,7 @@ void wxShape::ApplyAttachmentOrdering(wxList& linesToSort)
{ {
// This is a temporary store of all the lines. // This is a temporary store of all the lines.
wxList linesStore; wxList linesStore;
wxNode *node = m_lines.First(); wxNode *node = m_lines.First();
while (node) while (node)
{ {
@@ -1224,7 +1224,7 @@ void wxShape::SortLines(int attachment, wxList& linesToSort)
// This is a temporary store of all the lines at this attachment // This is a temporary store of all the lines at this attachment
// point. We'll tick them off as we've processed them. // point. We'll tick them off as we've processed them.
wxList linesAtThisAttachment; wxList linesAtThisAttachment;
wxNode *node = m_lines.First(); wxNode *node = m_lines.First();
while (node) while (node)
{ {
@@ -1317,7 +1317,7 @@ void wxShape::OnDragLeft(bool draw, double x, double y, int keys, int attachment
wxClientDC dc(GetCanvas()); wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen); dc.SetPen(dottedPen);
@@ -1362,7 +1362,7 @@ void wxShape::OnBeginDragLeft(double x, double y, int keys, int attachment)
yy = y + DragOffsetY; yy = y + DragOffsetY;
m_canvas->Snap(&xx, &yy); m_canvas->Snap(&xx, &yy);
// m_xpos = xx; m_ypos = yy; // m_xpos = xx; m_ypos = yy;
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen); dc.SetPen(dottedPen);
@@ -1530,7 +1530,7 @@ void wxShape::Flash()
wxClientDC dc(GetCanvas()); wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
Draw(dc); Draw(dc);
dc.SetLogicalFunction(wxCOPY); dc.SetLogicalFunction(wxCOPY);
Draw(dc); Draw(dc);
@@ -1730,7 +1730,7 @@ void wxShape::WriteAttributes(wxExpr *clause)
} }
else if (brushColour != "WHITE") else if (brushColour != "WHITE")
clause->AddAttributeValueString("brush_colour", brushColour); clause->AddAttributeValueString("brush_colour", brushColour);
if (m_brush->GetStyle() != wxSOLID) if (m_brush->GetStyle() != wxSOLID)
clause->AddAttributeValue("brush_style", (long)m_brush->GetStyle()); clause->AddAttributeValue("brush_style", (long)m_brush->GetStyle());
} }
@@ -2131,7 +2131,7 @@ void wxShape::ReadRegions(wxExpr *clause)
width = widthExpr->RealValue(); width = widthExpr->RealValue();
height = heightExpr->RealValue(); height = heightExpr->RealValue();
minWidth = minWidthExpr->RealValue(); minWidth = minWidthExpr->RealValue();
minHeight = minHeightExpr->RealValue(); minHeight = minHeightExpr->RealValue();
@@ -2392,42 +2392,42 @@ void wxShape::MakeControlPoints()
double left = (double)(- (widthMin / 2.0)); double left = (double)(- (widthMin / 2.0));
double right = (double)(widthMin / 2.0 + (maxX - minX)); double right = (double)(widthMin / 2.0 + (maxX - minX));
wxControlPoint *control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, top, wxControlPoint *control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, top,
CONTROL_POINT_DIAGONAL); CONTROL_POINT_DIAGONAL);
m_canvas->AddShape(control); m_canvas->AddShape(control);
m_controlPoints.Append(control); m_controlPoints.Append(control);
control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, 0, top, control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, 0, top,
CONTROL_POINT_VERTICAL); CONTROL_POINT_VERTICAL);
m_canvas->AddShape(control); m_canvas->AddShape(control);
m_controlPoints.Append(control); m_controlPoints.Append(control);
control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, top, control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, top,
CONTROL_POINT_DIAGONAL); CONTROL_POINT_DIAGONAL);
m_canvas->AddShape(control); m_canvas->AddShape(control);
m_controlPoints.Append(control); m_controlPoints.Append(control);
control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, 0, control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, 0,
CONTROL_POINT_HORIZONTAL); CONTROL_POINT_HORIZONTAL);
m_canvas->AddShape(control); m_canvas->AddShape(control);
m_controlPoints.Append(control); m_controlPoints.Append(control);
control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, bottom, control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, bottom,
CONTROL_POINT_DIAGONAL); CONTROL_POINT_DIAGONAL);
m_canvas->AddShape(control); m_canvas->AddShape(control);
m_controlPoints.Append(control); m_controlPoints.Append(control);
control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, 0, bottom, control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, 0, bottom,
CONTROL_POINT_VERTICAL); CONTROL_POINT_VERTICAL);
m_canvas->AddShape(control); m_canvas->AddShape(control);
m_controlPoints.Append(control); m_controlPoints.Append(control);
control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, bottom, control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, bottom,
CONTROL_POINT_DIAGONAL); CONTROL_POINT_DIAGONAL);
m_canvas->AddShape(control); m_canvas->AddShape(control);
m_controlPoints.Append(control); m_controlPoints.Append(control);
control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, 0, control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, 0,
CONTROL_POINT_HORIZONTAL); CONTROL_POINT_HORIZONTAL);
m_canvas->AddShape(control); m_canvas->AddShape(control);
m_controlPoints.Append(control); m_controlPoints.Append(control);
@@ -2534,7 +2534,7 @@ void wxShape::OnDrawControlPoints(wxDC& dc)
{ {
if (!m_drawHandles) if (!m_drawHandles)
return; return;
dc.SetBrush(* wxBLACK_BRUSH); dc.SetBrush(* wxBLACK_BRUSH);
dc.SetPen(* wxBLACK_PEN); dc.SetPen(* wxBLACK_PEN);
@@ -2673,7 +2673,7 @@ bool wxShape::AttachmentIsValid(int attachment) const
return FALSE; return FALSE;
} }
bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y, bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y,
int nth, int no_arcs, wxLineShape *line) int nth, int no_arcs, wxLineShape *line)
{ {
if (m_attachmentMode == ATTACHMENT_MODE_NONE) if (m_attachmentMode == ATTACHMENT_MODE_NONE)

View File

@@ -118,6 +118,12 @@ class WXDLLEXPORT wxExprDatabase;
// Round up // Round up
#define WXROUND(x) ( (long) (x + 0.5) ) #define WXROUND(x) ( (long) (x + 0.5) )
// logical function to use when drawing rubberband boxes, etc.
#define OGLRBLF wxINVERT
class wxShapeEvtHandler: public wxObject class wxShapeEvtHandler: public wxObject
{ {
DECLARE_DYNAMIC_CLASS(wxShapeEvtHandler) DECLARE_DYNAMIC_CLASS(wxShapeEvtHandler)

View File

@@ -328,7 +328,7 @@ bool wxPolygonShape::HitTest(double x, double y, int *attachment, double *distan
void wxPolygonShape::SetSize(double new_width, double new_height, bool recursive) void wxPolygonShape::SetSize(double new_width, double new_height, bool recursive)
{ {
SetAttachmentSize(new_width, new_height); SetAttachmentSize(new_width, new_height);
// Multiply all points by proportion of new size to old size // Multiply all points by proportion of new size to old size
double x_proportion = (double)(fabs(new_width/m_originalWidth)); double x_proportion = (double)(fabs(new_width/m_originalWidth));
double y_proportion = (double)(fabs(new_height/m_originalHeight)); double y_proportion = (double)(fabs(new_height/m_originalHeight));
@@ -464,7 +464,7 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1,
node = node->Next(); node = node->Next();
} }
} }
double *xpoints = new double[n]; double *xpoints = new double[n];
double *ypoints = new double[n]; double *ypoints = new double[n];
@@ -479,7 +479,7 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1,
i ++; i ++;
} }
oglFindEndForPolyline(n, xpoints, ypoints, oglFindEndForPolyline(n, xpoints, ypoints,
x1, y1, x2, y2, x3, y3); x1, y1, x2, y2, x3, y3);
delete[] xpoints; delete[] xpoints;
@@ -799,7 +799,7 @@ bool wxPolygonShape::AttachmentIsValid(int attachment)
{ {
if (!m_points) if (!m_points)
return FALSE; return FALSE;
if ((attachment >= 0) && (attachment < m_points->Number())) if ((attachment >= 0) && (attachment < m_points->Number()))
return TRUE; return TRUE;
@@ -1207,7 +1207,7 @@ bool wxCircleShape::GetPerimeterPoint(double x1, double y1,
double x2, double y2, double x2, double y2,
double *x3, double *y3) double *x3, double *y3)
{ {
oglFindEndForCircle(m_width/2, oglFindEndForCircle(m_width/2,
m_xpos, m_ypos, // Centre of circle m_xpos, m_ypos, // Centre of circle
x2, y2, // Other end of line x2, y2, // Other end of line
x3, y3); x3, y3);
@@ -1302,7 +1302,7 @@ void wxShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, double y
wxClientDC dc(GetCanvas()); wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen); dc.SetPen(dottedPen);
@@ -1338,7 +1338,7 @@ void wxShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, double y
if (this->GetFixedWidth()) if (this->GetFixedWidth())
new_width = bound_x; new_width = bound_x;
if (this->GetFixedHeight()) if (this->GetFixedHeight())
new_height = bound_y; new_height = bound_y;
@@ -1390,7 +1390,7 @@ void wxShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, double y
pt->sm_controlPointDragPosY = (double)(newY1 + (newHeight/2.0)); pt->sm_controlPointDragPosY = (double)(newY1 + (newHeight/2.0));
if (this->GetFixedWidth()) if (this->GetFixedWidth())
newWidth = bound_x; newWidth = bound_x;
if (this->GetFixedHeight()) if (this->GetFixedHeight())
newHeight = bound_y; newHeight = bound_y;
@@ -1411,7 +1411,7 @@ void wxShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int
this->Erase(dc); this->Erase(dc);
*/ */
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
double bound_x; double bound_x;
double bound_y; double bound_y;
@@ -1471,7 +1471,7 @@ void wxShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int
if (this->GetFixedWidth()) if (this->GetFixedWidth())
new_width = bound_x; new_width = bound_x;
if (this->GetFixedHeight()) if (this->GetFixedHeight())
new_height = bound_y; new_height = bound_y;
@@ -1566,11 +1566,11 @@ void wxShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, int ke
if (!eraseIt) if (!eraseIt)
theObject->Show(TRUE); theObject->Show(TRUE);
*/ */
// Recursively redraw links if we have a composite. // Recursively redraw links if we have a composite.
if (theObject->GetChildren().Number() > 0) if (theObject->GetChildren().Number() > 0)
theObject->DrawLinks(dc, -1, TRUE); theObject->DrawLinks(dc, -1, TRUE);
double width, height; double width, height;
theObject->GetBoundingBoxMax(&width, &height); theObject->GetBoundingBoxMax(&width, &height);
theObject->GetEventHandler()->OnEndSize(width, height); theObject->GetEventHandler()->OnEndSize(width, height);
@@ -1636,7 +1636,7 @@ void wxPolygonShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, d
wxClientDC dc(GetCanvas()); wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen); dc.SetPen(dottedPen);
@@ -1675,7 +1675,7 @@ void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double
this->Erase(dc); this->Erase(dc);
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
double bound_x; double bound_x;
double bound_y; double bound_y;

View File

@@ -43,7 +43,7 @@ wxMenu *oglPopupDivisionMenu = NULL;
/* /*
* Division control point * Division control point
*/ */
class wxDivisionControlPoint: public wxControlPoint class wxDivisionControlPoint: public wxControlPoint
{ {
DECLARE_DYNAMIC_CLASS(wxDivisionControlPoint) DECLARE_DYNAMIC_CLASS(wxDivisionControlPoint)
@@ -168,7 +168,7 @@ void wxCompositeShape::OnDragLeft(bool draw, double x, double y, int keys, int a
wxClientDC dc(GetCanvas()); wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen); dc.SetPen(dottedPen);
dc.SetBrush((* wxTRANSPARENT_BRUSH)); dc.SetBrush((* wxTRANSPARENT_BRUSH));
@@ -187,7 +187,7 @@ void wxCompositeShape::OnBeginDragLeft(double x, double y, int keys, int attachm
Erase(dc); Erase(dc);
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen); dc.SetPen(dottedPen);
@@ -228,7 +228,7 @@ void wxCompositeShape::OnEndDragLeft(double x, double y, int keys, int attachmen
double offsetY = yy - objectStartY; double offsetY = yy - objectStartY;
Move(dc, GetX() + offsetX, GetY() + offsetY); Move(dc, GetX() + offsetX, GetY() + offsetY);
if (m_canvas && !m_canvas->GetQuickEditMode()) m_canvas->Redraw(dc); if (m_canvas && !m_canvas->GetQuickEditMode()) m_canvas->Redraw(dc);
} }
@@ -284,7 +284,7 @@ void wxCompositeShape::SetSize(double w, double h, bool recursive)
object->Show(FALSE); object->Show(FALSE);
object->Move(dc, newX, newY); object->Move(dc, newX, newY);
object->Show(TRUE); object->Show(TRUE);
// Now set the scaled size // Now set the scaled size
object->GetBoundingBoxMin(&xBound, &yBound); object->GetBoundingBoxMin(&xBound, &yBound);
object->SetSize(object->GetFixedWidth() ? xBound : xScale*xBound, object->SetSize(object->GetFixedWidth() ? xBound : xScale*xBound,
@@ -377,7 +377,7 @@ void wxCompositeShape::Copy(wxShape& copy)
wxShape *newObject = object->CreateNewCopy(FALSE, FALSE); wxShape *newObject = object->CreateNewCopy(FALSE, FALSE);
if (newObject->GetId() == 0) if (newObject->GetId() == 0)
newObject->SetId(NewId()); newObject->SetId(NewId());
newObject->SetParent(&compositeCopy); newObject->SetParent(&compositeCopy);
compositeCopy.m_children.Append(newObject); compositeCopy.m_children.Append(newObject);
@@ -405,7 +405,7 @@ void wxCompositeShape::Copy(wxShape& copy)
wxShape *constrainedObject = (wxShape *)node2->Data(); wxShape *constrainedObject = (wxShape *)node2->Data();
wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->Data()); wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->Data());
newConstrainedList.Append(newConstrained); newConstrainedList.Append(newConstrained);
node2 = node2->Next(); node2 = node2->Next();
} }
wxOGLConstraint *newConstraint = new wxOGLConstraint(constraint->m_constraintType, newConstraining, wxOGLConstraint *newConstraint = new wxOGLConstraint(constraint->m_constraintType, newConstraining,
@@ -726,7 +726,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database)
m_constrainingObject = (wxShape *)objExpr1->GetClientData(); m_constrainingObject = (wxShape *)objExpr1->GetClientData();
else else
wxFatalError("Couldn't find constraining image of composite.", "Object graphics error"); wxFatalError("Couldn't find constraining image of composite.", "Object graphics error");
int i = 0; int i = 0;
wxExpr *currentIdExpr = constrainedExpr->Nth(i); wxExpr *currentIdExpr = constrainedExpr->Nth(i);
while (currentIdExpr) while (currentIdExpr)
@@ -938,7 +938,7 @@ void wxDivisionShape::OnEndDragLeft(double x, double y, int keys, int attachment
} }
return; return;
} }
wxClientDC dc(GetCanvas()); wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
@@ -1080,7 +1080,7 @@ bool wxDivisionShape::Divide(int direction)
double newYPos2 = (double)(y1 + (3.0*GetHeight()/4.0)); double newYPos2 = (double)(y1 + (3.0*GetHeight()/4.0));
wxDivisionShape *newDivision = compositeParent->OnCreateDivision(); wxDivisionShape *newDivision = compositeParent->OnCreateDivision();
newDivision->Show(TRUE); newDivision->Show(TRUE);
Erase(dc); Erase(dc);
// Anything adjoining the bottom of this division now adjoins the // Anything adjoining the bottom of this division now adjoins the
@@ -1109,7 +1109,7 @@ bool wxDivisionShape::Divide(int direction)
// Division is now receiving mouse events _before_ the contained object, // Division is now receiving mouse events _before_ the contained object,
// because it was added last (on top of all others) // because it was added last (on top of all others)
// Add after the image that visualizes the container // Add after the image that visualizes the container
compositeParent->AddChild(newDivision, compositeParent->FindContainerImage()); compositeParent->AddChild(newDivision, compositeParent->FindContainerImage());
m_handleSide = DIVISION_SIDE_BOTTOM; m_handleSide = DIVISION_SIDE_BOTTOM;
@@ -1131,7 +1131,7 @@ bool wxDivisionShape::Divide(int direction)
double newYPos2 = GetY(); double newYPos2 = GetY();
wxDivisionShape *newDivision = compositeParent->OnCreateDivision(); wxDivisionShape *newDivision = compositeParent->OnCreateDivision();
newDivision->Show(TRUE); newDivision->Show(TRUE);
Erase(dc); Erase(dc);
// Anything adjoining the left of this division now adjoins the // Anything adjoining the left of this division now adjoins the
@@ -1320,7 +1320,7 @@ bool wxDivisionShape::AdjustLeft(double left, bool test)
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
Move(dc, newX, GetY()); Move(dc, newX, GetY());
return TRUE; return TRUE;
} }
@@ -1341,7 +1341,7 @@ bool wxDivisionShape::AdjustTop(double top, bool test)
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
Move(dc, GetX(), newY); Move(dc, GetX(), newY);
return TRUE; return TRUE;
} }
@@ -1362,7 +1362,7 @@ bool wxDivisionShape::AdjustRight(double right, bool test)
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
Move(dc, newX, GetY()); Move(dc, newX, GetY());
return TRUE; return TRUE;
} }
@@ -1383,7 +1383,7 @@ bool wxDivisionShape::AdjustBottom(double bottom, bool test)
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
Move(dc, GetX(), newY); Move(dc, GetX(), newY);
return TRUE; return TRUE;
} }
@@ -1415,7 +1415,7 @@ void wxDivisionControlPoint::OnBeginDragLeft(double x, double y, int keys, int a
originalY = division->GetY(); originalY = division->GetY();
originalW = division->GetWidth(); originalW = division->GetWidth();
originalH = division->GetHeight(); originalH = division->GetHeight();
wxControlPoint::OnBeginDragLeft(x, y, keys, attachment); wxControlPoint::OnBeginDragLeft(x, y, keys, attachment);
} }
@@ -1453,7 +1453,7 @@ void wxDivisionControlPoint::OnEndDragLeft(double x, double y, int keys, int att
success = FALSE; success = FALSE;
else else
division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, FALSE); division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, FALSE);
break; break;
} }
case DIVISION_SIDE_TOP: case DIVISION_SIDE_TOP:
@@ -1464,7 +1464,7 @@ void wxDivisionControlPoint::OnEndDragLeft(double x, double y, int keys, int att
success = FALSE; success = FALSE;
else else
division->ResizeAdjoining(DIVISION_SIDE_TOP, y, FALSE); division->ResizeAdjoining(DIVISION_SIDE_TOP, y, FALSE);
break; break;
} }
case DIVISION_SIDE_RIGHT: case DIVISION_SIDE_RIGHT:
@@ -1475,7 +1475,7 @@ void wxDivisionControlPoint::OnEndDragLeft(double x, double y, int keys, int att
success = FALSE; success = FALSE;
else else
division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, FALSE); division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, FALSE);
break; break;
} }
case DIVISION_SIDE_BOTTOM: case DIVISION_SIDE_BOTTOM:
@@ -1486,7 +1486,7 @@ void wxDivisionControlPoint::OnEndDragLeft(double x, double y, int keys, int att
success = FALSE; success = FALSE;
else else
division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, FALSE); division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, FALSE);
break; break;
} }
} }
@@ -1564,7 +1564,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test)
} }
node = node->Next(); node = node->Next();
} }
return TRUE; return TRUE;
} }
@@ -1572,7 +1572,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test)
* Popup menu for editing divisions * Popup menu for editing divisions
* *
*/ */
void oglGraphicsDivisionMenuProc(wxMenu& menu, wxCommandEvent& event) void oglGraphicsDivisionMenuProc(wxMenu& menu, wxCommandEvent& event)
{ {
wxDivisionShape *division = (wxDivisionShape *)menu.GetClientData(); wxDivisionShape *division = (wxDivisionShape *)menu.GetClientData();
@@ -1628,7 +1628,7 @@ void wxDivisionShape::EditEdge(int side)
GraphicsForm *form = new GraphicsForm("Containers"); GraphicsForm *form = new GraphicsForm("Containers");
int lineWidth = currentPen->GetWidth(); int lineWidth = currentPen->GetWidth();
form->Add(wxMakeFormShort("Width", &lineWidth, wxFORM_DEFAULT, NULL, NULL, wxVERTICAL, form->Add(wxMakeFormShort("Width", &lineWidth, wxFORM_DEFAULT, NULL, NULL, wxVERTICAL,
150)); 150));
form->Add(wxMakeFormString("Colour", pColour, wxFORM_CHOICE, form->Add(wxMakeFormString("Colour", pColour, wxFORM_CHOICE,
@@ -1696,7 +1696,7 @@ void wxDivisionShape::EditEdge(int side)
else if (strcmp(*pStyle, "Dot Dash") == 0) else if (strcmp(*pStyle, "Dot Dash") == 0)
lineStyle = wxDOT_DASH; lineStyle = wxDOT_DASH;
} }
wxPen *newPen = wxThePenList->FindOrCreatePen(*pColour, lineWidth, lineStyle); wxPen *newPen = wxThePenList->FindOrCreatePen(*pColour, lineWidth, lineStyle);
if (!pen) if (!pen)
pen = wxBLACK_PEN; pen = wxBLACK_PEN;
@@ -1723,7 +1723,7 @@ void wxDivisionShape::PopupMenu(double x, double y)
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, TRUE); oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, TRUE);
else else
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, FALSE); oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, FALSE);
int x1, y1; int x1, y1;
m_canvas->ViewStart(&x1, &y1); m_canvas->ViewStart(&x1, &y1);

View File

@@ -151,7 +151,7 @@ void wxDividedShape::SetRegionSizes()
{ {
if (GetRegions().Number() == 0) if (GetRegions().Number() == 0)
return; return;
double defaultProportion = (double)(GetRegions().Number() > 0 ? (1.0/((double)(GetRegions().Number()))) : 0.0); double defaultProportion = (double)(GetRegions().Number() > 0 ? (1.0/((double)(GetRegions().Number()))) : 0.0);
double currentY = (double)(m_ypos - (m_height / 2.0)); double currentY = (double)(m_ypos - (m_height / 2.0));
double maxY = (double)(m_ypos + (m_height / 2.0)); double maxY = (double)(m_ypos + (m_height / 2.0));
@@ -440,7 +440,7 @@ void wxDividedShape::EditRegions()
#if 0 #if 0
if (GetRegions().Number() < 2) if (GetRegions().Number() < 2)
return; return;
wxBeginBusyCursor(); wxBeginBusyCursor();
GraphicsForm *form = new GraphicsForm("Divided nodes"); GraphicsForm *form = new GraphicsForm("Divided nodes");
@@ -596,7 +596,7 @@ void wxDividedShapeControlPoint::OnDragLeft(bool draw, double x, double y, int k
wxClientDC dc(GetCanvas()); wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen); dc.SetPen(dottedPen);
dc.SetBrush((* wxTRANSPARENT_BRUSH)); dc.SetBrush((* wxTRANSPARENT_BRUSH));
@@ -615,7 +615,7 @@ void wxDividedShapeControlPoint::OnBeginDragLeft(double x, double y, int keys, i
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
wxDividedShape *dividedObject = (wxDividedShape *)m_shape; wxDividedShape *dividedObject = (wxDividedShape *)m_shape;
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen); dc.SetPen(dottedPen);
dc.SetBrush((* wxTRANSPARENT_BRUSH)); dc.SetBrush((* wxTRANSPARENT_BRUSH));
@@ -637,7 +637,7 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int
wxNode *node = dividedObject->GetRegions().Nth(regionId); wxNode *node = dividedObject->GetRegions().Nth(regionId);
if (!node) if (!node)
return; return;
wxShapeRegion *thisRegion = (wxShapeRegion *)node->Data(); wxShapeRegion *thisRegion = (wxShapeRegion *)node->Data();
wxShapeRegion *nextRegion = NULL; // Region below this one wxShapeRegion *nextRegion = NULL; // Region below this one
@@ -648,7 +648,7 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int
// Find the old top and bottom of this region, // Find the old top and bottom of this region,
// and calculate the new proportion for this region // and calculate the new proportion for this region
// if legal. // if legal.
double currentY = (double)(dividedObject->GetY() - (dividedObject->GetHeight() / 2.0)); double currentY = (double)(dividedObject->GetY() - (dividedObject->GetHeight() / 2.0));
double maxY = (double)(dividedObject->GetY() + (dividedObject->GetHeight() / 2.0)); double maxY = (double)(dividedObject->GetY() + (dividedObject->GetHeight() / 2.0));

View File

@@ -80,7 +80,7 @@ wxLineShape::wxLineShape()
newRegion = new wxShapeRegion; newRegion = new wxShapeRegion;
newRegion->SetName("Start"); newRegion->SetName("Start");
newRegion->SetSize(150, 50); newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion); m_regions.Append((wxObject *)newRegion);
newRegion = new wxShapeRegion; newRegion = new wxShapeRegion;
newRegion->SetName("End"); newRegion->SetName("End");
@@ -213,7 +213,7 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i)
wxNode *node = m_regions.Nth(i); wxNode *node = m_regions.Nth(i);
if (!node) if (!node)
return; return;
wxShapeRegion *region = (wxShapeRegion *)node->Data(); wxShapeRegion *region = (wxShapeRegion *)node->Data();
region->SetText(s); region->SetText(s);
dc.SetFont(* region->GetFont()); dc.SetFont(* region->GetFont());
@@ -225,7 +225,7 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i)
w = 100; h = 50; w = 100; h = 50;
region->SetSize(w, h); region->SetSize(w, h);
} }
wxStringList *string_list = oglFormatText(dc, s, (w-5), (h-5), region->GetFormatMode()); wxStringList *string_list = oglFormatText(dc, s, (w-5), (h-5), region->GetFormatMode());
node = string_list->First(); node = string_list->First();
while (node) while (node)
@@ -444,7 +444,7 @@ void wxLineShape::SetEnds(double x1, double y1, double x2, double y2)
first_point->y = y1; first_point->y = y1;
last_point->x = x2; last_point->x = x2;
last_point->y = y2; last_point->y = y2;
m_xpos = (double)((x1 + x2)/2.0); m_xpos = (double)((x1 + x2)/2.0);
m_ypos = (double)((y1 + y2)/2.0); m_ypos = (double)((y1 + y2)/2.0);
} }
@@ -707,7 +707,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p
deltaX = x4 - positionOnLineX; deltaX = x4 - positionOnLineX;
deltaY = y4 - positionOnLineY; deltaY = y4 - positionOnLineY;
} }
switch (arrow->_GetType()) switch (arrow->_GetType())
{ {
case ARROW_ARROW: case ARROW_ARROW:
@@ -787,7 +787,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p
| / | /
| / | /
| /theta | /theta
| /(x1, y1) | /(x1, y1)
|______________________ |______________________
*/ */
double theta = 0.0; double theta = 0.0;
@@ -1017,7 +1017,7 @@ bool wxLineShape::OnMovePre(wxDC& dc, double x, double y, double old_x, double o
{ {
xr = 0.0; yr = 0.0; xr = 0.0; yr = 0.0;
} }
m_labelObjects[i]->Move(dc, xp+xr, yp+yr); m_labelObjects[i]->Move(dc, xp+xr, yp+yr);
} }
} }
@@ -1028,7 +1028,7 @@ void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints)
{ {
if (!m_from || !m_to) if (!m_from || !m_to)
return; return;
if (m_lineControlPoints->Number() > 2) if (m_lineControlPoints->Number() > 2)
Initialise(); Initialise();
@@ -1038,7 +1038,7 @@ void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints)
double other_end_x, other_end_y; double other_end_x, other_end_y;
FindLineEndPoints(&end_x, &end_y, &other_end_x, &other_end_y); FindLineEndPoints(&end_x, &end_y, &other_end_x, &other_end_y);
wxNode *first = m_lineControlPoints->First(); wxNode *first = m_lineControlPoints->First();
wxRealPoint *first_point = (wxRealPoint *)first->Data(); wxRealPoint *first_point = (wxRealPoint *)first->Data();
wxNode *last = m_lineControlPoints->Last(); wxNode *last = m_lineControlPoints->Last();
@@ -1090,7 +1090,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d
{ {
if (!m_from || !m_to) if (!m_from || !m_to)
return; return;
// Do each end - nothing in the middle. User has to move other points // Do each end - nothing in the middle. User has to move other points
// manually if necessary. // manually if necessary.
double end_x, end_y; double end_x, end_y;
@@ -1221,7 +1221,7 @@ void wxLineShape::OnDrawControlPoints(wxDC& dc)
{ {
if (!m_drawHandles) if (!m_drawHandles)
return; return;
// Draw temporary label rectangles if necessary // Draw temporary label rectangles if necessary
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
@@ -1314,7 +1314,7 @@ void wxLineShape::MakeControlPoints()
wxRealPoint *first_point = (wxRealPoint *)first->Data(); wxRealPoint *first_point = (wxRealPoint *)first->Data();
wxRealPoint *last_point = (wxRealPoint *)last->Data(); wxRealPoint *last_point = (wxRealPoint *)last->Data();
wxLineControlPoint *control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, wxLineControlPoint *control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
first_point->x, first_point->y, first_point->x, first_point->y,
CONTROL_POINT_ENDPOINT_FROM); CONTROL_POINT_ENDPOINT_FROM);
control->m_point = first_point; control->m_point = first_point;
@@ -1327,7 +1327,7 @@ void wxLineShape::MakeControlPoints()
{ {
wxRealPoint *point = (wxRealPoint *)node->Data(); wxRealPoint *point = (wxRealPoint *)node->Data();
control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
point->x, point->y, point->x, point->y,
CONTROL_POINT_LINE); CONTROL_POINT_LINE);
control->m_point = point; control->m_point = point;
@@ -1337,7 +1337,7 @@ void wxLineShape::MakeControlPoints()
node = node->Next(); node = node->Next();
} }
control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
last_point->x, last_point->y, last_point->x, last_point->y,
CONTROL_POINT_ENDPOINT_TO); CONTROL_POINT_ENDPOINT_TO);
control->m_point = last_point; control->m_point = last_point;
@@ -1473,11 +1473,11 @@ void wxLineShape::ReadAttributes(wxExpr *clause)
node = next; node = next;
} }
} }
newRegion = new wxShapeRegion; newRegion = new wxShapeRegion;
newRegion->SetName("Start"); newRegion->SetName("Start");
newRegion->SetSize(150, 50); newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion); m_regions.Append((wxObject *)newRegion);
newRegion = new wxShapeRegion; newRegion = new wxShapeRegion;
newRegion->SetName("End"); newRegion->SetName("End");
@@ -1540,7 +1540,7 @@ void wxLineShape::ReadAttributes(wxExpr *clause)
double arrowSize = 0.0; double arrowSize = 0.0;
wxString arrowName(""); wxString arrowName("");
long arrowId = -1; long arrowId = -1;
wxExpr *type_expr = node->Nth(0); wxExpr *type_expr = node->Nth(0);
wxExpr *end_expr = node->Nth(1); wxExpr *end_expr = node->Nth(1);
wxExpr *dist_expr = node->Nth(2); wxExpr *dist_expr = node->Nth(2);
@@ -1720,7 +1720,7 @@ void wxLineControlPoint::OnBeginDragLeft(double x, double y, int keys, int attac
{ {
m_shape->GetEventHandler()->OnSizingBeginDragLeft(this, x, y, keys, attachment); m_shape->GetEventHandler()->OnSizingBeginDragLeft(this, x, y, keys, attachment);
} }
void wxLineControlPoint::OnEndDragLeft(double x, double y, int keys, int attachment) void wxLineControlPoint::OnEndDragLeft(double x, double y, int keys, int attachment)
{ {
m_shape->GetEventHandler()->OnSizingEndDragLeft(this, x, y, keys, attachment); m_shape->GetEventHandler()->OnSizingEndDragLeft(this, x, y, keys, attachment);
@@ -1735,7 +1735,7 @@ void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, doub
wxClientDC dc(GetCanvas()); wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc); GetCanvas()->PrepareDC(dc);
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen); dc.SetPen(dottedPen);
@@ -1793,7 +1793,7 @@ void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y,
lineShape->GetTo()->OnDrawContents(dc); lineShape->GetTo()->OnDrawContents(dc);
this->SetDisableLabel(TRUE); this->SetDisableLabel(TRUE);
dc.SetLogicalFunction(wxXOR); dc.SetLogicalFunction(OGLRBLF);
lpt->m_xpos = x; lpt->m_ypos = y; lpt->m_xpos = x; lpt->m_ypos = y;
lpt->m_point->x = x; lpt->m_point->y = y; lpt->m_point->x = x; lpt->m_point->y = y;
@@ -1933,7 +1933,7 @@ void wxLineControlPoint::OnBeginDragRight(double x, double y, int keys, int atta
m_oldCursor = wxSTANDARD_CURSOR; m_oldCursor = wxSTANDARD_CURSOR;
} }
} }
void wxLineControlPoint::OnEndDragRight(double x, double y, int keys, int attachment) void wxLineControlPoint::OnEndDragRight(double x, double y, int keys, int attachment)
{ {
wxClientDC dc(GetCanvas()); wxClientDC dc(GetCanvas());
@@ -2136,7 +2136,7 @@ bool wxLineShape::ClearArrow(const wxString& name)
* Finds an arrowhead at the given position (if -1, any position) * Finds an arrowhead at the given position (if -1, any position)
* *
*/ */
wxArrowHead *wxLineShape::FindArrowHead(int position, const wxString& name) wxArrowHead *wxLineShape::FindArrowHead(int position, const wxString& name)
{ {
wxNode *node = m_arcArrows.First(); wxNode *node = m_arcArrows.First();
@@ -2168,7 +2168,7 @@ wxArrowHead *wxLineShape::FindArrowHead(long arrowId)
* Deletes an arrowhead at the given position (if -1, any position) * Deletes an arrowhead at the given position (if -1, any position)
* *
*/ */
bool wxLineShape::DeleteArrowHead(int position, const wxString& name) bool wxLineShape::DeleteArrowHead(int position, const wxString& name)
{ {
wxNode *node = m_arcArrows.First(); wxNode *node = m_arcArrows.First();
@@ -2244,7 +2244,7 @@ int wxLineShape::FindLinePosition(double x, double y)
{ {
double startX, startY, endX, endY; double startX, startY, endX, endY;
GetEnds(&startX, &startY, &endX, &endY); GetEnds(&startX, &startY, &endX, &endY);
// Find distances from centre, start and end. The smallest wins. // Find distances from centre, start and end. The smallest wins.
double centreDistance = (double)(sqrt((x - m_xpos)*(x - m_xpos) + (y - m_ypos)*(y - m_ypos))); double centreDistance = (double)(sqrt((x - m_xpos)*(x - m_xpos) + (y - m_ypos)*(y - m_ypos)));
double startDistance = (double)(sqrt((x - startX)*(x - startX) + (y - startY)*(y - startY))); double startDistance = (double)(sqrt((x - startX)*(x - startX) + (y - startY)*(y - startY)));
@@ -2373,7 +2373,7 @@ wxArrowHead::wxArrowHead(wxArrowHead& toCopy)
m_metaFile = NULL; m_metaFile = NULL;
m_id = NewId(); m_id = NewId();
} }
wxArrowHead::~wxArrowHead() wxArrowHead::~wxArrowHead()
{ {
if (m_metaFile) delete m_metaFile; if (m_metaFile) delete m_metaFile;
@@ -2387,7 +2387,7 @@ void wxArrowHead::SetSize(double size)
double oldWidth = m_metaFile->m_width; double oldWidth = m_metaFile->m_width;
if (oldWidth == 0.0) if (oldWidth == 0.0)
return; return;
double scale = (double)(size/oldWidth); double scale = (double)(size/oldWidth);
if (scale != 1.0) if (scale != 1.0)
m_metaFile->Scale(scale, scale); m_metaFile->Scale(scale, scale);
@@ -2422,7 +2422,7 @@ void wxLabelShape::OnDraw(wxDC& dc)
{ {
if (m_lineShape && !m_lineShape->GetDrawHandles()) if (m_lineShape && !m_lineShape->GetDrawHandles())
return; return;
double x1 = (double)(m_xpos - m_width/2.0); double x1 = (double)(m_xpos - m_width/2.0);
double y1 = (double)(m_ypos - m_height/2.0); double y1 = (double)(m_ypos - m_height/2.0);

View File

@@ -1,8 +1,8 @@
#
# File: makefile.vc # File: makefile.vc
# Author: Julian Smart # Author: Julian Smart
# Created: 1993 # Created: 1993
# Updated: # Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh # Copyright: (c) 1993, AIAI, University of Edinburgh
# #
# "%W% %G%" # "%W% %G%"
@@ -11,12 +11,13 @@
# Use FINAL=1 argument to nmake to build final version with no debugging # Use FINAL=1 argument to nmake to build final version with no debugging
# info # info
# Set WXDIR for your system # Set WXDIR for your system
WXDIR = $(WXWIN) WXDIR = $(WXWIN)
OBJECTSDIR = $(WXDIR)\utils\ogl OBJECTSDIR = $(WXDIR)\utils\ogl
THISDIR = $(WXDIR)\utils\ogl\src THISDIR = $(WXDIR)\utils\ogl\src
EXTRALIBS=$(WXDIR)\lib\ogl.lib $(WXDIR)\lib\mfutils.lib #EXTRALIBS=$(WXDIR)\lib\ogl.lib $(WXDIR)\lib\mfutils.lib
EXTRAINC=/I$(WXDIR)\utils\mfutils\src /I$(WXDIR)\utils\prologio\src #EXTRAINC=/I$(WXDIR)\utils\mfutils\src /I$(WXDIR)\utils\prologio\src
EXTRAFLAGS=/DPROLOGIO=1 EXTRAFLAGS=/DPROLOGIO=1
DOCDIR=$(WXDIR)\docs DOCDIR=$(WXDIR)\docs
LOCALDOCDIR=$(WXDIR)\utils\ogl\docs LOCALDOCDIR=$(WXDIR)\utils\ogl\docs
@@ -24,16 +25,19 @@ LOCALDOCDIR=$(WXDIR)\utils\ogl\docs
!include $(WXDIR)\src\makevc.env !include $(WXDIR)\src\makevc.env
PROGRAM=test PROGRAM=test
OBJECTS = $(THISDIR)\basic.obj $(THISDIR)\basic2.obj $(THISDIR)\canvas.obj $(THISDIR)\ogldiag.obj $(THISDIR)\lines.obj $(THISDIR)\misc.obj $(THISDIR)\divided.obj $(THISDIR)\constrnt.obj\
$(THISDIR)\composit.obj $(THISDIR)\drawn.obj $(THISDIR)\bmpshape.obj $(THISDIR)\mfutils.obj
LIBTARGET=$(WXDIR)\lib\ogl.lib OBJECTS = $(D)\basic.obj $(D)\basic2.obj $(D)\canvas.obj $(D)\ogldiag.obj $(D)\lines.obj $(D)\misc.obj $(D)\divided.obj $(D)\constrnt.obj\
$(D)\composit.obj $(D)\drawn.obj $(D)\bmpshape.obj $(D)\mfutils.obj
all: $(LIBTARGET) LIBTARGET=$(WXDIR)\lib\ogl$(LIBEXT).lib
all: $(D) $(LIBTARGET)
$(PROGRAM): $(PROGRAM).exe $(PROGRAM): $(PROGRAM).exe
$(D) :
mkdir $(D)
wx: wx:
cd $(WXDIR)\src\msw cd $(WXDIR)\src\msw
nmake -f makefile.vc FINAL=$(FINAL) nmake -f makefile.vc FINAL=$(FINAL)
@@ -54,68 +58,68 @@ $(OBJECTS)
# NOTE: This causes a floating point stack error when optimized, # NOTE: This causes a floating point stack error when optimized,
# so DON'T optimize! # so DON'T optimize!
basic.obj: basic.$(SRCSUFF) basic.h lines.h misc.h canvas.h $(D)\basic.obj: basic.$(SRCSUFF) basic.h lines.h misc.h canvas.h
cl @<< cl @<<
$(CPPFLAGS) /Od /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /Od /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
$(THISDIR)\basic2.obj: basic2.$(SRCSUFF) basic.h lines.h misc.h canvas.h $(D)\basic2.obj: basic2.$(SRCSUFF) basic.h lines.h misc.h canvas.h
cl @<< cl @<<
$(CPPFLAGS) /Od /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /Od /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
$(THISDIR)\canvas.obj: canvas.$(SRCSUFF) basic.h misc.h canvas.h $(D)\canvas.obj: canvas.$(SRCSUFF) basic.h misc.h canvas.h
cl @<< cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
$(THISDIR)\ogldiag.obj: ogldiag.$(SRCSUFF) ogldiag.h canvas.h basic.h $(D)\ogldiag.obj: ogldiag.$(SRCSUFF) ogldiag.h canvas.h basic.h
cl @<< cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
$(THISDIR)\lines.obj: lines.$(SRCSUFF) basic.h misc.h canvas.h lines.h basicp.h linesp.h $(D)\lines.obj: lines.$(SRCSUFF) basic.h misc.h canvas.h lines.h basicp.h linesp.h
cl @<< cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
$(THISDIR)\misc.obj: misc.$(SRCSUFF) basic.h misc.h constrnt.h basicp.h $(D)\misc.obj: misc.$(SRCSUFF) basic.h misc.h constrnt.h basicp.h
cl @<< cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
$(THISDIR)\divided.obj: divided.$(SRCSUFF) basic.h misc.h canvas.h divided.h basicp.h $(D)\divided.obj: divided.$(SRCSUFF) basic.h misc.h canvas.h divided.h basicp.h
cl @<< cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
$(THISDIR)\constrnt.obj: constrnt.$(SRCSUFF) basic.h constrnt.h $(D)\constrnt.obj: constrnt.$(SRCSUFF) basic.h constrnt.h
cl @<< cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
$(THISDIR)\composit.obj: composit.$(SRCSUFF) basic.h misc.h canvas.h constrnt.h composit.h basicp.h $(D)\composit.obj: composit.$(SRCSUFF) basic.h misc.h canvas.h constrnt.h composit.h basicp.h
cl @<< cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
$(THISDIR)\drawn.obj: drawn.$(SRCSUFF) basic.h misc.h canvas.h drawn.h drawnp.h basicp.h $(D)\drawn.obj: drawn.$(SRCSUFF) basic.h misc.h canvas.h drawn.h drawnp.h basicp.h
cl @<< cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
$(THISDIR)\bmpshape.obj: bmpshape.$(SRCSUFF) basic.h misc.h canvas.h bmpshape.h $(D)\bmpshape.obj: bmpshape.$(SRCSUFF) basic.h misc.h canvas.h bmpshape.h
cl @<< cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
$(THISDIR)\mfutils.obj: mfutils.$(SRCSUFF) mfutils.h $(D)\mfutils.obj: mfutils.$(SRCSUFF) mfutils.h
cl @<< cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<< <<
clean: clean:
-erase *.obj -erase $(D)\*.obj
-erase *.sbr -erase *.sbr
-erase *.exe -erase *.exe
-erase *.res -erase *.res
@@ -129,10 +133,15 @@ DOCSOURCES=$(LOCALDOCDIR)\ogl.tex \
$(LOCALDOCDIR)\topics.tex $(LOCALDOCDIR)\sample.tex $(LOCALDOCDIR)\topics.tex $(LOCALDOCDIR)\sample.tex
html: $(DOCDIR)\html\ogl\ogl.htm html: $(DOCDIR)\html\ogl\ogl.htm
htmlhelp: $(DOCDIR)\html\ogl\ogl.chm
hlp: $(DOCDIR)\winhelp\ogl.hlp hlp: $(DOCDIR)\winhelp\ogl.hlp
pdfrtf: $(DOCDIR)\pdf\ogl.rtf pdfrtf: $(DOCDIR)\pdf\ogl.rtf
ps: $(DOCDIR)\ps\ogl.ps ps: $(DOCDIR)\ps\ogl.ps
touchmanual:
touch $(LOCALDOCDIR)\ogl.tex
$(DOCDIR)\winhelp\ogl.hlp: $(LOCALDOCDIR)\ogl.rtf $(LOCALDOCDIR)\ogl.hpj $(DOCDIR)\winhelp\ogl.hlp: $(LOCALDOCDIR)\ogl.rtf $(LOCALDOCDIR)\ogl.hpj
cd $(LOCALDOCDIR) cd $(LOCALDOCDIR)
-erase ogl.ph -erase ogl.ph
@@ -143,24 +152,32 @@ $(DOCDIR)\winhelp\ogl.hlp: $(LOCALDOCDIR)\ogl.rtf $(LOCALDOCDIR)\ogl.hpj
$(LOCALDOCDIR)\ogl.rtf: $(DOCSOURCES) $(LOCALDOCDIR)\ogl.rtf: $(DOCSOURCES)
cd $(LOCALDOCDIR) cd $(LOCALDOCDIR)
-start /w tex2rtf $(LOCALDOCDIR)\ogl.tex $(LOCALDOCDIR)\ogl.rtf -twice -winhelp -start $(WAITFLAG) tex2rtf $(LOCALDOCDIR)\ogl.tex $(LOCALDOCDIR)\ogl.rtf -twice -winhelp
cd $(THISDIR) cd $(THISDIR)
$(DOCDIR)\pdf\ogl.rtf: $(DOCSOURCES) $(DOCDIR)\pdf\ogl.rtf: $(DOCSOURCES)
cd $(LOCALDOCDIR) cd $(LOCALDOCDIR)
-copy *.bmp $(DOCDIR)\pdf -copy *.bmp $(DOCDIR)\pdf
-start /w tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\pdf\ogl.rtf -twice -rtf -start $(WAITFLAG) tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\pdf\ogl.rtf -twice -rtf
cd $(THISDIR) cd $(THISDIR)
$(DOCDIR)\html\ogl\ogl.htm: $(DOCSOURCES) $(DOCDIR)\html\ogl\ogl.htm: $(DOCSOURCES)
cd $(LOCALDOCDIR) cd $(LOCALDOCDIR)
-mkdir $(DOCDIR)\html\ogl -mkdir $(DOCDIR)\html\ogl
copy *.gif $(DOCDIR)\html\ogl copy *.gif $(DOCDIR)\html\ogl
-start /w tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\html\ogl\ogl.htm -twice -html -start $(WAITFLAG) tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\html\ogl\ogl.htm -twice -html
-erase $(DOCDIR)\html\ogl\*.con -erase $(DOCDIR)\html\ogl\*.con
-erase *.con
-erase $(DOCDIR)\html\ogl\*.ref -erase $(DOCDIR)\html\ogl\*.ref
cd $(THISDIR) cd $(THISDIR)
$(DOCDIR)\html\ogl\ogl.chm: $(DOCDIR)\html\ogl\ogl.htm $(DOCDIR)\html\ogl\ogl.hhp
cd $(DOCDIR)\html\ogl
-hhc ogl.hhp
cd $(THISDIR)
$(LOCALDOCDIR)\ogl.dvi: $(DOCSOURCES) $(LOCALDOCDIR)\ogl.dvi: $(DOCSOURCES)
cd $(LOCALDOCDIR) cd $(LOCALDOCDIR)
-latex ogl -latex ogl