59 auto belowRootSheetCondition = [] (
const SELECTION& aSel ) {
86 filter.FilterPowerParts(
true );
89 wxFAIL_MSG(
"PlaceCompontent(): unexpected request" );
121 auto cleanup = [&] () {
128 if( evt->IsCancelInteractive() )
138 else if( evt->IsActivate() )
143 if( evt->IsMoveTool() )
196 int new_unit = component->
GetUnit();
207 next_comp = static_cast<SCH_COMPONENT*>( component->
Duplicate() );
209 next_comp->
SetUnit( new_unit );
222 component = next_comp;
268 bool immediateMode = image;
298 auto cleanup = [&] () {
305 if( evt->IsCancelInteractive() )
321 else if( evt->IsActivate() )
326 if( evt->IsMoveTool() )
342 wxFileDialog dlg(
m_frame,
_(
"Choose Image" ), wxEmptyString, wxEmptyString,
343 _(
"Image Files " ) + wxImage::GetImageExtWildcard(), wxFD_OPEN );
345 if( dlg.ShowModal() != wxID_OK )
351 wxString fullFilename = dlg.GetPath();
353 if( wxFileExists( fullFilename ) )
358 wxMessageBox(
_(
"Couldn't load image from \"%s\"" ), fullFilename );
423 auto itemFactory = [&] () ->
SCH_ITEM* {
442 SCH_LINE* wire = dynamic_cast<SCH_LINE*>( selection.
Front() );
460 SCH_ITEM* previewItem = itemFactory();
478 if( evt->IsCancelInteractive() )
483 else if( evt->IsActivate() )
485 if( evt->IsMoveTool() )
547 static_cast<SCH_BUS_ENTRY_BASE*>( previewItem )->SetBusEntryShape( shape );
589 auto cleanup = [&] () {
596 if( evt->IsCancelInteractive() )
606 else if( evt->IsActivate() )
611 if( evt->IsPointEditor() )
615 else if( evt->IsMoveTool() )
656 m_statusPopup->Move( wxGetMousePosition() + wxPoint( 20, 20 ) );
668 m_statusPopup->SetText(
_(
"No new hierarchical labels found." ) );
669 m_statusPopup->Move( wxGetMousePosition() + wxPoint( 20, 20 ) );
725 else if( item && evt->IsSelectionEvent() )
741 static_cast<SCH_ITEM*>( item )->SetPosition( (wxPoint) cursorPos );
781 auto cleanup = [&] () {
788 if( evt->IsCancelInteractive() )
798 else if( evt->IsActivate() )
803 if( evt->IsPointEditor() )
807 else if( evt->IsMoveTool() )
819 else if( evt->IsClick(
BUT_LEFT ) && !sheet )
823 sheet =
new SCH_SHEET( (wxPoint) cursorPos );
827 sheet->SetScreen( NULL );
834 else if( sheet && ( evt->IsClick(
BUT_LEFT )
884 wxPoint size = (wxPoint) aPos - pos;
890 aSheet->
Resize( wxSize( grid.x - pos.x, grid.y - pos.y ) );
virtual void ShowCursor(bool aEnabled)
Function ShowCursor() Enables or disables display of cursor.
Class for a bus to bus entry.
void SetTimeStamp(timestamp_t aNewTimeStamp)
Change the time stamp to aNewTimeStamp and updates the reference path.
virtual void PushTool(const std::string &actionName)
NB: the definition of "tool" is different at the user level.
bool SchematicCleanUp(SCH_SCREEN *aScreen=nullptr)
Performs routine schematic cleaning including breaking wire and buses and deleting identical objects ...
void AddToPreview(EDA_ITEM *aItem, bool aTakeOwnership=true)
static TOOL_ACTION finishSheet
SCH_ITEM * Duplicate(bool doClone=false)
Routine to create a new copy of given item.
SCH_TEXT * CreateNewText(int aType)
static TOOL_ACTION activatePointEditor
wxPoint GetStartPoint() const
SCH_SHEET * Last() const
Function Last returns a pointer to the last sheet of the list One can see the others sheet as the "pa...
This file is part of the common library.
static TOOL_ACTION toShapeBackslash
void SetCurrentCursor(wxStockCursor aStockCursorID)
Function SetCurrentCursor Set the current cursor shape for this panel.
VIEW_CONTROLS class definition.
bool HasPoint()
Indicates the cursor is over an edit point.
bool Resolve(PART_LIBS *aLibs)
Assigns the current LIB_PART from aLibs which this symbol is based on.
bool GetShowFootprintPreviews() const
static TOOL_ACTION mirrorY
static TOOL_ACTION placeHierLabel
static TOOL_ACTION placeJunction
void RecacheAllItems()
Function RecacheAllItems() Rebuilds GAL display lists.
int GetUnitCount() const
Return the number of units per package of the symbol.
virtual void SetSnapping(bool aEnabled)
Function SetSnapping() Enables/disables snapping cursor to grid.
std::vector< COMPONENT_SELECTION > HISTORY_LIST
void SetPosition(const wxPoint &aPosition) override
Function SetPosition set the schematic item position to aPosition.
Schematic editor (Eeschema) main window.
static TOOL_ACTION placeBusBusEntry
LIB_PART * GetLibPart(const LIB_ID &aLibId, bool aUseCacheLib=false, bool aShowErrorMsg=false)
static TOOL_ACTION placeBusWireEntry
bool TestDanglingEnds()
Test all of the connectable objects in the schematic for unused connection points.
void SetUnitSelection(SCH_SHEET_PATH *aSheet, int aUnitSelection)
static const KICAD_T SheetsOnly[]
wxPoint GetNearestGridPosition(const wxPoint &aPosition) const
Return the nearest aGridSize location to aPosition.
bool GetAutoplaceFields() const
bool EditSheet(SCH_SHEET *aSheet, SCH_SHEET_PATH *aHierarchy, bool *aClearAnnotationNewItems)
Edit an existing sheet or add a new sheet to the schematic.
const bool GetUseAllUnits()
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
static TOOL_ACTION rotateCW
static TOOL_ACTION leaveSheet
#define IS_NEW
New item, just created.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
static TOOL_ACTION drawSheet
timestamp_t GetNewTimeStamp()
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
Function WarpCursor() If enabled (.
static TOOL_ACTION rotateCCW
static TOOL_ACTION placePower
void SetFlags(STATUS_FLAGS aMask)
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
COMPONENT_SELECTION SelectCompFromLibTree(const SCHLIB_FILTER *aFilter, std::vector< COMPONENT_SELECTION > &aHistoryList, bool aUseLibBrowser, int aUnit, int aConvert, bool aShowFootprints, const LIB_ID *aHighlight=nullptr, bool aAllowFields=true)
Function SelectComponentFromLib Calls the library viewer to select component to import into schematic...
virtual void SetPosition(const wxPoint &aPosition)=0
Function SetPosition set the schematic item position to aPosition.
static TOOL_ACTION placeSheetPin
virtual void CaptureCursor(bool aEnabled)
Function CaptureCursor() Forces the cursor to stay within the drawing panel area.
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
static TOOL_ACTION placeSchematicText
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
static TOOL_ACTION placeImage
SCH_ITEM * GetItem(const wxPoint &aPosition, int aAccuracy=0, KICAD_T aType=SCH_LOCATE_ANY_T) const
Check aPosition within a distance of aAccuracy for items of type aFilter.
Define a library symbol object.
void SaveCopyForRepeatItem(SCH_ITEM *aItem)
Clone aItem and owns that clone in this container.
SCH_JUNCTION * AddJunction(const wxPoint &aPos, bool aAppendToUndo=false, bool aFinal=true)
static TOOL_ACTION mirrorX
static TOOL_ACTION importSheetPin
void SetUnit(int aUnit)
Change the unit number to aUnit.
static TOOL_ACTION clearSelection
Clears the current selection.
static TOOL_ACTION placeSymbol
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Moves the graphic crosshair cursor to the requested position expressed in world coordinates.
SCH_TEXT * GetNextNewText()
Gets the next queued text item.
wxPoint GetPosition() const override
Function GetPosition.
Object to handle a bitmap image that can be inserted in a schematic.
virtual void SetAutoPan(bool aEnabled)
Function SetAutoPan Turns on/off auto panning (this feature is used when there is a tool active (eg.
void SelectUnit(SCH_COMPONENT *aComponent, int aUnit)
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
virtual unsigned int GetSize() const override
Function GetSize() Returns the number of stored items.
static TOOL_ACTION placeLabel
const bool GetRepeatComponent()
SCH_HIERLABEL * ImportHierLabel(SCH_SHEET *aSheet)
Import a hierarchical label with no attached sheet pin.
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual)
Automatically orient all the fields in the component.
Segment description base class to describe items which have 2 end points (track, wire,...
static TOOL_ACTION placeNoConnect
Class SCH_COMPONENT describes a real schematic component.
EDA_ITEM * Clone() const override
Function Clone creates a duplicate of this item with linked list members set to NULL.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
#define IS_RESIZED
Item being resized.
virtual void PopTool(const std::string &actionName)
Class for a wire to bus entry.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
bool ReadImageFile(const wxString &aFullFilename)
Reads and stores an image file.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
Definition for part library class.
static TOOL_ACTION placeGlobalLabel
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
Definitions of the SCH_TEXT class and derivatives for Eeschema.
SCH_SHEET_PIN * CreateSheetPin(SCH_SHEET *aSheet, SCH_HIERLABEL *aLabel)
Create a new SCH_SHEET_PIN object and add it to aSheet at the current cursor position.
void SetPosition(const wxPoint &aPosition) override
Function SetPosition set the schematic item position to aPosition.
static TOOL_ACTION toShapeSlash
static TOOL_ACTION refreshPreview
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false)=0
Moves cursor to the requested position expressed in world coordinates.
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.
static TOOL_ACTION cursorClick
void Resize(const wxSize &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
void AddItemToScreenAndUndoList(SCH_ITEM *aItem, bool aUndoAppend=false)
Add an item to the schematic and adds the changes to the undo/redo container.
#define IS_MOVED
Item being moved.
wxPoint GetEndPoint() const