Updated OGL documentation and tidied up some code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
d6d1892b89
commit
6f5f3ca0fe
@ -2,8 +2,18 @@
|
||||
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
|
||||
\setfooter{\thepage}{}{}{}{}{\thepage}
|
||||
|
||||
Version 3.0, September 8th 1998
|
||||
|
||||
\begin{itemize}\itemsep=0pt
|
||||
\item Version for wxWindows 2.0.
|
||||
\item Various enhancements especially to wxDrawnShape
|
||||
(multiple metafiles, for different orientations).
|
||||
\item More ability to override functions e.g. OnSizeDragLeft, so events can be
|
||||
intercepted for Do/Undo.
|
||||
\end{itemize}
|
||||
|
||||
Version 2.0, June 1st 1996
|
||||
|
||||
\begin{itemize}\itemsep=0pt
|
||||
\item First publically released version.
|
||||
\item First publicly released version.
|
||||
\end{itemize}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -21,8 +21,8 @@ These are the files that comprise the \ogl\ library.
|
||||
\item[basic.h] Header for basic objects such as wxShape and wxRectangleShape.
|
||||
\item[basic.cpp] Basic objects implementation (1).
|
||||
\item[basic2.cpp] Basic objects implementation (2).
|
||||
\item[bitmap.cpp] wxBitmapShape class header.
|
||||
\item[bitmap.cpp] wxBitmapShape implementation.
|
||||
\item[bmpshape.h] wxBitmapShape class header.
|
||||
\item[bmpshape.cpp] wxBitmapShape implementation.
|
||||
\item[canvas.h] wxShapeCanvas class header.
|
||||
\item[canvas.cpp] wxShapeCanvas class implementation.
|
||||
\item[composit.h] Composite object class header.
|
||||
@ -40,6 +40,8 @@ These are the files that comprise the \ogl\ library.
|
||||
\item[misc.cpp] Miscellaneous graphics functions implementation.
|
||||
\item[ogldiag.h] wxDiagram class header.
|
||||
\item[ogldiag.cpp] wxDiagram implementation.
|
||||
\item[mfutils.h] Metafile utilities header.
|
||||
\item[mfutils.cpp] Metafile utilities implementation.
|
||||
\end{description}
|
||||
|
||||
|
||||
|
@ -1,11 +1,19 @@
|
||||
\documentstyle[a4,makeidx,verbatim,texhelp,fancyhea,mysober,mytitle]{report}
|
||||
\newcommand{\ogl}[0]{{OGL}}
|
||||
\newcommand{\ogl}[0]{{OGL}}%
|
||||
\definecolour{black}{0}{0}{0}%
|
||||
\definecolour{cyan}{0}{255}{255}%
|
||||
\definecolour{green}{0}{255}{0}%
|
||||
\definecolour{magenta}{255}{0}{255}%
|
||||
\definecolour{red}{255}{0}{0}%
|
||||
\definecolour{blue}{0}{0}{200}%
|
||||
\definecolour{yellow}{255}{255}{0}%
|
||||
\definecolour{white}{255}{255}{255}%
|
||||
\input psbox.tex
|
||||
\parindent 0pt
|
||||
\parskip 11pt
|
||||
\title{Manual for Object Graphics Library 3.0}
|
||||
\author{Julian Smart}
|
||||
\date{July 1998}
|
||||
\date{September 1998}
|
||||
|
||||
\makeindex
|
||||
\begin{document}
|
||||
|
@ -14,47 +14,6 @@ housekeeping logic required to get it up and running. OGLEdit also provides
|
||||
a demonstration of the Undo/Redo capability supported by the document/view classes,
|
||||
and how a typical application might implement this feature.
|
||||
|
||||
{\it Note:} A bug in the wxWindows document/view implementation before
|
||||
version 1.66C may cause Do/Undo to misbehave and get out of sync. If this is the case,
|
||||
please replace wxCommandProcessor::Submit with the following in wx\_doc.cpp.
|
||||
|
||||
{\small
|
||||
\begin{verbatim}
|
||||
Bool wxCommandProcessor::Submit(wxCommand *command, Bool storeIt)
|
||||
{
|
||||
Bool success = command->Do();
|
||||
if (success && storeIt)
|
||||
{
|
||||
if (commands.Number() == maxNoCommands)
|
||||
{
|
||||
wxNode *firstNode = commands.First();
|
||||
wxCommand *firstCommand = (wxCommand *)firstNode->Data();
|
||||
delete firstCommand;
|
||||
delete firstNode;
|
||||
}
|
||||
|
||||
// Correct a bug: we must chop off the current 'branch'
|
||||
// so that we're at the end of the command list.
|
||||
if (currentCommand)
|
||||
{
|
||||
wxNode *node = currentCommand->Next();
|
||||
while (node)
|
||||
{
|
||||
wxNode *next = node->Next();
|
||||
delete node;
|
||||
node = next;
|
||||
}
|
||||
}
|
||||
|
||||
commands.Append(command);
|
||||
currentCommand = commands.Last();
|
||||
SetMenuStrings();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
\end{verbatim}
|
||||
}
|
||||
|
||||
\section{OGLEdit files}
|
||||
|
||||
OGLEdit comprises the following source files.
|
||||
|
@ -1,3 +1,4 @@
|
||||
; Last change: JS 8 Sep 98 2:54 pm
|
||||
runTwice = yes
|
||||
titleFontSize = 12
|
||||
authorFontSize = 10
|
||||
@ -15,6 +16,11 @@ winHelpContents = yes
|
||||
winHelpTitle = "OGL Manual"
|
||||
truncateFilenames = yes
|
||||
combineSubSections = yes
|
||||
\overview [2] {\rtfonly{See also }\sethotspotcolour{off}\sethotspotunderline{on}\winhelponly{\image{}{books.bmp}}
|
||||
\overview [2] {\rtfonly{See also }\settransparency{on}\sethotspotcolour{off}\sethotspotunderline{on}\winhelponly{\image{}{books.bmp}\settransparency{off}}
|
||||
\htmlonly{\image{}{books.gif}}\helpref{#1}{#2}
|
||||
\sethotspotcolour{on}\sethotspotunderline{on}}
|
||||
\docparam [2]{\parskip{0}{\it #1}\htmlignore{\par}\parskip{10}\indented{1cm}{#2}}
|
||||
\wxheading [1]{{\bf \htmlignore{\fcol{blue}{#1}}\htmlonly{\fcol{red}{#1}}}}
|
||||
\const [0] {{\bf const}}
|
||||
\constfunc [3] {{\bf #1} {\bf #2}(#3) {\bf const}\index{#2}}
|
||||
\windowstyle [1] {{\bf #1}\index{#1}}
|
||||
|
@ -43,7 +43,6 @@ new shapes from wxShape.
|
||||
Instances of a class called \helpref{wxDiagram}{wxdiagram} organise collections of
|
||||
shapes, providing default file input and output behaviour.
|
||||
|
||||
|
||||
\section{wxDividedShape overview}\label{dividedshapeoverview}
|
||||
|
||||
Classes: \helpref{wxDividedShape}{wxdividedshape}
|
||||
@ -112,10 +111,9 @@ Here are examples of creating wxDividedShape objects:
|
||||
\end{verbatim}
|
||||
}
|
||||
|
||||
|
||||
\section{wxCompositeShape overview}\label{compositeshapeoverview}
|
||||
|
||||
Classes: \helpref{wxCompositeShape}{wxcompositeshape}, \helpref{OGLConstraint}{oglconstraint}
|
||||
Classes: \helpref{wxCompositeShape}{wxcompositeshape}, \helpref{wxOGLConstraint}{wxoglconstraint}
|
||||
|
||||
The wxCompositeShape allows fairly complex shapes to be created, and maintains
|
||||
a set of constraints which specify the layout and proportions of child shapes.
|
||||
@ -143,12 +141,12 @@ To specify a constraint, you need three things:
|
||||
The constraining shape can be either the parent of the constrained shapes, or a sibling. The
|
||||
constrained shapes must all be siblings of each other.
|
||||
|
||||
For an exhaustive list and description of the available constraint types, see the \helpref{OGLConstraint constructor}{oglconstraintconstr}.
|
||||
For an exhaustive list and description of the available constraint types, see the \helpref{wxOGLConstraint constructor}{wxoglconstraintconstr}.
|
||||
Note that most constraints operate in one dimension only (vertically or horizontally), so you will
|
||||
usually need to specify constraints in pairs.
|
||||
|
||||
You can set the spacing between constraining and constrained shapes by
|
||||
calling \helpref{OGLConstraint::SetSpacing}{oglconstraintsetspacing}.
|
||||
calling \helpref{wxOGLConstraint::SetSpacing}{wxoglconstraintsetspacing}.
|
||||
|
||||
Finally, a wxCompositeShape can have {\it divisions}, which are special child shapes of class
|
||||
wxDivisionShape (not to be confused with wxDividedShape). The purpose of this is to allow
|
||||
|
@ -1635,12 +1635,7 @@ void wxShape::RemoveLine(wxLineShape *line)
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
char *wxShape::GetFunctor()
|
||||
{
|
||||
return "node_image";
|
||||
}
|
||||
|
||||
void wxShape::WritePrologAttributes(wxExpr *clause)
|
||||
void wxShape::WriteAttributes(wxExpr *clause)
|
||||
{
|
||||
clause->AddAttributeValueString("type", GetClassInfo()->GetClassName());
|
||||
clause->AddAttributeValue("id", m_id);
|
||||
@ -1813,7 +1808,7 @@ void wxShape::WriteRegions(wxExpr *clause)
|
||||
}
|
||||
}
|
||||
|
||||
void wxShape::ReadPrologAttributes(wxExpr *clause)
|
||||
void wxShape::ReadAttributes(wxExpr *clause)
|
||||
{
|
||||
clause->GetAttributeValue("id", m_id);
|
||||
RegisterId(m_id);
|
||||
@ -2548,7 +2543,7 @@ bool wxShape::AncestorSelected() const
|
||||
return GetParent()->AncestorSelected();
|
||||
}
|
||||
|
||||
int wxShape::GetNumberOfAttachments()
|
||||
int wxShape::GetNumberOfAttachments() const
|
||||
{
|
||||
// Should return the MAXIMUM attachment point id here,
|
||||
// so higher-level functions can iterate through all attachments,
|
||||
@ -2570,7 +2565,7 @@ int wxShape::GetNumberOfAttachments()
|
||||
}
|
||||
}
|
||||
|
||||
bool wxShape::AttachmentIsValid(int attachment)
|
||||
bool wxShape::AttachmentIsValid(int attachment) const
|
||||
{
|
||||
if ((attachment >= 0) && (attachment < 4))
|
||||
return TRUE;
|
||||
|
@ -269,7 +269,7 @@ class wxShape: public wxShapeEvtHandler
|
||||
virtual bool HitTest(double x, double y, int *attachment, double *distance);
|
||||
inline void SetCentreResize(bool cr) { m_centreResize = cr; }
|
||||
inline bool GetCentreResize() const { return m_centreResize; }
|
||||
inline wxList& GetLines() { return m_lines; }
|
||||
inline wxList& GetLines() const { return (wxList&) m_lines; }
|
||||
inline void SetDisableLabel(bool flag) { m_disableLabel = flag; }
|
||||
inline bool GetDisableLabel() const { return m_disableLabel; }
|
||||
inline void SetAttachmentMode(bool flag) { m_attachmentMode = flag; }
|
||||
@ -364,10 +364,9 @@ class wxShape: public wxShapeEvtHandler
|
||||
void RemoveLine(wxLineShape *line);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
virtual char *GetFunctor();
|
||||
virtual void WritePrologAttributes(wxExpr *clause);
|
||||
virtual void ReadPrologAttributes(wxExpr *clause);
|
||||
// I/O
|
||||
virtual void WriteAttributes(wxExpr *clause);
|
||||
virtual void ReadAttributes(wxExpr *clause);
|
||||
|
||||
// In case the object has constraints it needs to read in in a different pass
|
||||
inline virtual void ReadConstraints(wxExpr *WXUNUSED(clause), wxExprDatabase *WXUNUSED(database)) { };
|
||||
@ -378,18 +377,18 @@ class wxShape: public wxShapeEvtHandler
|
||||
// Attachment code
|
||||
virtual bool GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
virtual int GetNumberOfAttachments();
|
||||
virtual bool AttachmentIsValid(int attachment);
|
||||
virtual int GetNumberOfAttachments() const;
|
||||
virtual bool AttachmentIsValid(int attachment) const;
|
||||
|
||||
// Assuming the attachment lies along a vertical or horizontal line,
|
||||
// calculate the position on that point.
|
||||
wxRealPoint CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2,
|
||||
virtual wxRealPoint CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2,
|
||||
int nth, int noArcs, wxLineShape* line);
|
||||
|
||||
// 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.
|
||||
bool AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, const wxRealPoint& pt2);
|
||||
virtual bool AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, const wxRealPoint& pt2);
|
||||
|
||||
virtual void EraseLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
|
||||
virtual void DrawLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
|
||||
@ -446,7 +445,7 @@ class wxShape: public wxShapeEvtHandler
|
||||
protected:
|
||||
wxShapeEvtHandler* m_eventHandler;
|
||||
bool m_formatted;
|
||||
double m_xpos, m_ypos;
|
||||
double m_xpos, m_ypos;
|
||||
wxPen* m_pen;
|
||||
wxBrush* m_brush;
|
||||
wxFont* m_font;
|
||||
@ -464,7 +463,7 @@ class wxShape: public wxShapeEvtHandler
|
||||
bool m_selected;
|
||||
bool m_highlighted; // Different from selected: user-defined highlighting,
|
||||
// e.g. thick border.
|
||||
double m_rotation;
|
||||
double m_rotation;
|
||||
int m_sensitivity;
|
||||
bool m_draggable;
|
||||
bool m_attachmentMode; // TRUE if using attachments, FALSE otherwise
|
||||
@ -534,11 +533,11 @@ class wxPolygonShape: public wxShape
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
void WriteAttributes(wxExpr *clause);
|
||||
void ReadAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
int GetNumberOfAttachments();
|
||||
int GetNumberOfAttachments() const;
|
||||
bool GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
bool AttachmentIsValid(int attachment);
|
||||
@ -550,10 +549,10 @@ class wxPolygonShape: public wxShape
|
||||
private:
|
||||
wxList* m_points;
|
||||
wxList* m_originalPoints;
|
||||
double m_boundWidth;
|
||||
double m_boundHeight;
|
||||
double m_originalWidth;
|
||||
double m_originalHeight;
|
||||
double m_boundWidth;
|
||||
double m_boundHeight;
|
||||
double m_originalWidth;
|
||||
double m_originalHeight;
|
||||
};
|
||||
|
||||
class wxRectangleShape: public wxShape
|
||||
@ -571,11 +570,11 @@ class wxRectangleShape: public wxShape
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
void WriteAttributes(wxExpr *clause);
|
||||
void ReadAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
int GetNumberOfAttachments();
|
||||
int GetNumberOfAttachments() const;
|
||||
bool GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
// Does the copying for this object
|
||||
@ -601,7 +600,7 @@ class wxTextShape: public wxRectangleShape
|
||||
void OnDraw(wxDC& dc);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void WriteAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
// Does the copying for this object
|
||||
@ -624,11 +623,11 @@ class wxEllipseShape: public wxShape
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
void WriteAttributes(wxExpr *clause);
|
||||
void ReadAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
int GetNumberOfAttachments();
|
||||
int GetNumberOfAttachments() const;
|
||||
bool GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
|
||||
|
@ -679,9 +679,9 @@ void wxPolygonShape::ResetControlPoints()
|
||||
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void wxPolygonShape::WritePrologAttributes(wxExpr *clause)
|
||||
void wxPolygonShape::WriteAttributes(wxExpr *clause)
|
||||
{
|
||||
wxShape::WritePrologAttributes(clause);
|
||||
wxShape::WriteAttributes(clause);
|
||||
|
||||
clause->AddAttributeValue("x", m_xpos);
|
||||
clause->AddAttributeValue("y", m_ypos);
|
||||
@ -722,9 +722,9 @@ void wxPolygonShape::WritePrologAttributes(wxExpr *clause)
|
||||
clause->AddAttributeValue("m_originalPoints", list);
|
||||
}
|
||||
|
||||
void wxPolygonShape::ReadPrologAttributes(wxExpr *clause)
|
||||
void wxPolygonShape::ReadAttributes(wxExpr *clause)
|
||||
{
|
||||
wxShape::ReadPrologAttributes(clause);
|
||||
wxShape::ReadAttributes(clause);
|
||||
|
||||
// Read a list of lists
|
||||
m_points = new wxList;
|
||||
@ -868,7 +868,7 @@ void wxPolygonShape::Copy(wxShape& copy)
|
||||
polyCopy.m_originalHeight = m_originalHeight;
|
||||
}
|
||||
|
||||
int wxPolygonShape::GetNumberOfAttachments()
|
||||
int wxPolygonShape::GetNumberOfAttachments() const
|
||||
{
|
||||
int maxN = (m_points ? (m_points->Number() - 1) : 0);
|
||||
wxNode *node = m_attachmentPoints.First();
|
||||
@ -991,9 +991,9 @@ bool wxRectangleShape::GetPerimeterPoint(double x1, double y1,
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void wxRectangleShape::WritePrologAttributes(wxExpr *clause)
|
||||
void wxRectangleShape::WriteAttributes(wxExpr *clause)
|
||||
{
|
||||
wxShape::WritePrologAttributes(clause);
|
||||
wxShape::WriteAttributes(clause);
|
||||
clause->AddAttributeValue("x", m_xpos);
|
||||
clause->AddAttributeValue("y", m_ypos);
|
||||
|
||||
@ -1003,9 +1003,9 @@ void wxRectangleShape::WritePrologAttributes(wxExpr *clause)
|
||||
clause->AddAttributeValue("corner", m_cornerRadius);
|
||||
}
|
||||
|
||||
void wxRectangleShape::ReadPrologAttributes(wxExpr *clause)
|
||||
void wxRectangleShape::ReadAttributes(wxExpr *clause)
|
||||
{
|
||||
wxShape::ReadPrologAttributes(clause);
|
||||
wxShape::ReadAttributes(clause);
|
||||
clause->AssignAttributeValue("width", &m_width);
|
||||
clause->AssignAttributeValue("height", &m_height);
|
||||
clause->AssignAttributeValue("corner", &m_cornerRadius);
|
||||
@ -1031,7 +1031,7 @@ void wxRectangleShape::Copy(wxShape& copy)
|
||||
rectCopy.m_cornerRadius = m_cornerRadius;
|
||||
}
|
||||
|
||||
int wxRectangleShape::GetNumberOfAttachments()
|
||||
int wxRectangleShape::GetNumberOfAttachments() const
|
||||
{
|
||||
return wxShape::GetNumberOfAttachments();
|
||||
}
|
||||
@ -1218,9 +1218,9 @@ void wxTextShape::Copy(wxShape& copy)
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void wxTextShape::WritePrologAttributes(wxExpr *clause)
|
||||
void wxTextShape::WriteAttributes(wxExpr *clause)
|
||||
{
|
||||
wxRectangleShape::WritePrologAttributes(clause);
|
||||
wxRectangleShape::WriteAttributes(clause);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1285,9 +1285,9 @@ void wxEllipseShape::SetSize(double x, double y, bool recursive)
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void wxEllipseShape::WritePrologAttributes(wxExpr *clause)
|
||||
void wxEllipseShape::WriteAttributes(wxExpr *clause)
|
||||
{
|
||||
wxShape::WritePrologAttributes(clause);
|
||||
wxShape::WriteAttributes(clause);
|
||||
clause->AddAttributeValue("x", m_xpos);
|
||||
clause->AddAttributeValue("y", m_ypos);
|
||||
|
||||
@ -1295,9 +1295,9 @@ void wxEllipseShape::WritePrologAttributes(wxExpr *clause)
|
||||
clause->AddAttributeValue("height", m_height);
|
||||
}
|
||||
|
||||
void wxEllipseShape::ReadPrologAttributes(wxExpr *clause)
|
||||
void wxEllipseShape::ReadAttributes(wxExpr *clause)
|
||||
{
|
||||
wxShape::ReadPrologAttributes(clause);
|
||||
wxShape::ReadAttributes(clause);
|
||||
clause->AssignAttributeValue("width", &m_width);
|
||||
clause->AssignAttributeValue("height", &m_height);
|
||||
|
||||
@ -1322,7 +1322,7 @@ void wxEllipseShape::Copy(wxShape& copy)
|
||||
ellipseCopy.m_height = m_height;
|
||||
}
|
||||
|
||||
int wxEllipseShape::GetNumberOfAttachments()
|
||||
int wxEllipseShape::GetNumberOfAttachments() const
|
||||
{
|
||||
return wxShape::GetNumberOfAttachments();
|
||||
}
|
||||
@ -1480,7 +1480,7 @@ void wxControlPoint::OnEndDragLeft(double x, double y, int keys, int attachment)
|
||||
m_shape->GetEventHandler()->OnSizingEndDragLeft(this, x, y, keys, attachment);
|
||||
}
|
||||
|
||||
int wxControlPoint::GetNumberOfAttachments()
|
||||
int wxControlPoint::GetNumberOfAttachments() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ class wxControlPoint: public wxRectangleShape
|
||||
|
||||
bool GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
int GetNumberOfAttachments();
|
||||
int GetNumberOfAttachments() const;
|
||||
|
||||
inline void SetEraseObject(bool er) { m_eraseObject = er; }
|
||||
|
||||
|
@ -79,23 +79,17 @@ void wxBitmapShape::SetSize(double w, double h, bool recursive)
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
char *wxBitmapShape::GetFunctor()
|
||||
{
|
||||
return "node_image";
|
||||
}
|
||||
|
||||
void wxBitmapShape::WritePrologAttributes(wxExpr *clause)
|
||||
void wxBitmapShape::WriteAttributes(wxExpr *clause)
|
||||
{
|
||||
// Can't really save the bitmap; so instantiate the bitmap
|
||||
// at a higher level in the application, from a symbol library.
|
||||
wxRectangleShape::WritePrologAttributes(clause);
|
||||
wxRectangleShape::WriteAttributes(clause);
|
||||
clause->AddAttributeValueString("filename", m_filename);
|
||||
}
|
||||
|
||||
void wxBitmapShape::ReadPrologAttributes(wxExpr *clause)
|
||||
void wxBitmapShape::ReadAttributes(wxExpr *clause)
|
||||
{
|
||||
wxRectangleShape::ReadPrologAttributes(clause);
|
||||
wxRectangleShape::ReadAttributes(clause);
|
||||
clause->GetAttributeValue("filename", m_filename);
|
||||
}
|
||||
#endif
|
||||
|
@ -28,10 +28,9 @@ class wxBitmapShape: public wxRectangleShape
|
||||
void OnDraw(wxDC& dc);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
char *GetFunctor();
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
// I/O
|
||||
void WriteAttributes(wxExpr *clause);
|
||||
void ReadAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
// Does the copying for this object
|
||||
|
@ -80,7 +80,7 @@ wxCompositeShape::~wxCompositeShape()
|
||||
wxNode *node = m_constraints.First();
|
||||
while (node)
|
||||
{
|
||||
OGLConstraint *constraint = (OGLConstraint *)node->Data();
|
||||
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
|
||||
delete constraint;
|
||||
node = node->Next();
|
||||
}
|
||||
@ -323,7 +323,7 @@ void wxCompositeShape::DeleteConstraintsInvolvingChild(wxShape *child)
|
||||
wxNode *node = m_constraints.First();
|
||||
while (node)
|
||||
{
|
||||
OGLConstraint *constraint = (OGLConstraint *)node->Data();
|
||||
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
|
||||
wxNode *nextNode = node->Next();
|
||||
|
||||
if ((constraint->m_constrainingObject == child) ||
|
||||
@ -341,7 +341,7 @@ void wxCompositeShape::RemoveChildFromConstraints(wxShape *child)
|
||||
wxNode *node = m_constraints.First();
|
||||
while (node)
|
||||
{
|
||||
OGLConstraint *constraint = (OGLConstraint *)node->Data();
|
||||
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
|
||||
wxNode *nextNode = node->Next();
|
||||
|
||||
if (constraint->m_constrainedObjects.Member(child))
|
||||
@ -396,7 +396,7 @@ void wxCompositeShape::Copy(wxShape& copy)
|
||||
node = m_constraints.First();
|
||||
while (node)
|
||||
{
|
||||
OGLConstraint *constraint = (OGLConstraint *)node->Data();
|
||||
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
|
||||
|
||||
wxShape *newConstraining = (wxShape *)(oglObjectCopyMapping.Find((long)constraint->m_constrainingObject)->Data());
|
||||
|
||||
@ -410,7 +410,7 @@ void wxCompositeShape::Copy(wxShape& copy)
|
||||
node2 = node2->Next();
|
||||
}
|
||||
|
||||
OGLConstraint *newConstraint = new OGLConstraint(constraint->m_constraintType, newConstraining,
|
||||
wxOGLConstraint *newConstraint = new wxOGLConstraint(constraint->m_constraintType, newConstraining,
|
||||
newConstrainedList);
|
||||
newConstraint->m_constraintId = constraint->m_constraintId;
|
||||
if (constraint->m_constraintName)
|
||||
@ -457,7 +457,7 @@ void wxCompositeShape::Copy(wxShape& copy)
|
||||
}
|
||||
}
|
||||
|
||||
OGLConstraint *wxCompositeShape::AddConstraint(OGLConstraint *constraint)
|
||||
wxOGLConstraint *wxCompositeShape::AddConstraint(wxOGLConstraint *constraint)
|
||||
{
|
||||
m_constraints.Append(constraint);
|
||||
if (constraint->m_constraintId == 0)
|
||||
@ -465,32 +465,32 @@ OGLConstraint *wxCompositeShape::AddConstraint(OGLConstraint *constraint)
|
||||
return constraint;
|
||||
}
|
||||
|
||||
OGLConstraint *wxCompositeShape::AddConstraint(int type, wxShape *constraining, wxList& constrained)
|
||||
wxOGLConstraint *wxCompositeShape::AddConstraint(int type, wxShape *constraining, wxList& constrained)
|
||||
{
|
||||
OGLConstraint *constraint = new OGLConstraint(type, constraining, constrained);
|
||||
wxOGLConstraint *constraint = new wxOGLConstraint(type, constraining, constrained);
|
||||
if (constraint->m_constraintId == 0)
|
||||
constraint->m_constraintId = NewId();
|
||||
m_constraints.Append(constraint);
|
||||
return constraint;
|
||||
}
|
||||
|
||||
OGLConstraint *wxCompositeShape::AddConstraint(int type, wxShape *constraining, wxShape *constrained)
|
||||
wxOGLConstraint *wxCompositeShape::AddConstraint(int type, wxShape *constraining, wxShape *constrained)
|
||||
{
|
||||
wxList l;
|
||||
l.Append(constrained);
|
||||
OGLConstraint *constraint = new OGLConstraint(type, constraining, l);
|
||||
wxOGLConstraint *constraint = new wxOGLConstraint(type, constraining, l);
|
||||
if (constraint->m_constraintId == 0)
|
||||
constraint->m_constraintId = NewId();
|
||||
m_constraints.Append(constraint);
|
||||
return constraint;
|
||||
}
|
||||
|
||||
OGLConstraint *wxCompositeShape::FindConstraint(long cId, wxCompositeShape **actualComposite)
|
||||
wxOGLConstraint *wxCompositeShape::FindConstraint(long cId, wxCompositeShape **actualComposite)
|
||||
{
|
||||
wxNode *node = m_constraints.First();
|
||||
while (node)
|
||||
{
|
||||
OGLConstraint *constraint = (OGLConstraint *)node->Data();
|
||||
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
|
||||
if (constraint->m_constraintId == cId)
|
||||
{
|
||||
if (actualComposite)
|
||||
@ -506,7 +506,7 @@ OGLConstraint *wxCompositeShape::FindConstraint(long cId, wxCompositeShape **act
|
||||
wxShape *child = (wxShape *)node->Data();
|
||||
if (child->IsKindOf(CLASSINFO(wxCompositeShape)))
|
||||
{
|
||||
OGLConstraint *constraint = ((wxCompositeShape *)child)->FindConstraint(cId, actualComposite);
|
||||
wxOGLConstraint *constraint = ((wxCompositeShape *)child)->FindConstraint(cId, actualComposite);
|
||||
if (constraint)
|
||||
{
|
||||
if (actualComposite)
|
||||
@ -519,7 +519,7 @@ OGLConstraint *wxCompositeShape::FindConstraint(long cId, wxCompositeShape **act
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxCompositeShape::DeleteConstraint(OGLConstraint *constraint)
|
||||
void wxCompositeShape::DeleteConstraint(wxOGLConstraint *constraint)
|
||||
{
|
||||
m_constraints.DeleteObject(constraint);
|
||||
delete constraint;
|
||||
@ -595,7 +595,7 @@ bool wxCompositeShape::Constrain()
|
||||
node = m_constraints.First();
|
||||
while (node)
|
||||
{
|
||||
OGLConstraint *constraint = (OGLConstraint *)node->Data();
|
||||
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
|
||||
if (constraint->Evaluate()) changed = TRUE;
|
||||
node = node->Next();
|
||||
}
|
||||
@ -603,9 +603,9 @@ bool wxCompositeShape::Constrain()
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void wxCompositeShape::WritePrologAttributes(wxExpr *clause)
|
||||
void wxCompositeShape::WriteAttributes(wxExpr *clause)
|
||||
{
|
||||
wxRectangleShape::WritePrologAttributes(clause);
|
||||
wxRectangleShape::WriteAttributes(clause);
|
||||
|
||||
// clause->AddAttributeValue("selectable", (long)selectable);
|
||||
|
||||
@ -615,7 +615,7 @@ void wxCompositeShape::WritePrologAttributes(wxExpr *clause)
|
||||
wxNode *node = m_constraints.First();
|
||||
while (node)
|
||||
{
|
||||
OGLConstraint *constraint = (OGLConstraint *)node->Data();
|
||||
wxOGLConstraint *constraint = (wxOGLConstraint *)node->Data();
|
||||
sprintf(m_constraintNameBuf, "constraint%d", constraintNo);
|
||||
|
||||
// Each constraint is stored in the form
|
||||
@ -674,9 +674,9 @@ void wxCompositeShape::WritePrologAttributes(wxExpr *clause)
|
||||
// so as to be able to link up to parent. So we may not be able
|
||||
// to find the constraint participants until we've read everything
|
||||
// in. Need to have another pass for composites.
|
||||
void wxCompositeShape::ReadPrologAttributes(wxExpr *clause)
|
||||
void wxCompositeShape::ReadAttributes(wxExpr *clause)
|
||||
{
|
||||
wxRectangleShape::ReadPrologAttributes(clause);
|
||||
wxRectangleShape::ReadAttributes(clause);
|
||||
|
||||
// clause->GetAttributeValue("selectable", selectable);
|
||||
}
|
||||
@ -747,7 +747,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database)
|
||||
i ++;
|
||||
currentIdExpr = constrainedExpr->Nth(i);
|
||||
}
|
||||
OGLConstraint *newConstraint = AddConstraint(cType, m_constrainingObject, m_constrainedObjects);
|
||||
wxOGLConstraint *newConstraint = AddConstraint(cType, m_constrainingObject, m_constrainedObjects);
|
||||
newConstraint->SetSpacing(cXSpacing, cYSpacing);
|
||||
newConstraint->m_constraintId = cId;
|
||||
newConstraint->m_constraintName = (const char*) cName;
|
||||
@ -989,9 +989,9 @@ void wxDivisionShape::Copy(wxShape& copy)
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void wxDivisionShape::WritePrologAttributes(wxExpr *clause)
|
||||
void wxDivisionShape::WriteAttributes(wxExpr *clause)
|
||||
{
|
||||
wxCompositeShape::WritePrologAttributes(clause);
|
||||
wxCompositeShape::WriteAttributes(clause);
|
||||
|
||||
if (m_leftSide)
|
||||
clause->AddAttributeValue("left_side", (long)m_leftSide->GetId());
|
||||
@ -1009,9 +1009,9 @@ void wxDivisionShape::WritePrologAttributes(wxExpr *clause)
|
||||
clause->AddAttributeValueString("top_style", m_topSideStyle);
|
||||
}
|
||||
|
||||
void wxDivisionShape::ReadPrologAttributes(wxExpr *clause)
|
||||
void wxDivisionShape::ReadAttributes(wxExpr *clause)
|
||||
{
|
||||
wxCompositeShape::ReadPrologAttributes(clause);
|
||||
wxCompositeShape::ReadAttributes(clause);
|
||||
|
||||
clause->GetAttributeValue("handle_side", m_handleSide);
|
||||
clause->GetAttributeValue("left_colour", m_leftSideColour);
|
||||
|
@ -17,7 +17,7 @@
|
||||
#endif
|
||||
|
||||
class wxDivisionShape;
|
||||
class OGLConstraint;
|
||||
class wxOGLConstraint;
|
||||
|
||||
/*
|
||||
* A composite object is an invisible rectangle surrounding all children
|
||||
@ -51,11 +51,11 @@ public:
|
||||
void AddChild(wxShape *child, wxShape *addAfter = NULL);
|
||||
void RemoveChild(wxShape *child);
|
||||
|
||||
OGLConstraint *AddConstraint(OGLConstraint *constraint);
|
||||
OGLConstraint *AddConstraint(int type, wxShape *constraining, wxList& constrained);
|
||||
OGLConstraint *AddConstraint(int type, wxShape *constraining, wxShape *constrained);
|
||||
wxOGLConstraint *AddConstraint(wxOGLConstraint *constraint);
|
||||
wxOGLConstraint *AddConstraint(int type, wxShape *constraining, wxList& constrained);
|
||||
wxOGLConstraint *AddConstraint(int type, wxShape *constraining, wxShape *constrained);
|
||||
|
||||
void DeleteConstraint(OGLConstraint *constraint);
|
||||
void DeleteConstraint(wxOGLConstraint *constraint);
|
||||
|
||||
// Delete constraints that involve this child.
|
||||
void DeleteConstraintsInvolvingChild(wxShape *child);
|
||||
@ -66,7 +66,7 @@ public:
|
||||
|
||||
// Find constraint, also returning actual composite the constraint was in,
|
||||
// in case it had to find it recursively.
|
||||
OGLConstraint *FindConstraint(long id, wxCompositeShape **actualComposite = NULL);
|
||||
wxOGLConstraint *FindConstraint(long id, wxCompositeShape **actualComposite = NULL);
|
||||
|
||||
// Returns TRUE if something changed
|
||||
bool Constrain();
|
||||
@ -79,8 +79,8 @@ public:
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
void WriteAttributes(wxExpr *clause);
|
||||
void ReadAttributes(wxExpr *clause);
|
||||
// In case the object has constraints it needs to read in in a different pass
|
||||
void ReadConstraints(wxExpr *clause, wxExprDatabase *database);
|
||||
#endif
|
||||
@ -155,8 +155,8 @@ class wxDivisionShape: public wxCompositeShape
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
void WriteAttributes(wxExpr *clause);
|
||||
void ReadAttributes(wxExpr *clause);
|
||||
#endif
|
||||
// Does the copying for this object
|
||||
void Copy(wxShape& copy);
|
||||
|
@ -32,95 +32,95 @@
|
||||
#include "constrnt.h"
|
||||
#include "canvas.h"
|
||||
|
||||
wxList *OGLConstraintTypes = NULL;
|
||||
wxList *wxOGLConstraintTypes = NULL;
|
||||
|
||||
/*
|
||||
* Constraint type
|
||||
*
|
||||
*/
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(OGLConstraintType, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxOGLConstraintType, wxObject)
|
||||
|
||||
OGLConstraintType::OGLConstraintType(int theType, const wxString& theName, const wxString& thePhrase)
|
||||
wxOGLConstraintType::wxOGLConstraintType(int theType, const wxString& theName, const wxString& thePhrase)
|
||||
{
|
||||
m_type = theType;
|
||||
m_name = theName;
|
||||
m_phrase = thePhrase;
|
||||
}
|
||||
|
||||
OGLConstraintType::~OGLConstraintType()
|
||||
wxOGLConstraintType::~wxOGLConstraintType()
|
||||
{
|
||||
}
|
||||
|
||||
void OGLInitializeConstraintTypes()
|
||||
{
|
||||
if (!OGLConstraintTypes)
|
||||
if (!wxOGLConstraintTypes)
|
||||
return;
|
||||
|
||||
OGLConstraintTypes = new wxList(wxKEY_INTEGER);
|
||||
wxOGLConstraintTypes = new wxList(wxKEY_INTEGER);
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_VERTICALLY,
|
||||
new OGLConstraintType(gyCONSTRAINT_CENTRED_VERTICALLY, "Centre vertically", "centred vertically w.r.t."));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_VERTICALLY,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_CENTRED_VERTICALLY, "Centre vertically", "centred vertically w.r.t."));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_HORIZONTALLY,
|
||||
new OGLConstraintType(gyCONSTRAINT_CENTRED_HORIZONTALLY, "Centre horizontally", "centred horizontally w.r.t."));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_HORIZONTALLY,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_CENTRED_HORIZONTALLY, "Centre horizontally", "centred horizontally w.r.t."));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_BOTH,
|
||||
new OGLConstraintType(gyCONSTRAINT_CENTRED_BOTH, "Centre", "centred w.r.t."));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_BOTH,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_CENTRED_BOTH, "Centre", "centred w.r.t."));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_LEFT_OF,
|
||||
new OGLConstraintType(gyCONSTRAINT_LEFT_OF, "Left of", "left of"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_LEFT_OF,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_LEFT_OF, "Left of", "left of"));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_RIGHT_OF,
|
||||
new OGLConstraintType(gyCONSTRAINT_RIGHT_OF, "Right of", "right of"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_RIGHT_OF,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_RIGHT_OF, "Right of", "right of"));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_ABOVE,
|
||||
new OGLConstraintType(gyCONSTRAINT_ABOVE, "Above", "above"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_ABOVE,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_ABOVE, "Above", "above"));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_BELOW,
|
||||
new OGLConstraintType(gyCONSTRAINT_BELOW, "Below", "below"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_BELOW,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_BELOW, "Below", "below"));
|
||||
|
||||
// Alignment
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_TOP,
|
||||
new OGLConstraintType(gyCONSTRAINT_ALIGNED_TOP, "Top-aligned", "aligned to the top of"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_TOP,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_TOP, "Top-aligned", "aligned to the top of"));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_BOTTOM,
|
||||
new OGLConstraintType(gyCONSTRAINT_ALIGNED_BOTTOM, "Bottom-aligned", "aligned to the bottom of"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_BOTTOM,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_BOTTOM, "Bottom-aligned", "aligned to the bottom of"));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_LEFT,
|
||||
new OGLConstraintType(gyCONSTRAINT_ALIGNED_LEFT, "Left-aligned", "aligned to the left of"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_LEFT,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_LEFT, "Left-aligned", "aligned to the left of"));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_RIGHT,
|
||||
new OGLConstraintType(gyCONSTRAINT_ALIGNED_RIGHT, "Right-aligned", "aligned to the right of"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_RIGHT,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_RIGHT, "Right-aligned", "aligned to the right of"));
|
||||
|
||||
// Mid-alignment
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_TOP,
|
||||
new OGLConstraintType(gyCONSTRAINT_MIDALIGNED_TOP, "Top-midaligned", "centred on the top of"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_TOP,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_TOP, "Top-midaligned", "centred on the top of"));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_BOTTOM,
|
||||
new OGLConstraintType(gyCONSTRAINT_MIDALIGNED_BOTTOM, "Bottom-midaligned", "centred on the bottom of"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_BOTTOM,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_BOTTOM, "Bottom-midaligned", "centred on the bottom of"));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_LEFT,
|
||||
new OGLConstraintType(gyCONSTRAINT_MIDALIGNED_LEFT, "Left-midaligned", "centred on the left of"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_LEFT,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_LEFT, "Left-midaligned", "centred on the left of"));
|
||||
|
||||
OGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_RIGHT,
|
||||
new OGLConstraintType(gyCONSTRAINT_MIDALIGNED_RIGHT, "Right-midaligned", "centred on the right of"));
|
||||
wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_RIGHT,
|
||||
new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_RIGHT, "Right-midaligned", "centred on the right of"));
|
||||
}
|
||||
|
||||
void OGLCleanUpConstraintTypes()
|
||||
{
|
||||
if (!OGLConstraintTypes)
|
||||
if (!wxOGLConstraintTypes)
|
||||
return;
|
||||
|
||||
wxNode* node = OGLConstraintTypes->First();
|
||||
wxNode* node = wxOGLConstraintTypes->First();
|
||||
while (node)
|
||||
{
|
||||
OGLConstraintType* ct = (OGLConstraintType*) node->Data();
|
||||
wxOGLConstraintType* ct = (wxOGLConstraintType*) node->Data();
|
||||
delete ct;
|
||||
node = node->Next();
|
||||
}
|
||||
delete OGLConstraintTypes;
|
||||
OGLConstraintTypes = NULL;
|
||||
delete wxOGLConstraintTypes;
|
||||
wxOGLConstraintTypes = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -128,9 +128,9 @@ void OGLCleanUpConstraintTypes()
|
||||
*
|
||||
*/
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(OGLConstraint, wxObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxOGLConstraint, wxObject)
|
||||
|
||||
OGLConstraint::OGLConstraint(int type, wxShape *constraining, wxList& constrained)
|
||||
wxOGLConstraint::wxOGLConstraint(int type, wxShape *constraining, wxList& constrained)
|
||||
{
|
||||
m_xSpacing = 0.0;
|
||||
m_ySpacing = 0.0;
|
||||
@ -149,11 +149,11 @@ OGLConstraint::OGLConstraint(int type, wxShape *constraining, wxList& constraine
|
||||
}
|
||||
}
|
||||
|
||||
OGLConstraint::~OGLConstraint()
|
||||
wxOGLConstraint::~wxOGLConstraint()
|
||||
{
|
||||
}
|
||||
|
||||
bool OGLConstraint::Equals(double a, double b)
|
||||
bool wxOGLConstraint::Equals(double a, double b)
|
||||
{
|
||||
double marg = 0.5;
|
||||
|
||||
@ -162,7 +162,7 @@ bool OGLConstraint::Equals(double a, double b)
|
||||
}
|
||||
|
||||
// Return TRUE if anything changed
|
||||
bool OGLConstraint::Evaluate()
|
||||
bool wxOGLConstraint::Evaluate()
|
||||
{
|
||||
double maxWidth, maxHeight, minWidth, minHeight, x, y;
|
||||
m_constrainingObject->GetBoundingBoxMax(&maxWidth, &maxHeight);
|
||||
|
@ -21,12 +21,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
class OGLConstraintType: public wxObject
|
||||
class wxOGLConstraintType: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(OGLConstraintType)
|
||||
DECLARE_DYNAMIC_CLASS(wxOGLConstraintType)
|
||||
public:
|
||||
OGLConstraintType(int type = 0, const wxString& name = "", const wxString& phrase = "");
|
||||
~OGLConstraintType();
|
||||
wxOGLConstraintType(int type = 0, const wxString& name = "", const wxString& phrase = "");
|
||||
~wxOGLConstraintType();
|
||||
|
||||
public:
|
||||
int m_type; // E.g. gyCONSTRAINT_CENTRED_VERTICALLY
|
||||
@ -35,7 +35,7 @@ public:
|
||||
|
||||
};
|
||||
|
||||
extern wxList* OGLConstraintTypes;
|
||||
extern wxList* wxOGLConstraintTypes;
|
||||
|
||||
#define gyCONSTRAINT_CENTRED_VERTICALLY 1
|
||||
#define gyCONSTRAINT_CENTRED_HORIZONTALLY 2
|
||||
@ -56,14 +56,14 @@ extern wxList* OGLConstraintTypes;
|
||||
#define gyCONSTRAINT_MIDALIGNED_LEFT 14
|
||||
#define gyCONSTRAINT_MIDALIGNED_RIGHT 15
|
||||
|
||||
class OGLConstraint: public wxObject
|
||||
class wxOGLConstraint: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(OGLConstraint)
|
||||
DECLARE_DYNAMIC_CLASS(wxOGLConstraint)
|
||||
public:
|
||||
OGLConstraint() { m_xSpacing = 0.0; m_ySpacing = 0.0; m_constraintType = 0; m_constraintName = ""; m_constraintId = 0;
|
||||
wxOGLConstraint() { m_xSpacing = 0.0; m_ySpacing = 0.0; m_constraintType = 0; m_constraintName = ""; m_constraintId = 0;
|
||||
m_constrainingObject = NULL; }
|
||||
OGLConstraint(int type, wxShape *constraining, wxList& constrained);
|
||||
~OGLConstraint();
|
||||
wxOGLConstraint(int type, wxShape *constraining, wxList& constrained);
|
||||
~wxOGLConstraint();
|
||||
|
||||
// Returns TRUE if anything changed
|
||||
bool Evaluate();
|
||||
|
@ -305,7 +305,7 @@ bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int wxDividedShape::GetNumberOfAttachments()
|
||||
int wxDividedShape::GetNumberOfAttachments() const
|
||||
{
|
||||
// There are two attachments for each region (left and right),
|
||||
// plus one on the top and one on the bottom.
|
||||
@ -418,14 +418,14 @@ void wxDividedShape::ResetMandatoryControlPoints()
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void wxDividedShape::WritePrologAttributes(wxExpr *clause)
|
||||
void wxDividedShape::WriteAttributes(wxExpr *clause)
|
||||
{
|
||||
wxRectangleShape::WritePrologAttributes(clause);
|
||||
wxRectangleShape::WriteAttributes(clause);
|
||||
}
|
||||
|
||||
void wxDividedShape::ReadPrologAttributes(wxExpr *clause)
|
||||
void wxDividedShape::ReadAttributes(wxExpr *clause)
|
||||
{
|
||||
wxRectangleShape::ReadPrologAttributes(clause);
|
||||
wxRectangleShape::ReadAttributes(clause);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -48,8 +48,8 @@ class wxDividedShape: public wxRectangleShape
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
void WriteAttributes(wxExpr *clause);
|
||||
void ReadAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
void Copy(wxShape ©);
|
||||
@ -65,7 +65,7 @@ class wxDividedShape: public wxRectangleShape
|
||||
bool GetAttachmentPosition(int attachment, double *x, double *y,
|
||||
int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
|
||||
bool AttachmentIsValid(int attachment);
|
||||
int GetNumberOfAttachments();
|
||||
int GetNumberOfAttachments() const;
|
||||
|
||||
// Invoke editor on CTRL-right click
|
||||
void OnRightClick(double x, double y, int keys = 0, int attachment = 0);
|
||||
|
@ -236,15 +236,9 @@ bool wxDrawnShape::GetPerimeterPoint(double x1, double y1,
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
char *wxDrawnShape::GetFunctor()
|
||||
void wxDrawnShape::WriteAttributes(wxExpr *clause)
|
||||
{
|
||||
return "node_image";
|
||||
}
|
||||
|
||||
void wxDrawnShape::WritePrologAttributes(wxExpr *clause)
|
||||
{
|
||||
wxRectangleShape::WritePrologAttributes(clause);
|
||||
wxRectangleShape::WriteAttributes(clause);
|
||||
|
||||
clause->AddAttributeValue("save_metafile", (long)m_saveToFile);
|
||||
if (m_saveToFile)
|
||||
@ -253,14 +247,14 @@ void wxDrawnShape::WritePrologAttributes(wxExpr *clause)
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (m_metafiles[i].IsValid())
|
||||
m_metafiles[i].WritePrologAttributes(clause, i);
|
||||
m_metafiles[i].WriteAttributes(clause, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxDrawnShape::ReadPrologAttributes(wxExpr *clause)
|
||||
void wxDrawnShape::ReadAttributes(wxExpr *clause)
|
||||
{
|
||||
wxRectangleShape::ReadPrologAttributes(clause);
|
||||
wxRectangleShape::ReadAttributes(clause);
|
||||
|
||||
int iVal = (int) m_saveToFile;
|
||||
clause->AssignAttributeValue("save_metafile", &iVal);
|
||||
@ -271,7 +265,7 @@ void wxDrawnShape::ReadPrologAttributes(wxExpr *clause)
|
||||
int i = 0;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
m_metafiles[i].ReadPrologAttributes(clause, i);
|
||||
m_metafiles[i].ReadAttributes(clause, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -376,32 +370,32 @@ void wxDrawnShape::DestroyClippingRect()
|
||||
m_metafiles[m_currentAngle].DestroyClippingRect();
|
||||
}
|
||||
|
||||
void wxDrawnShape::SetPen(wxPen* pen, bool isOutline)
|
||||
void wxDrawnShape::SetDrawnPen(wxPen* pen, bool isOutline)
|
||||
{
|
||||
m_metafiles[m_currentAngle].SetPen(pen, isOutline);
|
||||
}
|
||||
|
||||
void wxDrawnShape::SetBrush(wxBrush* brush, bool isFill)
|
||||
void wxDrawnShape::SetDrawnBrush(wxBrush* brush, bool isFill)
|
||||
{
|
||||
m_metafiles[m_currentAngle].SetBrush(brush, isFill);
|
||||
}
|
||||
|
||||
void wxDrawnShape::SetFont(wxFont* font)
|
||||
void wxDrawnShape::SetDrawnFont(wxFont* font)
|
||||
{
|
||||
m_metafiles[m_currentAngle].SetFont(font);
|
||||
}
|
||||
|
||||
void wxDrawnShape::SetTextColour(const wxColour& colour)
|
||||
void wxDrawnShape::SetDrawnTextColour(const wxColour& colour)
|
||||
{
|
||||
m_metafiles[m_currentAngle].SetTextColour(colour);
|
||||
}
|
||||
|
||||
void wxDrawnShape::SetBackgroundColour(const wxColour& colour)
|
||||
void wxDrawnShape::SetDrawnBackgroundColour(const wxColour& colour)
|
||||
{
|
||||
m_metafiles[m_currentAngle].SetBackgroundColour(colour);
|
||||
}
|
||||
|
||||
void wxDrawnShape::SetBackgroundMode(int mode)
|
||||
void wxDrawnShape::SetDrawnBackgroundMode(int mode)
|
||||
{
|
||||
m_metafiles[m_currentAngle].SetBackgroundMode(mode);
|
||||
}
|
||||
@ -1452,7 +1446,7 @@ void wxPseudoMetaFile::Rotate(double x, double y, double theta)
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void wxPseudoMetaFile::WritePrologAttributes(wxExpr *clause, int whichAngle)
|
||||
void wxPseudoMetaFile::WriteAttributes(wxExpr *clause, int whichAngle)
|
||||
{
|
||||
wxString widthStr;
|
||||
widthStr.Printf("meta_width%d", whichAngle);
|
||||
@ -1579,7 +1573,7 @@ void wxPseudoMetaFile::WritePrologAttributes(wxExpr *clause, int whichAngle)
|
||||
|
||||
}
|
||||
|
||||
void wxPseudoMetaFile::ReadPrologAttributes(wxExpr *clause, int whichAngle)
|
||||
void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
|
||||
{
|
||||
wxString widthStr;
|
||||
widthStr.Printf("meta_width%d", whichAngle);
|
||||
|
@ -33,8 +33,8 @@ class wxPseudoMetaFile: public wxObject
|
||||
void Draw(wxDC& dc, double xoffset, double yoffset);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void WritePrologAttributes(wxExpr *clause, int whichAngle);
|
||||
void ReadPrologAttributes(wxExpr *clause, int whichAngle);
|
||||
void WriteAttributes(wxExpr *clause, int whichAngle);
|
||||
void ReadAttributes(wxExpr *clause, int whichAngle);
|
||||
#endif
|
||||
|
||||
void Clear();
|
||||
@ -140,10 +140,9 @@ class wxDrawnShape: public wxRectangleShape
|
||||
void OnDraw(wxDC& dc);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
char *GetFunctor();
|
||||
void WritePrologAttributes(wxExpr *clause);
|
||||
void ReadPrologAttributes(wxExpr *clause);
|
||||
// I/O
|
||||
void WriteAttributes(wxExpr *clause);
|
||||
void ReadAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
// Does the copying for this object
|
||||
@ -190,12 +189,12 @@ class wxDrawnShape: public wxRectangleShape
|
||||
virtual void SetClippingRect(const wxRect& rect);
|
||||
virtual void DestroyClippingRect();
|
||||
|
||||
virtual void SetPen(wxPen* pen, bool isOutline = FALSE); // TODO: eventually, just store GDI object attributes, not actual
|
||||
virtual void SetBrush(wxBrush* brush, bool isFill = FALSE); // pens/brushes etc.
|
||||
virtual void SetFont(wxFont* font);
|
||||
virtual void SetTextColour(const wxColour& colour);
|
||||
virtual void SetBackgroundColour(const wxColour& colour);
|
||||
virtual void SetBackgroundMode(int mode);
|
||||
virtual void SetDrawnPen(wxPen* pen, bool isOutline = FALSE); // TODO: eventually, just store GDI object attributes, not actual
|
||||
virtual void SetDrawnBrush(wxBrush* brush, bool isFill = FALSE); // pens/brushes etc.
|
||||
virtual void SetDrawnFont(wxFont* font);
|
||||
virtual void SetDrawnTextColour(const wxColour& colour);
|
||||
virtual void SetDrawnBackgroundColour(const wxColour& colour);
|
||||
virtual void SetDrawnBackgroundMode(int mode);
|
||||
|
||||
// Set the width/height according to the shapes in the metafile.
|
||||
// Call this after drawing into the shape.
|
||||
@ -205,6 +204,8 @@ class wxDrawnShape: public wxRectangleShape
|
||||
|
||||
inline int GetAngle() const { return m_currentAngle; }
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
// Which metafile do we use now? Based on current rotation and validity
|
||||
// of metafiles.
|
||||
int DetermineMetaFile(double rotation);
|
||||
|
@ -1296,14 +1296,6 @@ void wxLineShape::OnDrawContents(wxDC& dc)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef PROLOGIO
|
||||
char *wxLineShape::GetFunctor()
|
||||
{
|
||||
return "arc_image";
|
||||
}
|
||||
#endif
|
||||
|
||||
void wxLineShape::SetTo(wxShape *object)
|
||||
{
|
||||
m_to = object;
|
||||
@ -1377,9 +1369,9 @@ void wxLineShape::ResetControlPoints()
|
||||
}
|
||||
|
||||
#ifdef PROLOGIO
|
||||
void wxLineShape::WritePrologAttributes(wxExpr *clause)
|
||||
void wxLineShape::WriteAttributes(wxExpr *clause)
|
||||
{
|
||||
wxShape::WritePrologAttributes(clause);
|
||||
wxShape::WriteAttributes(clause);
|
||||
|
||||
if (m_from)
|
||||
clause->AddAttributeValue("from", m_from->GetId());
|
||||
@ -1447,9 +1439,9 @@ void wxLineShape::WritePrologAttributes(wxExpr *clause)
|
||||
}
|
||||
}
|
||||
|
||||
void wxLineShape::ReadPrologAttributes(wxExpr *clause)
|
||||
void wxLineShape::ReadAttributes(wxExpr *clause)
|
||||
{
|
||||
wxShape::ReadPrologAttributes(clause);
|
||||
wxShape::ReadAttributes(clause);
|
||||
|
||||
int iVal = (int) m_isSpline;
|
||||
clause->AssignAttributeValue("is_spline", &iVal);
|
||||
|
@ -189,10 +189,9 @@ class wxLineShape: public wxShape
|
||||
bool HitTest(double x, double y, int *attachment, double *distance);
|
||||
|
||||
#ifdef PROLOGIO
|
||||
// Prolog database stuff
|
||||
virtual char *GetFunctor();
|
||||
virtual void WritePrologAttributes(wxExpr *clause);
|
||||
virtual void ReadPrologAttributes(wxExpr *clause);
|
||||
// I/O
|
||||
virtual void WriteAttributes(wxExpr *clause);
|
||||
virtual void ReadAttributes(wxExpr *clause);
|
||||
#endif
|
||||
|
||||
virtual void FindNth(wxShape *image, int *nth, int *no_arcs, bool incoming);
|
||||
|
@ -155,7 +155,7 @@ $(DOCDIR)\pdf\ogl.rtf: $(DOCSOURCES)
|
||||
$(DOCDIR)\html\ogl\ogl.htm: $(DOCSOURCES)
|
||||
cd $(LOCALDOCDIR)
|
||||
-mkdir $(DOCDIR)\html\ogl
|
||||
cp *.gif $(DOCDIR)\html\ogl
|
||||
copy *.gif $(DOCDIR)\html\ogl
|
||||
-start /w tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\html\ogl\ogl.htm -twice -html
|
||||
-erase $(DOCDIR)\html\ogl\*.con
|
||||
-erase $(DOCDIR)\html\ogl\*.ref
|
||||
|
@ -537,7 +537,7 @@ bool wxDiagram::OnDatabaseSave(wxExprDatabase& db)
|
||||
|
||||
bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
{
|
||||
shape.WritePrologAttributes(&expr);
|
||||
shape.WriteAttributes(&expr);
|
||||
db.Append(&expr);
|
||||
|
||||
if (shape.IsKindOf(CLASSINFO(wxCompositeShape)))
|
||||
@ -557,7 +557,7 @@ bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
|
||||
bool wxDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
{
|
||||
shape.ReadPrologAttributes(&expr);
|
||||
shape.ReadAttributes(&expr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
|
||||
void SetSnapToGrid(bool snap);
|
||||
void SetGridSpacing(double spacing);
|
||||
inline double GetGridSpacing() { return m_gridSpacing; }
|
||||
inline double GetGridSpacing() const { return m_gridSpacing; }
|
||||
inline bool GetSnapToGrid() const { return m_snapToGrid; }
|
||||
void Snap(double *x, double *y);
|
||||
|
||||
@ -85,7 +85,7 @@ protected:
|
||||
wxShapeCanvas* m_diagramCanvas;
|
||||
bool m_quickEditMode;
|
||||
bool m_snapToGrid;
|
||||
double m_gridSpacing;
|
||||
double m_gridSpacing;
|
||||
int m_mouseTolerance;
|
||||
wxList* m_shapeList;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user