KiCad PCB EDA Suite
DIALOG_BOARD_STATISTICS Class Reference

DIALOG_BOARD_STATISTIC. More...

#include <dialog_board_statistics.h>

Inheritance diagram for DIALOG_BOARD_STATISTICS:
DIALOG_BOARD_STATISTICS_BASE DIALOG_SHIM KIWAY_HOLDER

Classes

struct  componentsType_t
 Struct holds information about component type (such as SMD, THT, Virtual and so on), which will be shown in the dialog. More...
 
struct  drillType_t
 
struct  typeContainer_t
 Struct to hold type information, which will be shown in dialog. More...
 

Public Types

using padsType_t = typeContainer_t< PAD_ATTR_T >
 
using viasType_t = typeContainer_t< VIATYPE >
 
using componentsTypeList_t = std::deque< componentsType_t >
 
using padsTypeList_t = std::deque< padsType_t >
 
using viasTypeList_t = std::deque< viasType_t >
 
using drillTypeList_t = std::deque< drillType_t >
 
enum  HOLDER_TYPE { DIALOG, FRAME, PANEL }
 

Public Member Functions

 DIALOG_BOARD_STATISTICS (PCB_EDIT_FRAME *aParentFrame)
 
 ~DIALOG_BOARD_STATISTICS ()
 
bool TransferDataToWindow () override
 

Get data from the PCB board and print it to dialog

More...
 
void SetInitialFocus (wxWindow *aWindow)
 Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown. More...
 
int ShowQuasiModal ()
 
void EndQuasiModal (int retCode)
 
bool IsQuasiModal ()
 
bool Show (bool show) override
 
bool Enable (bool enable) override
 
void OnPaint (wxPaintEvent &event)
 
EDA_UNITS GetUserUnits () const
 
HOLDER_TYPE GetType ()
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Static Public Member Functions

static bool IsCtrl (int aChar, const wxKeyEvent &e)
 
static bool IsShiftCtrl (int aChar, const wxKeyEvent &e)
 
static void FixOSXCancelButtonIssue (wxWindow *aWindow)
 

Protected Member Functions

virtual void windowSize (wxSizeEvent &event)
 
void FinishDialogSettings ()
 In all dialogs, we must call the same functions to fix minimal dlg size, the default position and perhaps some others to fix a few issues depending on Windows Managers this helper function does these calls. More...
 
void SetSizeInDU (int x, int y)
 Set the dialog to the given dimensions in "dialog units". More...
 
int HorizPixelsFromDU (int x)
 Convert an integer number of dialog units to pixels, horizontally. More...
 
int VertPixelsFromDU (int y)
 Convert an integer number of dialog units to pixels, vertically. More...
 
void ResetSize ()
 Clear the existing dialog size and position. More...
 

Protected Attributes

wxNotebook * topNotebook
 
wxPanel * generalPanel
 
wxGrid * m_gridComponents
 
wxGrid * m_gridPads
 
wxGrid * m_gridBoard
 
wxStaticText * viasLabel
 
wxGrid * m_gridVias
 
wxCheckBox * m_checkBoxSubtractHoles
 
wxCheckBox * m_checkBoxExcludeComponentsNoPins
 
wxPanel * drillsPanel
 
wxGrid * m_gridDrills
 
wxButton * m_buttonSaveReport
 
wxStdDialogButtonSizer * m_sdbControlSizer
 
wxButton * m_sdbControlSizerCancel
 
EDA_UNITS m_units
 
std::string m_hash_key
 
bool m_firstPaintEvent
 
wxWindow * m_initialFocusTarget
 
WX_EVENT_LOOPm_qmodal_loop
 
bool m_qmodal_showing
 
WDO_ENABLE_DISABLEm_qmodal_parent_disabler
 
std::vector< wxWindow * > m_tabOrder
 

Private Member Functions

void refreshItemsTypes ()
 

Function to fill up all items types to be shown in the dialog.

More...
 
void getDataFromPCB ()
 

Gets data from board

More...
 
void updateWidets ()
 

Applies data to dialog widgets

More...
 
void updateDrillGrid ()
 

Updates drills grid

More...
 
void printGridToStringAsTable (wxGrid *aGrid, wxString &aStr, bool aUseRowLabels, bool aUseColLabels, bool aUseFirstColAsLabel)
 

Prints grid to string in tabular format

More...
 
void adjustDrillGridColumns ()
 
void checkboxClicked (wxCommandEvent &aEvent) override
 
void saveReportClicked (wxCommandEvent &aEvent) override
 

Save board statistics to a file

More...
 
void drillGridSize (wxSizeEvent &aEvent) override
 
void drillGridSort (wxGridEvent &aEvent)
 

Private Attributes

PCB_EDIT_FRAMEm_parentFrame
 
int m_boardWidth
 
int m_boardHeight
 
double m_boardArea
 
bool m_hasOutline
 

Shows if board outline properly defined

More...
 
componentsTypeList_t m_componentsTypes
 

Holds all components types to be shown in the dialog

More...
 
padsTypeList_t m_padsTypes
 

Holds all pads types to be shown in the dialog

More...
 
viasTypeList_t m_viasTypes
 

Holds all vias types to be shown in the dialog

More...
 
drillTypeList_t m_drillTypes
 

Holds all drill hole types to be shown in the dialog

More...
 

Detailed Description

DIALOG_BOARD_STATISTIC.

Dialog to show common board info.

Definition at line 47 of file dialog_board_statistics.h.

Member Typedef Documentation

◆ componentsTypeList_t

◆ drillTypeList_t

Definition at line 170 of file dialog_board_statistics.h.

◆ padsType_t

◆ padsTypeList_t

Definition at line 168 of file dialog_board_statistics.h.

◆ viasType_t

◆ viasTypeList_t

Definition at line 169 of file dialog_board_statistics.h.

Member Enumeration Documentation

◆ HOLDER_TYPE

enum KIWAY_HOLDER::HOLDER_TYPE
inherited
Enumerator
DIALOG 
FRAME 
PANEL 

Definition at line 42 of file kiway_holder.h.

Constructor & Destructor Documentation

◆ DIALOG_BOARD_STATISTICS()

DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS ( PCB_EDIT_FRAME aParentFrame)

Definition at line 69 of file dialog_board_statistics.cpp.

69  :
70  DIALOG_BOARD_STATISTICS_BASE( aParentFrame ),
71  m_boardWidth( 0 ),
72  m_boardHeight( 0 ),
73  m_boardArea( 0.0 ),
74  m_hasOutline( false )
75 {
76  m_parentFrame = aParentFrame;
77 
78  m_gridDrills->UseNativeColHeader();
79  m_gridDrills->Connect( wxEVT_GRID_COL_SORT, wxGridEventHandler( DIALOG_BOARD_STATISTICS::drillGridSort ), NULL, this );
80 
83 
84  // Make labels for grids
85  wxFont headingFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
86  headingFont.SetSymbolicSize( wxFONTSIZE_SMALL );
87  m_gridComponents->SetCellValue( ROW_LABEL, COL_FRONT_SIDE, _( "Front Side" ) );
88  m_gridComponents->SetCellFont( ROW_LABEL, COL_FRONT_SIDE, headingFont );
89  m_gridComponents->SetCellValue( ROW_LABEL, COL_BOTTOM_SIDE, _( "Back Side" ) );
90  m_gridComponents->SetCellFont( ROW_LABEL, COL_BOTTOM_SIDE, headingFont );
91  m_gridComponents->SetCellValue( ROW_LABEL, COL_TOTAL, _( "Total" ) );
92  m_gridComponents->SetCellFont( ROW_LABEL, COL_TOTAL, headingFont );
93 
94  m_gridBoard->SetCellValue( 0, 0, _( "Width:" ) );
95  m_gridBoard->SetCellAlignment( 0, 0, wxALIGN_LEFT, wxALIGN_CENTRE );
96  m_gridBoard->SetCellValue( 1, 0, _( "Height:" ) );
97  m_gridBoard->SetCellAlignment( 1, 0, wxALIGN_LEFT, wxALIGN_CENTRE );
98  m_gridBoard->SetCellValue( 2, 0, _( "Area:" ) );
99  m_gridBoard->SetCellAlignment( 2, 0, wxALIGN_LEFT, wxALIGN_CENTRE );
100 
101  wxGrid* grids[] = { m_gridComponents, m_gridPads, m_gridVias, m_gridBoard };
102  for( auto& grid : grids )
103  {
104  // Remove wxgrid's selection boxes
105  grid->SetCellHighlightPenWidth( 0 );
106  grid->SetColMinimalAcceptableWidth( 80 );
107  for( int i = 0; i < grid->GetNumberRows(); i++ )
108  grid->SetCellAlignment( i, COL_LABEL, wxALIGN_LEFT, wxALIGN_CENTRE );
109  }
110 
111  wxFileName fn = m_parentFrame->GetBoard()->GetFileName();
112 
114  || s_savedDialogState.m_project != Prj().GetProjectFullName() )
115  {
116  fn.SetName( fn.GetName() + "_report" );
117  fn.SetExt( "txt" );
118  s_savedDialogState.saveReportName = fn.GetFullName();
119  s_savedDialogState.saveReportFolder = wxPathOnly( Prj().GetProjectFullName() );
122  }
123 
124  // The wxStdDialogButtonSizer wxID_CANCLE button is in fact a close button
125  // Nothing to cancel:
126  m_sdbControlSizerCancel->SetLabel( _( "Close" ) );
127 }
bool m_hasOutline
Shows if board outline properly defined
const wxString & GetFileName() const
Definition: class_board.h:244
#define COL_TOTAL
void drillGridSort(wxGridEvent &aEvent)
#define COL_BOTTOM_SIDE
#define NULL
#define ROW_LABEL
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
#define COL_FRONT_SIDE
DIALOG_BOARD_STATISTICS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Board Statistics"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:118
#define _(s)
Definition: 3d_actions.cpp:33
BOARD * GetBoard() const
#define COL_LABEL
static DIALOG_BOARD_STATISTICS_SAVED_STATE s_savedDialogState

References _, COL_BOTTOM_SIDE, COL_FRONT_SIDE, COL_LABEL, COL_TOTAL, drillGridSort(), DIALOG_BOARD_STATISTICS_SAVED_STATE::excludeNoPins, PCB_BASE_FRAME::GetBoard(), BOARD::GetFileName(), PROJECT::GetProjectFullName(), DIALOG_BOARD_STATISTICS_BASE::m_checkBoxExcludeComponentsNoPins, DIALOG_BOARD_STATISTICS_BASE::m_checkBoxSubtractHoles, DIALOG_BOARD_STATISTICS_BASE::m_gridBoard, DIALOG_BOARD_STATISTICS_BASE::m_gridComponents, DIALOG_BOARD_STATISTICS_BASE::m_gridDrills, DIALOG_BOARD_STATISTICS_BASE::m_gridPads, DIALOG_BOARD_STATISTICS_BASE::m_gridVias, m_parentFrame, DIALOG_BOARD_STATISTICS_SAVED_STATE::m_project, DIALOG_BOARD_STATISTICS_BASE::m_sdbControlSizerCancel, NULL, KIWAY_HOLDER::Prj(), ROW_LABEL, s_savedDialogState, DIALOG_BOARD_STATISTICS_SAVED_STATE::saveReportFolder, DIALOG_BOARD_STATISTICS_SAVED_STATE::saveReportInitialized, DIALOG_BOARD_STATISTICS_SAVED_STATE::saveReportName, and DIALOG_BOARD_STATISTICS_SAVED_STATE::subtractHoles.

◆ ~DIALOG_BOARD_STATISTICS()

DIALOG_BOARD_STATISTICS::~DIALOG_BOARD_STATISTICS ( )

Definition at line 754 of file dialog_board_statistics.cpp.

755 {
756 }

Member Function Documentation

◆ adjustDrillGridColumns()

void DIALOG_BOARD_STATISTICS::adjustDrillGridColumns ( )
private

Definition at line 587 of file dialog_board_statistics.cpp.

588 {
589  int newTotalWidth = m_gridDrills->GetClientSize().GetWidth();
590  int curTotalWidth = 0;
591 
592  // Find the total current width
593  for( int i = 0; i < m_gridDrills->GetNumberCols(); i++ )
594  {
596  curTotalWidth += m_gridDrills->GetColSize( i );
597  }
598 
599  // Resize the last two columns to fill all available space
600 
601  int remainingWidth = newTotalWidth - curTotalWidth;
602 
603  m_gridDrills->SetColSize( drillType_t::COL_START_LAYER, remainingWidth / 2 );
604  m_gridDrills->SetColSize( drillType_t::COL_STOP_LAYER, remainingWidth - remainingWidth / 2 );
605 
606  m_gridDrills->Refresh();
607 }

References DIALOG_BOARD_STATISTICS::drillType_t::COL_START_LAYER, DIALOG_BOARD_STATISTICS::drillType_t::COL_STOP_LAYER, and DIALOG_BOARD_STATISTICS_BASE::m_gridDrills.

Referenced by drillGridSize(), and updateWidets().

◆ checkboxClicked()

void DIALOG_BOARD_STATISTICS::checkboxClicked ( wxCommandEvent &  aEvent)
overrideprivatevirtual

Reimplemented from DIALOG_BOARD_STATISTICS_BASE.

Definition at line 610 of file dialog_board_statistics.cpp.

611 {
615  getDataFromPCB();
616  updateWidets();
617  Layout();
618  drillsPanel->Layout();
619 }
void refreshItemsTypes()
Function to fill up all items types to be shown in the dialog.
void getDataFromPCB()
Gets data from board
void updateWidets()
Applies data to dialog widgets
static DIALOG_BOARD_STATISTICS_SAVED_STATE s_savedDialogState

References DIALOG_BOARD_STATISTICS_BASE::drillsPanel, DIALOG_BOARD_STATISTICS_SAVED_STATE::excludeNoPins, getDataFromPCB(), DIALOG_BOARD_STATISTICS_BASE::m_checkBoxExcludeComponentsNoPins, DIALOG_BOARD_STATISTICS_BASE::m_checkBoxSubtractHoles, refreshItemsTypes(), s_savedDialogState, DIALOG_BOARD_STATISTICS_SAVED_STATE::subtractHoles, and updateWidets().

◆ drillGridSize()

void DIALOG_BOARD_STATISTICS::drillGridSize ( wxSizeEvent &  aEvent)
overrideprivatevirtual

Reimplemented from DIALOG_BOARD_STATISTICS_BASE.

Definition at line 737 of file dialog_board_statistics.cpp.

738 {
739  aEvent.Skip();
741 }

References adjustDrillGridColumns().

◆ drillGridSort()

void DIALOG_BOARD_STATISTICS::drillGridSort ( wxGridEvent &  aEvent)
private

Definition at line 743 of file dialog_board_statistics.cpp.

744 {
745  drillType_t::COL_ID colId = static_cast<drillType_t::COL_ID>( aEvent.GetCol() );
746  bool ascending =
747  !( m_gridDrills->IsSortingBy( colId ) && m_gridDrills->IsSortOrderAscending() );
748 
749  sort( m_drillTypes.begin(), m_drillTypes.end(), drillType_t::COMPARE( colId, ascending ) );
750 
751  updateDrillGrid();
752 }
void updateDrillGrid()
Updates drills grid
drillTypeList_t m_drillTypes
Holds all drill hole types to be shown in the dialog

References m_drillTypes, DIALOG_BOARD_STATISTICS_BASE::m_gridDrills, and updateDrillGrid().

Referenced by DIALOG_BOARD_STATISTICS().

◆ Enable()

bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 269 of file dialog_shim.cpp.

270 {
271  // so we can do logging of this state change:
272  return wxDialog::Enable( enable );
273 }

◆ EndQuasiModal()

void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 388 of file dialog_shim.cpp.

389 {
390  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
391  // handle validation in the same way as other dialogs.
392  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
393  return;
394 
395  SetReturnCode( retCode );
396 
397  if( !IsQuasiModal() )
398  {
399  wxFAIL_MSG( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal"
400  "wasn't called" );
401  return;
402  }
403 
404  if( m_qmodal_loop )
405  {
406  if( m_qmodal_loop->IsRunning() )
407  m_qmodal_loop->Exit( 0 );
408  else
409  m_qmodal_loop->ScheduleExit( 0 );
410 
412  }
413 
416 
417  Show( false );
418 }
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:206
#define NULL
bool IsQuasiModal()
Definition: dialog_shim.h:123
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:209

References DIALOG_SHIM::IsQuasiModal(), DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, NULL, and DIALOG_SHIM::Show().

Referenced by HK_PROMPT_DIALOG::EndFlexible(), DIALOG_SHIM::OnButton(), DIALOG_EDIT_COMPONENTS_LIBID::onCancel(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnCancelButtonClick(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnCancelButtonClick(), DIALOG_LIB_EDIT_PIN_TABLE::OnClose(), DIALOG_PRINT_GENERIC::onCloseButton(), DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer(), DIALOG_CHOOSE_COMPONENT::OnCloseTimer(), DIALOG_SHIM::OnCloseWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnEditLibrarySymbol(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnEditSymbol(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnExchangeSymbol(), HTML_MESSAGE_BOX::OnOKButtonClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnUpdateSymbol(), DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser(), DIALOG_CHOOSE_COMPONENT::OnUseBrowser(), and DIALOG_SHIM::~DIALOG_SHIM().

◆ FinishDialogSettings()

void DIALOG_SHIM::FinishDialogSettings ( )
protectedinherited

In all dialogs, we must call the same functions to fix minimal dlg size, the default position and perhaps some others to fix a few issues depending on Windows Managers this helper function does these calls.

FinishDialogSettings must be called from derived classes, when all widgets are initialized, and therefore their size fixed. If TransferDataToWindow() is used to initialize widgets, at end of TransferDataToWindow, or better at end of a wxInitDialogEvent handler

In any case, the best way is to call it in a wxInitDialogEvent handler after calling TransfertDataToWindow(), which is the default wxInitDialogEvent handler wxDialog

Definition at line 144 of file dialog_shim.cpp.

145 {
146  // must be called from the constructor of derived classes,
147  // when all widgets are initialized, and therefore their size fixed
148 
149  // SetSizeHints fixes the minimal size of sizers in the dialog
150  // (SetSizeHints calls Fit(), so no need to call it)
151  GetSizer()->SetSizeHints( this );
152 
153  // the default position, when calling the first time the dlg
154  Center();
155 }

References PCAD2KICAD::Center.

Referenced by DIALOG_3D_VIEW_OPTIONS::DIALOG_3D_VIEW_OPTIONS(), DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DIALOG_BOM::DIALOG_BOM(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_CLEANUP_TRACKS_AND_VIAS::DIALOG_CLEANUP_TRACKS_AND_VIAS(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), DIALOG_DRC::DIALOG_DRC(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC(), DIALOG_EDIT_COMPONENTS_LIBID::DIALOG_EDIT_COMPONENTS_LIBID(), DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE(), DIALOG_EDIT_SHEET_PIN::DIALOG_EDIT_SHEET_PIN(), DIALOG_EDITOR_DATA::DIALOG_EDITOR_DATA(), DIALOG_ENUM_PADS::DIALOG_ENUM_PADS(), DIALOG_ERC::DIALOG_ERC(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXPORT_3DFILE::DIALOG_EXPORT_3DFILE(), DIALOG_EXPORT_IDF3::DIALOG_EXPORT_IDF3(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG(), DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), DIALOG_GENCAD_EXPORT_OPTIONS::DIALOG_GENCAD_EXPORT_OPTIONS(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(), DIALOG_GLOBAL_LIB_TABLE_CONFIG::DIALOG_GLOBAL_LIB_TABLE_CONFIG(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_IMAGE_EDITOR::DIALOG_IMAGE_EDITOR(), DIALOG_INSPECTOR::DIALOG_INSPECTOR(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM(), DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT(), DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_NETLIST::DIALOG_NETLIST(), DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::DIALOG_PAD_PRIMITIVE_POLY_PROPS(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC(), DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER(), DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES(), DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), DIALOG_SELECT_NET_FROM_LIST::DIALOG_SELECT_NET_FROM_LIST(), DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE(), DIALOG_UNUSED_PAD_LAYERS::DIALOG_UNUSED_PAD_LAYERS(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), DLG_SELECT_3DMODEL::DLG_SELECT_3DMODEL(), PAGED_DIALOG::finishInitialization(), DIALOG_EDIT_ONE_FIELD::init(), DIALOG_EDIT_LIBRARY_TABLES::InstallPanel(), NETLIST_DIALOG::NETLIST_DIALOG(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), DIALOG_SCH_SHEET_PROPS::OnInitDlg(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnInitDlg(), DIALOG_SIM_SETTINGS::onInitDlg(), DIALOG_SPICE_MODEL::onInitDlg(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_UPDATE_FIELDS::TransferDataToWindow(), TransferDataToWindow(), and DIALOG_COLOR_PICKER::TransferDataToWindow().

◆ FixOSXCancelButtonIssue()

static void DIALOG_SHIM::FixOSXCancelButtonIssue ( wxWindow *  aWindow)
staticinherited

◆ getDataFromPCB()

void DIALOG_BOARD_STATISTICS::getDataFromPCB ( )
private

Gets data from board

Definition at line 177 of file dialog_board_statistics.cpp.

178 {
179  BOARD* board = m_parentFrame->GetBoard();
180 
181  // Get modules and pads count
182  for( MODULE* module : board->Modules() )
183  {
184  // Do not proceed modules with no pads if checkbox checked
185  if( m_checkBoxExcludeComponentsNoPins->GetValue() && ! module->Pads().size() )
186  continue;
187 
188  // Go through components types list
189  for( auto& type : m_componentsTypes )
190  {
191  if( ( module->GetAttributes() & type.attribute ) > 0 )
192  {
193  if( module->IsFlipped() )
194  type.backSideQty++;
195  else
196  type.frontSideQty++;
197  break;
198  }
199  }
200 
201  for( D_PAD* pad : module->Pads() )
202  {
203  // Go through pads types list
204  for( auto& type : m_padsTypes )
205  {
206  if( pad->GetAttribute() == type.attribute )
207  {
208  type.qty++;
209  break;
210  }
211  }
212 
213  if( pad->GetDrillSize().x > 0 && pad->GetDrillSize().y > 0 )
214  {
215  PCB_LAYER_ID top, bottom;
216 
217  if( pad->GetLayerSet().CuStack().empty() )
218  {
219  // The pad is not on any copper layer
220  top = UNDEFINED_LAYER;
221  bottom = UNDEFINED_LAYER;
222  }
223  else
224  {
225  top = pad->GetLayerSet().CuStack().front();
226  bottom = pad->GetLayerSet().CuStack().back();
227  }
228 
229  drillType_t drill( pad->GetDrillSize().x, pad->GetDrillSize().y,
230  pad->GetDrillShape(), pad->GetAttribute() != PAD_ATTRIB_HOLE_NOT_PLATED,
231  true, top, bottom );
232 
233  auto it = m_drillTypes.begin();
234  for( ; it != m_drillTypes.end(); it++ )
235  {
236  if( *it == drill )
237  {
238  it->qty++;
239  break;
240  }
241  }
242 
243  if( it == m_drillTypes.end() )
244  {
245  drill.qty = 1;
246  m_drillTypes.push_back( drill );
247  m_gridDrills->InsertRows();
248  }
249  }
250  }
251  }
252 
253  // Get via counts
254  for( TRACK* track : board->Tracks() )
255  {
256  if( VIA* via = dyn_cast<VIA*>( track ) )
257  {
258  for( auto& type : m_viasTypes )
259  {
260  if( via->GetViaType() == type.attribute )
261  {
262  type.qty++;
263  break;
264  }
265  }
266 
267  drillType_t drill( via->GetDrillValue(), via->GetDrillValue(), PAD_DRILL_SHAPE_CIRCLE,
268  true, false, via->TopLayer(), via->BottomLayer() );
269 
270  auto it = m_drillTypes.begin();
271  for( ; it != m_drillTypes.end(); it++ )
272  {
273  if( *it == drill )
274  {
275  it->qty++;
276  break;
277  }
278  }
279 
280  if( it == m_drillTypes.end() )
281  {
282  drill.qty = 1;
283  m_drillTypes.push_back( drill );
284  m_gridDrills->InsertRows();
285  }
286  }
287  }
288 
289  sort( m_drillTypes.begin(), m_drillTypes.end(),
290  drillType_t::COMPARE( drillType_t::COL_COUNT, false ) );
291 
292  bool boundingBoxCreated = false; //flag if bounding box initialized
293  BOX2I bbox;
294  SHAPE_POLY_SET polySet;
295  m_hasOutline = board->GetBoardPolygonOutlines( polySet );
296 
297  // If board has no Edge Cuts lines, board->GetBoardPolygonOutlines will
298  // return small rectangle, so we double check that
299  bool edgeCutsExists = false;
300 
301  for( BOARD_ITEM* drawing : board->Drawings() )
302  {
303  if( drawing->GetLayer() == Edge_Cuts )
304  {
305  edgeCutsExists = true;
306  break;
307  }
308  }
309 
310  if( !edgeCutsExists )
311  m_hasOutline = false;
312 
313  if( m_hasOutline )
314  {
315  m_boardArea = 0.0;
316 
317  for( int i = 0; i < polySet.OutlineCount(); i++ )
318  {
319  SHAPE_LINE_CHAIN& outline = polySet.Outline( i );
320  m_boardArea += std::fabs( outline.Area() );
321 
322  // If checkbox "subtract holes" is checked
323  if( m_checkBoxSubtractHoles->GetValue() )
324  {
325  for( int j = 0; j < polySet.HoleCount( i ); j++ )
326  m_boardArea -= std::fabs( polySet.Hole( i, j ).Area() );
327  }
328 
329  if( boundingBoxCreated )
330  {
331  bbox.Merge( outline.BBox() );
332  }
333  else
334  {
335  bbox = outline.BBox();
336  boundingBoxCreated = true;
337  }
338  }
339 
341  m_boardArea /= ( IU_PER_MILS * IU_PER_MILS * 1000000 );
342  else
344 
345  m_boardWidth = bbox.GetWidth();
346  m_boardHeight = bbox.GetHeight();
347  }
348 }
bool m_hasOutline
Shows if board outline properly defined
int OutlineCount() const
Returns the number of outlines in the set
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:85
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
static constexpr double IU_PER_MM
Mock up a conversion function.
viasTypeList_t m_viasTypes
Holds all vias types to be shown in the dialog
SHAPE_LINE_CHAIN & Hole(int aOutline, int aHole)
Returns the reference to aHole-th hole in the aIndex-th outline
EDA_UNITS GetUserUnits() const
Definition: dialog_shim.h:131
PCB_LAYER_ID
A quick note on layer IDs:
const BOX2I BBox(int aClearance=0) const override
Function BBox()
MODULES & Modules()
Definition: class_board.h:249
SHAPE_POLY_SET.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Returns the reference to aIndex-th outline in the set
coord_type GetWidth() const
Definition: box2.h:197
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, wxString *aErrorText=nullptr, wxPoint *aErrorLocation=nullptr)
Function GetBoardPolygonOutlines Extracts the board outlines and build a closed polygon from lines,...
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect.
Definition: box2.h:386
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
SHAPE_LINE_CHAIN.
#define IU_PER_MILS
Definition: plotter.cpp:138
coord_type GetHeight() const
Definition: box2.h:198
padsTypeList_t m_padsTypes
Holds all pads types to be shown in the dialog
BOARD * GetBoard() const
drillTypeList_t m_drillTypes
Holds all drill hole types to be shown in the dialog
componentsTypeList_t m_componentsTypes
Holds all components types to be shown in the dialog
DRAWINGS & Drawings()
Definition: class_board.h:252
TRACKS & Tracks()
Definition: class_board.h:246

References SHAPE_LINE_CHAIN::Area(), SHAPE_LINE_CHAIN::BBox(), DIALOG_BOARD_STATISTICS::drillType_t::COL_COUNT, BOARD::Drawings(), Edge_Cuts, PCB_BASE_FRAME::GetBoard(), BOARD::GetBoardPolygonOutlines(), BOX2< Vec >::GetHeight(), DIALOG_SHIM::GetUserUnits(), BOX2< Vec >::GetWidth(), SHAPE_POLY_SET::Hole(), SHAPE_POLY_SET::HoleCount(), INCHES, IU_PER_MILS, IU_PER_MM, m_boardArea, m_boardHeight, m_boardWidth, DIALOG_BOARD_STATISTICS_BASE::m_checkBoxExcludeComponentsNoPins, DIALOG_BOARD_STATISTICS_BASE::m_checkBoxSubtractHoles, m_componentsTypes, m_drillTypes, DIALOG_BOARD_STATISTICS_BASE::m_gridDrills, m_hasOutline, m_padsTypes, m_parentFrame, m_viasTypes, BOX2< Vec >::Merge(), BOARD::Modules(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), PAD_ATTRIB_HOLE_NOT_PLATED, PAD_DRILL_SHAPE_CIRCLE, BOARD::Tracks(), and UNDEFINED_LAYER.

Referenced by checkboxClicked(), and TransferDataToWindow().

◆ GetType()

HOLDER_TYPE KIWAY_HOLDER::GetType ( )
inlineinherited

Definition at line 49 of file kiway_holder.h.

49 { return m_type; }
HOLDER_TYPE m_type
Definition: kiway_holder.h:82

References KIWAY_HOLDER::m_type.

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ GetUserUnits()

◆ HorizPixelsFromDU()

int DIALOG_SHIM::HorizPixelsFromDU ( int  x)
protectedinherited

Convert an integer number of dialog units to pixels, horizontally.

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 165 of file dialog_shim.cpp.

166 {
167  wxSize sz( x, 0 );
168  return ConvertDialogToPixels( sz ).x;
169 }

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), and DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT().

◆ IsCtrl()

static bool DIALOG_SHIM::IsCtrl ( int  aChar,
const wxKeyEvent &  e 
)
inlinestaticinherited

Definition at line 136 of file dialog_shim.h.

137  {
138  return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
139  !e.ShiftDown() && !e.MetaDown();
140  }

Referenced by DIALOG_TEXT_PROPERTIES::OnCharHook().

◆ IsQuasiModal()

◆ IsShiftCtrl()

static bool DIALOG_SHIM::IsShiftCtrl ( int  aChar,
const wxKeyEvent &  e 
)
inlinestaticinherited

Definition at line 142 of file dialog_shim.h.

143  {
144  return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
145  e.ShiftDown() && !e.MetaDown();
146  }

Referenced by DIALOG_TEXT_PROPERTIES::OnCharHook().

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in.

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 56 of file kiway_holder.h.

57  {
58  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
59  return *m_kiway;
60  }
KIWAY * m_kiway
Definition: kiway_holder.h:81

References KIWAY_HOLDER::m_kiway.

Referenced by TREEPROJECT_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_CONTROL::AddSymbolToSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), SCH_EDIT_FRAME::canCloseWindow(), KICAD_MANAGER_FRAME::CloseProject(), COMMON_CONTROL::ConfigurePaths(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), CVPCB_MAINFRAME::DisplayStatus(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), PCB_EDITOR_CONTROL::EditFpInFpEditor(), SCH_EDITOR_CONTROL::EditWithLibEdit(), BACK_ANNOTATE::FetchNetlistFromPCB(), DISPLAY_FOOTPRINTS_FRAME::GetModule(), PCB_EDIT_FRAME::importFile(), KIWAY_PLAYER::language_change(), KICAD_MANAGER_FRAME::language_change(), DIALOG_CHANGE_SYMBOLS::launchMatchIdSymbolBrowser(), DIALOG_CHANGE_SYMBOLS::launchNewIdSymbolBrowser(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), CVPCB_MAINFRAME::LoadFootprintFiles(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), PL_EDITOR_FRAME::OnExit(), SCH_EDIT_FRAME::OnExit(), FOOTPRINT_EDIT_FRAME::OnExitKiCad(), FOOTPRINT_VIEWER_FRAME::OnExitKiCad(), LIB_EDIT_FRAME::OnExitKiCad(), SAVE_AS_TRAVERSER::OnFile(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenPcbnew(), EDA_BASE_FRAME::OnPreferences(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), KIWAY_HOLDER::Prj(), SCH_EDIT_TOOL::Properties(), BACK_ANNOTATE::PushNewLinksToPCB(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDITOR_CONTROL::rescueProject(), EE_INSPECTION_TOOL::RunSimulation(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), LIB_TREE_MODEL_ADAPTER::SavePinnedItems(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlistToCvpcb(), SCH_EDIT_FRAME::SetCrossProbeConnection(), CVPCB_CONTROL::ShowFootprintViewer(), COMMON_CONTROL::ShowLibraryTable(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), PCB_EDITOR_CONTROL::UpdateSchematicFromPCB(), LIB_CONTROL::UpdateSymbolInSchematic(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ OnPaint()

void DIALOG_SHIM::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 295 of file dialog_shim.cpp.

296 {
297  if( m_firstPaintEvent )
298  {
300 
301  selectAllInTextCtrls( GetChildren() );
302 
304  m_initialFocusTarget->SetFocus();
305  else
306  SetFocus(); // Focus the dialog itself
307 
308  m_firstPaintEvent = false;
309  }
310 
311  event.Skip();
312 }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:204
bool m_firstPaintEvent
Definition: dialog_shim.h:203
void FixupCancelButtonCmdKeyCollision(wxWindow *aWindow)
Definition: gtk/ui.cpp:46
static void selectAllInTextCtrls(wxWindowList &children)

References KIPLATFORM::UI::FixupCancelButtonCmdKeyCollision(), DIALOG_SHIM::m_firstPaintEvent, DIALOG_SHIM::m_initialFocusTarget, and selectAllInTextCtrls().

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ printGridToStringAsTable()

void DIALOG_BOARD_STATISTICS::printGridToStringAsTable ( wxGrid *  aGrid,
wxString &  aStr,
bool  aUseRowLabels,
bool  aUseColLabels,
bool  aUseFirstColAsLabel 
)
private

Prints grid to string in tabular format

Definition at line 492 of file dialog_board_statistics.cpp.

494 {
495  std::vector<int> widths( aGrid->GetNumberCols(), 0 );
496  int rowLabelsWidth = 0;
497 
498  // Determine column widths.
499 
500  if( aUseColLabels )
501  {
502  for( int col = 0; col < aGrid->GetNumberCols(); col++ )
503  widths[col] = aGrid->GetColLabelValue( col ).length();
504  }
505 
506  for( int row = 0; row < aGrid->GetNumberRows(); row++ )
507  {
508  rowLabelsWidth = std::max<int>( rowLabelsWidth, aGrid->GetRowLabelValue( row ).length() );
509 
510  for( int col = 0; col < aGrid->GetNumberCols(); col++ )
511  widths[col] = std::max<int>( widths[col], aGrid->GetCellValue( row, col ).length() );
512  }
513 
514  // Print the cells.
515 
516  wxString tmp;
517 
518  // Print column labels.
519 
520  aStr << "|";
521 
522  if( aUseRowLabels )
523  {
524  aStr.Append( ' ', rowLabelsWidth );
525  aStr << " |";
526  }
527 
528  for( int col = 0; col < aGrid->GetNumberCols(); col++ )
529  {
530  if( aUseColLabels )
531  tmp.Printf( " %*s |", widths[col], aGrid->GetColLabelValue( col ) );
532  else
533  tmp.Printf( " %*s |", widths[col], aGrid->GetCellValue( 0, col ) );
534  aStr << tmp;
535  }
536 
537  aStr << "\n";
538 
539  // Print column label horizontal separators.
540 
541  aStr << "|";
542 
543  if( aUseRowLabels )
544  {
545  aStr.Append( '-', rowLabelsWidth );
546  aStr << "-|";
547  }
548 
549  for( int col = 0; col < aGrid->GetNumberCols(); col++ )
550  {
551  aStr << "-";
552  aStr.Append( '-', widths[col] );
553  aStr << "-|";
554  }
555 
556  aStr << "\n";
557 
558  // Print regular cells.
559 
560  int firstRow = 0, firstCol = 0;
561 
562  if( !aUseColLabels )
563  firstRow = 1;
564 
565  if( !aUseRowLabels && aUseFirstColAsLabel )
566  firstCol = 1;
567 
568  for( int row = firstRow; row < aGrid->GetNumberRows(); row++ )
569  {
570  if( aUseRowLabels )
571  tmp.Printf( "|%-*s |", rowLabelsWidth, aGrid->GetRowLabelValue( row ) );
572  else if( aUseFirstColAsLabel )
573  tmp.Printf( "|%-*s |", widths[0], aGrid->GetCellValue( row, 0 ) );
574  else
575  tmp.Printf( "|" );
576  aStr << tmp;
577 
578  for( int col = firstCol; col < aGrid->GetNumberCols(); col++ )
579  {
580  tmp.Printf( " %*s |", widths[col], aGrid->GetCellValue( row, col ) );
581  aStr << tmp;
582  }
583  aStr << "\n";
584  }
585 }

Referenced by saveReportClicked().

◆ Prj()

PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

Function Prj returns a reference to the PROJECT "associated with" this KIWAY.

Definition at line 35 of file kiway_holder.cpp.

36 {
37  return Kiway().Prj();
38 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:173

References KIWAY_HOLDER::Kiway(), and KIWAY::Prj().

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_MANAGER::addLibrary(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), DIALOG_SYMBOL_REMAP::backupProject(), CVPCB_MAINFRAME::buildEquivalenceList(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), KICAD_MANAGER_FRAME::CloseProject(), DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SCH_EDIT_FRAME::CreateScreens(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromLibrary(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DIALOG_BOARD_STATISTICS(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), LIB_VIEW_FRAME::DisplayLibInfos(), CVPCB_MAINFRAME::DisplayStatus(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), PCB_EDIT_FRAME::doAutoSave(), PCB_BASE_EDIT_FRAME::doCloseWindow(), SCH_EDIT_FRAME::doCloseWindow(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), KICAD_MANAGER_CONTROL::Execute(), PCB_EDIT_FRAME::Export_IDF3(), DIALOG_EXPORT_SVG::ExportSVGFile(), LIB_CONTROL::ExportSymbolAsSVG(), LIB_CONTROL::ExportView(), PCB_EDIT_FRAME::ExportVRML_File(), BACK_ANNOTATE::FetchNetlistFromPCB(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), DIALOG_GENDRILL::GenDrillAndMapFiles(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SCH_BASE_FRAME::GetLibPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), DISPLAY_FOOTPRINTS_FRAME::GetModule(), KICAD_MANAGER_FRAME::GetProjectFileName(), LIB_VIEW_FRAME::GetSelectedSymbol(), FP_THREAD_IFACE::GetTable(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDITOR_CONTROL::ImportFPAssignments(), DIALOG_CONFIG_EQUFILES::Init(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), SCH_EDIT_FRAME::KiwayMailIn(), LIB_EDIT_FRAME::KiwayMailIn(), EDA_DRAW_FRAME::LibraryFileBrowser(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), KICAD_MANAGER_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProjectSettings(), PCB_EDIT_FRAME::LoadProjectSettings(), SCH_EDIT_FRAME::LoadSheetFromFile(), EDA_BASE_FRAME::LoadWindowState(), DIALOG_FOOTPRINT_FP_EDITOR::On3DModelCellChanged(), DIALOG_FOOTPRINT_BOARD_EDITOR::On3DModelCellChanged(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DModel(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAdd3DModel(), DIALOG_BOARD_SETUP::OnAuxiliaryAction(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), TEXT_BUTTON_URL::OnButtonClick(), TEXT_BUTTON_FILE_BROWSER::OnButtonClick(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), DIALOG_GENDRILL::OnGenReportFile(), KICAD_MANAGER_FRAME::OnIdle(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), DIALOG_CONFIG_EQUFILES::OnOkClick(), SCH_EDIT_FRAME::OnOpenCvpcb(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_BOM::OnRunGenerator(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), DIALOG_ERC::OnSaveReport(), DIALOG_DRC::OnSaveReport(), PROPERTIES_FRAME::onScintillaCharAdded(), DIALOG_LABEL_EDITOR::onScintillaCharAdded(), DIALOG_SCH_EDIT_ONE_FIELD::onScintillaCharAdded(), DIALOG_SPICE_MODEL::onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), SCH_EDIT_FRAME::OnUpdatePCB(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PANEL_PREV_3D::PANEL_PREV_3D(), SCH_EDITOR_CONTROL::Paste(), FOOTPRINT_EDITOR_TOOLS::PasteFootprint(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), DIALOG_PLOT::Plot(), DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL(), DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDITOR_CONTROL::Print(), SCH_EDIT_FRAME::PrintPage(), EDA_DRAW_FRAME::PrintWorkSheet(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), SCH_EDIT_TOOL::RefreshSymbolFromLibrary(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), PCB_INSPECTION_TOOL::reportCopperClearance(), SCH_EDITOR_CONTROL::RescueLegacyProject(), SCH_EDITOR_CONTROL::RescueSymbolLibTableProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), DRC_TOOL::RunTests(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::saveLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), LIB_EDIT_FRAME::savePartAs(), PCB_EDIT_FRAME::SavePcbFile(), SCH_EDIT_FRAME::SaveProject(), PCB_EDIT_FRAME::SaveProjectSettings(), saveReportClicked(), EDA_BASE_FRAME::SaveSettings(), SCH_BASE_FRAME::saveSymbolLibTables(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectCompFromLibTree(), PCB_BASE_FRAME::SelectLibrary(), LIB_EDIT_FRAME::SelectLibraryFromList(), LIB_EDIT_FRAME::selectSymLibTable(), PCB_BASE_EDIT_FRAME::SetBoard(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), GERBVIEW_FRAME::SetPageSettings(), EE_INSPECTION_TOOL::ShowDatasheet(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), COMMON_CONTROL::ShowHelp(), LIB_VIEW_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::symTable(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), EDA_3D_VIEWER::takeScreenshot(), PANEL_SETUP_RULES::TransferDataFromWindow(), NETLIST_DIALOG::TransferDataFromWindow(), DIALOG_EDIT_COMPONENTS_LIBID::TransferDataFromWindow(), PANEL_SETUP_RULES::TransferDataToWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::UpdateTitle(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::~DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::~DIALOG_FOOTPRINT_FP_EDITOR(), and SCH_EDIT_FRAME::~SCH_EDIT_FRAME().

◆ refreshItemsTypes()

void DIALOG_BOARD_STATISTICS::refreshItemsTypes ( )
private

Function to fill up all items types to be shown in the dialog.

Definition at line 129 of file dialog_board_statistics.cpp.

130 {
131  m_componentsTypes.clear();
132 
133  // If you need some more types to be shown, simply add them to the
134  // corresponding list
135  m_componentsTypes.push_back( componentsType_t( MOD_THROUGH_HOLE, _( "THT:" ) ) );
136  m_componentsTypes.push_back( componentsType_t( MOD_SMD, _( "SMD:" ) ) );
137 
138  m_padsTypes.clear();
139  m_padsTypes.push_back( padsType_t( PAD_ATTRIB_STANDARD, _( "Through hole:" ) ) );
140  m_padsTypes.push_back( padsType_t( PAD_ATTRIB_SMD, _( "SMD:" ) ) );
141  m_padsTypes.push_back( padsType_t( PAD_ATTRIB_CONN, _( "Connector:" ) ) );
142  m_padsTypes.push_back( padsType_t( PAD_ATTRIB_HOLE_NOT_PLATED, _( "NPTH:" ) ) );
143 
144  m_viasTypes.clear();
145  m_viasTypes.push_back( viasType_t( VIATYPE::THROUGH, _( "Through vias:" ) ) );
146  m_viasTypes.push_back( viasType_t( VIATYPE::BLIND_BURIED, _( "Blind/buried:" ) ) );
147  m_viasTypes.push_back( viasType_t( VIATYPE::MICROVIA, _( "Micro vias:" ) ) );
148 
149  // If there not enough rows in grids, append some
150  int appendRows = m_componentsTypes.size() + 2 - m_gridComponents->GetNumberRows();
151 
152  if( appendRows > 0 )
153  m_gridComponents->AppendRows( appendRows );
154 
155  appendRows = m_padsTypes.size() + 1 - m_gridPads->GetNumberRows();
156 
157  if( appendRows > 0 )
158  m_gridPads->AppendRows( appendRows );
159 
160  appendRows = m_viasTypes.size() + 1 - m_gridVias->GetNumberRows();
161 
162  if( appendRows )
163  m_gridVias->AppendRows( appendRows );
164 }
typeContainer_t< VIATYPE > viasType_t
like PAD_STANDARD, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:85
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:81
viasTypeList_t m_viasTypes
Holds all vias types to be shown in the dialog
typeContainer_t< PAD_ATTR_T > padsType_t
Like smd, does not appear on the solder paste layer (default) note also has a special attribute in Ge...
Definition: pad_shapes.h:82
#define _(s)
Definition: 3d_actions.cpp:33
padsTypeList_t m_padsTypes
Holds all pads types to be shown in the dialog
componentsTypeList_t m_componentsTypes
Holds all components types to be shown in the dialog

References _, BLIND_BURIED, m_componentsTypes, DIALOG_BOARD_STATISTICS_BASE::m_gridComponents, DIALOG_BOARD_STATISTICS_BASE::m_gridPads, DIALOG_BOARD_STATISTICS_BASE::m_gridVias, m_padsTypes, m_viasTypes, MICROVIA, MOD_SMD, MOD_THROUGH_HOLE, PAD_ATTRIB_CONN, PAD_ATTRIB_HOLE_NOT_PLATED, PAD_ATTRIB_SMD, PAD_ATTRIB_STANDARD, and THROUGH.

Referenced by checkboxClicked(), and TransferDataToWindow().

◆ ResetSize()

void DIALOG_SHIM::ResetSize ( )
protectedinherited

Clear the existing dialog size and position.

This will cause the dialog size to be clear so the next time the dialog is shown the sizers will layout the dialog accordingly. This useful when there are dialog windows that size changes due to layout dependency hidden controls.

Definition at line 244 of file dialog_shim.cpp.

245 {
246  const char* hash_key;
247 
248  if( m_hash_key.size() )
249  {
250  // a special case like EDA_LIST_DIALOG, which has multiple uses.
251  hash_key = m_hash_key.c_str();
252  }
253  else
254  {
255  hash_key = typeid(*this).name();
256  }
257 
258  RECT_MAP::iterator it = class_map.find( hash_key );
259 
260  if( it == class_map.end() )
261  return;
262 
263  EDA_RECT rect = it->second;
264  rect.SetSize( 0, 0 );
265  class_map[ hash_key ] = rect;
266 }
std::string m_hash_key
Definition: dialog_shim.h:198
static RECT_MAP class_map
void SetSize(const wxSize &size)
Definition: eda_rect.h:144
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44

References class_map, DIALOG_SHIM::m_hash_key, and EDA_RECT::SetSize().

Referenced by DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY().

◆ saveReportClicked()

void DIALOG_BOARD_STATISTICS::saveReportClicked ( wxCommandEvent &  aEvent)
overrideprivatevirtual

Save board statistics to a file

Reimplemented from DIALOG_BOARD_STATISTICS_BASE.

Definition at line 621 of file dialog_board_statistics.cpp.

622 {
623  FILE* outFile;
624  wxString msg;
625  wxString boardName;
626 
627  wxFileName fn = m_parentFrame->GetBoard()->GetFileName();
628  boardName = fn.GetName();
629  wxFileDialog saveFileDialog( this, _( "Save Report File" ),
633  wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
634 
635  if( saveFileDialog.ShowModal() == wxID_CANCEL )
636  return;
637 
638  s_savedDialogState.saveReportFolder = wxPathOnly( saveFileDialog.GetPath() );
639  s_savedDialogState.saveReportName = saveFileDialog.GetFilename();
640 
641  outFile = wxFopen( saveFileDialog.GetPath(), "wt" );
642 
643  if( outFile == NULL )
644  {
645  msg.Printf( _( "Unable to create file \"%s\"" ), saveFileDialog.GetPath() );
646  DisplayErrorMessage( this, msg );
647  return;
648  }
649 
650  msg << _( "PCB statistics report\n=====================" ) << "\n";
651  msg << _( "- Date: " ) << wxDateTime::Now().Format() << "\n";
652  msg << _( "- Project: " ) << Prj().GetProjectName() << "\n";
653  msg << _( "- Board name: " ) << boardName << "\n";
654 
655  msg << "\n";
656  msg << _( "Board\n-----" ) << "\n";
657 
658  if( m_hasOutline )
659  {
660  msg << _( "- Width: " ) << MessageTextFromValue( GetUserUnits(), m_boardWidth ) << "\n";
661  msg << _( "- Height: " ) << MessageTextFromValue( GetUserUnits(), m_boardHeight ) << "\n";
662  msg << _( "- Area: " )
663  << wxString::Format(
664  wxT( "%.3f %s^2" ), m_boardArea, GetAbbreviatedUnitsLabel( GetUserUnits() ) )
665  << "\n";
666  }
667  else
668  {
669  msg << _( "- Width: " ) << _( "unknown" ) << "\n";
670  msg << _( "- Height: " ) << _( "unknown" ) << "\n";
671  msg << _( "- Area: " ) << _( "unknown" ) << "\n";
672  }
673 
674  msg << "\n";
675  msg << _( "Pads\n----" ) << "\n";
676 
677  for( auto& type : m_padsTypes )
678  msg << "- " << type.title << " " << type.qty << "\n";
679 
680  msg << "\n";
681  msg << _( "Vias\n----" ) << "\n";
682 
683  for( auto& type : m_viasTypes )
684  msg << "- " << type.title << " " << type.qty << "\n";
685 
686  // We will save data about components in the table.
687  // We have to calculate column widths
688  std::vector<int> widths;
689  std::vector<wxString> labels{ "", _( "Front Side" ), _( "Back Side" ), _( "Total" ) };
690  wxString tmp;
691 
692  widths.reserve( labels.size() );
693  for( const auto& label : labels )
694  widths.push_back( label.size() );
695 
696  int frontTotal = 0;
697  int backTotal = 0;
698 
699  for( const auto& type : m_componentsTypes )
700  {
701  // Get maximum width for left label column
702  widths[0] = std::max<int>( type.title.size(), widths[0] );
703  frontTotal += type.frontSideQty;
704  backTotal += type.backSideQty;
705  }
706 
707  // Get maximum width for other columns
708  tmp.Printf( "%i", frontTotal );
709  widths[1] = std::max<int>( tmp.size(), widths[1] );
710  tmp.Printf( "%i", backTotal );
711  widths[2] = std::max<int>( tmp.size(), widths[2] );
712  tmp.Printf( "%i", frontTotal + backTotal );
713  widths[3] = std::max<int>( tmp.size(), widths[3] );
714 
715  //Write components amount to file
716  msg << "\n";
717  msg << _( "Components\n----------" ) << "\n";
718  msg << "\n";
719 
720  printGridToStringAsTable( m_gridComponents, msg, false, false, true );
721 
722  msg << "\n";
723  msg << _( "Drill holes\n-----------" ) << "\n";
724  msg << "\n";
725 
726  printGridToStringAsTable( m_gridDrills, msg, false, true, false );
727 
728  if( fprintf( outFile, "%s", TO_UTF8( msg ) ) < 0 )
729  {
730  msg.Printf( _( "Error writing to file \"%s\"" ), saveFileDialog.GetPath() );
731  DisplayErrorMessage( this, msg );
732  }
733 
734  fclose( outFile );
735 }
bool m_hasOutline
Shows if board outline properly defined
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:252
viasTypeList_t m_viasTypes
Holds all vias types to be shown in the dialog
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:495
const wxString & GetFileName() const
Definition: class_board.h:244
EDA_UNITS GetUserUnits() const
Definition: dialog_shim.h:131
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:100
#define NULL
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
void printGridToStringAsTable(wxGrid *aGrid, wxString &aStr, bool aUseRowLabels, bool aUseColLabels, bool aUseFirstColAsLabel)
Prints grid to string in tabular format
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils, EDA_DATA_TYPE aType)
Definition: base_units.cpp:124
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201
#define _(s)
Definition: 3d_actions.cpp:33
wxString TextFileWildcard()
padsTypeList_t m_padsTypes
Holds all pads types to be shown in the dialog
VTBL_ENTRY const wxString GetProjectName() const
Function GetProjectName returns the short name of the project.
Definition: project.cpp:130
BOARD * GetBoard() const
static DIALOG_BOARD_STATISTICS_SAVED_STATE s_savedDialogState
componentsTypeList_t m_componentsTypes
Holds all components types to be shown in the dialog

References _, DisplayErrorMessage(), Format(), GetAbbreviatedUnitsLabel(), PCB_BASE_FRAME::GetBoard(), BOARD::GetFileName(), PROJECT::GetProjectName(), DIALOG_SHIM::GetUserUnits(), m_boardArea, m_boardHeight, m_boardWidth, m_componentsTypes, DIALOG_BOARD_STATISTICS_BASE::m_gridComponents, DIALOG_BOARD_STATISTICS_BASE::m_gridDrills, m_hasOutline, m_padsTypes, m_parentFrame, m_viasTypes, MessageTextFromValue(), NULL, printGridToStringAsTable(), KIWAY_HOLDER::Prj(), s_savedDialogState, DIALOG_BOARD_STATISTICS_SAVED_STATE::saveReportFolder, DIALOG_BOARD_STATISTICS_SAVED_STATE::saveReportName, TextFileWildcard(), and TO_UTF8.

◆ SetInitialFocus()

void DIALOG_SHIM::SetInitialFocus ( wxWindow *  aWindow)
inlineinherited

Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.

Definition at line 114 of file dialog_shim.h.

115  {
116  m_initialFocusTarget = aWindow;
117  }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:204

References DIALOG_SHIM::m_initialFocusTarget.

Referenced by DIALOG_BOM::DIALOG_BOM(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS(), DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE(), DIALOG_EDIT_SHEET_PIN::DIALOG_EDIT_SHEET_PIN(), DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_FIND::DIALOG_FIND(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_FP_PLUGIN_OPTIONS::DIALOG_FP_PLUGIN_OPTIONS(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM(), DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_SCH_FIND::DIALOG_SCH_FIND(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), EDA_VIEW_SWITCHER::EDA_VIEW_SWITCHER(), DIALOG_EDIT_ONE_FIELD::init(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchAllClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchIDClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchRefClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchSelectedClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchValueClicked(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), LIB_EDIT_FRAME::savePartAs(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow(), DIALOG_KEEPOUT_AREA_PROPERTIES::TransferDataToWindow(), and DIALOG_COPPER_ZONE::TransferDataToWindow().

◆ SetKiway()

void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

Function SetKiway.

Parameters
aDestis the recipient of aKiway pointer. It is only used for debugging, since "this" is not a wxWindow*. "this" is a KIWAY_HOLDER mix-in.
aKiwayis often from a parent window, or from KIFACE::CreateWindow().

Definition at line 42 of file kiway_holder.cpp.

43 {
44 #if defined(DEBUG)
45  // offer a trap point for debugging most any window
46  wxASSERT( aDest );
47  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
48  {
49  int breakhere=1;
50  (void) breakhere;
51  }
52 #endif
53 
54  (void) aDest;
55 
56  m_kiway = aKiway;
57 }
KIWAY * m_kiway
Definition: kiway_holder.h:81
const char * name
Definition: DXF_plotter.cpp:60

References KIWAY_HOLDER::m_kiway, and name.

Referenced by BM2CMP_FRAME::BM2CMP_FRAME(), PCB::IFACE::CreateWindow(), InvokePcbLibTableEditor(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

◆ SetSizeInDU()

void DIALOG_SHIM::SetSizeInDU ( int  x,
int  y 
)
protectedinherited

Set the dialog to the given dimensions in "dialog units".

These are units equivalent to 4* the average character width and 8* the average character height, allowing a dialog to be sized in a way that scales it with the system font.

Definition at line 158 of file dialog_shim.cpp.

159 {
160  wxSize sz( x, y );
161  SetSize( ConvertDialogToPixels( sz ) );
162 }

Referenced by DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), HTML_MESSAGE_BOX::HTML_MESSAGE_BOX(), and HTML_MESSAGE_BOX::SetDialogSizeInDU().

◆ Show()

bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 185 of file dialog_shim.cpp.

186 {
187  bool ret;
188  const char* hash_key;
189 
190  if( m_hash_key.size() )
191  {
192  // a special case like EDA_LIST_DIALOG, which has multiple uses.
193  hash_key = m_hash_key.c_str();
194  }
195  else
196  {
197  hash_key = typeid(*this).name();
198  }
199 
200  // Show or hide the window. If hiding, save current position and size.
201  // If showing, use previous position and size.
202  if( show )
203  {
204 #ifndef __WINDOWS__
205  wxDialog::Raise(); // Needed on OS X and some other window managers (i.e. Unity)
206 #endif
207  ret = wxDialog::Show( show );
208 
209  // classname is key, returns a zeroed out default EDA_RECT if none existed before.
210  EDA_RECT savedDialogRect = class_map[ hash_key ];
211 
212  if( savedDialogRect.GetSize().x != 0 && savedDialogRect.GetSize().y != 0 )
213  {
214  SetSize( savedDialogRect.GetPosition().x,
215  savedDialogRect.GetPosition().y,
216  std::max( wxDialog::GetSize().x, savedDialogRect.GetSize().x ),
217  std::max( wxDialog::GetSize().y, savedDialogRect.GetSize().y ),
218  0 );
219  }
220 
221  // Be sure that the dialog appears in a visible area
222  // (the dialog position might have been stored at the time when it was
223  // shown on another display)
224  if( wxDisplay::GetFromWindow( this ) == wxNOT_FOUND )
225  Centre();
226  }
227  else
228  {
229  // Save the dialog's position & size before hiding, using classname as key
230  class_map[ hash_key ] = EDA_RECT( wxDialog::GetPosition(), wxDialog::GetSize() );
231 
232 #ifdef __WXMAC__
233  if ( m_eventLoop )
234  m_eventLoop->Exit( GetReturnCode() ); // Needed for APP-MODAL dlgs on OSX
235 #endif
236 
237  ret = wxDialog::Show( show );
238  }
239 
240  return ret;
241 }
std::string m_hash_key
Definition: dialog_shim.h:198
static RECT_MAP class_map
const wxPoint GetPosition() const
Definition: eda_rect.h:115
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
const wxSize GetSize() const
Definition: eda_rect.h:103

References class_map, EDA_RECT::GetPosition(), EDA_RECT::GetSize(), DIALOG_SHIM::m_hash_key, wxPoint::x, and wxPoint::y.

Referenced by DIALOG_SHIM::EndQuasiModal(), InvokeDialogERC(), SCH_EDIT_FRAME::OnAnnotate(), DIALOG_DRC::OnDRCItemDClick(), DIALOG_ERC::OnERCItemDClick(), DIALOG_CLEANUP_GRAPHICS::OnLeftDClickItem(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnLeftDClickItem(), POSITION_RELATIVE_TOOL::PositionRelative(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), EDA_VIEW_SWITCHER::Show(), DIALOG_PAD_PROPERTIES::Show(), DRC_TOOL::ShowDRCDialog(), SCH_EDIT_FRAME::ShowFindReplaceDialog(), HTML_MESSAGE_BOX::ShowModeless(), DIALOG_SHIM::ShowQuasiModal(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), and SCH_EDIT_FRAME::UpdateHierarchyNavigator().

◆ ShowQuasiModal()

int DIALOG_SHIM::ShowQuasiModal ( )
inherited

Definition at line 338 of file dialog_shim.cpp.

339 {
340  // This is an exception safe way to zero a pointer before returning.
341  // Yes, even though DismissModal() clears this first normally, this is
342  // here in case there's an exception before the dialog is dismissed.
343  struct NULLER
344  {
345  void*& m_what;
346  NULLER( void*& aPtr ) : m_what( aPtr ) {}
347  ~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
348  } clear_this( (void*&) m_qmodal_loop );
349 
350  // release the mouse if it's currently captured as the window having it
351  // will be disabled when this dialog is shown -- but will still keep the
352  // capture making it impossible to do anything in the modal dialog itself
353  wxWindow* win = wxWindow::GetCapture();
354  if( win )
355  win->ReleaseMouse();
356 
357  // Get the optimal parent
358  wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
359 
360  wxASSERT_MSG( !m_qmodal_parent_disabler,
361  wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
362 
363  // quasi-modal: disable only my "optimal" parent
365 
366  // Apple in its infinite wisdom will raise a disabled window before even passing
367  // us the event, so we have no way to stop it. Instead, we must set an order on
368  // the windows so that the quasi-modal will be pushed in front of the disabled
369  // window when it is raised.
371 
372  Show( true );
373 
374  m_qmodal_showing = true;
375 
376  WX_EVENT_LOOP event_loop;
377 
378  m_qmodal_loop = &event_loop;
379 
380  event_loop.Run();
381 
382  m_qmodal_showing = false;
383 
384  return GetReturnCode();
385 }
bool m_qmodal_showing
Definition: dialog_shim.h:208
#define WX_EVENT_LOOP
Definition: kiway_player.h:41
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:206
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:209
Toggle a window's "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:40
void ReparentQuasiModal(wxNonOwnedWindow *aWindow)
Move a window's parent to be the top-level window and force the window to be on top.
Definition: gtk/ui.cpp:40

References DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, DIALOG_SHIM::m_qmodal_showing, KIPLATFORM::UI::ReparentQuasiModal(), DIALOG_SHIM::Show(), and WX_EVENT_LOOP.

Referenced by LIB_EDIT_TOOL::editFieldProperties(), SCH_EDITOR_CONTROL::EditSymbolFields(), LIB_EDIT_TOOL::editSymbolProperties(), GLOBAL_EDIT_TOOL::EditTracksAndVias(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), PCB_EDIT_FRAME::InstallExchangeModuleFrame(), PCB_BASE_FRAME::InstallPadOptionsFrame(), InvokeDialogEditComponentsLibId(), InvokeDialogRescueEach(), InvokeDialogUpdateFields(), LIB_VIEW_FRAME::OnSelectSymbol(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), SCH_EDITOR_CONTROL::RemapSymbols(), PCB_BASE_FRAME::SelectFootprintFromLibTree(), PCB_EDIT_FRAME::ShowBoardSetupDialog(), and SCH_EDIT_FRAME::ShowSchematicSetupDialog().

◆ TransferDataToWindow()

bool DIALOG_BOARD_STATISTICS::TransferDataToWindow ( )
override

Get data from the PCB board and print it to dialog

Definition at line 166 of file dialog_board_statistics.cpp.

167 {
169  getDataFromPCB();
170  updateWidets();
171  Layout();
172  drillsPanel->Layout();
174  return true;
175 }
void refreshItemsTypes()
Function to fill up all items types to be shown in the dialog.
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
void getDataFromPCB()
Gets data from board
void updateWidets()
Applies data to dialog widgets

References DIALOG_BOARD_STATISTICS_BASE::drillsPanel, DIALOG_SHIM::FinishDialogSettings(), getDataFromPCB(), refreshItemsTypes(), and updateWidets().

◆ updateDrillGrid()

void DIALOG_BOARD_STATISTICS::updateDrillGrid ( )
private

Updates drills grid

Definition at line 440 of file dialog_board_statistics.cpp.

441 {
442  BOARD* board = m_parentFrame->GetBoard();
443  int currentRow = 0;
444 
445  for( auto& type : m_drillTypes )
446  {
447  wxString shapeStr;
448  wxString startLayerStr;
449  wxString stopLayerStr;
450 
451  switch( type.shape )
452  {
454  shapeStr = _( "Round" );
455  break;
457  shapeStr = _( "Slot" );
458  break;
459  default:
460  shapeStr = _( "???" );
461  break;
462  }
463 
464  if( type.startLayer == UNDEFINED_LAYER )
465  startLayerStr = _( "N/A" );
466  else
467  startLayerStr = board->GetLayerName( type.startLayer );
468 
469  if( type.stopLayer == UNDEFINED_LAYER )
470  stopLayerStr = _( "N/A" );
471  else
472  stopLayerStr = board->GetLayerName( type.stopLayer );
473 
474  m_gridDrills->SetCellValue(
475  currentRow, drillType_t::COL_COUNT, wxString::Format( "%i", type.qty ) );
476  m_gridDrills->SetCellValue( currentRow, drillType_t::COL_SHAPE, shapeStr );
477  m_gridDrills->SetCellValue( currentRow, drillType_t::COL_X_SIZE,
478  MessageTextFromValue( GetUserUnits(), type.xSize ) );
479  m_gridDrills->SetCellValue( currentRow, drillType_t::COL_Y_SIZE,
480  MessageTextFromValue( GetUserUnits(), type.ySize ) );
481  m_gridDrills->SetCellValue(
482  currentRow, drillType_t::COL_PLATED, type.isPlated ? _( "PTH" ) : _( "NPTH" ) );
483  m_gridDrills->SetCellValue(
484  currentRow, drillType_t::COL_VIA_PAD, type.isPad ? _( "Pad" ) : _( "Via" ) );
485  m_gridDrills->SetCellValue( currentRow, drillType_t::COL_START_LAYER, startLayerStr );
486  m_gridDrills->SetCellValue( currentRow, drillType_t::COL_STOP_LAYER, stopLayerStr );
487 
488  currentRow++;
489  }
490 }
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
EDA_UNITS GetUserUnits() const
Definition: dialog_shim.h:131
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils, EDA_DATA_TYPE aType)
Definition: base_units.cpp:124
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
#define _(s)
Definition: 3d_actions.cpp:33
BOARD * GetBoard() const
drillTypeList_t m_drillTypes
Holds all drill hole types to be shown in the dialog

References _, DIALOG_BOARD_STATISTICS::drillType_t::COL_COUNT, DIALOG_BOARD_STATISTICS::drillType_t::COL_PLATED, DIALOG_BOARD_STATISTICS::drillType_t::COL_SHAPE, DIALOG_BOARD_STATISTICS::drillType_t::COL_START_LAYER, DIALOG_BOARD_STATISTICS::drillType_t::COL_STOP_LAYER, DIALOG_BOARD_STATISTICS::drillType_t::COL_VIA_PAD, DIALOG_BOARD_STATISTICS::drillType_t::COL_X_SIZE, DIALOG_BOARD_STATISTICS::drillType_t::COL_Y_SIZE, Format(), PCB_BASE_FRAME::GetBoard(), BOARD::GetLayerName(), DIALOG_SHIM::GetUserUnits(), m_drillTypes, DIALOG_BOARD_STATISTICS_BASE::m_gridDrills, m_parentFrame, MessageTextFromValue(), PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG, and UNDEFINED_LAYER.

Referenced by drillGridSort(), and updateWidets().

◆ updateWidets()

void DIALOG_BOARD_STATISTICS::updateWidets ( )
private

Applies data to dialog widgets

Definition at line 350 of file dialog_board_statistics.cpp.

351 {
352  int totalPads = 0;
353  int currentRow = 0;
354 
355  for( auto& type : m_padsTypes )
356  {
357  m_gridPads->SetCellValue( currentRow, COL_LABEL, type.title );
358  m_gridPads->SetCellValue(
359  currentRow, COL_AMOUNT, wxString::Format( wxT( "%i " ), type.qty ) );
360  totalPads += type.qty;
361  currentRow++;
362  }
363 
364  m_gridPads->SetCellValue( currentRow, COL_LABEL, _( "Total:" ) );
365  m_gridPads->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( "%i ", totalPads ) );
366 
367  int totalVias = 0;
368  currentRow = 0;
369 
370  for( auto& type : m_viasTypes )
371  {
372  m_gridVias->SetCellValue( currentRow, COL_LABEL, type.title );
373  m_gridVias->SetCellValue(
374  currentRow, COL_AMOUNT, wxString::Format( "%i ", type.qty ) );
375  totalVias += type.qty;
376  currentRow++;
377  }
378 
379  m_gridVias->SetCellValue( currentRow, COL_LABEL, _( "Total:" ) );
380  m_gridVias->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( "%i ", totalVias ) );
381 
382 
383  int totalFront = 0;
384  int totalBack = 0;
385 
386  // We don't use row 0, as there labels are
387  currentRow = 1;
388 
389  for( auto& type : m_componentsTypes )
390  {
391  m_gridComponents->SetCellValue( currentRow, COL_LABEL, type.title );
392  m_gridComponents->SetCellValue(
393  currentRow, COL_FRONT_SIDE, wxString::Format( "%i ", type.frontSideQty ) );
394  m_gridComponents->SetCellValue(
395  currentRow, COL_BOTTOM_SIDE, wxString::Format( "%i ", type.backSideQty ) );
396  m_gridComponents->SetCellValue( currentRow, 3,
397  wxString::Format( wxT( "%i " ), type.frontSideQty + type.backSideQty ) );
398  totalFront += type.frontSideQty;
399  totalBack += type.backSideQty;
400  currentRow++;
401  }
402 
403  m_gridComponents->SetCellValue( currentRow, COL_LABEL, _( "Total:" ) );
404  m_gridComponents->SetCellValue( currentRow, COL_FRONT_SIDE,
405  wxString::Format( "%i ", totalFront ) );
406  m_gridComponents->SetCellValue( currentRow, COL_BOTTOM_SIDE,
407  wxString::Format( "%i ", totalBack ) );
408  m_gridComponents->SetCellValue( currentRow, COL_TOTAL,
409  wxString::Format( "%i ", totalFront + totalBack ) );
410 
411  if( m_hasOutline )
412  {
413  m_gridBoard->SetCellValue( ROW_BOARD_WIDTH, COL_AMOUNT,
415  m_gridBoard->SetCellValue( ROW_BOARD_HEIGHT, COL_AMOUNT,
417  m_gridBoard->SetCellValue( ROW_BOARD_AREA, COL_AMOUNT,
418  wxString::Format( wxT( "%.3f %s²" ),
419  m_boardArea,
421  }
422  else
423  {
424  m_gridBoard->SetCellValue( ROW_BOARD_WIDTH, COL_AMOUNT, _( "unknown" ) );
425  m_gridBoard->SetCellValue( ROW_BOARD_HEIGHT, COL_AMOUNT, _( "unknown" ) );
426  m_gridBoard->SetCellValue( ROW_BOARD_AREA, COL_AMOUNT, _( "unknown" ) );
427  }
428 
429  updateDrillGrid();
430 
431  m_gridComponents->AutoSize();
432  m_gridPads->AutoSize();
433  m_gridBoard->AutoSize();
434  m_gridVias->AutoSize();
435  m_gridDrills->AutoSize();
436 
438 }
bool m_hasOutline
Shows if board outline properly defined
#define COL_AMOUNT
viasTypeList_t m_viasTypes
Holds all vias types to be shown in the dialog
#define ROW_BOARD_AREA
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:495
#define ROW_BOARD_HEIGHT
EDA_UNITS GetUserUnits() const
Definition: dialog_shim.h:131
#define COL_TOTAL
#define COL_BOTTOM_SIDE
#define COL_FRONT_SIDE
void updateDrillGrid()
Updates drills grid
#define ROW_BOARD_WIDTH
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aUseMils, EDA_DATA_TYPE aType)
Definition: base_units.cpp:124
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201
#define _(s)
Definition: 3d_actions.cpp:33
padsTypeList_t m_padsTypes
Holds all pads types to be shown in the dialog
#define COL_LABEL
componentsTypeList_t m_componentsTypes
Holds all components types to be shown in the dialog

References _, adjustDrillGridColumns(), COL_AMOUNT, COL_BOTTOM_SIDE, COL_FRONT_SIDE, COL_LABEL, COL_TOTAL, Format(), GetAbbreviatedUnitsLabel(), DIALOG_SHIM::GetUserUnits(), m_boardArea, m_boardHeight, m_boardWidth, m_componentsTypes, DIALOG_BOARD_STATISTICS_BASE::m_gridBoard, DIALOG_BOARD_STATISTICS_BASE::m_gridComponents, DIALOG_BOARD_STATISTICS_BASE::m_gridDrills, DIALOG_BOARD_STATISTICS_BASE::m_gridPads, DIALOG_BOARD_STATISTICS_BASE::m_gridVias, m_hasOutline, m_padsTypes, m_viasTypes, MessageTextFromValue(), ROW_BOARD_AREA, ROW_BOARD_HEIGHT, ROW_BOARD_WIDTH, and updateDrillGrid().

Referenced by checkboxClicked(), and TransferDataToWindow().

◆ VertPixelsFromDU()

int DIALOG_SHIM::VertPixelsFromDU ( int  y)
protectedinherited

Convert an integer number of dialog units to pixels, vertically.

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 172 of file dialog_shim.cpp.

173 {
174  wxSize sz( 0, y );
175  return ConvertDialogToPixels( sz ).y;
176 }

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT().

◆ windowSize()

virtual void DIALOG_BOARD_STATISTICS_BASE::windowSize ( wxSizeEvent &  event)
inlineprotectedvirtualinherited

Member Data Documentation

◆ drillsPanel

wxPanel* DIALOG_BOARD_STATISTICS_BASE::drillsPanel
protectedinherited

◆ generalPanel

wxPanel* DIALOG_BOARD_STATISTICS_BASE::generalPanel
protectedinherited

◆ m_boardArea

double DIALOG_BOARD_STATISTICS::m_boardArea
private

Definition at line 183 of file dialog_board_statistics.h.

Referenced by getDataFromPCB(), saveReportClicked(), and updateWidets().

◆ m_boardHeight

int DIALOG_BOARD_STATISTICS::m_boardHeight
private

Definition at line 182 of file dialog_board_statistics.h.

Referenced by getDataFromPCB(), saveReportClicked(), and updateWidets().

◆ m_boardWidth

int DIALOG_BOARD_STATISTICS::m_boardWidth
private

Definition at line 181 of file dialog_board_statistics.h.

Referenced by getDataFromPCB(), saveReportClicked(), and updateWidets().

◆ m_buttonSaveReport

wxButton* DIALOG_BOARD_STATISTICS_BASE::m_buttonSaveReport
protectedinherited

◆ m_checkBoxExcludeComponentsNoPins

wxCheckBox* DIALOG_BOARD_STATISTICS_BASE::m_checkBoxExcludeComponentsNoPins
protectedinherited

◆ m_checkBoxSubtractHoles

wxCheckBox* DIALOG_BOARD_STATISTICS_BASE::m_checkBoxSubtractHoles
protectedinherited

◆ m_componentsTypes

componentsTypeList_t DIALOG_BOARD_STATISTICS::m_componentsTypes
private

Holds all components types to be shown in the dialog

Definition at line 189 of file dialog_board_statistics.h.

Referenced by getDataFromPCB(), refreshItemsTypes(), saveReportClicked(), and updateWidets().

◆ m_drillTypes

drillTypeList_t DIALOG_BOARD_STATISTICS::m_drillTypes
private

Holds all drill hole types to be shown in the dialog

Definition at line 198 of file dialog_board_statistics.h.

Referenced by drillGridSort(), getDataFromPCB(), and updateDrillGrid().

◆ m_firstPaintEvent

bool DIALOG_SHIM::m_firstPaintEvent
protectedinherited

Definition at line 203 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint().

◆ m_gridBoard

wxGrid* DIALOG_BOARD_STATISTICS_BASE::m_gridBoard
protectedinherited

◆ m_gridComponents

wxGrid* DIALOG_BOARD_STATISTICS_BASE::m_gridComponents
protectedinherited

◆ m_gridDrills

◆ m_gridPads

wxGrid* DIALOG_BOARD_STATISTICS_BASE::m_gridPads
protectedinherited

◆ m_gridVias

wxGrid* DIALOG_BOARD_STATISTICS_BASE::m_gridVias
protectedinherited

◆ m_hash_key

◆ m_hasOutline

bool DIALOG_BOARD_STATISTICS::m_hasOutline
private

Shows if board outline properly defined

Definition at line 186 of file dialog_board_statistics.h.

Referenced by getDataFromPCB(), saveReportClicked(), and updateWidets().

◆ m_initialFocusTarget

wxWindow* DIALOG_SHIM::m_initialFocusTarget
protectedinherited

Definition at line 204 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint(), and DIALOG_SHIM::SetInitialFocus().

◆ m_padsTypes

padsTypeList_t DIALOG_BOARD_STATISTICS::m_padsTypes
private

Holds all pads types to be shown in the dialog

Definition at line 192 of file dialog_board_statistics.h.

Referenced by getDataFromPCB(), refreshItemsTypes(), saveReportClicked(), and updateWidets().

◆ m_parentFrame

PCB_EDIT_FRAME* DIALOG_BOARD_STATISTICS::m_parentFrame
private

◆ m_qmodal_loop

WX_EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 206 of file dialog_shim.h.

Referenced by DIALOG_SHIM::EndQuasiModal(), and DIALOG_SHIM::ShowQuasiModal().

◆ m_qmodal_parent_disabler

WDO_ENABLE_DISABLE* DIALOG_SHIM::m_qmodal_parent_disabler
protectedinherited

◆ m_qmodal_showing

bool DIALOG_SHIM::m_qmodal_showing
protectedinherited

Definition at line 208 of file dialog_shim.h.

Referenced by DIALOG_SHIM::IsQuasiModal(), and DIALOG_SHIM::ShowQuasiModal().

◆ m_sdbControlSizer

wxStdDialogButtonSizer* DIALOG_BOARD_STATISTICS_BASE::m_sdbControlSizer
protectedinherited

◆ m_sdbControlSizerCancel

wxButton* DIALOG_BOARD_STATISTICS_BASE::m_sdbControlSizerCancel
protectedinherited

◆ m_tabOrder

◆ m_units

◆ m_viasTypes

viasTypeList_t DIALOG_BOARD_STATISTICS::m_viasTypes
private

Holds all vias types to be shown in the dialog

Definition at line 195 of file dialog_board_statistics.h.

Referenced by getDataFromPCB(), refreshItemsTypes(), saveReportClicked(), and updateWidets().

◆ topNotebook

wxNotebook* DIALOG_BOARD_STATISTICS_BASE::topNotebook
protectedinherited

◆ viasLabel

wxStaticText* DIALOG_BOARD_STATISTICS_BASE::viasLabel
protectedinherited

The documentation for this class was generated from the following files: