54 m_titleBlock( nullptr ),
55 m_drawingSheet( nullptr ),
69 if( current->GetFilename() != app_settings->
m_ColorTheme )
93 m_preview->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
151 wxString msg =
_(
"Some items have the same color as the background\n" 152 "and they will not be seen on the screen. Are you\n" 153 "sure you want to use these colors?" );
155 if( wxMessageBox( msg,
_(
"Warning" ), wxYES_NO | wxICON_QUESTION,
this ) == wxNO )
177 color.Darken( 0.01 );
189 std::vector<SCH_LAYER_ID> layers;
192 layers.push_back( i );
194 std::sort( layers.begin(), layers.end(),
200 for(
int layer : layers )
205 name += wxS(
" " ) +
_(
"(symbol editor only)" );
213 const int margin = 20;
254 auto addItem = [&](
EDA_ITEM* aItem )
260 std::vector<std::pair<SCH_LAYER_ID, std::pair<wxPoint, wxPoint>>> lines = {
261 {
LAYER_WIRE, { { 1950, 1500 }, { 2325, 1500 } } },
262 {
LAYER_WIRE, { { 1950, 2600 }, { 2350, 2600 } } },
263 {
LAYER_WIRE, { { 2150, 1700 }, { 2325, 1700 } } },
264 {
LAYER_WIRE, { { 2150, 2000 }, { 2150, 1700 } } },
265 {
LAYER_WIRE, { { 2925, 1600 }, { 3075, 1600 } } },
266 {
LAYER_WIRE, { { 3075, 1600 }, { 3075, 2000 } } },
267 {
LAYER_WIRE, { { 3075, 1600 }, { 3250, 1600 } } },
268 {
LAYER_WIRE, { { 3075, 2000 }, { 2150, 2000 } } },
269 {
LAYER_BUS, { { 1750, 1400 }, { 1850, 1400 } } },
270 {
LAYER_BUS, { { 1850, 2500 }, { 1850, 1400 } } },
271 {
LAYER_NOTES, { { 2350, 2125 }, { 2350, 2300 } } },
272 {
LAYER_NOTES, { { 2350, 2125 }, { 2950, 2125 } } },
273 {
LAYER_NOTES, { { 2950, 2125 }, { 2950, 2300 } } },
274 {
LAYER_NOTES, { { 2950, 2300 }, { 2350, 2300 } } }
277 for(
const auto& line : lines )
281 wire->
SetStartPoint( wxPoint( Mils2iu( line.second.first.x ),
282 Mils2iu( line.second.first.y ) ) );
283 wire->
SetEndPoint( wxPoint( Mils2iu( line.second.second.x ),
284 Mils2iu( line.second.second.y ) ) );
288 #define MILS_POINT( x, y ) wxPoint( Mils2iu( x ), Mils2iu( y ) ) 333 wxPoint p( 2625, -1600 );
343 value.
SetText( wxT(
"OPA604" ) );
355 comp_body->
SetWidth( Mils2iu( 10 ) );
362 addItem( comp_body );
401 s->
SetSize( wxSize( Mils2iu( 800 ), Mils2iu( 1300 ) ) );
452 double scale = view->GetScale() / std::max( fabs( psize.x / screenSize.
x ),
453 fabs( psize.y / screenSize.
y ) );
455 view->SetScale(
scale * 1.1 );
bool TransferDataFromWindow() override
void ResetPanel() override
Reset the contents of this panel.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void SetClearColor(const COLOR4D &aColor)
void ForceRefresh()
Force a redraw.
virtual bool saveCurrentTheme(bool aValidate)
void createPreviewItems()
wxCheckBox * m_optOverrideColors
void SetOrientation(int aOrientation)
void SetColorLayer(int aLayerId)
Can be used to override which layer ID is used for worksheet item colors.
virtual void ResetPanel() override
Reset the contents of this panel.
wxString GetFilename() const
Field object used in symbol libraries.
std::map< int, wxStaticText * > m_labels
void SetFillMode(FILL_TYPE aFillMode)
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
void SetPosition(const wxPoint &aPosition) override
LIB_FIELD & GetValueField()
Return reference to the value field.
void SetDate(const wxString &aDate)
Set the date field, and defaults to the current time and date.
void SetLength(int aLength)
static const wxChar Custom[]
"User" defined page type
std::map< int, COLOR_SWATCH * > m_swatches
bool m_forceDisplayCursor
The pixel scale factor (>1 for hi-DPI scaled displays)
void SetIsDangling(bool aIsDangling)
void OnSize(wxSizeEvent &aEvent) override
void SetPosition(const wxPoint &aPos) override
wxFlexGridSizer * m_colorsGridSizer
void SetWidth(int aWidth) override
bool validateSave(bool aQuiet=false) override
Performs a pre-save validation of the current color theme.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
wxScrolledWindow * m_colorsListWindow
Hold the information shown in the lower right corner of a plot, printout, or editing view.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
void SetEndPoint(const wxPoint &aPosition)
std::string m_colorNamespace
A namespace that will be passed to SETTINGS_MANAGER::SaveColorSettings.
bool saveCurrentTheme(bool aValidate) override
void onNewThemeSelected() override
Event fired when a new theme is selected that can be overridden in children.
void SetNumber(const wxString &aNumber)
std::vector< SCH_FIELD > & GetFields()
void SetType(ELECTRICAL_PINTYPE aType)
LIB_FIELD & GetReferenceField()
Return reference to the reference designator field.
virtual void SetText(const wxString &aText)
void onColorChanged() override
Event fired when the user changes any color.
void SetPosition(const wxPoint &aPosition) override
PANEL_EESCHEMA_COLOR_SETTINGS(SCH_BASE_FRAME *aFrame, wxWindow *aParent)
void AddDrawItem(LIB_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
SCH_PREVIEW_PANEL * m_preview
Describe the page size and margins of a paper page on which to eventually print or plot.
void createThemeList(const wxString &aCurrent)
COLOR_SETTINGS * m_currentSettings
void SetStartPoint(const wxPoint &aPosition)
void SetLayer(SCH_LAYER_ID aLayer)
Set the layer this item is on.
void SetOverrideSchItemColors(bool aFlag)
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
~PANEL_EESCHEMA_COLOR_SETTINGS() override
void SetStealsFocus(bool aStealsFocus)
Set whether focus is taken on certain events (mouseover, keys, etc).
Define a library symbol object.
std::vector< EDA_ITEM * > m_previewItems
void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
virtual KIGFX::VIEW * GetView() const
Return a pointer to the #VIEW instance used in the panel.
AppSettings * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
wxBoxSizer * m_colorsMainSizer
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
SCH_LAYER_ID
Eeschema drawing layers.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
void AddPoint(const wxPoint &aPoint)
void SetTitle(const wxString &aTitle)
void SetAxesEnabled(bool aAxesEnabled)
Enable drawing the axes.
TITLE_BLOCK * m_titleBlock
void SetHeightMils(int aHeightInMils)
std::vector< int > m_validLayers
A list of layer IDs that are valid for the current color settings dialog.
bool TransferDataToWindow() override
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetSize(const wxSize &aSize)
void SetConvert(int aConvert)
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
void OnOverrideItemColorsClicked(wxCommandEvent &aEvent) override
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
COLOR4D GetColor(int aLayer) const
void ReloadColorSettings()
Re-scans the color themes directory, reloading any changes it finds.
const BOX2I ViewBBox() const override
Board layer functions and definitions.
void SetName(const wxString &aName)
Segment description base class to describe items which have 2 end points (track, wire,...
void SetShowPinNumbers(bool aShow)
Set or clear the pin number visibility flag.
void SetHorizJustify(EDA_TEXT_HJUSTIFY_T aType)
usual pin input: must be connected
void SetWidthMils(int aWidthInMils)
void ReadConfig(COMMON_SETTINGS &aCommonConfig, WINDOW_SETTINGS &aWindowConfig, wxWindow *aWindow)
Read application and common configs.
A base class for most all the KiCad significant classes used in schematics and boards.
Class for a wire to bus entry.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetPosition(const wxPoint &aPosition) override
bool GetOverrideSchItemColors() const
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle) override
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
virtual void SetLabelSpinStyle(LABEL_SPIN_STYLE aSpinStyle)
Set a spin or rotation angle, along with specific horizontal and vertical justification styles with e...
void Refresh(bool aEraseBackground, const wxRect *aRect) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
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.
void createSwatch(int aLayer, const wxString &aName)
KIGFX::GAL_DISPLAY_OPTIONS m_galDisplayOptions
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
SCH_BUS_WIRE_ENTRY_PREVIEW_ITEM()
DS_PROXY_VIEW_ITEM * m_drawingSheet
void SetColor(int aLayer, COLOR4D aColor)
wxString m_ColorTheme
Active color theme name.
A color representation with 4 components: red, green, blue, alpha.