📄 classes.tex
字号:
\chapter{Class reference}\label{classref}
\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
\setfooter{\thepage}{}{}{}{}{\thepage}
These are the main \ogl\ classes.
\section{\class{wxOGLConstraint}}\label{wxoglconstraint}
\overview{wxCompositeShape overview}{compositeshapeoverview}
An wxOGLConstraint object helps specify how child shapes are laid out with respect
to siblings and parents.
\wxheading{Derived from}
wxObject
\wxheading{See also}
\helpref{wxCompositeShape}{wxcompositeshape}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxOGLConstraint::wxOGLConstraint}\label{wxoglconstraintconstr}
\func{}{wxOGLConstraint}{\void}
Default constructor.
\func{}{wxOGLConstraint}{\param{int}{ type}, \param{wxShape *}{constraining}, \param{wxList\& }{constrained}}
Constructor.
\wxheading{Parameters}
\docparam{constraining}{The shape which is used as the reference for positioning the {\it constrained} objects.}
\docparam{constrained}{Contains a list of wxShapes which are to be constrained (with respect
to {\it constraining}) using {\it type}.}
\docparam{type}{Can be one of:
\begin{itemize}\itemsep=0pt
\item {\bf gyCONSTRAINT\_CENTRED\_VERTICALLY}: the Y co-ordinates of the centres of the
bounding boxes of the constrained objects and the constraining object
will be the same
\item {\bf gyCONSTRAINT\_CENTRED\_HORIZONTALLY}: the X co-ordinates of the centres of the
bounding boxes of the constrained objects and the constraining object
will be the same
\item {\bf gyCONSTRAINT\_CENTRED\_BOTH}: the co-ordinates of the centres of the bounding boxes
of the constrained objects and the constraining object will be the same
\item {\bf gyCONSTRAINT\_LEFT\_OF}: the X co-ordinates of the right hand vertical edges
of the bounding boxes of the constrained objects will be less than
the X co-ordinate of the left hand vertical edge of the bounding box
of the constraining object
\item {\bf gyCONSTRAINT\_RIGHT\_OF}: the X co-ordinates of the left hand vertical edges
of the bounding boxes of the constrained objects will be greater than
the X co-ordinate of the right hand vertical edge of the bounding box
of the constraining object
\item {\bf gyCONSTRAINT\_ABOVE}: the Y co-ordinates of the bottom horizontal edges of the
bounding boxes of the constrained objects will be less than the
Y co-ordinate of the top horizontal edge of the bounding box of the
constraining object
\item {\bf gyCONSTRAINT\_BELOW}: the Y co-ordinates of the top horizontal edges of the
bounding boxes of the constrained objects will be greater than
the X co-ordinate of the bottom horizontal edge of the bounding box
of the constraining object
\item {\bf gyCONSTRAINT\_ALIGNED\_TOP}: the Y co-ordinates of the top horizontal edges of the
bounding boxes of the constrained objects will be the same as the
Y co-ordinate of the top horizontal edge of the bounding box of the
constraining object
\item {\bf gyCONSTRAINT\_ALIGNED\_BOTTOM}: the Y co-ordinates of the bottom horizontal edges
of the bounding boxes of the constrained objects will be the same as
the Y co-ordinate of the bottom horizontal edge of the bounding box
of the constraining object
\item {\bf gyCONSTRAINT\_ALIGNED\_LEFT}: the X co-ordinates of the left hand vertical edges
of the bounding boxes of the constrained objects will be the same as
the X co-ordinate of the left hand vertical edge of the bounding box
of the constraining object
\item {\bf gyCONSTRAINT\_ALIGNED\_RIGHT}: the X co-ordinates of the right hand vertical edges
of the bounding boxes of the constrained objects will be the same as
the X co-ordinate of the right hand vertical edge of the bounding box
of the constraining object
\item {\bf gyCONSTRAINT\_MIDALIGNED\_TOP}: the Y co-ordinates of the centres of
the bounding boxes of the constrained objects will be the same
as the Y co-ordinate of the top horizontal edge of
the bounding box of the constraining object
\item {\bf gyCONSTRAINT\_MIDALIGNED\_BOTTOM}: the Y co-ordinates of the centres of
the bounding boxes of the constrained objects will be the same
as the Y co-ordinate of the bottom horizontal edge of
the bounding box of the constraining object
\item {\bf gyCONSTRAINT\_MIDALIGNED\_LEFT}: the X co-ordinates of the centres of
the bounding boxes of the constrained objects will be the same
as the X co-ordinate of the left hand vertical edge of
the bounding box of the constraining object
\item {\bf gyCONSTRAINT\_MIDALIGNED\_RIGHT}: the X co-ordinates of the centres of
the bounding boxes of the constrained objects will be the same as
the X co-ordinate of the right hand vertical edge of
the bounding box of the constraining object
\end{itemize}
}
\membersection{wxOGLConstraint::\destruct{wxOGLConstraint}}
\func{}{\destruct{wxOGLConstraint}}{\void}
Destructor.
\membersection{wxOGLConstraint::Equals}
\func{bool}{Equals}{\param{double}{ x}, \param{double}{ y}}
Returns TRUE if {\it x} and {\it y} are approximately equal (for the purposes
of evaluating the constraint).
\membersection{wxOGLConstraint::Evaluate}
\func{bool}{Evaluate}{\void}
Evaluates this constraint, returning TRUE if anything changed.
\membersection{wxOGLConstraint::SetSpacing}\label{wxoglconstraintsetspacing}
\func{void}{SetSpacing}{\param{double}{ x}, \param{double}{ y}}
Sets the horizontal and vertical spacing for the constraint.
\section{\class{wxBitmapShape}}\label{wxbitmapshape}
Draws a bitmap (non-resizable).
\wxheading{Derived from}
\helpref{wxRectangleShape}{wxrectangleshape}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxBitmapShape::wxBitmapShape}
\func{}{wxBitmapShape}{\void}
Constructor.
\membersection{wxBitmapShape::\destruct{wxBitmapShape}}
\func{}{\destruct{wxBitmapShape}}{\void}
Destructor.
\membersection{wxBitmapShape::GetBitmap}
\constfunc{wxBitmap\&}{GetBitmap}{\void}
Returns a reference to the bitmap associated with this shape.
\membersection{wxBitmapShape::GetFilename}
\constfunc{wxString}{GetFilename}{\void}
Returns the bitmap filename.
\membersection{wxBitmapShape::SetBitmap}
\func{void}{SetBitmap}{\param{const wxBitmap\&}{ bitmap}}
Sets the bitmap associated with this shape. You can delete the bitmap
from the calling application, since reference counting will take care of
holding on to the internal bitmap data.
\membersection{wxBitmapShape::SetFilename}
\func{void}{SetFilename}{\param{const wxString\& }{filename}}
Sets the bitmap filename.
\section{\class{wxDiagram}}\label{wxdiagram}
Encapsulates an entire diagram, with methods for reading/writing and drawing.
A diagram has an associated wxShapeCanvas.
\wxheading{Derived from}
wxObject
\wxheading{See also}
\helpref{wxShapeCanvas}{wxshapecanvas}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxDiagram::wxDiagram}
\func{}{wxDiagram}{\void}
Constructor.
\membersection{wxDiagram::\destruct{wxDiagram}}
\func{}{\destruct{wxDiagram}}{\void}
Destructor.
\membersection{wxDiagram::AddShape}
\func{void}{AddShape}{\param{wxShape*}{shape}, \param{wxShape *}{addAfter = NULL}}
Adds a shape to the diagram. If {\it addAfter} is non-NULL, the shape will be added after this
one.
\membersection{wxDiagram::Clear}
\func{void}{Clear}{\param{wxDC\&}{ dc}}
Clears the specified device context.
\membersection{wxDiagram::DeleteAllShapes}
\func{void}{DeletesAllShapes}{\void}
Removes and deletes all shapes in the diagram.
\membersection{wxDiagram::DrawOutline}
\func{void}{DrawOutline}{\param{wxDC\&}{ dc}, \param{double}{ x1}, \param{double}{ y1}, \param{double}{ x2}, \param{double}{ y2}}
Draws an outline rectangle on the current device context.
\membersection{wxDiagram::FindShape}\label{wxdiagramfindshape}
\constfunc{wxShape*}{FindShape}{\param{long}{ id}}
Returns the shape for the given identifier.
\membersection{wxDiagram::GetCanvas}
\constfunc{wxShapeCanvas*}{GetCanvas}{\void}
Returns the shape canvas associated with this diagram.
\membersection{wxDiagram::GetCount}\label{wxdiagramgetcount}
\constfunc{int}{GetCount}{\void}
Returns the number of shapes in the diagram.
\membersection{wxDiagram::GetGridSpacing}
\constfunc{double}{GetGridSpacing}{\void}
Returns the grid spacing.
\membersection{wxDiagram::GetMouseTolerance}
\func{int}{GetMouseTolerance}{\void}
Returns the tolerance within which a mouse move is ignored.
\membersection{wxDiagram::GetShapeList}
\constfunc{wxList*}{GetShapeList}{\void}
Returns a pointer to the internal shape list.
\membersection{wxDiagram::GetQuickEditMode}
\constfunc{bool}{GetQuickEditMode}{\void}
Returns quick edit mode.
\membersection{wxDiagram::GetSnapToGrid}
\constfunc{bool}{GetSnapToGrid}{\void}
Returns snap-to-grid mode.
\membersection{wxDiagram::InsertShape}
\func{void}{InsertShape}{\param{wxShape *}{shape}}
Inserts a shape at the front of the shape list.
\membersection{wxDiagram::LoadFile}
\func{bool}{LoadFile}{\param{const wxString\& }{filename}}
Loads the diagram from a file.
\membersection{wxDiagram::OnDatabaseLoad}
\func{void}{OnDatabaseLoad}{\param{wxExprDatabase\&}{ database}}
Called just after the nodes and lines have been read from the wxExprDatabase. You may override this;
the default member does nothing.
\membersection{wxDiagram::OnDatabaseSave}
\func{void}{OnDatabaseSave}{\param{wxExprDatabase\&}{ database}}
Called just after the nodes and lines have been written to the wxExprDatabase. You may override this;
the default member does nothing.
\membersection{wxDiagram::OnHeaderLoad}
\func{bool}{OnHeaderLoad}{\param{wxExprDatabase\&}{ database}, \param{wxExpr\&}{ expr}}
Called to allow the `diagram' header object to be read. The default member reads no further information.
You may wish to override this to read version information, author name, etc.
\membersection{wxDiagram::OnHeaderSave}
\func{bool}{OnHeaderSave}{\param{wxExprDatabase\&}{ database}, \param{wxExpr\&}{ expr}}
Called to allow instantiation of the `diagram' header object. The default member writes no further information.
You may wish to override this to include version information, author name, etc.
\membersection{wxDiagram::OnShapeLoad}
\func{bool}{OnShapeLoad}{\param{wxExprDatabase\&}{ database}, \param{wxShape\&}{ shape}, \param{wxExpr\&}{ expr}}
Called to read the shape from the {\it expr}. You may override this, but call this function first.
The default member calls ReadAttributes for the shape.
\membersection{wxDiagram::OnShapeSave}
\func{bool}{OnShapeSave}{\param{wxExprDatabase\&}{ database}, \param{wxShape\&}{ shape}, \param{wxExpr\&}{ expr}}
Called to save the shape to the {\it expr} and {\it database}. You may override this, but call this function first.
The default member calls WriteAttributes for the shape, appends the shape to the database, and of the shape
is a composite, recursively calls OnShapeSave for its children.
\membersection{wxDiagram::ReadContainerGeometry}
\func{void}{ReadContainerGeometry}{\param{wxExprDatabase\&}{ database}}
Reads container geometry from a wxExprDatabase, linking up nodes which
are part of a composite. You probably won't need to redefine this.
\membersection{wxDiagram::ReadLines}
\func{void}{ReadLines}{\param{wxExprDatabase\&}{ database}}
Reads lines from a wxExprDatabase. You probably won't need to redefine this.
\membersection{wxDiagram::ReadNodes}
\func{void}{ReadNodes}{\param{wxExprDatabase\&}{ database}}
Reads nodes from a wxExprDatabase. You probably won't need to redefine this.
\membersection{wxDiagram::RecentreAll}
\func{void}{RecentreAll}{\param{wxDC\&}{ dc}}
Make sure all text that should be centred, is centred.
\membersection{wxDiagram::Redraw}
\func{void}{Redraw}{\param{wxDC\&}{ dc}}
Draws the shapes in the diagram on the specified device context.
\membersection{wxDiagram::RemoveAllShapes}
\func{void}{RemoveAllShapes}{\void}
Removes all shapes from the diagram but does not delete the shapes.
\membersection{wxDiagram::RemoveShape}
\func{void}{RemoveShape}{\param{wxShape*}{ shape}}
Removes the shape from the diagram (non-recursively) but does not delete it.
\membersection{wxDiagram::SaveFile}
\func{bool}{SaveFile}{\param{const wxString\& }{filename}}
Saves the diagram in a file.
\membersection{wxDiagram::SetCanvas}\label{wxdiagramsetcanvas}
\func{void}{SetCanvas}{\param{wxShapeCanvas*}{ canvas}}
Sets the canvas associated with this diagram.
\membersection{wxDiagram::SetGridSpacing}
\func{void}{SetGridSpacing}{\param{double}{ spacing}}
Sets the grid spacing. The default is 5.
\membersection{wxDiagram::SetMouseTolerance}
\func{void}{SetMouseTolerance}{\param{int}{ tolerance}}
Sets the tolerance within which a mouse move is ignored. The default is 3 pixels.
\membersection{wxDiagram::SetQuickEditMode}
\func{void}{SetQuickEditMode}{\param{bool}{ mode}}
Sets quick-edit-mode on or off. In this mode, refreshes are minimized, but the
diagram may need manual refreshing occasionally.
\membersection{wxDiagram::SetSnapToGrid}
\func{void}{SetSnapToGrid}{\param{bool}{ snap}}
Sets snap-to-grid mode on or off. The default is on.
\membersection{wxDiagram::ShowAll}
\func{void}{ShowAll}{\param{bool}{ show}}
Calls Show for each shape in the diagram.
\membersection{wxDiagram::Snap}
\func{void}{Snap}{\param{double *}{x}, \param{double *}{y}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -