21#ifndef _APPEARANCE_CONTROLS_H 
   22#define _APPEARANCE_CONTROLS_H 
   78        return static_cast<void*
>( &aColor );
 
 
   83        return *
static_cast<COLOR4D*
>( aColor );
 
 
  100    wxGridCellAttr* 
GetAttr( 
int aRow, 
int aCol, wxGridCellAttr::wxAttrKind ) 
override;
 
  102    wxString 
GetValue( 
int aRow, 
int aCol ) 
override;
 
  104    void SetValue( 
int aRow, 
int aCol, 
const wxString& aValue ) 
override;
 
  106    wxString 
GetTypeName( 
int aRow, 
int aCol ) 
override;
 
  112    void* 
GetValueAsCustom( 
int aRow, 
int aCol, 
const wxString& aTypeName ) 
override;
 
  114    void SetValueAsCustom( 
int aRow, 
int aCol, 
const wxString& aTypeName, 
void* aValue ) 
override;
 
 
  167                            const wxString& aTooltip = wxEmptyString,
 
  168                            bool aCanControlOpacity = 
false,
 
  169                            bool aCanControlVisibility = 
true ) :
 
 
 
  223                                 std::vector<BOARD_ITEM*>& aRemovedItems,
 
  224                                 std::vector<BOARD_ITEM*>& aChangedItems ) 
override;
 
  260            return wxEmptyString;
 
 
  300    void OnSetFocus( wxFocusEvent& aEvent ) 
override;
 
  301    void OnSize( wxSizeEvent& aEvent ) 
override;
 
  321    void buildNetClassMenu( wxMenu& aMenu, 
bool isDefaultClass, 
const wxString& aName );
 
  367    void showNetclass( 
const wxString& aClassName, 
bool aShow = 
true );
 
 
APPEARANCE_CONTROLS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
 
void OnBoardNetSettingsChanged(BOARD &aBoard) override
 
void doApplyLayerPreset(const LAYER_PRESET &aPreset)
 
std::map< PCB_LAYER_ID, APPEARANCE_SETTING * > m_layerSettingsMap
 
wxArrayString m_presetMRU
 
wxStaticText * m_inactiveLayersLabel
 
void syncColorsAndVisibility()
 
std::map< GAL_LAYER_ID, APPEARANCE_SETTING * > m_objectSettingsMap
 
void ApplyLayerPreset(const wxString &aPresetName)
 
static LAYER_PRESET m_lastBuiltinPreset
 
wxRadioButton * m_rbHighContrastNormal
 
void onObjectVisibilityChanged(GAL_LAYER_ID aLayer, bool isVisible, bool isFinal)
 
static LAYER_PRESET presetFrontAssembly
 
void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aItem) override
 
void syncLayerPresetSelection()
 
static LAYER_PRESET presetBackAssembly
 
void OnNetGridClick(wxGridEvent &event) override
 
void setVisibleObjects(GAL_SET aObjects)
 
wxRadioButton * m_rbRatsnestNone
 
WX_COLLAPSIBLE_PANE * m_paneLayerDisplayOptions
 
void buildNetClassMenu(wxMenu &aMenu, bool isDefaultClass, const wxString &aName)
 
void onLayerVisibilityToggled(PCB_LAYER_ID aLayer)
 
void onLayerPresetChanged(wxCommandEvent &aEvent) override
 
wxBitmapBundle m_visibleBitmapBundle
 
void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aItem) override
 
wxMenu * m_layerContextMenu
 
wxRadioButton * m_rbRatsnestVisLayers
 
@ ID_PRESET_FRONT_ASSEMBLY
 
@ ID_SHOW_ALL_COPPER_LAYERS
 
@ ID_HIDE_ALL_COPPER_LAYERS
 
@ ID_USE_SCHEMATIC_NET_COLOR
 
@ ID_PRESET_BACK_ASSEMBLY
 
wxRadioButton * m_rbNetColorAll
 
bool doesBoardItemNeedRebuild(BOARD_ITEM *aBoardItem)
 
wxCheckBox * m_cbFlipBoard
 
void SetUserLayerPresets(std::vector< LAYER_PRESET > &aPresetList)
 
std::vector< LAYER_PRESET > GetUserLayerPresets() const
Update the current layer presets from those saved in the project file.
 
static LAYER_PRESET presetInnerCopper
 
void updateViewportSelection(const wxString &aName)
 
std::map< wxString, VIEWPORT > m_viewports
 
void onViewportChanged(wxCommandEvent &aEvent) override
 
NET_GRID_TABLE * m_netsTable
 
std::vector< std::unique_ptr< APPEARANCE_SETTING > > m_layerSettings
 
void loadDefaultLayerPresets()
 
std::vector< std::unique_ptr< APPEARANCE_SETTING > > m_objectSettings
 
void onObjectOpacitySlider(int aLayer, float aOpacity)
 
bool isLayerEnabled(PCB_LAYER_ID aLayer) const
 
void setVisibleLayers(const LSET &aLayers)
 
void rebuildViewportsWidget()
 
wxRadioButton * m_rbRatsnestAllLayers
 
wxBoxSizer * m_objectsOuterSizer
 
wxSize GetBestSize() const
Update the panel contents from the application and board models.
 
LAYER_PRESET * m_lastSelectedUserPreset
 
wxString m_contextMenuNetclass
The name of the netclass that was right-clicked.
 
wxRadioButton * m_rbNetColorRatsnest
 
void rebuildLayerPresetsWidget(bool aReset)
 
void onRatsnestMode(wxCommandEvent &aEvent)
 
wxRadioButton * m_rbNetColorOff
 
static LAYER_PRESET presetFront
 
void doApplyViewport(const VIEWPORT &aViewport)
 
static const APPEARANCE_SETTING s_objectSettings[]
Template for object appearance settings.
 
const wxArrayString & GetViewportsMRU()
 
void OnNetGridMouseEvent(wxMouseEvent &aEvent)
 
WX_COLLAPSIBLE_PANE * m_paneNetDisplayOptions
 
void OnNotebookPageChanged(wxNotebookEvent &event) override
 
int GetTabIndex() const
Set the current notebook tab.
 
bool IsLayerOptionsExpanded()
 
void onNetclassVisibilityChanged(wxCommandEvent &aEvent)
 
void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aItems) override
 
void onNetContextMenu(wxCommandEvent &aEvent)
 
void OnColorSwatchChanged(wxCommandEvent &aEvent)
 
void updateLayerPresetSelection(const wxString &aName)
 
ROW_ICON_PROVIDER * m_iconProvider
 
std::map< wxString, LAYER_PRESET > m_layerPresets
 
bool IsTogglingNetclassRatsnestVisibility()
 
static LAYER_PRESET presetBack
 
void rebuildLayerContextMenu()
 
void RefreshCollapsiblePanes()
Function to force a redraw of the collapsible panes in this control.
 
static LAYER_PRESET presetNoLayers
 
void idleFocusHandler(wxIdleEvent &aEvent)
 
void rightClickHandler(wxMouseEvent &aEvent)
 
wxBitmapBundle m_notVisibileBitmapBundle
 
void OnNetGridRightClick(wxGridEvent &event) override
 
void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aItems) override
 
wxBoxSizer * m_layersOuterSizer
 
void UpdateDisplayOptions()
Return a list of the layer presets created by the user.
 
std::vector< std::unique_ptr< APPEARANCE_SETTING > > m_netclassSettings
 
wxRadioButton * m_rbHighContrastOff
 
const wxArrayString & GetLayerPresetsMRU()
Return a list of viewports created by the user.
 
void OnBoardCompositeUpdate(BOARD &aBoard, std::vector< BOARD_ITEM * > &aAddedItems, std::vector< BOARD_ITEM * > &aRemovedItems, std::vector< BOARD_ITEM * > &aChangedItems) override
Update the colors on all the widgets from the new chosen color theme.
 
void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aItems) override
 
void OnColorThemeChanged()
Respond to change in OS's DarkMode.
 
LAYER_PRESET * m_currentPreset
 
std::map< wxString, APPEARANCE_SETTING * > m_netclassSettingsMap
 
GAL_SET getVisibleObjects()
 
void OnSetFocus(wxFocusEvent &aEvent) override
 
void OnLanguageChanged(wxCommandEvent &aEvent)
 
static LAYER_PRESET presetAllCopper
 
void SetUserViewports(std::vector< VIEWPORT > &aPresetList)
 
void handleBoardItemsChanged()
 
wxRadioButton * m_rbHighContrastDim
 
void OnSize(wxSizeEvent &aEvent) override
 
wxString netclassNameFromEvent(wxEvent &aEvent)
 
bool IsTogglingNetRatsnestVisibility()
 
wxGridCellCoords m_hoveredCell
Grid cell that is being hovered over, for tooltips.
 
void showNetclass(const wxString &aClassName, bool aShow=true)
 
wxStaticText * m_txtRatsnestVisibility
 
wxString GetActiveLayerPreset() const
 
APPEARANCE_CONTROLS(const APPEARANCE_CONTROLS &)=delete
 
void onLayerLeftClick(wxMouseEvent &aEvent)
 
std::vector< VIEWPORT > GetUserViewports() const
Update the current viewports from those saved in the project file.
 
VIEWPORT * m_lastSelectedViewport
 
wxArrayString m_viewportMRU
 
void SetTabIndex(int aTab)
 
wxColour m_layerPanelColour
 
std::map< int, wxString > m_netclassIdMap
Stores wxIDs for each netclass for control event mapping.
 
void OnLayerContextMenu(wxCommandEvent &aEvent)
Return the index of the current tab (0-2).
 
void onNetColorMode(wxCommandEvent &aEvent)
 
APPEARANCE_CONTROLS & operator=(const APPEARANCE_CONTROLS &)=delete
 
void OnNetVisibilityChanged(int aNetCode, bool aVisibility)
Notifies the panel when a net has been hidden or shown via the external tool.
 
bool IsNetOptionsExpanded()
 
void OnDarkModeToggle()
Update the widget when the active board layer is changed.
 
static LAYER_PRESET presetAllLayers
 
bool m_togglingNetclassRatsnestVisibility
 
void onNetclassContextMenu(wxCommandEvent &aEvent)
 
wxStaticText * m_txtNetDisplayTitle
 
wxStaticLine * m_layerDisplaySeparator
 
void syncObjectSettings()
 
APPEARANCE_CONTROLS(PCB_BASE_FRAME *aParent, wxWindow *aFocusOwner, bool aFpEditor=false)
 
void SetObjectVisible(GAL_LAYER_ID aLayer, bool isVisible=true)
 
void OnNetGridDoubleClick(wxGridEvent &event) override
 
void SetLayerVisible(int aLayer, bool isVisible)
 
void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aItem) override
 
void onNetclassColorChanged(wxCommandEvent &aEvent)
 
void ApplyViewport(const wxString &aPresetName)
 
GRID_BITMAP_TOGGLE_RENDERER * m_toggleGridRenderer
 
A checkbox control except with custom bitmaps for the checked and unchecked states.
 
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
 
Information pertinent to a Pcbnew printed circuit board.
 
A simple color swatch of the kind used to set layer colors.
 
Helper for storing and iterating over GAL_LAYER_IDs.
 
A toggle button renderer for a wxGrid, similar to BITMAP_TOGGLE.
 
Represent a row indicator icon for use in places like the layer widget.
 
A color representation with 4 components: red, green, blue, alpha.
 
LSET is a set of PCB_LAYER_IDs.
 
void SetValue(int aRow, int aCol, const wxString &aValue) override
 
void SetValueAsCustom(int aRow, int aCol, const wxString &aTypeName, void *aValue) override
 
std::vector< NET_GRID_ENTRY > m_nets
 
void updateNetColor(const NET_GRID_ENTRY &aNet)
 
NET_GRID_ENTRY & GetEntry(int aRow)
 
void SetValueAsBool(int aRow, int aCol, bool aValue) override
 
void * GetValueAsCustom(int aRow, int aCol, const wxString &aTypeName) override
 
NET_GRID_TABLE(PCB_BASE_FRAME *aFrame, wxColor aBackgroundColor)
 
void updateNetVisibility(const NET_GRID_ENTRY &aNet)
 
wxString GetValue(int aRow, int aCol) override
 
wxGridCellAttr * m_labelAttr
 
void HideOtherNets(const NET_GRID_ENTRY &aNet)
 
wxGridCellAttr * m_defaultAttr
 
bool GetValueAsBool(int aRow, int aCol) override
 
wxGridCellAttr * GetAttr(int aRow, int aCol, wxGridCellAttr::wxAttrKind) override
 
int GetNumberCols() override
 
static void * ColorToVoid(COLOR4D &aColor)
 
int GetRowByNetcode(int aCode) const
 
int GetNumberRows() override
 
wxString GetTypeName(int aRow, int aCol) override
 
static COLOR4D VoidToColor(void *aColor)
 
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
 
Icon provider for the "standard" row indicators, for example in layer selection lists.
 
A better wxCollapsiblePane that.
 
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
 
PCB_LAYER_ID
A quick note on layer IDs:
 
Container for an appearance setting (can control a single board layer, or GAL layer,...
 
APPEARANCE_SETTING(const wxString &aLabel, int aId, const wxString &aTooltip=wxEmptyString, bool aCanControlOpacity=false, bool aCanControlVisibility=true)
 
bool can_control_visibility
 
BITMAP_TOGGLE * ctl_visibility
 
INDICATOR_ICON * ctl_indicator
 
A saved set of layers that are visible.
 
NET_GRID_ENTRY(int aCode, const wxString &aName, const COLOR4D &aColor, bool aVisible)