📄 classes.tex
字号:
Draws the internal graphic of the shape (such as
text).
Do not override this function: override OnDrawContents, which is called
by this function.
\membersection{wxShape::DrawLinks}
\func{void}{DrawLinks}{\param{wxDC\&}{ dc}, \param{int}{ attachment = -1}}
Draws any lines linked to this shape.
\membersection{wxShape::Erase}
\func{void}{Erase}{\param{wxDC\&}{ dc}}
Erases the shape, but does not repair damage caused to other
shapes.
\membersection{wxShape::EraseContents}
\func{void}{EraseContents}{\param{wxDC\&}{ dc}}
Erases the shape contents, that is, the area within the shape's
minimum bounding box.
\membersection{wxShape::EraseLinks}
\func{void}{EraseLinks}{\param{wxDC\&}{ dc}, \param{int}{ attachment = -1}}
Erases links attached to this shape, but does not repair
damage caused to other shapes.
\membersection{wxShape::FindRegion}
\func{wxShape *}{FindRegion}{\param{const wxString\& }{regionName}, \param{int *}{regionId}}
Finds the actual image (`this' if non-composite) and region id for the given
region name.
\membersection{wxShape::FindRegionNames}
\func{void}{FindRegionNames}{\param{wxStringList\&}{ list}}
Finds all region names for this image (composite or simple).
Supply an empty string list.
\membersection{wxShape::Flash}
\func{void}{Flash}{\void}
Flashes the shape.
\membersection{wxShape::FormatText}
\func{void}{FormatText}{\param{const wxString\& }{s}, \param{int}{ i = 0}}
Reformats the given text region; defaults to formatting the default region.
\membersection{wxShape::GetAttachmentMode}
\constfunc{bool}{GetAttachmentMode}{\void}
Returns the attachment mode, which is TRUE if attachments are used, FALSE otherwise (in which case
lines will be drawn as if to the centre of the shape). See \helpref{wxShape::SetAttachmentMode}{wxshapesetattachmentmode}.
\membersection{wxShape::GetAttachmentPosition}\label{wxshapegetattachmentposition}
\func{bool}{GetAttachmentPosition}{\param{int}{ attachment}, \param{double*}{ x}, \param{double*}{ y},
\param{int}{ nth = 0}, \param{int}{ noArcs = 1}, \param{wxLineShape*}{ line = NULL}}
Gets the position at which the given attachment point should be drawn.
If {\it attachment} isn't found among the attachment points of the shape, returns FALSE.
\membersection{wxShape::GetBoundingBoxMax}
\func{void}{GetBoundingBoxMax}{\param{double *}{width}, \param{double *}{height}}
Gets the maximum bounding box for the shape, taking into
account external features such as shadows.
\membersection{wxShape::GetBoundingBoxMin}
\func{void}{GetBoundingBoxMin}{\param{double *}{width}, \param{double *}{height}}
Gets the minimum bounding box for the shape, that defines
the area available for drawing the contents (such as text).
\membersection{wxShape::GetBrush}
\constfunc{wxBrush*}{GetBrush}{\void}
Returns the brush used for filling the shape.
\membersection{wxShape::GetCanvas}
\constfunc{wxShapeCanvas*}{GetCanvas}{\void}
Gets the internal canvas pointer.
\membersection{wxShape::GetCentreResize}
\constfunc{bool}{GetCentreResize}{\void}
Returns TRUE if the shape is to be resized from the centre (the centre
stands still), or FALSE if from the corner or side being dragged (the
other corner or side stands still).
\membersection{wxShape::GetChildren}
\constfunc{wxList\&}{GetChildren}{\void}
Returns a reference to the list of children for this shape.
\membersection{wxShape::GetClientData}
\func{wxObject*}{GetClientData}{\void}
Gets the client data associated with the shape (NULL if there is
none).
\membersection{wxShape::GetDisableLabel}
\constfunc{bool}{GetDisableLabel}{\void}
Returns TRUE if the default region will not be shown, FALSE otherwise.
\membersection{wxShape::GetEventHandler}
\constfunc{wxShapeEvtHandler*}{GetEventHandler}{\void}
Returns the event handler for this shape.
\membersection{wxShape::GetFixedHeight}
\constfunc{bool}{GetFixedHeight}{\void}
Returns TRUE if the shape cannot be resized in the vertical plane.
\membersection{wxShape::GetFixedSize}
\func{void}{GetFixedSize}{\param{bool *}{ x}, \param{bool *}{ y}}
Returns flags indicating whether the shape is of fixed size in either direction.
\membersection{wxShape::GetFixedWidth}
\constfunc{bool}{GetFixedWidth}{\void}
Returns TRUE if the shape cannot be resized in the horizontal plane.
\membersection{wxShape::GetFont}
\constfunc{wxFont*}{GetFont}{\param{int}{ regionId = 0}}
Gets the font for the specified text region.
\membersection{wxShape::GetFunctor}
\constfunc{wxString}{GetFunctor}{\void}
Gets a string representing the type of the shape, to be used when
writing out shape descriptions to a file. This is overridden by
each derived shape class to provide an appropriate type string. By default,
"node\_image" is used for non-line shapes, and "arc\_image" for lines.
\membersection{wxShape::GetId}
\constfunc{long}{GetId}{\void}
Returns the integer identifier for this shape.
\membersection{wxShape::GetLinePosition}\label{wxshapegetlineposition}
\func{int}{GetLinePosition}{\param{wxLineShape*}{ line}}
Gets the zero-based position of {\it line} in the list of lines for this shape.
\membersection{wxShape::GetLines}
\constfunc{wxList\&}{GetLines}{\void}
Returns a reference to the list of lines connected to this shape.
\membersection{wxShape::GetMaintainAspectRatio}\label{wxshapegetmaintainaspectratio}
\constfunc{bool}{GetMaintainAspectRatio}{\void}
If returns TRUE, resizing the shape will not change the aspect ratio
(width and height will be in the original proportion).
\membersection{wxShape::GetNumberOfAttachments}\label{wxshapegetnumberofattachments}
\constfunc{int}{GetNumberOfAttachments}{\void}
Gets the number of attachment points for this shape.
\membersection{wxShape::GetNumberOfTextRegions}
\constfunc{int}{GetNumberOfTextRegions}{\void}
Gets the number of text regions for this shape.
\membersection{wxShape::GetParent}
\constfunc{wxShape *}{GetParent}{\void}
Returns the parent of this shape, if it is part of a composite.
\membersection{wxShape::GetPen}
\constfunc{wxPen*}{GetPen}{\void}
Returns the pen used for drawing the shape's outline.
\membersection{wxShape::GetPerimeterPoint}
\func{bool}{GetPerimeterPoint}{\param{double}{ x1}, \param{double}{ y1}, \param{double}{ x2}, \param{double}{ y2}, \param{double *}{x3}, \param{double *}{y3}}
Gets the point at which the line from (x1, y1) to (x2, y2) hits the shape. Returns TRUE if the
line hits the perimeter.
\membersection{wxShape::GetRegionId}\label{getregionid}
\func{int}{GetRegionId}{\param{const wxString\& }{name}}
Gets the region's identifier by name. This is {\it not} unique for within an entire composite, but
is unique for the image.
\membersection{wxShape::GetRegionName}\label{getregionname}
\func{wxString}{GetRegionName}{\param{int}{ regionId = 0}}
Gets the region's name. A region's name can be used to uniquely determine a region within
an entire composite image hierarchy. See also \helpref{wxShape::SetRegionName}{wxshapesetregionname}.
\membersection{wxShape::GetRegions}\label{getregions}
\func{wxList\&}{GetRegions}{\void}
Returns the list of wxShapeRegions.
\membersection{wxShape::GetRotation}
\constfunc{double}{GetRotatation}{\void}
Returns the angle of rotation in radians.
\membersection{wxShape::GetSensitivityFilter}
\constfunc{void}{GetSensitivityFilter}{\void}
Returns the sensitivity filter, a bitlist of values. See \helpref{wxShape::SetSensitivityFilter}{wxshapesetsensitivityfilter}.
\membersection{wxShape::GetShadowMode}
\constfunc{int}{SetShadowMode}{\void}
Returns the shadow mode. See \helpref{wxShape::SetShadowMode}{wxshapesetshadowmode}.
\membersection{wxShape::GetSpaceAttachments}
\constfunc{bool}{GetSpaceAttachments}{\void}
Indicates whether lines should be spaced out evenly at the point they touch the node (TRUE), or whether they
should join at a single point (FALSE).
\membersection{wxShape::GetTextColour}
\constfunc{wxString}{GetTextColour}{\param{int}{ regionId = 0}}
Gets the colour for the specified text region.
\membersection{wxShape::GetTopAncestor}
\constfunc{wxShape *}{GetTopAncestor}{\void}
Returns the top-most ancestor of this shape (the root of the composite).
\membersection{wxShape::GetX}
\constfunc{double}{GetX}{\void}
Gets the x position of the centre of the shape.
\membersection{wxShape::GetY}
\constfunc{double}{GetY}{\void}
Gets the y position of the centre of the shape.
\membersection{wxShape::HitTest}
\func{bool}{HitTest}{\param{double}{ x}, \param{double}{ y}, \param{int*}{ attachment}, \param{double*}{ distance}}
Given a point on a canvas, returns TRUE if the point was on the shape, and returns
the nearest attachment point and distance from the given point and target.
\membersection{wxShape::Insert}
\func{void}{InsertInCanvas}{\param{wxShapeCanvas*}{ canvas}}
Inserts the shape at the front of the shape list of {\it canvas}.
\membersection{wxShape::IsHighlighted}
\constfunc{bool}{IsHighlighted}{\void}
Returns TRUE if the shape is highlighted. Shape highlighting is unimplemented.
\membersection{wxShape::IsShown}
\constfunc{bool}{IsShown}{\void}
Returns TRUE if the shape is in a visible state, FALSE otherwise. Note
that this has nothing to do with whether the window is hidden or the
shape has scrolled off the canvas; it refers to the internal
visibility flag.
\membersection{wxShape::MakeControlPoints}
\func{void}{MakeControlPoints}{\void}
Make a list of control points (draggable handles) appropriate to the shape.
\membersection{wxShape::MakeMandatoryControlPoints}
\func{void}{MakeMandatoryControlPoints}{\void}
Make the mandatory control points. For example, the control point on a dividing line should
appear even if the divided rectangle shape's handles should not appear (because it is the child of
a composite, and children are not resizable).
\membersection{wxShape::Move}\label{wxshapemove}
\func{void}{Move}{\param{wxDC\&}{ dc}, \param{double}{ x1}, \param{double}{ y1}, \param{bool}{ display = TRUE}}
Move the shape to the given position, redrawing if {\it display} is TRUE.
\membersection{wxShape::MoveLineToNewAttachment}\label{wxshapemovelinetonewattachment}
\func{void}{MoveLineToNewAttachment}{\param{wxDC\&}{ dc}, \param{wxLineShape*}{ toMove}, \param{double}{ x}, \param{double}{ y}}
Move the given line (which must already be attached to the shape) to
a different attachment point on the shape, or a different order on the same attachment.
Cals \helpref{wxShape::AttachmentSortTest}{wxshapeattachmentsorttest} and then \helpref{wxShapeEvtHandler::OnChangeAttachment}{wxshapeevthandleronchangeattachment}.
\membersection{wxShape::MoveLinks}
\func{void}{MoveLinks}{\param{wxDC\&}{ dc}}
Redraw all the lines attached to the shape.
\membersection{wxShape::NameRegions}
\func{void}{NameRegions}{\param{const wxString\& }{parentName = ``"}}
Make unique names for all the regions in a shape or composite shape.
\membersection{wxShape::Rotate}
\func{void}{Rotate}{\param{double }{x}, \param{double }{y}, \param{double }{theta}}
Rotate about the given axis by the given amount in radians (does nothing
for most shapes). But even non-rotating shapes should record their
notional rotation in case it's important (e.g. in dog-leg code).
\membersection{wxShape::ReadConstraints}
\func{void}{ReadConstraints}{\param{wxExpr *}{clause}, \param{wxExprDatabase *}{database}}
If the shape is a composite, it may have constraints that need to be read in in a separate pass.
\membersection{wxShape::ReadAttributes}
\func{void}{ReadAttributes}{\param{wxExpr*}{ clause}}
Reads the attributes (data member values) from the given expression.
\membersection{wxShape::ReadRegions}
\func{void}{ReadRegions}{\param{wxExpr *}{clause}}
Reads in the regions.
\membersection{wxShape::Recentre}
\func{void}{Recentre}{\void}
Does recentring (or other formatting) for all the text regions for this shape.
\membersection{wxShape::RemoveFromCanvas}
\func{void}{RemoveFromCanvas}{\param{wxShapeCanvas*}{ canvas}}
Removes the shape from the canvas.
\membersection{wxShape::ResetControlPoints}
\func{void}{ResetControlPoints}{\void}
Resets the positions of the control points (for instance when the
shape's shape has changed).
\membersection{wxShape::ResetMandatoryControlPoints}
\func{void}{ResetMandatoryControlPoints}{\void}
Reset the mandatory control points. For example, the control point on a dividing line should
appear even if the divided rectangle shape's handles should not appear (because it is the child of
a composite, and children are not resizable).
\membersection{wx
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -