21 #ifndef _APPEARANCE_CONTROLS_H 22 #define _APPEARANCE_CONTROLS_H 77 return static_cast<void*>( &aColor );
82 return *static_cast<COLOR4D*>( aColor );
99 wxGridCellAttr*
GetAttr(
int aRow,
int aCol, wxGridCellAttr::wxAttrKind )
override;
101 wxString
GetValue(
int aRow,
int aCol )
override;
103 void SetValue(
int aRow,
int aCol,
const wxString& aValue )
override;
105 wxString
GetTypeName(
int aRow,
int aCol )
override;
111 void*
GetValueAsCustom(
int aRow,
int aCol,
const wxString& aTypeName )
override;
113 void SetValueAsCustom(
int aRow,
int aCol,
const wxString& aTypeName,
void* aValue )
override;
165 const wxString& aTooltip = wxEmptyString,
166 bool aCanControlOpacity =
false ) :
255 return wxEmptyString;
281 void OnSetFocus( wxFocusEvent& aEvent )
override;
283 void OnSize( wxSizeEvent& aEvent )
override;
340 void showNetclass(
const wxString& aClassName,
bool aShow =
true );
void OnSize(wxSizeEvent &aEvent) override
void OnBoardItemChanged(BOARD &aBoard, BOARD_ITEM *aItem) override
void rebuildLayerPresetsWidget()
static LAYER_PRESET presetFrontAssembly
A saved set of layers that are visible.
wxSize GetBestSize() const
void onObjectOpacitySlider(int aLayer, float aOpacity)
std::map< PCB_LAYER_ID, APPEARANCE_SETTING * > m_layerSettingsMap
void OnNetGridMouseEvent(wxMouseEvent &aEvent)
BITMAP_TOGGLE * ctl_visibility
Icon provider for the "standard" row indicators, for example in layer selection lists.
static COLOR4D VoidToColor(void *aColor)
void syncLayerPresetSelection()
Class APPEARANCE_CONTROLS_BASE.
void * GetValueAsCustom(int aRow, int aCol, const wxString &aTypeName) override
void HideOtherNets(const NET_GRID_ENTRY &aNet)
void ApplyLayerPreset(const wxString &aPresetName)
wxCheckBox * m_cbFlipBoard
void OnBoardItemsChanged(BOARD &aBoard, std::vector< BOARD_ITEM * > &aItems) override
Update the colors on all the widgets from the new chosen color theme.
WX_COLLAPSIBLE_PANE * m_paneLayerDisplayOptions
void SetValueAsCustom(int aRow, int aCol, const wxString &aTypeName, void *aValue) override
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void syncObjectSettings()
std::vector< std::unique_ptr< APPEARANCE_SETTING > > m_layerSettings
void onLayerVisibilityToggled(PCB_LAYER_ID aLayer)
void onNetColorMode(wxCommandEvent &aEvent)
void rebuildLayerContextMenu()
APPEARANCE_SETTING(const wxString &aLabel, int aId, const wxString &aTooltip=wxEmptyString, bool aCanControlOpacity=false)
void SetTabIndex(int aTab)
LAYER_PRESET * m_lastSelectedUserPreset
The last user (non-read-only) preset selected by the user.
void OnLanguageChanged()
Update the panel contents from the application and board models.
void onRatsnestMode(wxCommandEvent &aEvent)
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
std::map< int, wxString > m_netclassIdMap
Stores wxIDs for each netclass for control event mapping.
wxRadioButton * m_rbNetColorOff
wxStaticLine * m_layerDisplaySeparator
void idleFocusHandler(wxIdleEvent &aEvent)
wxRadioButton * m_rbRatsnestAllLayers
int LAYER_NUM
This can be replaced with int and removed.
static void * ColorToVoid(COLOR4D &aColor)
void OnBoardItemAdded(BOARD &aBoard, BOARD_ITEM *aItem) override
NET_GRID_TABLE(PCB_BASE_FRAME *aFrame, wxColor aBackgroundColor)
wxRadioButton * m_rbHighContrastOff
wxGridCellAttr * m_defaultAttr
NET_GRID_ENTRY(int aCode, const wxString &aName, const COLOR4D &aColor, bool aVisible)
void OnNetGridClick(wxGridEvent &event) override
const wxArrayString & GetLayerPresetsMRU()
wxMenu * m_layerContextMenu
void OnBoardItemsRemoved(BOARD &aBoard, std::vector< BOARD_ITEM * > &aItems) override
std::map< GAL_LAYER_ID, APPEARANCE_SETTING * > m_objectSettingsMap
A checkbox control except with custom bitmaps for the checked and unchecked states.
wxColour m_layerPanelColour
wxString name
A name for this layer set.
void showNetclass(const wxString &aClassName, bool aShow=true)
void OnBoardItemRemoved(BOARD &aBoard, BOARD_ITEM *aItem) override
void UpdateDisplayOptions()
Return a list of the layer presets created by the user.
representing a row indicator icon for use in places like the layer widget
void OnBoardNetSettingsChanged(BOARD &aBoard) override
LSET is a set of PCB_LAYER_IDs.
static LAYER_PRESET presetNoLayers
void OnNetGridDoubleClick(wxGridEvent &event) override
GRID_BITMAP_TOGGLE_RENDERER * m_toggleGridRenderer
void onNetclassVisibilityChanged(wxCommandEvent &aEvent)
wxGridCellAttr * m_labelAttr
std::map< wxString, APPEARANCE_SETTING * > m_netclassSettingsMap
std::map< wxString, LAYER_PRESET > m_layerPresets
void OnSetFocus(wxFocusEvent &aEvent) override
ROW_ICON_PROVIDER * m_iconProvider
void setVisibleLayers(LSET aLayers)
void doApplyLayerPreset(const LAYER_PRESET &aPreset)
Helper for storing and iterating over GAL_LAYER_IDs.
LAYER_PRESET * m_currentPreset
wxRadioButton * m_rbHighContrastNormal
wxStaticText * m_txtNetDisplayTitle
void onNetContextMenu(wxCommandEvent &aEvent)
wxBoxSizer * m_objectsOuterSizer
wxGridCellAttr * GetAttr(int aRow, int aCol, wxGridCellAttr::wxAttrKind) override
void OnBoardItemsAdded(BOARD &aBoard, std::vector< BOARD_ITEM * > &aItems) override
void SetUserLayerPresets(std::vector< LAYER_PRESET > &aPresetList)
int GetTabIndex() const
Set the current notebook tab.
Container for an appearance setting (can control a single board layer, or GAL layer,...
APPEARANCE_CONTROLS(PCB_BASE_FRAME *aParent, wxWindow *aFocusOwner, bool aFpEditor=false)
std::vector< LAYER_PRESET > GetUserLayerPresets() const
Update the current layer presets from those saved in the project file.
std::vector< std::unique_ptr< APPEARANCE_SETTING > > m_netclassSettings
int GetNumberRows() override
void onLayerPresetChanged(wxCommandEvent &aEvent) override
wxRadioButton * m_rbHighContrastDim
NET_GRID_ENTRY & GetEntry(int aRow)
bool GetValueAsBool(int aRow, int aCol) override
int GetRowByNetcode(int aCode) const
wxStaticText * m_inactiveLayersLabel
void SetValueAsBool(int aRow, int aCol, bool aValue) override
void OnNetVisibilityChanged(int aNetCode, bool aVisibility)
Notifies the panel when a net has been hidden or shown via the external tool.
int GetNumberCols() override
void updateLayerPresetSelection(const wxString &aName)
static LAYER_PRESET presetInnerCopper
void loadDefaultLayerPresets()
wxArrayString m_presetMRU
static LAYER_PRESET presetBackAssembly
Information pertinent to a Pcbnew printed circuit board.
void setVisibleObjects(GAL_SET aObjects)
std::vector< std::unique_ptr< APPEARANCE_SETTING > > m_objectSettings
wxRadioButton * m_rbRatsnestNone
PCB_LAYER_ID
A quick note on layer IDs:
void syncColorsAndVisibility()
A toggle button renderer for a wxGrid, similar to BITMAP_TOGGLE.
void handleBoardItemsChanged()
NET_GRID_TABLE * m_netsTable
wxString GetTypeName(int aRow, int aCol) override
INDICATOR_ICON * ctl_indicator
wxString netclassNameFromEvent(wxEvent &aEvent)
wxString GetValue(int aRow, int aCol) override
A simple color swatch of the kind used to set layer colors.
void SetValue(int aRow, int aCol, const wxString &aValue) override
void OnNotebookPageChanged(wxNotebookEvent &event) override
wxString GetActiveLayerPreset() const
void onLayerLeftClick(wxMouseEvent &aEvent)
void onObjectVisibilityChanged(GAL_LAYER_ID aLayer, bool isVisible, bool isFinal)
void onNetclassColorChanged(wxCommandEvent &aEvent)
void RefreshCollapsiblePanes()
Function to force a redraw of the collapsible panes in this control.
wxGridCellCoords m_hoveredCell
Grid cell that is being hovered over, for tooltips.
wxBoxSizer * m_layersOuterSizer
std::vector< NET_GRID_ENTRY > m_nets
void SetLayerVisible(LAYER_NUM aLayer, bool isVisible)
wxString m_contextMenuNetclass
The name of the netclass that was right-clicked.
void rightClickHandler(wxMouseEvent &aEvent)
void onNetclassContextMenu(wxCommandEvent &aEvent)
void OnNetGridRightClick(wxGridEvent &event) override
GAL_SET getVisibleObjects()
void OnColorSwatchChanged(wxCommandEvent &aEvent)
void OnLayerContextMenu(wxCommandEvent &aEvent)
Return the index of the current tab (0-2).
static LAYER_PRESET presetFront
void OnColorThemeChanged()
Update the widget when the active board layer is changed.
wxStaticText * m_txtRatsnestVisibility
A better wxCollapsiblePane that.
static LAYER_PRESET presetAllCopper
void updateNetColor(const NET_GRID_ENTRY &aNet)
static const APPEARANCE_SETTING s_objectSettings[]
Template for object appearance settings.
void OnLayerAlphaChanged()
bool doesBoardItemNeedRebuild(BOARD_ITEM *aBoardItem)
static LAYER_PRESET presetAllLayers
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
void updateNetVisibility(const NET_GRID_ENTRY &aNet)
void SetObjectVisible(GAL_LAYER_ID aLayer, bool isVisible=true)
Update the manual layer alpha overrides.
WX_COLLAPSIBLE_PANE * m_paneNetDisplayOptions
static LAYER_PRESET presetBack
wxRadioButton * m_rbNetColorRatsnest
A color representation with 4 components: red, green, blue, alpha.
wxRadioButton * m_rbNetColorAll
wxRadioButton * m_rbRatsnestVisLayers