111 item->SetParent(
nullptr );
147 wxString msg =
_(
"Some items have the same color as the background\n"
148 "and they will not be seen on the screen. Are you\n"
149 "sure you want to use these colors?" );
151 if( wxMessageBox( msg,
_(
"Warning" ), wxYES_NO | wxICON_QUESTION,
152 wxGetTopLevelParent(
this ) ) == wxNO )
174 color.Darken( 0.01 );
186 std::vector<SCH_LAYER_ID> layers;
193 layers.push_back( i );
196 std::sort( layers.begin(), layers.end(),
199 return LayerName( a ) < LayerName( b );
202 for(
int layer : layers )
207 name += wxS(
" " ) +
_(
"(symbol editor only)" );
215 const int margin = 20;
221 m_preview->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
222 m_preview->GetGAL()->SetAxesEnabled(
false );
248 std::vector<DANGLING_END_ITEM> endPointsByType;
253 m_titleBlock->SetDate( wxDateTime::Now().FormatDate() );
255 m_page->SetHeightMils( 5000 );
256 m_page->SetWidthMils( 6000 );
265 auto addItem = [&](
EDA_ITEM* aItem )
271 std::vector<std::pair<SCH_LAYER_ID, std::pair<VECTOR2I, VECTOR2I>>> lines = {
272 {
LAYER_WIRE, { { 1950, 1500 }, { 2325, 1500 } } },
273 {
LAYER_WIRE, { { 1950, 2600 }, { 2350, 2600 } } },
274 {
LAYER_WIRE, { { 2150, 1700 }, { 2325, 1700 } } },
275 {
LAYER_WIRE, { { 2150, 2000 }, { 2150, 1700 } } },
276 {
LAYER_WIRE, { { 2925, 1600 }, { 3075, 1600 } } },
277 {
LAYER_WIRE, { { 3075, 1600 }, { 3075, 2000 } } },
278 {
LAYER_WIRE, { { 3075, 1600 }, { 3250, 1600 } } },
279 {
LAYER_WIRE, { { 3075, 2000 }, { 2150, 2000 } } },
280 {
LAYER_BUS, { { 1750, 1300 }, { 1850, 1300 } } },
281 {
LAYER_BUS, { { 1850, 2500 }, { 1850, 1300 } } },
282 {
LAYER_NOTES, { { 2350, 2125 }, { 2350, 2300 } } },
283 {
LAYER_NOTES, { { 2350, 2125 }, { 2950, 2125 } } },
284 {
LAYER_NOTES, { { 2950, 2125 }, { 2950, 2300 } } },
285 {
LAYER_NOTES, { { 2950, 2300 }, { 2350, 2300 } } }
288 for(
const std::pair<
SCH_LAYER_ID, std::pair<VECTOR2I, VECTOR2I>>& line : lines )
307 schIUScale.MilsToIU( line.second.first.y ) ) );
309 schIUScale.MilsToIU( line.second.second.y ) ) );
313#define MILS_POINT( x, y ) VECTOR2I( schIUScale.MilsToIU( x ), schIUScale.MilsToIU( y ) )
356 auto mapLibItemPosition =
360 return VECTOR2I( aLibPosition.x, aLibPosition.y );
374 value.
SetText( wxT(
"OPA604" ) );
394 addItem( comp_body );
402 pin->SetNumber( wxT(
"1" ) );
403 pin->SetName( wxT(
"-" ) );
407 endPointsByType.emplace_back(
PIN_END,
pin, mapLibItemPosition(
pin->GetPosition() ) );
416 pin->SetNumber( wxT(
"2" ) );
417 pin->SetName( wxT(
"+" ) );
421 endPointsByType.emplace_back(
PIN_END,
pin, mapLibItemPosition(
pin->GetPosition() ) );
430 pin->SetNumber( wxT(
"3" ) );
431 pin->SetName( wxT(
"OUT" ) );
435 endPointsByType.emplace_back(
PIN_END,
pin, mapLibItemPosition(
pin->GetPosition() ) );
461 std::vector<DANGLING_END_ITEM> endPointsByPos = endPointsByType;
498 m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() );
517 double scale = view->
GetScale() / std::max( fabs( psize.
x / screenSize.
x ),
518 fabs( psize.
y / screenSize.
y ) );
constexpr EDA_IU_SCALE schIUScale
wxString m_ColorTheme
Active color theme name.
static const COLOR4D WHITE
Color settings are a bit different than most of the settings objects in that there can be more than o...
bool GetOverrideSchItemColors() const
static void sort_dangling_end_items(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos)
Both contain the same information.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual void SetParent(EDA_ITEM *aParent)
void SetFillMode(FILL_T aFill)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
wxString GetFilename() const
A color representation with 4 components: red, green, blue, alpha.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
Define a library symbol object.
SCH_FIELD & GetValueField()
Return reference to the value field.
void AddDrawItem(SCH_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
SCH_FIELD & GetReferenceField()
Return reference to the reference designator field.
Describe the page size and margins of a paper page on which to eventually print or plot.
wxCheckBox * m_optOverrideColors
wxBoxSizer * m_colorsMainSizer
wxFlexGridSizer * m_colorsGridSizer
wxScrolledWindow * m_colorsListWindow
void createThemeList(const wxString &aCurrent)
Builds the theme listbox and sets the selection to the current theme.
void createSwatch(int aLayer, const wxString &aName)
std::vector< int > m_validLayers
A list of layer IDs that are valid for the current color settings dialog.
virtual bool saveCurrentTheme(bool aValidate)
std::string m_colorNamespace
A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings.
virtual void ResetPanel() override
Reset the contents of this panel.
std::map< int, wxStaticText * > m_labels
COLOR_SETTINGS * m_currentSettings
PANEL_COLOR_SETTINGS(wxWindow *aParent)
std::map< int, COLOR_SWATCH * > m_swatches
TITLE_BLOCK * m_titleBlock
bool saveCurrentTheme(bool aValidate) override
PANEL_EESCHEMA_COLOR_SETTINGS(wxWindow *aParent)
void onNewThemeSelected() override
Event fired when a new theme is selected that can be overridden in children.
void OnOverrideItemColorsClicked(wxCommandEvent &aEvent) override
bool validateSave(bool aQuiet=false) override
Performs a pre-save validation of the current color theme.
void ResetPanel() override
Reset the contents of this panel.
GAL_DISPLAY_OPTIONS_IMPL m_galDisplayOptions
void OnSize(wxSizeEvent &aEvent) override
DS_PROXY_VIEW_ITEM * m_drawingSheet
void createPreviewItems()
~PANEL_EESCHEMA_COLOR_SETTINGS() override
void updateAllowedSwatches()
EDA_DRAW_PANEL_GAL::GAL_TYPE m_galType
void onColorChanged() override
Event fired when the user changes any color.
SCH_PREVIEW_PANEL * m_preview
void createSwatches() override
bool TransferDataToWindow() override
bool TransferDataFromWindow() override
std::vector< EDA_ITEM * > m_previewItems
virtual COMMON_SETTINGS * GetCommonSettings() const
void SetPosition(const VECTOR2I &aPosition) override
Class for a wire to bus entry.
void SetPosition(const VECTOR2I &aPosition) override
void SetText(const wxString &aText) override
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
void SetSpinStyle(SPIN_STYLE aSpinStyle) override
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual void SetBodyStyle(int aBodyStyle)
virtual bool IsConnectable() const
virtual void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo)
virtual void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList)
Add the schematic item end points to aItemList if the item has end points.
virtual bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, const SCH_SHEET_PATH *aSheet=nullptr)
Test the schematic item to aItemList to check if it's dangling state has changed.
void SetLayer(SCH_LAYER_ID aLayer)
virtual void SetUnit(int aUnit)
void SetIsDangling(bool aIsDangling)
virtual void SetSpinStyle(SPIN_STYLE aSpinStyle)
Segment description base class to describe items which have 2 end points (track, wire,...
void SetStartPoint(const VECTOR2I &aPosition)
virtual STROKE_PARAMS GetStroke() const override
virtual void SetStroke(const STROKE_PARAMS &aStroke) override
void SetEndPoint(const VECTOR2I &aPosition)
void SetPosition(const VECTOR2I &aPosition) override
void LoadColors(const COLOR_SETTINGS *aSettings) override
void SetStroke(const STROKE_PARAMS &aStroke) override
void AddPoint(const VECTOR2I &aPosition)
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this sheet.
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) override
Simple container to manage line stroke parameters.
void SetLineStyle(LINE_STYLE aLineStyle)
void SetWidth(int aWidth)
virtual void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
virtual void SetShowPinNames(bool aShow)
Set or clear the pin name visibility flag.
void SetPinNameOffset(int aOffset)
Set the offset in mils of the pin name text from the pin symbol.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
@ FILLED_WITH_BG_BODYCOLOR
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
SCH_LAYER_ID
Eeschema drawing layers.
@ LAYER_NET_COLOR_HIGHLIGHT
@ LAYER_SCHEMATIC_DRAWINGSHEET
@ LAYER_SCHEMATIC_GRID_AXES
@ LAYER_SCHEMATIC_PAGE_LIMITS
@ LAYER_SCHEMATIC_BACKGROUND
@ COLOR
Color has changed.
std::set< int > g_excludedLayers
PGM_BASE & Pgm()
The global program "get" accessor.
@ PT_INPUT
usual pin input: must be connected
@ PIN_RIGHT
The pin extends rightwards from the connection point.
@ PIN_LEFT
The pin extends leftwards from the connection point: Probably on the right side of the symbol.
COLOR_SETTINGS * GetColorSettings(const wxString &aName)
T * GetAppSettings(const char *aFilename)
int canvas_type
EDA_DRAW_PANEL_GAL::GAL_TYPE_* value, see gal_options_panel.cpp.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
VECTOR2D ToVECTOR2D(const wxPoint &aPoint)