📄 classes.tex
字号:
`Snaps' the coordinate to the nearest grid position, if snap-to-grid is on.
\section{\class{wxDrawnShape}}\label{wxdrawnshape}
Draws a pseduo-metafile shape, which can be loaded from a simple Windows metafile.
wxDrawnShape allows you to specify a different shape for each of four orientations (North, West,
South and East). It also provides a set of drawing functions for programmatic drawing of a shape,
so that during construction of the shape you can draw into it as if it were a device context.
\wxheading{Derived from}
\helpref{wxRectangleShape}{wxrectangleshape}
See also \helpref{wxRectangleShape}{wxrectangleshape}.
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxDrawnShape::wxDrawnShape}
\func{}{wxDrawnShape}{\void}
Constructor.
\membersection{wxDrawnShape::\destruct{wxDrawnShape}}
\func{}{\destruct{wxDrawnShape}}{\void}
Destructor.
\membersection{wxDrawnShape::CalculateSize}
\func{void}{CalculateSize}{\void}
Calculates the wxDrawnShape size from the current metafile. Call this after you have drawn
into the shape.
\membersection{wxDrawnShape::DestroyClippingRect}\label{wxdrawnshapedestroyclippingrect}
\func{void}{DestroyClippingRect}{\void}
Destroys the clipping rectangle. See also \helpref{wxDrawnShape::SetClippingRect}{wxdrawnshapesetclippingrect}.
\membersection{wxDrawnShape::DrawArc}\label{wxdrawnshapedrawarc}
\func{void}{DrawArc}{\param{const wxPoint\&}{ centrePoint}, \param{const wxPoint\&}{ startPoint},
\param{const wxPoint\&}{ endPoint}}
Draws an arc (see wxWindows documentation for details).
\membersection{wxDrawnShape::DrawAtAngle}\label{wxdrawnshapedrawatangle}
\func{void}{DrawAtAngle}{\param{int}{ angle}}
Sets the metafile for the given orientation, which can be one of:
\begin{itemize}\itemsep=0pt
\item oglDRAWN\_ANGLE\_0
\item oglDRAWN\_ANGLE\_90
\item oglDRAWN\_ANGLE\_180
\item oglDRAWN\_ANGLE\_270
\end{itemize}
See also \helpref{wxDrawnShape::GetAngle}{wxdrawnshapegetangle}.
\membersection{wxDrawnShape::DrawEllipticArc}\label{wxdrawnshapedrawellipticarc}
\func{void}{DrawEllipticArc}{\param{const wxRect\&}{ rect}, \param{double}{ startAngle}, \param{double}{ endAngle}}
Draws an elliptic arc (see wxWindows documentation for details).
\membersection{wxDrawnShape::DrawLine}\label{wxdrawnshapedrawline}
\func{void}{DrawLine}{\param{const wxPoint\&}{ point1}, \param{const wxPoint\&}{ point2}}
Draws a line from {\it point1} to {\it point2}.
\membersection{wxDrawnShape::DrawLines}\label{wxdrawnshapedrawlines}
\func{void}{DrawLines}{\param{int}{ n}, \param{wxPoint\&}{ points[]}}
Draws {\it n} lines.
\membersection{wxDrawnShape::DrawPoint}\label{wxdrawnshapedrawpoint}
\func{void}{DrawPoint}{\param{const wxPoint\&}{ point}}
Draws a point.
\membersection{wxDrawnShape::DrawPolygon}\label{wxdrawnshapedrawpolygon}
\func{void}{DrawPolygon}{\param{int}{ n}, \param{wxPoint\&}{ points[]}, \param{int}{ flags = 0}}
Draws a polygon. {\it flags} can be one or more of {\bf oglMETAFLAGS\_OUTLINE} (use this polygon for the drag outline)
and {\bf oglMETAFLAGS\_ATTACHMENTS} (use the vertices of this polygon for attachments).
\membersection{wxDrawnShape::DrawRectangle}\label{wxdrawnshapedrawrectangle}
\func{void}{DrawRectangle}{\param{const wxRect\&}{ rect}}
Draws a rectangle.
\membersection{wxDrawnShape::DrawRoundedRectangle}\label{wxdrawnshapedrawroundedrectangle}
\func{void}{DrawRoundedRectangle}{\param{const wxRect\&}{ rect}, \param{double}{ radius}}
Draws a rounded rectangle. {\it radius} is the corner radius. If {\it radius} is negative,
it expresses the radius as a proportion of the smallest dimension of the rectangle.
\membersection{wxDrawnShape::DrawSpline}\label{wxdrawnshapedrawspline}
\func{void}{DrawSpline}{\param{int}{ n}, \param{wxPoint\&}{ points[]}}
Draws a spline curve.
\membersection{wxDrawnShape::DrawText}\label{wxdrawnshapedrawtext}
\func{void}{DrawText}{\param{const wxString\&}{ text}, \param{const wxPoint\&}{ point}}
Draws text at the given point.
\membersection{wxDrawnShape::GetAngle}\label{wxdrawnshapegetangle}
\constfunc{int}{GetAngle}{\void}
Returns the current orientation, which can be one of:
\begin{itemize}\itemsep=0pt
\item oglDRAWN\_ANGLE\_0
\item oglDRAWN\_ANGLE\_90
\item oglDRAWN\_ANGLE\_180
\item oglDRAWN\_ANGLE\_270
\end{itemize}
See also \helpref{wxDrawnShape::DrawAtAngle}{wxdrawnshapedrawatangle}.
\membersection{wxDrawnShape::GetMetaFile}
\constfunc{wxPseudoMetaFile\& }{GetMetaFile}{\void}
Returns a reference to the internal `pseudo-metafile'.
\membersection{wxDrawnShape::GetRotation}\label{wxdrawnshapegetrotation}
\constfunc{double}{GetRotation}{\void}
Returns the current rotation of the shape in radians.
\membersection{wxDrawnShape::LoadFromMetaFile}
\func{bool}{LoadFromMetaFile}{\param{const wxString\& }{filename}}
Loads a (very simple) Windows metafile, created for example by Top Draw, the Windows shareware graphics package.
\membersection{wxDrawnShape::Rotate}
\func{void}{Rotate}{\param{double }{x}, \param{double }{y}, \param{double }{theta}}
Rotate about the given axis by the given amount in radians.
\membersection{wxDrawnShape::SetClippingRect}\label{wxdrawnshapesetclippingrect}
\func{void}{SetClippingRect}{\param{const wxRect\&}{ rect}}
Sets the clipping rectangle. See also \helpref{wxDrawnShape::DestroyClippingRect}{wxdrawnshapedestroyclippingrect}.
\membersection{wxDrawnShape::SetDrawnBackgroundColour}\label{wxdrawnshapesetdrawnbackgroundcolour}
\func{void}{SetDrawnBackgroundColour}{\param{const wxColour\&}{ colour}}
Sets the current background colour for the current metafile.
\membersection{wxDrawnShape::SetDrawnBackgroundMode}\label{wxdrawnshapesetdrawnbackgroundmode}
\func{void}{SetDrawnBackgroundMode}{\param{int}{ mode}}
Sets the current background mode for the current metafile.
\membersection{wxDrawnShape::SetDrawnBrush}\label{wxdrawnshapesetdrawnbrush}
\func{void}{SetDrawnBrush}{\param{wxPen*}{ pen}, \param{bool}{ isOutline = FALSE}}
Sets the pen for this metafile. If {\it isOutline} is TRUE, this pen is taken to indicate the outline
(and if the outline pen is changed for the whole shape, the pen will be replaced with the outline pen).
\membersection{wxDrawnShape::SetDrawnFont}\label{wxdrawnshapesetdrawnfont}
\func{void}{SetDrawnFont}{\param{wxFont*}{ font}}
Sets the current font for the current metafile.
\membersection{wxDrawnShape::SetDrawnPen}\label{wxdrawnshapesetdrawnpen}
\func{void}{SetDrawnPen}{\param{wxPen*}{ pen}, \param{bool}{ isOutline = FALSE}}
Sets the pen for this metafile. If {\it isOutline} is TRUE, this pen is taken to indicate the outline
(and if the outline pen is changed for the whole shape, the pen will be replaced with the outline pen).
\membersection{wxDrawnShape::SetDrawnTextColour}\label{wxdrawnshapesetdrawntextcolour}
\func{void}{SetDrawnTextColour}{\param{const wxColour\&}{ colour}}
Sets the current text colour for the current metafile.
\membersection{wxDrawnShape::Scale}
\func{void}{Scale}{\param{double }{sx}, \param{double }{sy}}
Scales the shape by the given amount.
\membersection{wxDrawnShape::SetSaveToFile}
\func{void}{SetSaveToFile}{\param{bool }{save}}
If {\it save} is TRUE, the image will be saved along with the shape's other attributes. The reason
why this might not be desirable is that if there are many shapes with the same image, it would be
more efficient for the application to save one copy, and not duplicate the information for every
shape. The default is TRUE.
\membersection{wxDrawnShape::Translate}
\func{void}{Translate}{\param{double }{x}, \param{double }{y}}
Translates the shape by the given amount.
\section{\class{wxCircleShape}}\label{wxcircleshape}
An wxEllipseShape whose width and height are the same.
\wxheading{Derived from}
\helpref{wxEllipseShape}{wxellipseshape}.
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxCircleShape::wxCircleShape}
\func{}{wxCircleShape}{\param{double}{ width = 0.0}}
Constructor.
\membersection{wxCircleShape::\destruct{wxCircleShape}}
\func{}{\destruct{wxCircleShape}}{\void}
Destructor.
\section{\class{wxCompositeShape}}\label{wxcompositeshape}
This is an object with a list of child objects, and a list of size
and positioning constraints between the children.
\wxheading{Derived from}
\helpref{wxRectangleShape}{wxrectangleshape}
\wxheading{See also}
\helpref{wxCompositeShape overview}{compositeshapeoverview}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxCompositeShape::wxCompositeShape}
\func{}{wxCompositeShape}{\void}
Constructor.
\membersection{wxCompositeShape::\destruct{wxCompositeShape}}
\func{}{\destruct{wxCompositeShape}}{\void}
Destructor.
\membersection{wxCompositeShape::AddChild}\label{wxcompositeshapeaddchild}
\func{void}{AddChild}{\param{wxShape *}{child}, \param{wxShape *}{addAfter = NULL}}
Adds a child shape to the composite. If {\it addAfter} is non-NULL, the shape will be added
after this shape.
\membersection{wxCompositeShape::AddConstraint}\label{wxcompositeshapeaddconstraint}
\func{wxOGLConstraint *}{AddConstraint}{\param{wxOGLConstraint *}{constraint}}
\func{wxOGLConstraint *}{AddConstraint}{\param{int}{ type}, \param{wxShape *}{constraining}, \param{wxList\&}{constrained}}
\func{wxOGLConstraint *}{AddConstraint}{\param{int}{ type}, \param{wxShape *}{constraining}, \param{wxShape *}{constrained}}
Adds a constraint to the composite.
\membersection{wxCompositeShape::CalculateSize}
\func{void}{CalculateSize}{\void}
Calculates the size and position of the composite based on child sizes and positions.
\membersection{wxCompositeShape::ContainsDivision}
\func{bool}{FindContainerImage}{\param{wxDivisionShape *}{division}}
Returns TRUE if {\it division} is a descendant of this container.
\membersection{wxCompositeShape::DeleteConstraint}
\func{void}{DeleteConstraint}{\param{wxOGLConstraint *}{constraint}}
Deletes constraint from composite.
\membersection{wxCompositeShape::DeleteConstraintsInvolvingChild}
\func{void}{DeleteConstraintsInvolvingChild}{\param{wxShape *}{child}}
This function deletes constraints which mention the given child. Used when
deleting a child from the composite.
\membersection{wxCompositeShape::FindConstraint}
\func{wxOGLConstraint *}{FindConstraint}{\param{long}{ id}, \param{wxCompositeShape **}{actualComposite}}
Finds the constraint with the given id, also returning the actual composite the constraint was in,
in case that composite was a descendant of this composite.
\membersection{wxCompositeShape::FindContainerImage}
\func{wxShape *}{FindContainerImage}{\void}
Finds the image used to visualize a container. This is any child
of the composite that is not in the divisions list.
\membersection{wxCompositeShape::GetConstraints}
\constfunc{wxList\&}{GetConstraints}{\void}
Returns a reference to the list of constraints.
\membersection{wxCompositeShape::GetDivisions}
\constfunc{wxList\&}{GetDivisions}{\void}
Returns a reference to the list of divisions.
\membersection{wxCompositeShape::MakeContainer}\label{wxcompositeshapemakecontainer}
\func{void}{MakeContainer}{\void}
Makes this composite into a container by creating one child wxDivisionShape.
\membersection{wxCompositeShape::OnCreateDivision}
\func{wxDivisionShape *}{OnCreateDivision}{\void}
Called when a new division shape is required. Can be overriden to allow an application
to use a different class of division.
\membersection{wxCompositeShape::Recompute}\label{wxcompositeshaperecompute}
\func{bool}{Recompute}{\void}
Recomputes any constraints associated with the object. If FALSE is returned,
the constraints could not be satisfied (there was an inconsistency).
\membersection{wxCompositeShape::RemoveChild}
\func{void}{RemoveChild}{\param{wxShape *}{child}}
Removes the child from the composite and any constraint relationships, but does not
delete the child.
\section{\class{wxDividedShape}}\label{wxdividedshape}
A wxDividedShape is a rectangle with a number of vertical divisions. Each
division may have its text formatted with independent characteristics, and
the size of each division relative to the whole image may be specified.
\wxheading{Derived from}
\helpref{wxRectangleShape}{wxrectangleshape}
\wxheading{See also}
\helpref{wxDividedShape overview}{dividedshapeoverview}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxDividedShape::wxDividedShape}
\func{}{wxDividedShape}{\param{double}{ width = 0.0}, \param{double}{ height = 0.0}}
Constructor.
\membersection{wxDividedShape::\destruct{wxDividedShape}}
\func{}{\destruct{wxDividedShape}}{\void}
Destructor.
\membersection{wxDividedShape::EditRegions}
\func{void}{EditRegions}{\void}
Edit the region colours and styles.
\membersection{wxDividedShape::SetRegionSizes}
\func{void}{SetRegionSizes}{\void}
Set all region sizes according to proportions and
this object total size.
\section{\class{wxDivisionShape}}\label{wxdivisionshape}
A division shape is like a composite in that it can contain further objects, but is used exclusively to
divide another shape into regions, or divisions. A wxDivisionShape is never free-standing.
\wxheading{Derived from}
\helpref{wxCompositeShape}{wxcompositeshape}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -