-1->wxID_ANY, TRUE->true, FALSE->false and tabs replacements. Correct help system in non MSW builds of OGL-Studio sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27708 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -137,7 +137,7 @@ bool wxShapeEvtHandler::OnMovePre(wxDC& dc, double x, double y, double old_x, do
|
||||
if (m_previousHandler)
|
||||
return m_previousHandler->OnMovePre(dc, x, y, old_x, old_y, display);
|
||||
else
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxShapeEvtHandler::OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display)
|
||||
@@ -270,7 +270,7 @@ wxShape::wxShape(wxShapeCanvas *can)
|
||||
m_eventHandler = this;
|
||||
SetShape(this);
|
||||
m_id = 0;
|
||||
m_formatted = FALSE;
|
||||
m_formatted = false;
|
||||
m_canvas = can;
|
||||
m_xpos = 0.0; m_ypos = 0.0;
|
||||
m_pen = g_oglBlackPen;
|
||||
@@ -278,16 +278,16 @@ wxShape::wxShape(wxShapeCanvas *can)
|
||||
m_font = g_oglNormalFont;
|
||||
m_textColour = wxT("BLACK");
|
||||
m_textColourName = wxT("BLACK");
|
||||
m_visible = FALSE;
|
||||
m_selected = FALSE;
|
||||
m_visible = false;
|
||||
m_selected = false;
|
||||
m_attachmentMode = ATTACHMENT_MODE_NONE;
|
||||
m_spaceAttachments = TRUE;
|
||||
m_disableLabel = FALSE;
|
||||
m_fixedWidth = FALSE;
|
||||
m_fixedHeight = FALSE;
|
||||
m_drawHandles = TRUE;
|
||||
m_spaceAttachments = true;
|
||||
m_disableLabel = false;
|
||||
m_fixedWidth = false;
|
||||
m_fixedHeight = false;
|
||||
m_drawHandles = true;
|
||||
m_sensitivity = OP_ALL;
|
||||
m_draggable = TRUE;
|
||||
m_draggable = true;
|
||||
m_parent = NULL;
|
||||
m_formatMode = FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT;
|
||||
m_shadowMode = SHADOW_NONE;
|
||||
@@ -297,9 +297,9 @@ wxShape::wxShape(wxShapeCanvas *can)
|
||||
m_textMarginX = 5;
|
||||
m_textMarginY = 5;
|
||||
m_regionName = wxT("0");
|
||||
m_centreResize = TRUE;
|
||||
m_maintainAspectRatio = FALSE;
|
||||
m_highlighted = FALSE;
|
||||
m_centreResize = true;
|
||||
m_maintainAspectRatio = false;
|
||||
m_highlighted = false;
|
||||
m_rotation = 0.0;
|
||||
m_branchNeckLength = 10;
|
||||
m_branchStemLength = 10;
|
||||
@@ -349,9 +349,9 @@ void wxShape::SetHighlight(bool hi, bool recurse)
|
||||
void wxShape::SetSensitivityFilter(int sens, bool recursive)
|
||||
{
|
||||
if (sens & OP_DRAG_LEFT)
|
||||
m_draggable = TRUE;
|
||||
m_draggable = true;
|
||||
else
|
||||
m_draggable = FALSE;
|
||||
m_draggable = false;
|
||||
|
||||
m_sensitivity = sens;
|
||||
if (recursive)
|
||||
@@ -360,7 +360,7 @@ void wxShape::SetSensitivityFilter(int sens, bool recursive)
|
||||
while (node)
|
||||
{
|
||||
wxShape *obj = (wxShape *)node->GetData();
|
||||
obj->SetSensitivityFilter(sens, TRUE);
|
||||
obj->SetSensitivityFilter(sens, true);
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
@@ -381,7 +381,7 @@ void wxShape::SetDraggable(bool drag, bool recursive)
|
||||
while (node)
|
||||
{
|
||||
wxShape *obj = (wxShape *)node->GetData();
|
||||
obj->SetDraggable(drag, TRUE);
|
||||
obj->SetDraggable(drag, true);
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
@@ -463,7 +463,7 @@ void wxShape::InsertInCanvas(wxShapeCanvas *theCanvas)
|
||||
void wxShape::RemoveFromCanvas(wxShapeCanvas *theCanvas)
|
||||
{
|
||||
if (Selected())
|
||||
Select(FALSE);
|
||||
Select(false);
|
||||
theCanvas->RemoveShape(this);
|
||||
wxNode *node = m_children.GetFirst();
|
||||
while (node)
|
||||
@@ -491,9 +491,9 @@ void wxShape::ClearText(int regionId)
|
||||
{
|
||||
if (regionId == 0)
|
||||
{
|
||||
m_text.DeleteContents(TRUE);
|
||||
m_text.DeleteContents(true);
|
||||
m_text.Clear();
|
||||
m_text.DeleteContents(FALSE);
|
||||
m_text.DeleteContents(false);
|
||||
}
|
||||
wxNode *node = m_regions.Item(regionId);
|
||||
if (!node)
|
||||
@@ -533,7 +533,7 @@ void wxShape::SetDefaultRegionSize()
|
||||
bool wxShape::HitTest(double x, double y, int *attachment, double *distance)
|
||||
{
|
||||
// if (!sensitive)
|
||||
// return FALSE;
|
||||
// return false;
|
||||
|
||||
double width = 0.0, height = 0.0;
|
||||
GetBoundingBoxMin(&width, &height);
|
||||
@@ -577,15 +577,15 @@ bool wxShape::HitTest(double x, double y, int *attachment, double *distance)
|
||||
}
|
||||
*attachment = nearest_attachment;
|
||||
*distance = nearest;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else return FALSE;
|
||||
else return false;
|
||||
}
|
||||
|
||||
// Format a text string according to the region size, adding
|
||||
// strings with positions to region text list
|
||||
|
||||
static bool GraphicsInSizeToContents = FALSE; // Infinite recursion elimination
|
||||
static bool GraphicsInSizeToContents = false; // Infinite recursion elimination
|
||||
void wxShape::FormatText(wxDC& dc, const wxString& s, int i)
|
||||
{
|
||||
double w, h;
|
||||
@@ -632,7 +632,7 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i)
|
||||
if (topAncestor != this)
|
||||
{
|
||||
// Make sure we don't recurse infinitely
|
||||
GraphicsInSizeToContents = TRUE;
|
||||
GraphicsInSizeToContents = true;
|
||||
|
||||
wxCompositeShape *composite = (wxCompositeShape *)topAncestor;
|
||||
composite->Erase(dc);
|
||||
@@ -648,7 +648,7 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i)
|
||||
// Where infinite recursion might happen if we didn't stop it
|
||||
composite->Draw(dc);
|
||||
|
||||
GraphicsInSizeToContents = FALSE;
|
||||
GraphicsInSizeToContents = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -662,7 +662,7 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i)
|
||||
}
|
||||
}
|
||||
oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, actualW-2*m_textMarginX, actualH-2*m_textMarginY, region->GetFormatMode());
|
||||
m_formatted = TRUE;
|
||||
m_formatted = true;
|
||||
}
|
||||
|
||||
void wxShape::Recentre(wxDC& dc)
|
||||
@@ -686,7 +686,7 @@ bool wxShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1),
|
||||
double WXUNUSED(x2), double WXUNUSED(y2),
|
||||
double *WXUNUSED(x3), double *WXUNUSED(y3))
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxShape::SetPen(wxPen *the_pen)
|
||||
@@ -924,7 +924,7 @@ void wxShape::OnDrawContents(wxDC& dc)
|
||||
if (!m_formatted)
|
||||
{
|
||||
oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, bound_x-2*m_textMarginX, bound_y-2*m_textMarginY, region->GetFormatMode());
|
||||
m_formatted = TRUE;
|
||||
m_formatted = true;
|
||||
}
|
||||
if (!GetDisableLabel())
|
||||
{
|
||||
@@ -943,7 +943,7 @@ void wxShape::OnSize(double WXUNUSED(x), double WXUNUSED(y))
|
||||
|
||||
bool wxShape::OnMovePre(wxDC& WXUNUSED(dc), double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(old_x), double WXUNUSED(old_y), bool WXUNUSED(display))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxShape::OnMovePost(wxDC& WXUNUSED(dc), double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(old_x), double WXUNUSED(old_y), bool WXUNUSED(display))
|
||||
@@ -1043,7 +1043,7 @@ void wxShape::DrawLinks(wxDC& dc, int attachment, bool recurse)
|
||||
}
|
||||
}
|
||||
|
||||
// Returns TRUE if pt1 <= pt2 in the sense that one point comes before another on an
|
||||
// Returns true if pt1 <= pt2 in the sense that one point comes before another on an
|
||||
// edge of the shape.
|
||||
// attachmentPoint is the attachment point (= side) in question.
|
||||
|
||||
@@ -1065,14 +1065,14 @@ bool wxShape::AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, co
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move,
|
||||
double x, double y)
|
||||
{
|
||||
if (GetAttachmentMode() == ATTACHMENT_MODE_NONE)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
int newAttachment, oldAttachment;
|
||||
double distance;
|
||||
@@ -1081,7 +1081,7 @@ bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move,
|
||||
// the user has moved the point to
|
||||
bool hit = HitTest(x, y, &newAttachment, &distance);
|
||||
if (!hit)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
EraseLinks(dc);
|
||||
|
||||
@@ -1109,7 +1109,7 @@ bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move,
|
||||
double old_y = (double) -99999.9;
|
||||
|
||||
node = newOrdering.GetFirst();
|
||||
bool found = FALSE;
|
||||
bool found = false;
|
||||
|
||||
while (!found && node)
|
||||
{
|
||||
@@ -1136,7 +1136,7 @@ bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move,
|
||||
|
||||
if (AttachmentSortTest(newAttachment, newPoint, thisPoint) && AttachmentSortTest(newAttachment, lastPoint, newPoint))
|
||||
{
|
||||
found = TRUE;
|
||||
found = true;
|
||||
newOrdering.Insert(node, to_move);
|
||||
}
|
||||
|
||||
@@ -1151,7 +1151,7 @@ bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move,
|
||||
|
||||
GetEventHandler()->OnChangeAttachment(newAttachment, to_move, newOrdering);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxShape::OnChangeAttachment(int attachment, wxLineShape* line, wxList& ordering)
|
||||
@@ -1547,7 +1547,7 @@ void wxShape::Erase(wxDC& dc)
|
||||
{
|
||||
GetEventHandler()->OnErase(dc);
|
||||
GetEventHandler()->OnEraseControlPoints(dc);
|
||||
GetEventHandler()->OnDrawBranches(dc, TRUE);
|
||||
GetEventHandler()->OnDrawBranches(dc, true);
|
||||
}
|
||||
|
||||
void wxShape::EraseContents(wxDC& dc)
|
||||
@@ -1566,7 +1566,7 @@ void wxShape::AddText(const wxString& string)
|
||||
new wxShapeTextLine(0.0, 0.0, string);
|
||||
region->GetFormattedText().Append(new_line);
|
||||
|
||||
m_formatted = FALSE;
|
||||
m_formatted = false;
|
||||
}
|
||||
|
||||
void wxShape::SetSize(double x, double y, bool WXUNUSED(recursive))
|
||||
@@ -1759,10 +1759,10 @@ void wxShape::WriteAttributes(wxExpr *clause)
|
||||
clause->AddAttributeValue(_T("fixed_height"), (long)m_fixedHeight);
|
||||
if (m_shadowMode != SHADOW_NONE)
|
||||
clause->AddAttributeValue(_T("shadow_mode"), (long)m_shadowMode);
|
||||
if (m_centreResize != TRUE)
|
||||
if (m_centreResize != true)
|
||||
clause->AddAttributeValue(_T("centre_resize"), (long)0);
|
||||
clause->AddAttributeValue(_T("maintain_aspect_ratio"), (long) m_maintainAspectRatio);
|
||||
if (m_highlighted != FALSE)
|
||||
if (m_highlighted != false)
|
||||
clause->AddAttributeValue(_T("hilite"), (long)m_highlighted);
|
||||
|
||||
if (m_parent) // For composite objects
|
||||
@@ -1882,7 +1882,7 @@ void wxShape::ReadAttributes(wxExpr *clause)
|
||||
wxExpr *strings = clause->AttributeValue(_T("text"));
|
||||
if (strings && strings->Type() == wxExprList)
|
||||
{
|
||||
m_formatted = TRUE; // Assume text is formatted unless we prove otherwise
|
||||
m_formatted = true; // Assume text is formatted unless we prove otherwise
|
||||
wxExpr *node = strings->value.first;
|
||||
while (node)
|
||||
{
|
||||
@@ -1896,7 +1896,7 @@ void wxShape::ReadAttributes(wxExpr *clause)
|
||||
if (string_expr->Type() == wxExprString)
|
||||
{
|
||||
the_string = string_expr->StringValue();
|
||||
m_formatted = FALSE;
|
||||
m_formatted = false;
|
||||
}
|
||||
else if (string_expr->Type() == wxExprList)
|
||||
{
|
||||
@@ -2068,7 +2068,7 @@ void wxShape::ReadRegions(wxExpr *clause)
|
||||
wxSprintf(regionNameBuf, _T("region%d"), regionNo);
|
||||
wxSprintf(textNameBuf, _T("text%d"), regionNo);
|
||||
|
||||
m_formatted = TRUE; // Assume text is formatted unless we prove otherwise
|
||||
m_formatted = true; // Assume text is formatted unless we prove otherwise
|
||||
|
||||
while ((regionExpr = clause->AttributeValue(regionNameBuf)) != NULL)
|
||||
{
|
||||
@@ -2189,7 +2189,7 @@ void wxShape::ReadRegions(wxExpr *clause)
|
||||
if (string_expr->Type() == wxExprString)
|
||||
{
|
||||
the_string = string_expr->StringValue();
|
||||
m_formatted = FALSE;
|
||||
m_formatted = false;
|
||||
}
|
||||
else if (string_expr->Type() == wxExprList)
|
||||
{
|
||||
@@ -2620,9 +2620,9 @@ bool wxShape::Selected() const
|
||||
|
||||
bool wxShape::AncestorSelected() const
|
||||
{
|
||||
if (m_selected) return TRUE;
|
||||
if (m_selected) return true;
|
||||
if (!GetParent())
|
||||
return FALSE;
|
||||
return false;
|
||||
else
|
||||
return GetParent()->AncestorSelected();
|
||||
}
|
||||
@@ -2661,10 +2661,10 @@ bool wxShape::AttachmentIsValid(int attachment) const
|
||||
{
|
||||
wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
|
||||
if (point->m_id == attachment)
|
||||
return TRUE;
|
||||
return true;
|
||||
node = node->GetNext();
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
@@ -2673,7 +2673,7 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
if (m_attachmentMode == ATTACHMENT_MODE_NONE)
|
||||
{
|
||||
*x = m_xpos; *y = m_ypos;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if (m_attachmentMode == ATTACHMENT_MODE_BRANCHING)
|
||||
{
|
||||
@@ -2681,7 +2681,7 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
GetBranchingAttachmentPoint(attachment, nth, pt, stemPt);
|
||||
*x = pt.x;
|
||||
*y = pt.y;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if (m_attachmentMode == ATTACHMENT_MODE_EDGE)
|
||||
{
|
||||
@@ -2695,12 +2695,12 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
{
|
||||
*x = (double)(m_xpos + point->m_x);
|
||||
*y = (double)(m_ypos + point->m_y);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
node = node->GetNext();
|
||||
}
|
||||
*x = m_xpos; *y = m_ypos;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2753,13 +2753,13 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
}
|
||||
default:
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxShape::GetBoundingBoxMax(double *w, double *h)
|
||||
@@ -2775,21 +2775,21 @@ void wxShape::GetBoundingBoxMax(double *w, double *h)
|
||||
*h = hh;
|
||||
}
|
||||
|
||||
// Returns TRUE if image is a descendant of this composite
|
||||
// Returns true if image is a descendant of this composite
|
||||
bool wxShape::HasDescendant(wxShape *image)
|
||||
{
|
||||
if (image == this)
|
||||
return TRUE;
|
||||
return true;
|
||||
wxNode *node = m_children.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *child = (wxShape *)node->GetData();
|
||||
bool ans = child->HasDescendant(image);
|
||||
if (ans)
|
||||
return TRUE;
|
||||
return true;
|
||||
node = node->GetNext();
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clears points from a list of wxRealPoints, and clears list
|
||||
@@ -2814,7 +2814,7 @@ wxRealPoint wxShape::CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPo
|
||||
bool isEnd = (line && line->IsEnd(this));
|
||||
|
||||
// Are we horizontal or vertical?
|
||||
bool isHorizontal = (oglRoughlyEqual(pt1.y, pt2.y) == TRUE);
|
||||
bool isHorizontal = (oglRoughlyEqual(pt1.y, pt2.y) == true);
|
||||
|
||||
double x, y;
|
||||
|
||||
@@ -2854,7 +2854,7 @@ wxRealPoint wxShape::CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPo
|
||||
}
|
||||
else
|
||||
{
|
||||
wxASSERT( oglRoughlyEqual(pt1.x, pt2.x) == TRUE );
|
||||
wxASSERT( oglRoughlyEqual(pt1.x, pt2.x) == true );
|
||||
|
||||
wxRealPoint firstPoint, secondPoint;
|
||||
if (pt1.y > pt2.y)
|
||||
@@ -2911,7 +2911,7 @@ int wxShape::GetLinePosition(wxLineShape* line)
|
||||
// <- branching attachment point N-1
|
||||
|
||||
// This function gets information about where branching connections go.
|
||||
// Returns FALSE if there are no lines at this attachment.
|
||||
// Returns false if there are no lines at this attachment.
|
||||
bool wxShape::GetBranchingAttachmentInfo(int attachment, wxRealPoint& root, wxRealPoint& neck,
|
||||
wxRealPoint& shoulder1, wxRealPoint& shoulder2)
|
||||
{
|
||||
@@ -2921,7 +2921,7 @@ bool wxShape::GetBranchingAttachmentInfo(int attachment, wxRealPoint& root, wxRe
|
||||
int lineCount = GetAttachmentLineCount(attachment);
|
||||
|
||||
if (lineCount == 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
int totalBranchLength = m_branchSpacing * (lineCount - 1);
|
||||
|
||||
@@ -2984,7 +2984,7 @@ bool wxShape::GetBranchingAttachmentInfo(int attachment, wxRealPoint& root, wxRe
|
||||
break;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// n is the number of the adjoining line, from 0 to N-1 where N is the number of lines
|
||||
@@ -3044,7 +3044,7 @@ bool wxShape::GetBranchingAttachmentPoint(int attachment, int n, wxRealPoint& pt
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get the number of lines at this attachment position.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -202,7 +202,7 @@ void wxPolygonShape::CalculatePolygonCentre()
|
||||
bool PolylineHitTest(double n, double xvec[], double yvec[],
|
||||
double x1, double y1, double x2, double y2)
|
||||
{
|
||||
bool isAHit = FALSE;
|
||||
bool isAHit = false;
|
||||
int i;
|
||||
double lastx = xvec[0];
|
||||
double lasty = yvec[0];
|
||||
@@ -216,7 +216,7 @@ bool PolylineHitTest(double n, double xvec[], double yvec[],
|
||||
oglCheckLineIntersection(x1, y1, x2, y2, lastx, lasty, xvec[i], yvec[i],
|
||||
&line_ratio, &other_ratio);
|
||||
if (line_ratio != 1.0)
|
||||
isAHit = TRUE;
|
||||
isAHit = true;
|
||||
lastx = xvec[i];
|
||||
lasty = yvec[i];
|
||||
|
||||
@@ -230,7 +230,7 @@ bool PolylineHitTest(double n, double xvec[], double yvec[],
|
||||
oglCheckLineIntersection(x1, y1, x2, y2, lastx, lasty, xvec[0], yvec[0],
|
||||
&line_ratio, &other_ratio);
|
||||
if (line_ratio != 1.0)
|
||||
isAHit = TRUE;
|
||||
isAHit = true;
|
||||
|
||||
}
|
||||
return isAHit;
|
||||
@@ -273,13 +273,13 @@ bool wxPolygonShape::HitTest(double x, double y, int *attachment, double *distan
|
||||
|
||||
// We assume it's inside the polygon UNLESS one or more
|
||||
// lines don't hit the outline.
|
||||
bool isContained = TRUE;
|
||||
bool isContained = true;
|
||||
|
||||
int noPoints = 4;
|
||||
for (i = 0; i < noPoints; i++)
|
||||
{
|
||||
if (!PolylineHitTest(np, xpoints, ypoints, x, y, endPointsX[i], endPointsY[i]))
|
||||
isContained = FALSE;
|
||||
isContained = false;
|
||||
}
|
||||
/*
|
||||
if (isContained)
|
||||
@@ -291,7 +291,7 @@ bool wxPolygonShape::HitTest(double x, double y, int *attachment, double *distan
|
||||
delete[] ypoints;
|
||||
|
||||
if (!isContained)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
int nearest_attachment = 0;
|
||||
|
||||
@@ -315,7 +315,7 @@ bool wxPolygonShape::HitTest(double x, double y, int *attachment, double *distan
|
||||
}
|
||||
*attachment = nearest_attachment;
|
||||
*distance = nearest;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Really need to be able to reset the shape! Otherwise, if the
|
||||
@@ -447,13 +447,13 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1,
|
||||
{
|
||||
*x3 = point->x + m_xpos;
|
||||
*y3 = point->y + m_ypos;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if ((y2 < y1) && (point->y < 0.0))
|
||||
{
|
||||
*x3 = point->x + m_xpos;
|
||||
*y3 = point->y + m_ypos;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
node = node->GetNext();
|
||||
@@ -480,7 +480,7 @@ bool wxPolygonShape::GetPerimeterPoint(double x1, double y1,
|
||||
delete[] xpoints;
|
||||
delete[] ypoints;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxPolygonShape::OnDraw(wxDC& dc)
|
||||
@@ -784,7 +784,7 @@ bool wxPolygonShape::GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
wxRealPoint *point = (wxRealPoint *)m_points->Item(attachment)->GetData();
|
||||
*x = point->x + m_xpos;
|
||||
*y = point->y + m_ypos;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{ return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs, line); }
|
||||
@@ -793,20 +793,20 @@ bool wxPolygonShape::GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
bool wxPolygonShape::AttachmentIsValid(int attachment) const
|
||||
{
|
||||
if (!m_points)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if ((attachment >= 0) && (attachment < (int) m_points->GetCount()))
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
wxNode *node = m_attachmentPoints.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData();
|
||||
if (point->m_id == attachment)
|
||||
return TRUE;
|
||||
return true;
|
||||
node = node->GetNext();
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Rotate about the given axis by the given amount in radians
|
||||
@@ -928,7 +928,7 @@ bool wxRectangleShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1
|
||||
GetBoundingBoxMax(&bound_x, &bound_y);
|
||||
oglFindEndForBox(bound_x, bound_y, m_xpos, m_ypos, x2, y2, x3, y3);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#if wxUSE_PROLOGIO
|
||||
@@ -1036,7 +1036,7 @@ bool wxEllipseShape::GetPerimeterPoint(double x1, double y1,
|
||||
// oglFindEndForBox(bound_x, bound_y, m_xpos, m_ypos, x2, y2, x3, y3);
|
||||
oglDrawArcToEllipse(m_xpos, m_ypos, bound_x, bound_y, x2, y2, x1, y1, x3, y3);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxEllipseShape::OnDraw(wxDC& dc)
|
||||
@@ -1177,10 +1177,10 @@ bool wxEllipseShape::GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs, line);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{ *x = m_xpos; *y = m_ypos; return TRUE; }
|
||||
{ *x = m_xpos; *y = m_ypos; return true; }
|
||||
}
|
||||
|
||||
|
||||
@@ -1189,7 +1189,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCircleShape, wxEllipseShape)
|
||||
|
||||
wxCircleShape::wxCircleShape(double diameter):wxEllipseShape(diameter, diameter)
|
||||
{
|
||||
SetMaintainAspectRatio(TRUE);
|
||||
SetMaintainAspectRatio(true);
|
||||
}
|
||||
|
||||
void wxCircleShape::Copy(wxShape& copy)
|
||||
@@ -1206,7 +1206,7 @@ bool wxCircleShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1),
|
||||
x2, y2, // Other end of line
|
||||
x3, y3);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Control points
|
||||
@@ -1232,8 +1232,8 @@ wxControlPoint::wxControlPoint(wxShapeCanvas *theCanvas, wxShape *object, double
|
||||
SetPen(g_oglBlackForegroundPen);
|
||||
SetBrush(wxBLACK_BRUSH);
|
||||
m_oldCursor = NULL;
|
||||
m_visible = TRUE;
|
||||
m_eraseObject = TRUE;
|
||||
m_visible = true;
|
||||
m_eraseObject = true;
|
||||
}
|
||||
|
||||
wxControlPoint::~wxControlPoint()
|
||||
@@ -1282,7 +1282,7 @@ bool wxControlPoint::GetAttachmentPosition(int WXUNUSED(attachment), double *x,
|
||||
int WXUNUSED(nth), int WXUNUSED(no_arcs), wxLineShape *WXUNUSED(line))
|
||||
{
|
||||
*x = m_xpos; *y = m_ypos;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Control points ('handles') redirect control to the actual shape, to make it easier
|
||||
@@ -1540,7 +1540,7 @@ void wxShape::OnSizingEndDragLeft(wxControlPoint* pt, double WXUNUSED(x), double
|
||||
this->Erase(dc);
|
||||
/*
|
||||
if (!pt->m_eraseObject)
|
||||
this->Show(FALSE);
|
||||
this->Show(false);
|
||||
*/
|
||||
|
||||
this->SetSize(pt->sm_controlPointDragEndWidth, pt->sm_controlPointDragEndHeight);
|
||||
@@ -1559,12 +1559,12 @@ void wxShape::OnSizingEndDragLeft(wxControlPoint* pt, double WXUNUSED(x), double
|
||||
|
||||
/*
|
||||
if (!eraseIt)
|
||||
theObject->Show(TRUE);
|
||||
theObject->Show(true);
|
||||
*/
|
||||
|
||||
// Recursively redraw links if we have a composite.
|
||||
if (theObject->GetChildren().GetCount() > 0)
|
||||
theObject->DrawLinks(dc, -1, TRUE);
|
||||
theObject->DrawLinks(dc, -1, true);
|
||||
|
||||
double width, height;
|
||||
theObject->GetBoundingBoxMax(&width, &height);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -75,7 +75,7 @@ wxShapeCanvas::wxShapeCanvas(wxWindow *parent, wxWindowID id,
|
||||
m_oldDragY = 0;
|
||||
m_firstDragX = 0;
|
||||
m_firstDragY = 0;
|
||||
m_checkTolerance = TRUE;
|
||||
m_checkTolerance = true;
|
||||
}
|
||||
|
||||
wxShapeCanvas::~wxShapeCanvas()
|
||||
@@ -129,7 +129,7 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
// If we've ignored the tolerance once, then ALWAYS ignore
|
||||
// tolerance in this drag, even if we come back within
|
||||
// the tolerance range.
|
||||
m_checkTolerance = FALSE;
|
||||
m_checkTolerance = false;
|
||||
}
|
||||
|
||||
// Dragging - note that the effect of dragging is left entirely up
|
||||
@@ -153,16 +153,16 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
else if (dragging && m_draggedShape && m_dragState == ContinueDraggingLeft)
|
||||
{
|
||||
// Continue dragging
|
||||
m_draggedShape->GetEventHandler()->OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
m_draggedShape->GetEventHandler()->OnDragLeft(TRUE, (double)x, (double)y, keys, m_draggedAttachment);
|
||||
m_draggedShape->GetEventHandler()->OnDragLeft(false, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
m_draggedShape->GetEventHandler()->OnDragLeft(true, (double)x, (double)y, keys, m_draggedAttachment);
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (event.LeftUp() && m_draggedShape && m_dragState == ContinueDraggingLeft)
|
||||
{
|
||||
m_dragState = NoDragging;
|
||||
m_checkTolerance = TRUE;
|
||||
m_checkTolerance = true;
|
||||
|
||||
m_draggedShape->GetEventHandler()->OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
m_draggedShape->GetEventHandler()->OnDragLeft(false, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
|
||||
m_draggedShape->GetEventHandler()->OnEndDragLeft((double)x, (double)y, keys, m_draggedAttachment);
|
||||
m_draggedShape = NULL;
|
||||
@@ -183,16 +183,16 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
else if (dragging && m_draggedShape && m_dragState == ContinueDraggingRight)
|
||||
{
|
||||
// Continue dragging
|
||||
m_draggedShape->GetEventHandler()->OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
m_draggedShape->GetEventHandler()->OnDragRight(TRUE, (double)x, (double)y, keys, m_draggedAttachment);
|
||||
m_draggedShape->GetEventHandler()->OnDragRight(false, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
m_draggedShape->GetEventHandler()->OnDragRight(true, (double)x, (double)y, keys, m_draggedAttachment);
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (event.RightUp() && m_draggedShape && m_dragState == ContinueDraggingRight)
|
||||
{
|
||||
m_dragState = NoDragging;
|
||||
m_checkTolerance = TRUE;
|
||||
m_checkTolerance = true;
|
||||
|
||||
m_draggedShape->GetEventHandler()->OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
m_draggedShape->GetEventHandler()->OnDragRight(false, m_oldDragX, m_oldDragY, keys, m_draggedAttachment);
|
||||
|
||||
m_draggedShape->GetEventHandler()->OnEndDragRight((double)x, (double)y, keys, m_draggedAttachment);
|
||||
m_draggedShape = NULL;
|
||||
@@ -208,16 +208,16 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
else if (dragging && !m_draggedShape && m_dragState == ContinueDraggingLeft)
|
||||
{
|
||||
// Continue dragging
|
||||
OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys);
|
||||
OnDragLeft(TRUE, (double)x, (double)y, keys);
|
||||
OnDragLeft(false, m_oldDragX, m_oldDragY, keys);
|
||||
OnDragLeft(true, (double)x, (double)y, keys);
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (event.LeftUp() && !m_draggedShape && m_dragState == ContinueDraggingLeft)
|
||||
{
|
||||
m_dragState = NoDragging;
|
||||
m_checkTolerance = TRUE;
|
||||
m_checkTolerance = true;
|
||||
|
||||
OnDragLeft(FALSE, m_oldDragX, m_oldDragY, keys);
|
||||
OnDragLeft(false, m_oldDragX, m_oldDragY, keys);
|
||||
OnEndDragLeft((double)x, (double)y, keys);
|
||||
m_draggedShape = NULL;
|
||||
}
|
||||
@@ -230,16 +230,16 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
else if (dragging && !m_draggedShape && m_dragState == ContinueDraggingRight)
|
||||
{
|
||||
// Continue dragging
|
||||
OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys);
|
||||
OnDragRight(TRUE, (double)x, (double)y, keys);
|
||||
OnDragRight(false, m_oldDragX, m_oldDragY, keys);
|
||||
OnDragRight(true, (double)x, (double)y, keys);
|
||||
m_oldDragX = x; m_oldDragY = y;
|
||||
}
|
||||
else if (event.RightUp() && !m_draggedShape && m_dragState == ContinueDraggingRight)
|
||||
{
|
||||
m_dragState = NoDragging;
|
||||
m_checkTolerance = TRUE;
|
||||
m_checkTolerance = true;
|
||||
|
||||
OnDragRight(FALSE, m_oldDragX, m_oldDragY, keys);
|
||||
OnDragRight(false, m_oldDragX, m_oldDragY, keys);
|
||||
OnEndDragRight((double)x, (double)y, keys);
|
||||
m_draggedShape = NULL;
|
||||
}
|
||||
@@ -247,7 +247,7 @@ void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||
// Non-dragging events
|
||||
else if (event.IsButton())
|
||||
{
|
||||
m_checkTolerance = TRUE;
|
||||
m_checkTolerance = true;
|
||||
|
||||
// Find the nearest object
|
||||
int attachment = 0;
|
||||
@@ -358,7 +358,7 @@ wxShape *wxShapeCanvas::FindFirstSensitiveShape1(wxShape *image, int op)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Helper function: TRUE if 'contains' wholly contains 'contained'.
|
||||
// Helper function: true if 'contains' wholly contains 'contained'.
|
||||
static bool WhollyContains(wxShape *contains, wxShape *contained)
|
||||
{
|
||||
double xp1, yp1, xp2, yp2;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -65,7 +65,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxCompositeShape, wxRectangleShape)
|
||||
|
||||
wxCompositeShape::wxCompositeShape(): wxRectangleShape(10.0, 10.0)
|
||||
{
|
||||
// selectable = FALSE;
|
||||
// selectable = false;
|
||||
m_oldX = m_xpos;
|
||||
m_oldY = m_ypos;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ bool wxCompositeShape::OnMovePre(wxDC& dc, double x, double y, double oldx, doub
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxCompositeShape::OnErase(wxDC& dc)
|
||||
@@ -278,9 +278,9 @@ void wxCompositeShape::SetSize(double w, double h, bool recursive)
|
||||
// Scale the position first
|
||||
double newX = (double)(((object->GetX() - GetX())*xScale) + GetX());
|
||||
double newY = (double)(((object->GetY() - GetY())*yScale) + GetY());
|
||||
object->Show(FALSE);
|
||||
object->Show(false);
|
||||
object->Move(dc, newX, newY);
|
||||
object->Show(TRUE);
|
||||
object->Show(true);
|
||||
|
||||
// Now set the scaled size
|
||||
object->GetBoundingBoxMin(&xBound, &yBound);
|
||||
@@ -371,7 +371,7 @@ void wxCompositeShape::Copy(wxShape& copy)
|
||||
while (node)
|
||||
{
|
||||
wxShape *object = (wxShape *)node->GetData();
|
||||
wxShape *newObject = object->CreateNewCopy(FALSE, FALSE);
|
||||
wxShape *newObject = object->CreateNewCopy(false, false);
|
||||
if (newObject->GetId() == 0)
|
||||
newObject->SetId(wxNewId());
|
||||
|
||||
@@ -558,7 +558,7 @@ void wxCompositeShape::CalculateSize()
|
||||
bool wxCompositeShape::Recompute()
|
||||
{
|
||||
int noIterations = 0;
|
||||
bool changed = TRUE;
|
||||
bool changed = true;
|
||||
while (changed && (noIterations < 500))
|
||||
{
|
||||
changed = Constrain();
|
||||
@@ -577,13 +577,13 @@ bool wxCompositeShape::Constrain()
|
||||
{
|
||||
CalculateSize();
|
||||
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
wxNode *node = m_children.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *object = (wxShape *)node->GetData();
|
||||
if (object->Constrain())
|
||||
changed = TRUE;
|
||||
changed = true;
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
@@ -591,7 +591,7 @@ bool wxCompositeShape::Constrain()
|
||||
while (node)
|
||||
{
|
||||
wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData();
|
||||
if (constraint->Evaluate()) changed = TRUE;
|
||||
if (constraint->Evaluate()) changed = true;
|
||||
node = node->GetNext();
|
||||
}
|
||||
return changed;
|
||||
@@ -681,7 +681,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database)
|
||||
// Constraints are output as constraint1 = (...), constraint2 = (...), etc.
|
||||
int constraintNo = 1;
|
||||
wxChar m_constraintNameBuf[20];
|
||||
bool haveConstraints = TRUE;
|
||||
bool haveConstraints = true;
|
||||
|
||||
while (haveConstraints)
|
||||
{
|
||||
@@ -690,7 +690,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database)
|
||||
clause->GetAttributeValue(m_constraintNameBuf, &constraintExpr);
|
||||
if (!constraintExpr)
|
||||
{
|
||||
haveConstraints = FALSE;
|
||||
haveConstraints = false;
|
||||
break;
|
||||
}
|
||||
wxString cName = wxEmptyString;
|
||||
@@ -761,7 +761,7 @@ void wxCompositeShape::MakeContainer()
|
||||
|
||||
division->Move(dc, GetX(), GetY());
|
||||
Recompute();
|
||||
division->Show(TRUE);
|
||||
division->Show(true);
|
||||
}
|
||||
|
||||
wxDivisionShape *wxCompositeShape::OnCreateDivision()
|
||||
@@ -782,11 +782,11 @@ wxShape *wxCompositeShape::FindContainerImage()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Returns TRUE if division is a descendant of this container
|
||||
// Returns true if division is a descendant of this container
|
||||
bool wxCompositeShape::ContainsDivision(wxDivisionShape *division)
|
||||
{
|
||||
if (m_divisions.Member(division))
|
||||
return TRUE;
|
||||
return true;
|
||||
wxNode *node = m_children.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
@@ -795,11 +795,11 @@ bool wxCompositeShape::ContainsDivision(wxDivisionShape *division)
|
||||
{
|
||||
bool ans = ((wxCompositeShape *)child)->ContainsDivision(division);
|
||||
if (ans)
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
node = node->GetNext();
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -812,8 +812,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxDivisionShape, wxCompositeShape)
|
||||
wxDivisionShape::wxDivisionShape()
|
||||
{
|
||||
SetSensitivityFilter(OP_CLICK_LEFT | OP_CLICK_RIGHT | OP_DRAG_RIGHT);
|
||||
SetCentreResize(FALSE);
|
||||
SetAttachmentMode(TRUE);
|
||||
SetCentreResize(false);
|
||||
SetAttachmentMode(true);
|
||||
m_leftSide = NULL;
|
||||
m_rightSide = NULL;
|
||||
m_topSide = NULL;
|
||||
@@ -881,7 +881,7 @@ bool wxDivisionShape::OnMovePre(wxDC& dc, double x, double y, double oldx, doubl
|
||||
object->Move(dc, object->GetX() + diffX, object->GetY() + diffY, display);
|
||||
node = node->GetNext();
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDivisionShape::OnDragLeft(bool draw, double x, double y, int keys, int attachment)
|
||||
@@ -1026,11 +1026,11 @@ void wxDivisionShape::OnRightClick(double x, double y, int keys, int attachment)
|
||||
{
|
||||
if (Selected())
|
||||
{
|
||||
Select(FALSE);
|
||||
Select(false);
|
||||
GetParent()->Draw(dc);
|
||||
}
|
||||
else
|
||||
Select(TRUE);
|
||||
Select(true);
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -1058,7 +1058,7 @@ bool wxDivisionShape::Divide(int direction)
|
||||
double oldWidth = GetWidth();
|
||||
double oldHeight = GetHeight();
|
||||
if (Selected())
|
||||
Select(FALSE);
|
||||
Select(false);
|
||||
|
||||
wxClientDC dc(GetCanvas());
|
||||
GetCanvas()->PrepareDC(dc);
|
||||
@@ -1072,7 +1072,7 @@ bool wxDivisionShape::Divide(int direction)
|
||||
double newXPos2 = GetX();
|
||||
double newYPos2 = (double)(y1 + (3.0*GetHeight()/4.0));
|
||||
wxDivisionShape *newDivision = compositeParent->OnCreateDivision();
|
||||
newDivision->Show(TRUE);
|
||||
newDivision->Show(true);
|
||||
|
||||
Erase(dc);
|
||||
|
||||
@@ -1123,7 +1123,7 @@ bool wxDivisionShape::Divide(int direction)
|
||||
double newXPos2 = (double)(x1 + (3.0*GetWidth()/4.0));
|
||||
double newYPos2 = GetY();
|
||||
wxDivisionShape *newDivision = compositeParent->OnCreateDivision();
|
||||
newDivision->Show(TRUE);
|
||||
newDivision->Show(true);
|
||||
|
||||
Erase(dc);
|
||||
|
||||
@@ -1162,7 +1162,7 @@ bool wxDivisionShape::Divide(int direction)
|
||||
compositeParent->MakeMandatoryControlPoints();
|
||||
}
|
||||
compositeParent->Draw(dc);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Make one control point for every visible line
|
||||
@@ -1295,15 +1295,15 @@ void wxDivisionShape::ResetMandatoryControlPoints()
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust a side, returning FALSE if it's not physically possible.
|
||||
// Adjust a side, returning false if it's not physically possible.
|
||||
bool wxDivisionShape::AdjustLeft(double left, bool test)
|
||||
{
|
||||
double x2 = (double)(GetX() + (GetWidth()/2.0));
|
||||
|
||||
if (left >= x2)
|
||||
return FALSE;
|
||||
return false;
|
||||
if (test)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
double newW = x2 - left;
|
||||
double newX = (double)(left + newW/2.0);
|
||||
@@ -1314,7 +1314,7 @@ bool wxDivisionShape::AdjustLeft(double left, bool test)
|
||||
|
||||
Move(dc, newX, GetY());
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxDivisionShape::AdjustTop(double top, bool test)
|
||||
@@ -1322,9 +1322,9 @@ bool wxDivisionShape::AdjustTop(double top, bool test)
|
||||
double y2 = (double)(GetY() + (GetHeight()/2.0));
|
||||
|
||||
if (top >= y2)
|
||||
return FALSE;
|
||||
return false;
|
||||
if (test)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
double newH = y2 - top;
|
||||
double newY = (double)(top + newH/2.0);
|
||||
@@ -1335,7 +1335,7 @@ bool wxDivisionShape::AdjustTop(double top, bool test)
|
||||
|
||||
Move(dc, GetX(), newY);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxDivisionShape::AdjustRight(double right, bool test)
|
||||
@@ -1343,9 +1343,9 @@ bool wxDivisionShape::AdjustRight(double right, bool test)
|
||||
double x1 = (double)(GetX() - (GetWidth()/2.0));
|
||||
|
||||
if (right <= x1)
|
||||
return FALSE;
|
||||
return false;
|
||||
if (test)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
double newW = right - x1;
|
||||
double newX = (double)(x1 + newW/2.0);
|
||||
@@ -1356,7 +1356,7 @@ bool wxDivisionShape::AdjustRight(double right, bool test)
|
||||
|
||||
Move(dc, newX, GetY());
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxDivisionShape::AdjustBottom(double bottom, bool test)
|
||||
@@ -1364,9 +1364,9 @@ bool wxDivisionShape::AdjustBottom(double bottom, bool test)
|
||||
double y1 = (double)(GetY() - (GetHeight()/2.0));
|
||||
|
||||
if (bottom <= y1)
|
||||
return FALSE;
|
||||
return false;
|
||||
if (test)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
double newH = bottom - y1;
|
||||
double newY = (double)(y1 + newH/2.0);
|
||||
@@ -1377,13 +1377,13 @@ bool wxDivisionShape::AdjustBottom(double bottom, bool test)
|
||||
|
||||
Move(dc, GetX(), newY);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxDivisionControlPoint::wxDivisionControlPoint(wxShapeCanvas *the_canvas, wxShape *object, double size, double the_xoffset, double the_yoffset, int the_type):
|
||||
wxControlPoint(the_canvas, object, size, the_xoffset, the_yoffset, the_type)
|
||||
{
|
||||
SetEraseObject(FALSE);
|
||||
SetEraseObject(false);
|
||||
}
|
||||
|
||||
wxDivisionControlPoint::~wxDivisionControlPoint()
|
||||
@@ -1434,51 +1434,51 @@ void wxDivisionControlPoint::OnEndDragLeft(double x, double y, int keys, int att
|
||||
double dx2 = (double)(division->GetX() + (division->GetWidth()/2.0));
|
||||
double dy2 = (double)(division->GetY() + (division->GetHeight()/2.0));
|
||||
|
||||
bool success = TRUE;
|
||||
bool success = true;
|
||||
switch (division->GetHandleSide())
|
||||
{
|
||||
case DIVISION_SIDE_LEFT:
|
||||
{
|
||||
if ((x <= x1) || (x >= x2) || (x >= dx2))
|
||||
success = FALSE;
|
||||
success = false;
|
||||
// Try it out first...
|
||||
else if (!division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, TRUE))
|
||||
success = FALSE;
|
||||
else if (!division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, true))
|
||||
success = false;
|
||||
else
|
||||
division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, FALSE);
|
||||
division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, false);
|
||||
|
||||
break;
|
||||
}
|
||||
case DIVISION_SIDE_TOP:
|
||||
{
|
||||
if ((y <= y1) || (y >= y2) || (y >= dy2))
|
||||
success = FALSE;
|
||||
else if (!division->ResizeAdjoining(DIVISION_SIDE_TOP, y, TRUE))
|
||||
success = FALSE;
|
||||
success = false;
|
||||
else if (!division->ResizeAdjoining(DIVISION_SIDE_TOP, y, true))
|
||||
success = false;
|
||||
else
|
||||
division->ResizeAdjoining(DIVISION_SIDE_TOP, y, FALSE);
|
||||
division->ResizeAdjoining(DIVISION_SIDE_TOP, y, false);
|
||||
|
||||
break;
|
||||
}
|
||||
case DIVISION_SIDE_RIGHT:
|
||||
{
|
||||
if ((x <= x1) || (x >= x2) || (x <= dx1))
|
||||
success = FALSE;
|
||||
else if (!division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, TRUE))
|
||||
success = FALSE;
|
||||
success = false;
|
||||
else if (!division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, true))
|
||||
success = false;
|
||||
else
|
||||
division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, FALSE);
|
||||
division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, false);
|
||||
|
||||
break;
|
||||
}
|
||||
case DIVISION_SIDE_BOTTOM:
|
||||
{
|
||||
if ((y <= y1) || (y >= y2) || (y <= dy1))
|
||||
success = FALSE;
|
||||
else if (!division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, TRUE))
|
||||
success = FALSE;
|
||||
success = false;
|
||||
else if (!division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, true))
|
||||
success = false;
|
||||
else
|
||||
division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, FALSE);
|
||||
division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, false);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1518,7 +1518,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test)
|
||||
{
|
||||
bool success = division->AdjustRight(newPos, test);
|
||||
if (!success && test)
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1528,7 +1528,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test)
|
||||
{
|
||||
bool success = division->AdjustBottom(newPos, test);
|
||||
if (!success && test)
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1538,7 +1538,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test)
|
||||
{
|
||||
bool success = division->AdjustLeft(newPos, test);
|
||||
if (!success && test)
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1548,7 +1548,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test)
|
||||
{
|
||||
bool success = division->AdjustTop(newPos, test);
|
||||
if (!success && test)
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1558,7 +1558,7 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test)
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1694,7 +1694,7 @@ void wxDivisionShape::EditEdge(int WXUNUSED(side))
|
||||
dialog->Centre(wxBOTH);
|
||||
|
||||
wxEndBusyCursor();
|
||||
dialog->Show(TRUE);
|
||||
dialog->Show(true);
|
||||
|
||||
int lineStyle = wxSOLID;
|
||||
if (*pStyle)
|
||||
@@ -1732,13 +1732,13 @@ void wxDivisionShape::PopupMenu(double x, double y)
|
||||
|
||||
oglPopupDivisionMenu->SetClientData((void *)this);
|
||||
if (m_leftSide)
|
||||
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_LEFT_EDGE, TRUE);
|
||||
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_LEFT_EDGE, true);
|
||||
else
|
||||
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_LEFT_EDGE, FALSE);
|
||||
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_LEFT_EDGE, false);
|
||||
if (m_topSide)
|
||||
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, TRUE);
|
||||
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, true);
|
||||
else
|
||||
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, FALSE);
|
||||
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, false);
|
||||
|
||||
int x1, y1;
|
||||
m_canvas->GetViewStart(&x1, &y1);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -160,7 +160,7 @@ bool wxOGLConstraint::Equals(double a, double b)
|
||||
return eq;
|
||||
}
|
||||
|
||||
// Return TRUE if anything changed
|
||||
// Return true if anything changed
|
||||
bool wxOGLConstraint::Evaluate()
|
||||
{
|
||||
double maxWidth, maxHeight, minWidth, minHeight, x, y;
|
||||
@@ -204,7 +204,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
|
||||
// Now position the objects
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
@@ -214,8 +214,8 @@ bool wxOGLConstraint::Evaluate()
|
||||
startY += (double)(spacingY + (height2/2.0));
|
||||
if (!Equals(startY, constrainedObject->GetY()))
|
||||
{
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), startY, FALSE);
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), startY, false);
|
||||
changed = true;
|
||||
}
|
||||
startY += (double)(height2/2.0);
|
||||
node = node->GetNext();
|
||||
@@ -252,7 +252,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
|
||||
// Now position the objects
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
@@ -262,8 +262,8 @@ bool wxOGLConstraint::Evaluate()
|
||||
startX += (double)(spacingX + (width2/2.0));
|
||||
if (!Equals(startX, constrainedObject->GetX()))
|
||||
{
|
||||
constrainedObject->Move(dc, startX, constrainedObject->GetY(), FALSE);
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, startX, constrainedObject->GetY(), false);
|
||||
changed = true;
|
||||
}
|
||||
startX += (double)(width2/2.0);
|
||||
node = node->GetNext();
|
||||
@@ -318,7 +318,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
|
||||
// Now position the objects
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
@@ -329,10 +329,10 @@ bool wxOGLConstraint::Evaluate()
|
||||
startY += (double)(spacingY + (height2/2.0));
|
||||
|
||||
if ((!Equals(startX, constrainedObject->GetX())) || (!Equals(startY, constrainedObject->GetY())))
|
||||
{
|
||||
constrainedObject->Move(dc, startX, startY, FALSE);
|
||||
changed = TRUE;
|
||||
}
|
||||
{
|
||||
constrainedObject->Move(dc, startX, startY, false);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
startX += (double)(width2/2.0);
|
||||
startY += (double)(height2/2.0);
|
||||
@@ -343,7 +343,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
case gyCONSTRAINT_LEFT_OF:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -355,10 +355,10 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double x3 = (double)(x - (minWidth/2.0) - (width2/2.0) - m_xSpacing);
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
@@ -366,7 +366,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
case gyCONSTRAINT_RIGHT_OF:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -378,10 +378,10 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double x3 = (double)(x + (minWidth/2.0) + (width2/2.0) + m_xSpacing);
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
@@ -389,7 +389,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
case gyCONSTRAINT_ABOVE:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -401,10 +401,10 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double y3 = (double)(y - (minHeight/2.0) - (height2/2.0) - m_ySpacing);
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
@@ -412,7 +412,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
case gyCONSTRAINT_BELOW:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -424,10 +424,10 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double y3 = (double)(y + (minHeight/2.0) + (height2/2.0) + m_ySpacing);
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
@@ -435,7 +435,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
case gyCONSTRAINT_ALIGNED_LEFT:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -447,10 +447,10 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double x3 = (double)(x - (minWidth/2.0) + (width2/2.0) + m_xSpacing);
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
@@ -458,7 +458,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
case gyCONSTRAINT_ALIGNED_RIGHT:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -470,22 +470,22 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double x3 = (double)(x + (minWidth/2.0) - (width2/2.0) - m_xSpacing);
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
return changed;
|
||||
#if 0
|
||||
// two returned values ?
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
case gyCONSTRAINT_ALIGNED_TOP:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -497,10 +497,10 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double y3 = (double)(y - (minHeight/2.0) + (height2/2.0) + m_ySpacing);
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
@@ -508,7 +508,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
case gyCONSTRAINT_ALIGNED_BOTTOM:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -520,10 +520,10 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double y3 = (double)(y + (minHeight/2.0) - (height2/2.0) - m_ySpacing);
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
@@ -531,7 +531,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
case gyCONSTRAINT_MIDALIGNED_LEFT:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -540,10 +540,10 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double x3 = (double)(x - (minWidth/2.0));
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
@@ -551,7 +551,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
case gyCONSTRAINT_MIDALIGNED_RIGHT:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -560,22 +560,22 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double x3 = (double)(x + (minWidth/2.0));
|
||||
if (!Equals(x3, constrainedObject->GetX()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
return changed;
|
||||
#if 0
|
||||
// two returned values ?
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
case gyCONSTRAINT_MIDALIGNED_TOP:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -584,10 +584,10 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double y3 = (double)(y - (minHeight/2.0));
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
@@ -595,7 +595,7 @@ bool wxOGLConstraint::Evaluate()
|
||||
}
|
||||
case gyCONSTRAINT_MIDALIGNED_BOTTOM:
|
||||
{
|
||||
bool changed = FALSE;
|
||||
bool changed = false;
|
||||
|
||||
wxNode *node = m_constrainedObjects.GetFirst();
|
||||
while (node)
|
||||
@@ -604,10 +604,10 @@ bool wxOGLConstraint::Evaluate()
|
||||
|
||||
double y3 = (double)(y + (minHeight/2.0));
|
||||
if (!Equals(y3, constrainedObject->GetY()))
|
||||
{
|
||||
changed = TRUE;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
|
||||
}
|
||||
{
|
||||
changed = true;
|
||||
constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
@@ -616,9 +616,9 @@ bool wxOGLConstraint::Evaluate()
|
||||
#if 0
|
||||
// default value handled in main function body
|
||||
default:
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -93,7 +93,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc)
|
||||
if (!formatted)
|
||||
{
|
||||
FormatRegionText();
|
||||
formatted = TRUE;
|
||||
formatted = true;
|
||||
}
|
||||
*/
|
||||
if (GetDisableLabel()) return;
|
||||
@@ -285,10 +285,10 @@ bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
{
|
||||
*x = m_xpos;
|
||||
*y = m_ypos;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int wxDividedShape::GetNumberOfAttachments() const
|
||||
@@ -317,9 +317,9 @@ bool wxDividedShape::AttachmentIsValid(int attachment) const
|
||||
return wxShape::AttachmentIsValid(attachment);
|
||||
}
|
||||
else if (attachment >= 0)
|
||||
return TRUE;
|
||||
return true;
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxDividedShape::Copy(wxShape& copy)
|
||||
@@ -524,7 +524,7 @@ void wxDividedShape::EditRegions()
|
||||
|
||||
wxEndBusyCursor();
|
||||
|
||||
dialog->Show(TRUE);
|
||||
dialog->Show(true);
|
||||
|
||||
node = GetRegions().GetFirst();
|
||||
i = 0;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -51,7 +51,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDrawnShape, wxRectangleShape)
|
||||
|
||||
wxDrawnShape::wxDrawnShape():wxRectangleShape(100.0, 50.0)
|
||||
{
|
||||
m_saveToFile = TRUE;
|
||||
m_saveToFile = true;
|
||||
m_currentAngle = oglDRAWN_ANGLE_0;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ bool wxDrawnShape::GetPerimeterPoint(double x1, double y1,
|
||||
wxDrawOp* op = (wxDrawOp*) node->GetData();
|
||||
|
||||
if (op->GetPerimeterPoint(x1, y1, x2, y2, x3, y3, GetX(), GetY(), GetAttachmentMode()))
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Default... just use a rectangle
|
||||
@@ -815,10 +815,10 @@ void wxOpDraw::Rotate(double x, double y, double theta, double sinTheta, double
|
||||
double newX2 = m_x2*cosTheta - m_y2*sinTheta + x*(1.0 - cosTheta) + y*sinTheta;
|
||||
double newY2 = m_x2*sinTheta + m_y2*cosTheta + y*(1.0 - cosTheta) + x*sinTheta;
|
||||
|
||||
m_x1 = newX1;
|
||||
m_y1 = newY1;
|
||||
m_x2 = newX2;
|
||||
m_y2 = newY2;
|
||||
m_x1 = newX1;
|
||||
m_y1 = newY1;
|
||||
m_x2 = newX2;
|
||||
m_y2 = newY2;
|
||||
break;
|
||||
}
|
||||
case DRAWOP_DRAW_RECT:
|
||||
@@ -861,12 +861,12 @@ void wxOpDraw::Rotate(double x, double y, double theta, double sinTheta, double
|
||||
double newX3 = m_x3*cosTheta - m_y3*sinTheta + x*(1.0 - cosTheta) + y*sinTheta;
|
||||
double newY3 = m_x3*sinTheta + m_y3*cosTheta + y*(1.0 - cosTheta) + x*sinTheta;
|
||||
|
||||
m_x1 = newX1;
|
||||
m_y1 = newY1;
|
||||
m_x2 = newX2;
|
||||
m_y2 = newY2;
|
||||
m_x3 = newX3;
|
||||
m_y3 = newY3;
|
||||
m_x1 = newX1;
|
||||
m_y1 = newY1;
|
||||
m_x2 = newX2;
|
||||
m_y2 = newY2;
|
||||
m_x3 = newX3;
|
||||
m_y3 = newY3;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1209,7 +1209,7 @@ bool wxOpPolyDraw::OnDrawOutline(wxDC& dc, double x, double y, double w, double
|
||||
}
|
||||
dc.DrawPolygon(n, intPoints, (long) x, (long) y);
|
||||
delete[] intPoints;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Assume (x1, y1) is centre of box (most generally, line end at box)
|
||||
@@ -1239,13 +1239,13 @@ bool wxOpPolyDraw::GetPerimeterPoint(double x1, double y1,
|
||||
{
|
||||
*x3 = point->x + xOffset;
|
||||
*y3 = point->y + yOffset;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if ((y2 < y1) && (point->y < 0.0))
|
||||
{
|
||||
*x3 = point->x + xOffset;
|
||||
*y3 = point->y + yOffset;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1267,7 +1267,7 @@ bool wxOpPolyDraw::GetPerimeterPoint(double x1, double y1,
|
||||
delete[] xpoints;
|
||||
delete[] ypoints;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1363,7 +1363,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPseudoMetaFile, wxObject)
|
||||
wxPseudoMetaFile::wxPseudoMetaFile()
|
||||
{
|
||||
m_currentRotation = 0;
|
||||
m_rotateable = TRUE;
|
||||
m_rotateable = true;
|
||||
m_width = 0.0;
|
||||
m_height = 0.0;
|
||||
m_outlinePen = NULL;
|
||||
@@ -1602,7 +1602,7 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
|
||||
// Read GDI objects
|
||||
wxChar buf[50];
|
||||
int i = 1;
|
||||
bool keepGoing = TRUE;
|
||||
bool keepGoing = true;
|
||||
while (keepGoing)
|
||||
{
|
||||
wxSprintf(buf, _T("gdi%d_%d"), whichAngle, i);
|
||||
@@ -1610,7 +1610,7 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
|
||||
clause->GetAttributeValue(buf, &expr);
|
||||
if (!expr)
|
||||
{
|
||||
keepGoing = FALSE;
|
||||
keepGoing = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1667,7 +1667,7 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
|
||||
}
|
||||
|
||||
// Now read in the operations
|
||||
keepGoing = TRUE;
|
||||
keepGoing = true;
|
||||
i = 1;
|
||||
while (keepGoing)
|
||||
{
|
||||
@@ -1676,7 +1676,7 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
|
||||
clause->GetAttributeValue(buf, &expr);
|
||||
if (!expr)
|
||||
{
|
||||
keepGoing = FALSE;
|
||||
keepGoing = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1821,14 +1821,14 @@ void wxPseudoMetaFile::Copy(wxPseudoMetaFile& copy)
|
||||
bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth, double *rheight)
|
||||
{
|
||||
if (!wxFileExists(filename))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
wxXMetaFile *metaFile = new wxXMetaFile;
|
||||
|
||||
if (!metaFile->ReadFile(filename))
|
||||
{
|
||||
delete metaFile;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
double lastX = 0.0;
|
||||
@@ -2165,7 +2165,7 @@ bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth
|
||||
m_height = *rheight;
|
||||
|
||||
delete metaFile;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Scale to fit size
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -45,7 +45,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxLineShape, wxShape)
|
||||
wxLineShape::wxLineShape()
|
||||
{
|
||||
m_sensitivity = OP_CLICK_LEFT | OP_CLICK_RIGHT;
|
||||
m_draggable = FALSE;
|
||||
m_draggable = false;
|
||||
m_attachmentTo = 0;
|
||||
m_attachmentFrom = 0;
|
||||
/*
|
||||
@@ -54,11 +54,11 @@ wxLineShape::wxLineShape()
|
||||
*/
|
||||
m_from = NULL;
|
||||
m_to = NULL;
|
||||
m_erasing = FALSE;
|
||||
m_erasing = false;
|
||||
m_arrowSpacing = 5.0; // For the moment, don't bother saving this to file.
|
||||
m_ignoreArrowOffsets = FALSE;
|
||||
m_isSpline = FALSE;
|
||||
m_maintainStraightLines = FALSE;
|
||||
m_ignoreArrowOffsets = false;
|
||||
m_isSpline = false;
|
||||
m_maintainStraightLines = false;
|
||||
m_alignmentStart = 0;
|
||||
m_alignmentEnd = 0;
|
||||
|
||||
@@ -97,7 +97,7 @@ wxLineShape::~wxLineShape()
|
||||
{
|
||||
if (m_labelObjects[i])
|
||||
{
|
||||
m_labelObjects[i]->Select(FALSE);
|
||||
m_labelObjects[i]->Select(false);
|
||||
m_labelObjects[i]->RemoveFromCanvas(m_canvas);
|
||||
delete m_labelObjects[i];
|
||||
m_labelObjects[i] = NULL;
|
||||
@@ -144,7 +144,7 @@ wxNode *wxLineShape::InsertLineControlPoint(wxDC* dc)
|
||||
bool wxLineShape::DeleteLineControlPoint()
|
||||
{
|
||||
if (m_lineControlPoints->GetCount() < 3)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
wxNode *last = m_lineControlPoints->GetLast();
|
||||
wxNode *second_last = last->GetPrevious();
|
||||
@@ -153,7 +153,7 @@ bool wxLineShape::DeleteLineControlPoint()
|
||||
delete second_last_point;
|
||||
delete second_last;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxLineShape::Initialise()
|
||||
@@ -242,7 +242,7 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i)
|
||||
EraseRegion(dc, region, xx, yy);
|
||||
if (m_labelObjects[i])
|
||||
{
|
||||
m_labelObjects[i]->Select(FALSE, &dc);
|
||||
m_labelObjects[i]->Select(false, &dc);
|
||||
m_labelObjects[i]->Erase(dc);
|
||||
m_labelObjects[i]->SetSize(actualW, actualH);
|
||||
}
|
||||
@@ -251,13 +251,13 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i)
|
||||
|
||||
if (m_labelObjects[i])
|
||||
{
|
||||
m_labelObjects[i]->Select(TRUE, & dc);
|
||||
m_labelObjects[i]->Select(true, & dc);
|
||||
m_labelObjects[i]->Draw(dc);
|
||||
}
|
||||
}
|
||||
}
|
||||
oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, actualW, actualH, region->GetFormatMode());
|
||||
m_formatted = TRUE;
|
||||
m_formatted = true;
|
||||
}
|
||||
|
||||
void wxLineShape::DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y)
|
||||
@@ -464,10 +464,10 @@ void wxLineShape::SetAttachments(int from_attach, int to_attach)
|
||||
bool wxLineShape::HitTest(double x, double y, int *attachment, double *distance)
|
||||
{
|
||||
if (!m_lineControlPoints)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// Look at label regions in case mouse is over a label
|
||||
bool inLabelRegion = FALSE;
|
||||
bool inLabelRegion = false;
|
||||
for (int i = 0; i < 3; i ++)
|
||||
{
|
||||
wxNode *regionNode = m_regions.Item(i);
|
||||
@@ -489,7 +489,7 @@ bool wxLineShape::HitTest(double x, double y, int *attachment, double *distance)
|
||||
double rBottom = (double)(cy + (ch/2.0));
|
||||
if (x > rLeft && x < rRight && y > rTop && y < rBottom)
|
||||
{
|
||||
inLabelRegion = TRUE;
|
||||
inLabelRegion = true;
|
||||
i = 3;
|
||||
}
|
||||
}
|
||||
@@ -520,12 +520,12 @@ bool wxLineShape::HitTest(double x, double y, int *attachment, double *distance)
|
||||
{
|
||||
*attachment = 0;
|
||||
*distance = distance_from_seg;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxLineShape::DrawArrows(wxDC& dc)
|
||||
@@ -545,10 +545,10 @@ void wxLineShape::DrawArrows(wxDC& dc)
|
||||
{
|
||||
if ((arrow->GetXOffset() != 0.0) && !m_ignoreArrowOffsets)
|
||||
// If specified, x offset is proportional to line length
|
||||
DrawArrow(dc, arrow, arrow->GetXOffset(), TRUE);
|
||||
DrawArrow(dc, arrow, arrow->GetXOffset(), true);
|
||||
else
|
||||
{
|
||||
DrawArrow(dc, arrow, startArrowPos, FALSE); // Absolute distance
|
||||
DrawArrow(dc, arrow, startArrowPos, false); // Absolute distance
|
||||
startArrowPos += arrow->GetSize() + arrow->GetSpacing();
|
||||
}
|
||||
break;
|
||||
@@ -556,10 +556,10 @@ void wxLineShape::DrawArrows(wxDC& dc)
|
||||
case ARROW_POSITION_END:
|
||||
{
|
||||
if ((arrow->GetXOffset() != 0.0) && !m_ignoreArrowOffsets)
|
||||
DrawArrow(dc, arrow, arrow->GetXOffset(), TRUE);
|
||||
DrawArrow(dc, arrow, arrow->GetXOffset(), true);
|
||||
else
|
||||
{
|
||||
DrawArrow(dc, arrow, endArrowPos, FALSE);
|
||||
DrawArrow(dc, arrow, endArrowPos, false);
|
||||
endArrowPos += arrow->GetSize() + arrow->GetSpacing();
|
||||
}
|
||||
break;
|
||||
@@ -568,10 +568,10 @@ void wxLineShape::DrawArrows(wxDC& dc)
|
||||
{
|
||||
arrow->SetXOffset(middleArrowPos);
|
||||
if ((arrow->GetXOffset() != 0.0) && !m_ignoreArrowOffsets)
|
||||
DrawArrow(dc, arrow, arrow->GetXOffset(), TRUE);
|
||||
DrawArrow(dc, arrow, arrow->GetXOffset(), true);
|
||||
else
|
||||
{
|
||||
DrawArrow(dc, arrow, middleArrowPos, FALSE);
|
||||
DrawArrow(dc, arrow, middleArrowPos, false);
|
||||
middleArrowPos += arrow->GetSize() + arrow->GetSpacing();
|
||||
}
|
||||
break;
|
||||
@@ -879,10 +879,10 @@ void wxLineShape::OnErase(wxDC& dc)
|
||||
}
|
||||
else
|
||||
{
|
||||
m_erasing = TRUE;
|
||||
m_erasing = true;
|
||||
GetEventHandler()->OnDraw(dc);
|
||||
GetEventHandler()->OnEraseControlPoints(dc);
|
||||
m_erasing = FALSE;
|
||||
m_erasing = false;
|
||||
}
|
||||
|
||||
if (old_pen) SetPen(old_pen);
|
||||
@@ -1018,7 +1018,7 @@ bool wxLineShape::OnMovePre(wxDC& dc, double x, double y, double old_x, double o
|
||||
m_labelObjects[i]->Move(dc, xp+xr, yp+yr);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints)
|
||||
@@ -1109,7 +1109,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d
|
||||
if (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE)
|
||||
{
|
||||
int nth, no_arcs;
|
||||
FindNth(m_from, &nth, &no_arcs, FALSE); // Not incoming
|
||||
FindNth(m_from, &nth, &no_arcs, false); // Not incoming
|
||||
m_from->GetAttachmentPosition(m_attachmentFrom, &end_x, &end_y, nth, no_arcs, this);
|
||||
}
|
||||
else
|
||||
@@ -1120,7 +1120,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d
|
||||
if (m_to->GetAttachmentMode() != ATTACHMENT_MODE_NONE)
|
||||
{
|
||||
int nth, no_arcs;
|
||||
FindNth(m_to, &nth, &no_arcs, TRUE); // Incoming
|
||||
FindNth(m_to, &nth, &no_arcs, true); // Incoming
|
||||
m_to->GetAttachmentPosition(m_attachmentTo, &other_end_x, &other_end_y, nth, no_arcs, this);
|
||||
}
|
||||
else
|
||||
@@ -1138,7 +1138,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d
|
||||
if (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE)
|
||||
{
|
||||
int nth, no_arcs;
|
||||
FindNth(m_from, &nth, &no_arcs, FALSE);
|
||||
FindNth(m_from, &nth, &no_arcs, false);
|
||||
m_from->GetAttachmentPosition(m_attachmentFrom, &end_x, &end_y, nth, no_arcs, this);
|
||||
fromX = end_x;
|
||||
fromY = end_y;
|
||||
@@ -1147,7 +1147,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d
|
||||
if (m_to->GetAttachmentMode() != ATTACHMENT_MODE_NONE)
|
||||
{
|
||||
int nth, no_arcs;
|
||||
FindNth(m_to, &nth, &no_arcs, TRUE);
|
||||
FindNth(m_to, &nth, &no_arcs, true);
|
||||
m_to->GetAttachmentPosition(m_attachmentTo, &other_end_x, &other_end_y, nth, no_arcs, this);
|
||||
toX = other_end_x;
|
||||
toY = other_end_y;
|
||||
@@ -1652,16 +1652,16 @@ void wxLineShape::Select(bool select, wxDC* dc)
|
||||
GetLabelPosition(i, &xx, &yy);
|
||||
if (m_labelObjects[i])
|
||||
{
|
||||
m_labelObjects[i]->Select(FALSE);
|
||||
m_labelObjects[i]->Select(false);
|
||||
m_labelObjects[i]->RemoveFromCanvas(m_canvas);
|
||||
delete m_labelObjects[i];
|
||||
}
|
||||
m_labelObjects[i] = OnCreateLabelShape(this, region, w, h);
|
||||
m_labelObjects[i]->AddToCanvas(m_canvas);
|
||||
m_labelObjects[i]->Show(TRUE);
|
||||
m_labelObjects[i]->Show(true);
|
||||
if (dc)
|
||||
m_labelObjects[i]->Move(*dc, (double)(x + xx), (double)(y + yy));
|
||||
m_labelObjects[i]->Select(TRUE, dc);
|
||||
m_labelObjects[i]->Select(true, dc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1672,7 +1672,7 @@ void wxLineShape::Select(bool select, wxDC* dc)
|
||||
{
|
||||
if (m_labelObjects[i])
|
||||
{
|
||||
m_labelObjects[i]->Select(FALSE, dc);
|
||||
m_labelObjects[i]->Select(false, dc);
|
||||
m_labelObjects[i]->Erase(*dc);
|
||||
m_labelObjects[i]->RemoveFromCanvas(m_canvas);
|
||||
delete m_labelObjects[i];
|
||||
@@ -1754,7 +1754,7 @@ void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), doub
|
||||
lineShape->SetPen(& dottedPen);
|
||||
lineShape->SetBrush(wxTRANSPARENT_BRUSH);
|
||||
|
||||
lineShape->GetEventHandler()->OnMoveLink(dc, FALSE);
|
||||
lineShape->GetEventHandler()->OnMoveLink(dc, false);
|
||||
|
||||
lineShape->SetPen(old_pen);
|
||||
lineShape->SetBrush(old_brush);
|
||||
@@ -1789,7 +1789,7 @@ void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y,
|
||||
lineShape->GetTo()->OnDraw(dc);
|
||||
lineShape->GetTo()->OnDrawContents(dc);
|
||||
|
||||
this->SetDisableLabel(TRUE);
|
||||
this->SetDisableLabel(true);
|
||||
dc.SetLogicalFunction(OGLRBLF);
|
||||
|
||||
lpt->m_xpos = x; lpt->m_ypos = y;
|
||||
@@ -1802,7 +1802,7 @@ void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y,
|
||||
lineShape->SetPen(& dottedPen);
|
||||
lineShape->SetBrush(wxTRANSPARENT_BRUSH);
|
||||
|
||||
lineShape->GetEventHandler()->OnMoveLink(dc, FALSE);
|
||||
lineShape->GetEventHandler()->OnMoveLink(dc, false);
|
||||
|
||||
lineShape->SetPen(old_pen);
|
||||
lineShape->SetBrush(old_brush);
|
||||
@@ -1822,7 +1822,7 @@ void wxLineShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, in
|
||||
wxClientDC dc(GetCanvas());
|
||||
GetCanvas()->PrepareDC(dc);
|
||||
|
||||
this->SetDisableLabel(FALSE);
|
||||
this->SetDisableLabel(false);
|
||||
wxLineShape *lineShape = (wxLineShape *)this;
|
||||
|
||||
if (lpt->m_type == CONTROL_POINT_LINE)
|
||||
@@ -1891,7 +1891,7 @@ bool wxLineShape::OnMoveMiddleControlPoint(wxDC& dc, wxLineControlPoint* lpt, co
|
||||
|
||||
GetEventHandler()->OnMoveLink(dc);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Implement movement of endpoint to a new attachment
|
||||
@@ -2023,7 +2023,7 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int
|
||||
wxNode *refNode = referenceList.GetFirst();
|
||||
wxNode *currNode = m_arcArrows.GetFirst();
|
||||
wxString targetName(arrow->GetName());
|
||||
if (!refNode) return FALSE;
|
||||
if (!refNode) return false;
|
||||
|
||||
// First check whether we need to insert in front of list,
|
||||
// because this arrowhead is the first in the reference
|
||||
@@ -2032,7 +2032,7 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int
|
||||
if (refArrow->GetName() == targetName)
|
||||
{
|
||||
m_arcArrows.Insert(arrow);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData();
|
||||
@@ -2057,12 +2057,12 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int
|
||||
m_arcArrows.Insert(currNode, arrow);
|
||||
else
|
||||
m_arcArrows.Append(arrow);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
refNode = refNode->GetNext();
|
||||
}
|
||||
m_arcArrows.Append(arrow);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxLineShape::ClearArrowsAtPosition(int end)
|
||||
@@ -2122,11 +2122,11 @@ bool wxLineShape::ClearArrow(const wxString& name)
|
||||
{
|
||||
delete arrow;
|
||||
delete node;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
node = node->GetNext();
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2177,11 +2177,11 @@ bool wxLineShape::DeleteArrowHead(int position, const wxString& name)
|
||||
{
|
||||
delete arrow;
|
||||
delete node;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
node = node->GetNext();
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Overloaded DeleteArrowHead: pass arrowhead id.
|
||||
@@ -2195,11 +2195,11 @@ bool wxLineShape::DeleteArrowHead(long id)
|
||||
{
|
||||
delete arrow;
|
||||
delete node;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
node = node->GetNext();
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2331,7 +2331,7 @@ wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject)
|
||||
return (wxRealPoint *)node->GetData();
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2496,7 +2496,7 @@ bool wxLineShape::OnLabelMovePre(wxDC& dc, wxLabelShape* labelShape, double x, d
|
||||
labelShape->FormatText(dc, s, i);
|
||||
DrawRegion(dc, labelShape->m_shapeRegion, xx, yy);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Divert left and right clicks to line object
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -67,20 +67,20 @@ static long getint(FILE *fp)
|
||||
c = getc(fp); c1 = getc(fp); c2 = getc(fp); c3 = getc(fp);
|
||||
long res = (long)((long) c) +
|
||||
(((long) c1) << 8) +
|
||||
(((long) c2) << 16) +
|
||||
(((long) c3) << 24);
|
||||
(((long) c2) << 16) +
|
||||
(((long) c3) << 24);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/* Placeable metafile header
|
||||
struct mfPLACEABLEHEADER {
|
||||
DWORD key; // 32-bit
|
||||
HANDLE hmf; // 16-bit
|
||||
RECT bbox; // 4x16 bit
|
||||
WORD inch; // 16-bit
|
||||
DWORD reserved; // 32-bit
|
||||
WORD checksum; // 16-bit
|
||||
DWORD key; // 32-bit
|
||||
HANDLE hmf; // 16-bit
|
||||
RECT bbox; // 4x16 bit
|
||||
WORD inch; // 16-bit
|
||||
DWORD reserved; // 32-bit
|
||||
WORD checksum; // 16-bit
|
||||
};
|
||||
*/
|
||||
|
||||
@@ -92,7 +92,7 @@ wxMetaRecord::~wxMetaRecord(void)
|
||||
|
||||
wxXMetaFile::wxXMetaFile(const wxChar *file)
|
||||
{
|
||||
ok = FALSE;
|
||||
ok = false;
|
||||
top = 0.0;
|
||||
bottom = 0.0;
|
||||
left = 0.0;
|
||||
@@ -159,7 +159,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
|
||||
HandleTableSize = 0;
|
||||
|
||||
FILE *handle = wxFopen(file, wxT("rb"));
|
||||
if (!handle) return FALSE;
|
||||
if (!handle) return false;
|
||||
|
||||
// Read placeable metafile header, if any
|
||||
long key = getint(handle);
|
||||
@@ -196,7 +196,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
|
||||
if (mtType != 1 && mtType != 2)
|
||||
{
|
||||
fclose(handle);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* int mtHeaderSize = */ getshort(handle);
|
||||
@@ -205,7 +205,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
|
||||
if (mtVersion != 0x0300 && mtVersion != 0x0100)
|
||||
{
|
||||
fclose(handle);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* long mtSize = */ getint(handle);
|
||||
@@ -723,7 +723,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file)
|
||||
}
|
||||
}
|
||||
fclose(handle);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxXMetaFile::~wxXMetaFile(void)
|
||||
@@ -741,7 +741,7 @@ wxXMetaFile::~wxXMetaFile(void)
|
||||
|
||||
bool wxXMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height))
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxXMetaFile::Play(wxDC *dc)
|
||||
@@ -1082,6 +1082,6 @@ bool wxXMetaFile::Play(wxDC *dc)
|
||||
}
|
||||
node = node->GetNext();
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -45,8 +45,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxDiagram, wxObject)
|
||||
wxDiagram::wxDiagram()
|
||||
{
|
||||
m_diagramCanvas = NULL;
|
||||
m_quickEditMode = FALSE;
|
||||
m_snapToGrid = TRUE;
|
||||
m_quickEditMode = false;
|
||||
m_snapToGrid = true;
|
||||
m_gridSpacing = 5.0;
|
||||
m_shapeList = new wxList;
|
||||
m_mouseTolerance = DEFAULT_MOUSE_TOLERANCE;
|
||||
@@ -250,7 +250,7 @@ bool wxDiagram::SaveFile(const wxString& filename)
|
||||
{
|
||||
wxEndBusyCursor();
|
||||
delete database;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
database->Write(file);
|
||||
@@ -285,7 +285,7 @@ bool wxDiagram::SaveFile(const wxString& filename)
|
||||
}
|
||||
|
||||
wxEndBusyCursor();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxDiagram::LoadFile(const wxString& filename)
|
||||
@@ -296,7 +296,7 @@ bool wxDiagram::LoadFile(const wxString& filename)
|
||||
if (!database.Read(filename))
|
||||
{
|
||||
wxEndBusyCursor();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
DeleteAllShapes();
|
||||
@@ -326,7 +326,7 @@ bool wxDiagram::LoadFile(const wxString& filename)
|
||||
|
||||
wxEndBusyCursor();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDiagram::ReadNodes(wxExprDatabase& database)
|
||||
@@ -348,7 +348,7 @@ void wxDiagram::ReadNodes(wxExprDatabase& database)
|
||||
OnShapeLoad(database, *shape, *clause);
|
||||
|
||||
shape->SetCanvas(GetCanvas());
|
||||
shape->Show(TRUE);
|
||||
shape->Show(true);
|
||||
|
||||
m_shapeList->Append(shape);
|
||||
|
||||
@@ -389,7 +389,7 @@ void wxDiagram::ReadLines(wxExprDatabase& database)
|
||||
if (classInfo)
|
||||
{
|
||||
wxLineShape *shape = (wxLineShape *)classInfo->CreateObject();
|
||||
shape->Show(TRUE);
|
||||
shape->Show(true);
|
||||
|
||||
OnShapeLoad(database, *shape, *clause);
|
||||
shape->SetCanvas(GetCanvas());
|
||||
@@ -519,12 +519,12 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database)
|
||||
// Allow for modifying file
|
||||
bool wxDiagram::OnDatabaseLoad(wxExprDatabase& WXUNUSED(db))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxDiagram::OnDatabaseSave(wxExprDatabase& WXUNUSED(db))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
@@ -544,23 +544,23 @@ bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxDiagram::OnShapeLoad(wxExprDatabase& WXUNUSED(db), wxShape& shape, wxExpr& expr)
|
||||
{
|
||||
shape.ReadAttributes(&expr);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxDiagram::OnHeaderSave(wxExprDatabase& WXUNUSED(db), wxExpr& WXUNUSED(expr))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxDiagram::OnHeaderLoad(wxExprDatabase& WXUNUSED(db), wxExpr& WXUNUSED(expr))
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Created: 12/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
@@ -384,7 +384,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double
|
||||
// Make new lines into NULL strings at this point
|
||||
int i = 0; int j = 0; int len = text.Length();
|
||||
wxChar word[200]; word[0] = 0;
|
||||
bool end_word = FALSE; bool new_line = FALSE;
|
||||
bool end_word = false; bool new_line = false;
|
||||
while (i < len)
|
||||
{
|
||||
switch (text[i])
|
||||
@@ -397,7 +397,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double
|
||||
else
|
||||
{
|
||||
if (text[i] == wxT('n'))
|
||||
{ new_line = TRUE; end_word = TRUE; i++; }
|
||||
{ new_line = true; end_word = true; i++; }
|
||||
else
|
||||
{ word[j] = wxT('%'); j ++; word[j] = text[i]; j ++; i ++; }
|
||||
}
|
||||
@@ -405,17 +405,17 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double
|
||||
}
|
||||
case 10:
|
||||
{
|
||||
new_line = TRUE; end_word = TRUE; i++;
|
||||
new_line = true; end_word = true; i++;
|
||||
break;
|
||||
}
|
||||
case 13:
|
||||
{
|
||||
new_line = TRUE; end_word = TRUE; i++;
|
||||
new_line = true; end_word = true; i++;
|
||||
break;
|
||||
}
|
||||
case wxT(' '):
|
||||
{
|
||||
end_word = TRUE;
|
||||
end_word = true;
|
||||
i ++;
|
||||
break;
|
||||
}
|
||||
@@ -426,18 +426,18 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == len) end_word = TRUE;
|
||||
if (i == len) end_word = true;
|
||||
if (end_word)
|
||||
{
|
||||
word[j] = 0;
|
||||
j = 0;
|
||||
word_list.Add(word);
|
||||
end_word = FALSE;
|
||||
end_word = false;
|
||||
}
|
||||
if (new_line)
|
||||
{
|
||||
word_list.Append(NULL);
|
||||
new_line = FALSE;
|
||||
new_line = false;
|
||||
}
|
||||
}
|
||||
// Now, make a list of strings which can fit in the box
|
||||
|
||||
Reference in New Issue
Block a user