35 #include <wx/fdrepdlg.h> 40 m_forceVisible( false ),
42 m_structType( idType )
49 m_forceVisible( false ),
51 m_structType( idType )
56 m_Uuid( base.m_Uuid ),
57 m_status( base.m_status ),
58 m_parent( base.m_parent ),
59 m_forceVisible( base.m_forceVisible ),
60 m_flags( base.m_flags ),
61 m_structType( base.m_structType )
79 return EDA_RECT( wxPoint( 0, 0 ), wxSize( 0, 0 ) );
85 wxCHECK_MSG(
false,
nullptr, wxT(
"Clone not implemented in derived class " ) +
GetClass() +
86 wxT(
". Bad programmer!" ) );
95 #if 0 && defined(DEBUG) 96 std::cout <<
GetClass().mb_str() <<
' ';
111 wxFAIL_MSG( wxT(
"GetSelectMenuText() was not overridden for schematic item type " ) +
114 return wxString( wxT(
"Undefined menu text for " ) +
GetClass() );
120 wxString
text = aText;
121 int flags = aSearchData.GetFlags();
122 wxString searchText = aSearchData.GetFindString();
128 if( !( flags & wxFR_MATCHCASE ) )
131 searchText.MakeUpper();
134 if( flags & wxFR_WHOLEWORD )
138 while( ii < (
int)
text.length() )
140 int next =
text.find( searchText, ii );
142 if(
next == wxNOT_FOUND )
146 next += searchText.length();
148 bool startOK = ( ii == 0 || !wxIsalnum(
text.GetChar( ii - 1 ) ) );
149 bool endOK = (
next == (int)
text.length() || !wxIsalnum(
text.GetChar(
next ) ) );
151 if( startOK && endOK )
161 return text.Matches( searchText );
165 return text.Find( searchText ) != wxNOT_FOUND;
172 wxString
text = aText;
173 int flags = aSearchData.GetFlags();
174 wxString searchText = aSearchData.GetFindString();
176 bool replaced =
false;
178 if( flags & wxFR_MATCHCASE )
181 searchText = searchText.Upper();
186 while( ii < (
int)
text.length() )
188 int next =
text.find( searchText, ii );
190 if(
next == wxNOT_FOUND )
192 result += aText.Mid( ii, wxString::npos );
197 result += aText.Mid( ii,
next - ii );
200 next += searchText.length();
205 if( flags & wxFR_WHOLEWORD )
207 startOK = ( ii == 0 || !wxIsalnum(
text.GetChar( ii - 1 ) ) );
208 endOK = (
next == (int)
text.length() || !wxIsalnum(
text.GetChar(
next ) ) );
216 if( startOK && endOK )
218 result += aSearchData.GetReplaceString();
224 result += aText.GetChar( ii );
236 wxFAIL_MSG(
wxString::Format( wxT(
"Less than operator not defined for item type %s." ),
282 void EDA_ITEM::ShowDummy( std::ostream& os )
const 287 os <<
'<' << s.Lower().mb_str() <<
">" 288 <<
" Need ::Show() override for this class " 289 <<
"</" << s.Lower().mb_str() <<
">\n";
293 std::ostream& EDA_ITEM::NestedSpace(
int nestLevel, std::ostream& os )
295 for(
int i = 0; i<nestLevel; ++i )
312 .Map(
NOT_USED, wxT(
"<not used>" ) )
#define IS_CHANGED
Item was edited, and modified.
EDA_ITEM * m_parent
Linked list: Link (parent struct)
virtual SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[])
May be re-implemented for each derived class in order to handle all the types given by its member dat...
virtual bool Matches(const wxFindReplaceData &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
static PROPERTY_MANAGER & Instance()
bool operator<(const EDA_ITEM &aItem) const
Test if another item is less than this object.
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
class PCB_DIM_LEADER, a leader dimension (graphic item)
class FP_TEXT, text in a footprint
class PCB_GROUP, a set of BOARD_ITEMs
class PCB_DIM_CENTER, a center point marking (graphic item)
the 3d code uses this value
static ENUM_MAP< T > & Instance()
void SetFlags(EDA_ITEM_FLAGS aMask)
class PCB_TEXT, text on a layer
class PCB_ARC, an arc track segment on a copper layer
class FP_SHAPE, a footprint edge
class PAD, a pad in a footprint
#define NO_SETTER(owner, type)
const INSPECTOR_FUNC & INSPECTOR
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
not really an item, used to identify a screen
class PCB_TRACK, a track segment (segment on a copper layer)
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Return the all the layers within the VIEW the object is painted on.
const wxPoint GetOrigin() const
class BOARD_ITEM_LIST, a list of board items
wxLogTrace helper definitions.
virtual bool IsType(const KICAD_T aScanTypes[]) const
Check whether the item is one of the listed types.
class ZONE, a copper pour area
static bool Replace(const wxFindReplaceData &aSearchData, wxString &aText)
Perform a text replace on aText using the find and replace criteria in aSearchData on items that supp...
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType)
class PCB_TARGET, a target (graphic item)
class FOOTPRINT, a footprint
Some functions to handle hotkeys in KiCad.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
class PCB_MARKER, a marker used to show something
virtual wxString GetClass() const =0
Return the class name.
BITMAPS
A list of all bitmap identifiers.
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Return the text to display to be used in the selection clarification context menu when multiple items...
virtual BITMAPS GetMenuImage() const
Return a pointer to an image to be used in menus.
class NETINFO_ITEM, a description of a net
void AddProperty(PROPERTY_BASE *aProperty)
Register a property.
class ZONE, managed by a footprint
virtual bool IsReplaceable() const
Override this method in any derived object that supports test find and replace.
Handle the component boundary box.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T m_structType
Run time identification, keep private so it can never be changed after a ctor sets it.
static struct EDA_ITEM_DESC _EDA_ITEM_DESC
Provide class metadata.Helper macro to map type hashes to names.
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
class PCB_VIA, a via (like a track segment on a copper layer)
virtual const EDA_RECT GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
virtual const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
class PCB_SHAPE, a segment not on copper layers
const wxSize GetSize() const
KICAD_T Type() const
Returns the type of object.