101 int result =
m_Text.CmpNoCase( tmp->m_Text );
166 int rot_angle = aRotateCCW ? -900 : 900;
179 wxASSERT( plotter != NULL );
230 if( aColor == COLOR4D::UNSPECIFIED )
287 bBox.
Move( aOffset );
377 wxT(
"Invalid edit mode for LIB_TEXT object." ) );
397 wxT(
"Bad call to ContinueEdit(). Text is not being edited." ) );
406 wxT(
"Bad call to EndEdit(). Text is not being edited." ) );
void SetTextAngle(double aAngle)
KICAD_T Type() const
Function Type()
#define TEXT_ANGLE_HORIZ
Frequent text rotations, used with {Set,Get}TextAngle(), in 0.1 degrees for now, hoping to migrate to...
void Offset(const wxPoint &aOffset)
void BeginEdit(STATUS_FLAGS aEditMode, const wxPoint aStartPoint=wxPoint(0, 0)) override
Begin an editing a component library draw item in aEditMode at aPosition.
void Plot(PLOTTER *aPlotter, const wxPoint &aOffset, bool aFill, const TRANSFORM &aTransform) override
Plot the draw item using the plot object.
int Clamp_Text_PenSize(int aPenSize, int aSize, bool aBold)
Function Clamp_Text_PenSize As a rule, pen width should not be >1/4em, otherwise the character will b...
void Move(const wxPoint &aMoveVector)
Function Move moves the rectangle by the aMoveVector.
const wxPoint GetOrigin() const
wxString ShortenedShownText() const
Returns a shortened version (max 15 characters) of the shown text.
PNG memory record (file in memory).
int GetPenSizeForBold(int aTextSize)
Function GetPensizeForBold.
void GRSetDrawMode(wxDC *DC, GR_DRAWMODE draw_mode)
const wxPoint & GetTextPos() const
void SetEraseLastDrawItem(bool aErase=true)
void Move(const wxPoint &aPosition) override
Move a draw object to aPosition.
Implementation of conversion functions that require both schematic and board internal units...
Define a symbol library graphical text item.
bool HitTest(const wxPoint &aPosition) const override
Function HitTest tests if aPosition is contained within or on the bounding area of an item...
void EndEdit(const wxPoint &aPosition, bool aAbort=false) override
End an object editing action.
virtual COLOR4D GetDefaultColor()
bool ContinueEdit(const wxPoint aNextPoint) override
Continue an edit in progress at aPosition.
void SetEffects(const EDA_TEXT &aSrc)
Function SetEffects sets the text effects from another instance.
void MirrorHorizontal(const wxPoint &aCenter) override
Mirror the draw object along the horizontal (X) axis about aCenter point.
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i...
void SetTextPos(const wxPoint &aPoint)
bool InEditMode() const
Return the draw item editing mode status.
void SetOrigin(const wxPoint &pos)
int m_Unit
Unit identification for multiple parts per package.
void SetTextSize(const wxSize &aNewSize)
void RotatePoint(int *pX, int *pY, double angle)
void Rotate() override
Rotate the draw item.
void RevertYAxis()
Function RevertYAxis Mirror the rectangle from the X axis (negate Y pos and size) ...
bool Inside(EDA_RECT &aRect) const override
Test if any part of the draw object is inside rectangle bounds of aRect.
void DrawGraphicText(EDA_RECT *aClipBox, wxDC *aDC, const wxPoint &aPos, COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, void(*aCallback)(int x0, int y0, int xf, int yf, void *aData), void *aCallbackData, PLOTTER *aPlotter)
Function DrawGraphicText Draw a graphic text (like module texts)
double GetTextAngle() const
The base class for drawable items used by schematic library components.
int GetThickness() const
Function GetThickness returns pen width.
This file contains miscellaneous commonly used macros and functions.
virtual void Text(const wxPoint &aPos, const COLOR4D aColor, const wxString &aText, double aOrient, const wxSize &aSize, enum EDA_TEXT_HJUSTIFY_T aH_justify, enum EDA_TEXT_VJUSTIFY_T aV_justify, int aWidth, bool aItalic, bool aBold, bool aMultilineAllowed=false, void *aData=NULL)
Draws text with the plotter.
virtual wxString GetShownText() const
Returns the string actually shown after processing of the base text.
#define IS_NEW
New item, just created.
Class EDA_TEXT is a mix-in class (via multiple inheritance) that handles texts such as labels...
void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
void GRRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, COLOR4D aColor)
EDA_RECT GetTextBox(int aLine=-1, int aThickness=-1, bool aInvertY=false) const
Function GetTextBox useful in multiline texts to calculate the full text or a line area (for zones fi...
virtual bool TextHitTest(const wxPoint &aPoint, int aAccuracy=0) const
Function TextHitTest Test if aPoint is within the bounds of this object.
GR_DRAWMODE
Drawmode. Compositing mode plus a flag or two.
void SetEnd(int x, int y)
void SetOffset(const wxPoint &aOffset) override
Set the drawing object by aOffset from the current position.
Define a library symbol object.
bool m_rotate
Flag to indicate a rotation occurred while editing.
void MirrorVertical(const wxPoint &aCenter) override
Mirror the draw object along the MirrorVertical (Y) axis about aCenter point.
bool GetColorMode() const
const wxPoint GetEnd() const
EDA_UNITS_T g_UserUnit
Global variables definitions.
int GetPenSize() const override
wxString m_savedText
Temporary storage for the string when edition.
void calcEdit(const wxPoint &aPosition) override
Calculates the attributes of an item at aPosition when it is being edited.
Base plotter engine class.
bool Intersects(const EDA_RECT &aRect) const
Function Intersects tests for a common area between rectangles.
virtual void GetMsgPanelInfo(std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
BITMAP_DEF GetMenuImage() const override
Function GetMenuImage returns a pointer to an image to be used in menus.
TRANSFORM DefaultTransform
void drawGraphic(EDA_DRAW_PANEL *aPanel, wxDC *aDC, const wxPoint &aOffset, COLOR4D aColor, GR_DRAWMODE aDrawMode, void *aData, const TRANSFORM &aTransform) override
Draw the item on aPanel.
const EDA_RECT GetBoundingBox() const override
wxPoint m_initialPos
Temporary position when moving an existing item.
void SetText(const wxString &aText) override
Sets the text item string to aText.
STATUS_FLAGS m_Flags
Flag bits for editing and other uses.
Class EDA_RECT handles the component boundary box.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
int m_Convert
Shape identification for alternate body styles.
int GetTextHeight() const
COLOR4D GetItemSelectedColor()
static const char * text_xpm[]
const wxSize & GetTextSize() const
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Class EDA_MSG_ITEM is used EDA_MSG_PANEL as the item type for displaying messages.
Message panel definition file.
bool m_updateText
Flag to indicate text change occurred while editing.
LIB_TEXT(LIB_PART *aParent)
int compare(const LIB_ITEM &aOther) const override
Provide the draw object specific comparison called by the == and < operators.
wxPoint m_initialCursorPos
Initial cursor position at the beginning of a move.
wxString GetSelectMenuText() const override
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
#define IS_MOVED
Item being moved.