KiCad PCB EDA Suite
DIALOG_DRC_CONTROL Class Reference

#include <dialog_drc.h>

Inheritance diagram for DIALOG_DRC_CONTROL:
DIALOG_DRC_CONTROL_BASE DIALOG_SHIM KIWAY_HOLDER

Public Member Functions

 DIALOG_DRC_CONTROL (DRC *aTester, PCB_EDIT_FRAME *aEditorFrame, wxWindow *aParent)
 Constructors. More...
 
 ~DIALOG_DRC_CONTROL ()
 
void SetRptSettings (bool aEnable, const wxString &aFileName)
 Enable/disable the report file creation. More...
 
void GetRptSettings (bool *aEnable, wxString &aFileName)
 
void UpdateDisplayedCounts ()
 
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_T GetUserUnits () const override
 
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...
 

Public Attributes

BOARD_DESIGN_SETTINGS m_BrdSettings
 
wxTextCtrl * m_SetClearance
 
wxTextCtrl * m_SetTrackMinWidthCtrl
 
wxTextCtrl * m_SetViaMinSizeCtrl
 
wxTextCtrl * m_SetMicroViakMinSizeCtrl
 
DRCLISTBOXm_ClearanceListBox
 
DRCLISTBOXm_UnconnectedListBox
 

Protected Member Functions

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...
 

Protected Attributes

wxStaticText * m_ClearanceTitle
 
wxStaticText * m_TrackMinWidthTitle
 
wxStaticText * m_TrackMinWidthUnit
 
wxStaticText * m_ViaMinTitle
 
wxStaticText * m_ViaMinUnit
 
wxStaticText * m_MicroViaMinTitle
 
wxStaticText * m_MicroViaMinUnit
 
wxCheckBox * m_cbRefillZones
 
wxCheckBox * m_cbReportAllTrackErrors
 
wxStaticText * m_messagesLabel
 
wxTextCtrl * m_Messages
 
wxCheckBox * m_CreateRptCtrl
 
wxTextCtrl * m_RptFilenameCtrl
 
wxBitmapButton * m_BrowseButton
 
wxNotebook * m_Notebook
 
wxPanel * m_panelClearanceListBox
 
wxBoxSizer * m_sizerButtons
 
wxButton * m_DeleteCurrentMarkerButton
 
wxButton * m_DeleteAllMarkersButton
 
wxStdDialogButtonSizer * m_sdbSizer1
 
wxButton * m_sdbSizer1OK
 
wxButton * m_sdbSizer1Apply
 
wxButton * m_sdbSizer1Cancel
 
EDA_UNITS_T 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
 

Private Member Functions

bool writeReport (const wxString &aFullFileName)
 Function writeReport outputs the MARKER items and unconnecte DRC_ITEMs with commentary to an open text file. More...
 
const wxString makeValidFileNameReport ()
 filenames can be entered by name. More...
 
void InitValues ()
 
void DisplayDRCValues ()
 
void SetDrcParmeters ()
 
void OnReportCheckBoxClicked (wxCommandEvent &event) override
 wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_RPT_FILE More...
 
void OnReportFilenameEdited (wxCommandEvent &event) override
 wxEVT_COMMAND_TEXT_UPDATED event handler for m_RptFilenameCtrl More...
 
void OnButtonBrowseRptFileClick (wxCommandEvent &event) override
 wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE More...
 
void OnStartdrcClick (wxCommandEvent &event) override
 wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STARTDRC More...
 
void OnListUnconnectedClick (wxCommandEvent &event) override
 wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIST_UNCONNECTED More...
 
void OnDeleteAllClick (wxCommandEvent &event) override
 wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ALL More...
 
void OnDeleteOneClick (wxCommandEvent &event) override
 wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ONE More...
 
void OnLeftDClickClearance (wxMouseEvent &event) override
 wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST More...
 
void OnRightUpClearance (wxMouseEvent &event) override
 wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST More...
 
void OnLeftDClickUnconnected (wxMouseEvent &event) override
 wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST More...
 
void OnRightUpUnconnected (wxMouseEvent &event) override
 wxEVT_RIGHT_UP event handler for ID_UNCONNECTED_LIST More...
 
void OnCancelClick (wxCommandEvent &event) override
 wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL More...
 
void OnActivateDlg (wxActivateEvent &event) override
 handler for activate event, updating data which can be modified outside the dialog (DRC parameters) More...
 
void OnMarkerSelectionEvent (wxCommandEvent &event) override
 
void OnUnconnectedSelectionEvent (wxCommandEvent &event) override
 
void OnChangingMarkerList (wxNotebookEvent &event) override
 
void DelDRCMarkers ()
 
void RedrawDrawPanel ()
 
void doSelectionMenu (const DRC_ITEM *aItem)
 Run the SELECTION_TOOL's disambiguation menu to highlight the two BOARD_ITEMs in the DRC_ITEM. More...
 

Private Attributes

BOARDm_currentBoard
 
DRCm_tester
 
PCB_EDIT_FRAMEm_brdEditor
 
wxConfigBase * m_config
 
wxString m_markersTitleTemplate
 
wxString m_unconnectedTitleTemplate
 
UNIT_BINDER m_trackMinWidth
 
UNIT_BINDER m_viaMinSize
 
UNIT_BINDER m_uviaMinSize
 

Detailed Description

DrcDialog class declaration

Definition at line 53 of file dialog_drc.h.

Constructor & Destructor Documentation

◆ DIALOG_DRC_CONTROL()

DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL ( DRC aTester,
PCB_EDIT_FRAME aEditorFrame,
wxWindow *  aParent 
)

Constructors.

Definition at line 57 of file dialog_drc.cpp.

References DIALOG_SHIM::FinishDialogSettings(), PCB_BASE_FRAME::GetBoard(), BOARD::GetDesignSettings(), ID_CLEARANCE_LIST, ID_UNCONNECTED_LIST, InitValues(), KiBitmap(), Kiface(), KIFACE_I::KifaceSettings(), m_brdEditor, m_BrdSettings, DIALOG_DRC_CONTROL_BASE::m_BrowseButton, DIALOG_DRC_CONTROL_BASE::m_ClearanceListBox, m_config, m_currentBoard, DIALOG_DRC_CONTROL_BASE::m_messagesLabel, DIALOG_DRC_CONTROL_BASE::m_sdbSizer1Apply, DIALOG_DRC_CONTROL_BASE::m_sdbSizer1Cancel, DIALOG_DRC_CONTROL_BASE::m_sdbSizer1OK, DIALOG_DRC_CONTROL_BASE::m_sizerButtons, m_tester, DIALOG_DRC_CONTROL_BASE::m_UnconnectedListBox, OnLeftDClickClearance(), OnLeftDClickUnconnected(), OnRightUpClearance(), and OnRightUpUnconnected().

58  :
59  DIALOG_DRC_CONTROL_BASE( aParent ),
63 {
65  m_tester = aTester;
66  m_brdEditor = aEditorFrame;
69 
70  wxFont messagesLabelFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
71  messagesLabelFont.SetSymbolicSize( wxFONTSIZE_SMALL );
72  m_messagesLabel->SetFont( messagesLabelFont );
73 
74  m_BrowseButton->SetBitmap( KiBitmap( folder_xpm ) );
75 
76  // We use a sdbSizer here to get the order right, which is platform-dependent
77  m_sdbSizer1OK->SetLabel( _( "Run DRC" ) );
78  m_sdbSizer1Apply->SetLabel( _( "List Unconnected" ) );
79  m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
80  m_sizerButtons->Layout();
81 
82  m_sdbSizer1OK->SetDefault();
83 
84  InitValues();
85 
86  // Connect events
87  m_ClearanceListBox->Connect( ID_CLEARANCE_LIST, wxEVT_LEFT_DCLICK,
88  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnLeftDClickClearance ), NULL, this );
89  m_ClearanceListBox->Connect( ID_CLEARANCE_LIST, wxEVT_RIGHT_UP,
90  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnRightUpClearance ), NULL, this );
91  m_UnconnectedListBox->Connect( ID_UNCONNECTED_LIST, wxEVT_LEFT_DCLICK,
92  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnLeftDClickUnconnected ), NULL, this );
93  m_UnconnectedListBox->Connect( ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP,
94  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnRightUpUnconnected ), NULL, this );
95 
96  // Now all widgets have the size fixed, call FinishDialogSettings
98 }
wxStaticText * m_MicroViaMinTitle
wxStaticText * m_messagesLabel
#define ID_CLEARANCE_LIST
void OnRightUpClearance(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:418
wxStaticText * m_TrackMinWidthTitle
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:103
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
wxStaticText * m_ViaMinUnit
void OnLeftDClickClearance(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:368
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:539
UNIT_BINDER m_viaMinSize
Definition: dialog_drc.h:157
DRCLISTBOX * m_UnconnectedListBox
BOARD_DESIGN_SETTINGS m_BrdSettings
Definition: dialog_drc.h:56
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
wxStaticText * m_ViaMinTitle
wxTextCtrl * m_SetViaMinSizeCtrl
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
wxStaticText * m_MicroViaMinUnit
DRCLISTBOX * m_ClearanceListBox
void OnLeftDClickUnconnected(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:445
wxBitmapButton * m_BrowseButton
wxConfigBase * m_config
Definition: dialog_drc.h:151
UNIT_BINDER m_uviaMinSize
Definition: dialog_drc.h:158
UNIT_BINDER m_trackMinWidth
Definition: dialog_drc.h:156
wxTextCtrl * m_SetMicroViakMinSizeCtrl
wxStaticText * m_TrackMinWidthUnit
void OnRightUpUnconnected(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:407
wxTextCtrl * m_SetTrackMinWidthCtrl
BOARD * GetBoard() const
#define ID_UNCONNECTED_LIST
DIALOG_DRC_CONTROL_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("DRC Control"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
BOARD * m_currentBoard
Definition: dialog_drc.h:148

◆ ~DIALOG_DRC_CONTROL()

DIALOG_DRC_CONTROL::~DIALOG_DRC_CONTROL ( )

Definition at line 101 of file dialog_drc.cpp.

References ID_CLEARANCE_LIST, ID_UNCONNECTED_LIST, DIALOG_DRC_CONTROL_BASE::m_cbRefillZones, DIALOG_DRC_CONTROL_BASE::m_ClearanceListBox, m_config, DIALOG_DRC_CONTROL_BASE::m_UnconnectedListBox, OnLeftDClickClearance(), OnLeftDClickUnconnected(), OnRightUpClearance(), OnRightUpUnconnected(), and RefillZonesBeforeDrc.

102 {
103  m_config->Write( RefillZonesBeforeDrc, m_cbRefillZones->GetValue() );
104 
105  // Disconnect events
106  m_ClearanceListBox->Disconnect( ID_CLEARANCE_LIST, wxEVT_LEFT_DCLICK,
107  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnLeftDClickClearance ), NULL, this );
108  m_ClearanceListBox->Disconnect( ID_CLEARANCE_LIST, wxEVT_RIGHT_UP,
109  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnRightUpClearance ), NULL, this );
110  m_UnconnectedListBox->Disconnect( ID_UNCONNECTED_LIST, wxEVT_LEFT_DCLICK,
111  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnLeftDClickUnconnected ), NULL, this );
112  m_UnconnectedListBox->Disconnect( ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP,
113  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnRightUpUnconnected ), NULL, this );
114 }
#define ID_CLEARANCE_LIST
void OnRightUpClearance(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:418
wxCheckBox * m_cbRefillZones
void OnLeftDClickClearance(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:368
DRCLISTBOX * m_UnconnectedListBox
DRCLISTBOX * m_ClearanceListBox
void OnLeftDClickUnconnected(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:445
wxConfigBase * m_config
Definition: dialog_drc.h:151
#define RefillZonesBeforeDrc
Definition: dialog_drc.cpp:54
void OnRightUpUnconnected(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:407
#define ID_UNCONNECTED_LIST

Member Function Documentation

◆ DelDRCMarkers()

void DIALOG_DRC_CONTROL::DelDRCMarkers ( )
private

Definition at line 554 of file dialog_drc.cpp.

References DRCLISTBOX::DeleteAllItems(), EDA_DRAW_FRAME::GetToolManager(), m_brdEditor, DIALOG_DRC_CONTROL_BASE::m_ClearanceListBox, DIALOG_DRC_CONTROL_BASE::m_DeleteCurrentMarkerButton, DIALOG_DRC_CONTROL_BASE::m_UnconnectedListBox, TOOL_MANAGER::RunAction(), PCB_ACTIONS::selectionClear, and PCB_BASE_FRAME::SetCurItem().

Referenced by OnDeleteAllClick(), OnListUnconnectedClick(), and OnStartdrcClick().

555 {
556  m_brdEditor->SetCurItem( NULL ); // clear curr item, because it could be a DRC marker
557 
558  // Clear current selection list to avoid selection of deleted items
560 
563  m_DeleteCurrentMarkerButton->Enable( false );
564 }
static TOOL_ACTION selectionClear
Clears the current selection.
Definition: pcb_actions.h:53
void SetCurItem(BOARD_ITEM *aItem, bool aDisplayInfo=true)
Function SetCurItem sets the currently selected item and displays it in the MsgPanel.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
wxButton * m_DeleteCurrentMarkerButton
DRCLISTBOX * m_UnconnectedListBox
TOOL_MANAGER * GetToolManager() const
Return the tool manager instance, if any.
Definition: draw_frame.h:940
void DeleteAllItems()
Function DeleteAllItems deletes all items in the list.
DRCLISTBOX * m_ClearanceListBox
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150

◆ DisplayDRCValues()

void DIALOG_DRC_CONTROL::DisplayDRCValues ( )
private

Definition at line 138 of file dialog_drc.cpp.

References m_BrdSettings, BOARD_DESIGN_SETTINGS::m_MicroViasMinSize, m_trackMinWidth, BOARD_DESIGN_SETTINGS::m_TrackMinWidth, m_uviaMinSize, m_viaMinSize, BOARD_DESIGN_SETTINGS::m_ViasMinSize, and UNIT_BINDER::SetValue().

Referenced by InitValues(), and OnActivateDlg().

139 {
143 }
UNIT_BINDER m_viaMinSize
Definition: dialog_drc.h:157
BOARD_DESIGN_SETTINGS m_BrdSettings
Definition: dialog_drc.h:56
int m_TrackMinWidth
track min value for width ((min copper size value
int m_ViasMinSize
vias (not micro vias) min diameter
int m_MicroViasMinSize
micro vias (not vias) min diameter
UNIT_BINDER m_uviaMinSize
Definition: dialog_drc.h:158
UNIT_BINDER m_trackMinWidth
Definition: dialog_drc.h:156
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...

◆ doSelectionMenu()

void DIALOG_DRC_CONTROL::doSelectionMenu ( const DRC_ITEM aItem)
private

Run the SELECTION_TOOL's disambiguation menu to highlight the two BOARD_ITEMs in the DRC_ITEM.

Definition at line 429 of file dialog_drc.cpp.

References COLLECTOR::Append(), DRC_ITEM::GetAuxiliaryItem(), PCB_BASE_FRAME::GetBoard(), EDA_DRAW_FRAME::GetCanvas(), DRC_ITEM::GetMainItem(), EDA_DRAW_FRAME::GetToolManager(), DRC_ITEM::HasSecondItem(), m_brdEditor, EDA_DRAW_PANEL::Refresh(), TOOL_MANAGER::RunAction(), and PCB_ACTIONS::selectionMenu.

Referenced by OnRightUpClearance(), and OnRightUpUnconnected().

430 {
431  // popup menu to go to either of the items listed in the DRC_ITEM.
432  GENERAL_COLLECTOR items;
433 
434  items.Append( aItem->GetMainItem( m_brdEditor->GetBoard() ) );
435 
436  if( aItem->HasSecondItem() )
437  items.Append( aItem->GetAuxiliaryItem( m_brdEditor->GetBoard() ) );
438 
439  WINDOW_THAWER thawer( m_brdEditor );
442 }
BOARD_ITEM * GetAuxiliaryItem(BOARD *aBoard) const
Definition: drc_item.cpp:234
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
static TOOL_ACTION selectionMenu
Runs a selection menu to select from a list of items.
Definition: pcb_actions.h:68
void Append(EDA_ITEM *item)
Function Append adds an item to the end of the list.
Definition: collector.h:133
TOOL_MANAGER * GetToolManager() const
Return the tool manager instance, if any.
Definition: draw_frame.h:940
virtual EDA_DRAW_PANEL * GetCanvas() const
Definition: draw_frame.h:394
BOARD_ITEM * GetMainItem(BOARD *aBoard) const
Access to A and B items for BOARDs.
Definition: drc_item.cpp:228
bool HasSecondItem() const
Definition: drc_item.h:155
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:245
BOARD * GetBoard() const
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150

◆ Enable()

bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 230 of file dialog_shim.cpp.

231 {
232  // so we can do logging of this state change:
233 
234 #if defined(DEBUG)
235  const char* type_id = typeid( *this ).name();
236  printf( "wxDialog %s: %s\n", type_id, enable ? "enabled" : "disabled" );
237 #endif
238 
239  return wxDialog::Enable( enable );
240 }

◆ EndQuasiModal()

void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 390 of file dialog_shim.cpp.

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

Referenced by HK_PROMPT_DIALOG::EndFlexible(), DIALOG_SHIM::OnButton(), DIALOG_LIB_EDIT_PIN_TABLE::OnClose(), DIALOG_PRINT_GENERIC::onCloseButton(), DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer(), DIALOG_CHOOSE_COMPONENT::OnCloseTimer(), DIALOG_SHIM::OnCloseWindow(), DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser(), DIALOG_CHOOSE_COMPONENT::OnUseBrowser(), and DIALOG_SHIM::~DIALOG_SHIM().

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

◆ 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 129 of file dialog_shim.cpp.

References PCAD2KICAD::Center.

Referenced by DIALOG_3D_VIEW_OPTIONS::DIALOG_3D_VIEW_OPTIONS(), DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_BOM::DIALOG_BOM(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_DRC_CONTROL(), 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_ENUM_PADS::DIALOG_ENUM_PADS(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXIT::DIALOG_EXIT(), 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_FOOTPRINTS_DISPLAY_OPTIONS::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS(), DIALOG_FP_BROWSER_DISPLAY_OPTIONS::DIALOG_FP_BROWSER_DISPLAY_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_IMAGE_EDITOR::DIALOG_IMAGE_EDITOR(), 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_PIN::DIALOG_LIB_EDIT_PIN(), 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_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_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_EDIT_SHEET_PIN::DIALOG_SCH_EDIT_SHEET_PIN(), DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS(), DIALOG_SELECT_NET_FROM_LIST::DIALOG_SELECT_NET_FROM_LIST(), DIALOG_SET_GRID::DIALOG_SET_GRID(), 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_UPDATE_PCB::DIALOG_UPDATE_PCB(), PAGED_DIALOG::finishInitialization(), DIALOG_EDIT_ONE_FIELD::init(), DIALOG_EDIT_LIBRARY_TABLES::InstallPanel(), NETLIST_DIALOG::NETLIST_DIALOG(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), DIALOG_SIM_SETTINGS::onInitDlg(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnInitDlg(), DIALOG_SPICE_MODEL::onInitDlg(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_UPDATE_FIELDS::TransferDataToWindow(), and DIALOG_COLOR_PICKER::TransferDataToWindow().

130 {
131  // must be called from the constructor of derived classes,
132  // when all widgets are initialized, and therefore their size fixed
133 
134  // SetSizeHints fixes the minimal size of sizers in the dialog
135  // (SetSizeHints calls Fit(), so no need to call it)
136  GetSizer()->SetSizeHints( this );
137 
138  // the default position, when calling the first time the dlg
139  Center();
140 }

◆ GetRptSettings()

void DIALOG_DRC_CONTROL::GetRptSettings ( bool *  aEnable,
wxString &  aFileName 
)

Definition at line 184 of file dialog_drc.cpp.

References DIALOG_DRC_CONTROL_BASE::m_CreateRptCtrl, and DIALOG_DRC_CONTROL_BASE::m_RptFilenameCtrl.

Referenced by DRC::DestroyDRCDialog().

185 {
186  *aEnable = m_CreateRptCtrl->GetValue();
187  aFileName = m_RptFilenameCtrl->GetValue();
188 }
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl

◆ 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 150 of file dialog_shim.cpp.

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

151 {
152  wxSize sz( x, 0 );
153  return ConvertDialogToPixels( sz ).x;
154 }

◆ InitValues()

void DIALOG_DRC_CONTROL::InitValues ( )
private

Definition at line 146 of file dialog_drc.cpp.

References DisplayDRCValues(), DIALOG_DRC_CONTROL_BASE::m_cbRefillZones, m_config, DIALOG_DRC_CONTROL_BASE::m_DeleteCurrentMarkerButton, m_markersTitleTemplate, DIALOG_DRC_CONTROL_BASE::m_Notebook, m_unconnectedTitleTemplate, and RefillZonesBeforeDrc.

Referenced by DIALOG_DRC_CONTROL().

147 {
148  m_markersTitleTemplate = m_Notebook->GetPageText( 0 );
149  m_unconnectedTitleTemplate = m_Notebook->GetPageText( 1 );
150 
151  m_DeleteCurrentMarkerButton->Enable( false );
152 
154 
155  // read options
156  bool value;
157  m_config->Read( RefillZonesBeforeDrc, &value, false );
158  m_cbRefillZones->SetValue( value );
159 
160  Layout(); // adding the units above expanded Clearance text, now resize.
161 
162  SetFocus();
163 }
wxCheckBox * m_cbRefillZones
wxButton * m_DeleteCurrentMarkerButton
wxString m_unconnectedTitleTemplate
Definition: dialog_drc.h:154
wxString m_markersTitleTemplate
Definition: dialog_drc.h:153
wxConfigBase * m_config
Definition: dialog_drc.h:151
#define RefillZonesBeforeDrc
Definition: dialog_drc.cpp:54

◆ IsQuasiModal()

◆ 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 60 of file kiway_player.h.

References KIWAY_HOLDER::m_kiway.

Referenced by TREEPROJECT_ITEM::Activate(), PCB_BASE_EDIT_FRAME::AddLibrary(), SCH_EDIT_FRAME::AppendSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), CVPCB_MAINFRAME::CreateScreenCmp(), SCH_EDIT_FRAME::CreateScreens(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), SCH_EDIT_FRAME::doUpdatePcb(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), LIB_MANAGER::GetBufferedPart(), LIB_MANAGER::getLibraryBuffer(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::KiwayMailIn(), KIWAY_PLAYER::language_change(), KICAD_MANAGER_FRAME::language_change(), CVPCB_MAINFRAME::LoadFootprintFiles(), KICAD_MANAGER_FRAME::LoadProject(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), KICAD_MANAGER_FRAME::OnEditFpLibTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), KICAD_MANAGER_FRAME::OnEditSymLibTable(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnLeftClick(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), SCH_BASE_FRAME::OnOpenLibraryViewer(), SCH_EDIT_FRAME::OnOpenPcbModuleEditor(), SCH_EDIT_FRAME::OnOpenPcbnew(), KICAD_MANAGER_FRAME::OnRunPcbFpEditor(), KICAD_MANAGER_FRAME::OnRunSchLibEditor(), SCH_EDIT_FRAME::OnSimulate(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), SCH_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDIT_FRAME::rescueProject(), KICAD_MANAGER_FRAME::RunEeschema(), KICAD_MANAGER_FRAME::RunPcbNew(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), EDA_BASE_FRAME::ShowPreferences(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::UpdatePart(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

61  {
62  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
63  return *m_kiway;
64  }
KIWAY * m_kiway
Definition: kiway_player.h:94

◆ makeValidFileNameReport()

const wxString DIALOG_DRC_CONTROL::makeValidFileNameReport ( )
private

filenames can be entered by name.

Returns
a good report filename (with .rpt extension) (a full filename) from m_CreateRptCtrl

Definition at line 567 of file dialog_drc.cpp.

References PROJECT::GetProjectPath(), DIALOG_DRC_CONTROL_BASE::m_RptFilenameCtrl, KIWAY_HOLDER::Prj(), and ReportFileExtension.

Referenced by OnListUnconnectedClick(), and OnStartdrcClick().

568 {
569  wxFileName fn = m_RptFilenameCtrl->GetValue();
570 
571  if( !fn.HasExt() )
572  {
573  fn.SetExt( ReportFileExtension );
574  m_RptFilenameCtrl->SetValue( fn.GetFullPath() );
575  }
576 
577  // Ensure it is an absolute filename. if it is given relative
578  // it will be made relative to the project
579  if( !fn.IsAbsolute() )
580  {
581  wxString prj_path = Prj().GetProjectPath();
582  fn.MakeAbsolute( prj_path );
583  }
584 
585  return fn.GetFullPath();
586 }
wxTextCtrl * m_RptFilenameCtrl
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
const std::string ReportFileExtension

◆ OnActivateDlg()

void DIALOG_DRC_CONTROL::OnActivateDlg ( wxActivateEvent &  event)
overrideprivatevirtual

handler for activate event, updating data which can be modified outside the dialog (DRC parameters)

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 117 of file dialog_drc.cpp.

References DRC::DestroyDRCDialog(), DisplayDRCValues(), PCB_BASE_FRAME::GetBoard(), BOARD::GetDesignSettings(), m_brdEditor, m_BrdSettings, m_currentBoard, and m_tester.

118 {
120  {
121  // If m_currentBoard is not the current parent board,
122  // (for instance because a new board was loaded),
123  // close the dialog, because many pointers are now invalid
124  // in lists
125  SetReturnCode( wxID_CANCEL );
126  Close();
127  m_tester->DestroyDRCDialog( wxID_CANCEL );
128  return;
129  }
130 
131  // updating data which can be modified outside the dialog (DRC parameters, units ...)
132  // because the dialog is not modal
135 }
void DestroyDRCDialog(int aReason)
Deletes this ui dialog box and zeros out its pointer to remember the state of the dialog&#39;s existence...
Definition: drc.cpp:119
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:539
BOARD_DESIGN_SETTINGS m_BrdSettings
Definition: dialog_drc.h:56
BOARD * GetBoard() const
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
BOARD * m_currentBoard
Definition: dialog_drc.h:148

◆ OnButtonBrowseRptFileClick()

void DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick ( wxCommandEvent &  event)
overrideprivatevirtual

wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 327 of file dialog_drc.cpp.

References PCB_BASE_FRAME::GetBoard(), BOARD::GetFileName(), PROJECT::GetProjectPath(), m_brdEditor, DIALOG_DRC_CONTROL_BASE::m_CreateRptCtrl, DIALOG_DRC_CONTROL_BASE::m_RptFilenameCtrl, KIWAY_HOLDER::Prj(), ReportFileExtension, and ReportFileWildcard().

Referenced by OnListUnconnectedClick(), and OnStartdrcClick().

328 {
329  wxFileName fn = m_brdEditor->GetBoard()->GetFileName();
330  fn.SetExt( ReportFileExtension );
331  wxString prj_path = Prj().GetProjectPath();
332 
333  wxFileDialog dlg( this, _( "Save DRC Report File" ), prj_path, fn.GetFullName(),
334  ReportFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
335 
336  if( dlg.ShowModal() == wxID_CANCEL )
337  return;
338 
339  m_CreateRptCtrl->SetValue( true );
340  m_RptFilenameCtrl->SetValue( dlg.GetPath() );
341 }
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl
const wxString & GetFileName() const
Definition: class_board.h:238
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
wxString ReportFileWildcard()
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
const std::string ReportFileExtension
BOARD * GetBoard() const
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150

◆ OnCancelClick()

void DIALOG_DRC_CONTROL::OnCancelClick ( wxCommandEvent &  event)
overrideprivatevirtual

wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 344 of file dialog_drc.cpp.

References DRC::DestroyDRCDialog(), m_tester, and SetDrcParmeters().

345 {
346  SetReturnCode( wxID_CANCEL );
347  SetDrcParmeters();
348 
349  // The dialog can be modal or not modal.
350  // Leave the DRC caller destroy (or not) the dialog
351  m_tester->DestroyDRCDialog( wxID_CANCEL );
352 }
void DestroyDRCDialog(int aReason)
Deletes this ui dialog box and zeros out its pointer to remember the state of the dialog&#39;s existence...
Definition: drc.cpp:119

◆ OnChangingMarkerList()

void DIALOG_DRC_CONTROL::OnChangingMarkerList ( wxNotebookEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 479 of file dialog_drc.cpp.

References DIALOG_DRC_CONTROL_BASE::m_ClearanceListBox, DIALOG_DRC_CONTROL_BASE::m_DeleteCurrentMarkerButton, DIALOG_DRC_CONTROL_BASE::m_Notebook, and DIALOG_DRC_CONTROL_BASE::m_UnconnectedListBox.

480 {
481  // Shouldn't be necessary, but is on at least OSX
482  m_Notebook->ChangeSelection( event.GetSelection() );
483 
484  m_DeleteCurrentMarkerButton->Enable( false );
485  m_ClearanceListBox->SetSelection( -1 );
486  m_UnconnectedListBox->SetSelection( -1 );
487 }
wxButton * m_DeleteCurrentMarkerButton
DRCLISTBOX * m_UnconnectedListBox
DRCLISTBOX * m_ClearanceListBox

◆ OnDeleteAllClick()

void DIALOG_DRC_CONTROL::OnDeleteAllClick ( wxCommandEvent &  event)
overrideprivatevirtual

wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ALL

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 254 of file dialog_drc.cpp.

References DelDRCMarkers(), RedrawDrawPanel(), and UpdateDisplayedCounts().

255 {
256  DelDRCMarkers();
257  RedrawDrawPanel();
259 }
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:663

◆ OnDeleteOneClick()

void DIALOG_DRC_CONTROL::OnDeleteOneClick ( wxCommandEvent &  event)
overrideprivatevirtual

wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ONE

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 628 of file dialog_drc.cpp.

References DRCLISTBOX::DeleteItem(), DIALOG_DRC_CONTROL_BASE::m_ClearanceListBox, DIALOG_DRC_CONTROL_BASE::m_Notebook, DIALOG_DRC_CONTROL_BASE::m_UnconnectedListBox, RedrawDrawPanel(), and UpdateDisplayedCounts().

629 {
630  int selectedIndex;
631  int curTab = m_Notebook->GetSelection();
632 
633  if( curTab == 0 )
634  {
635  selectedIndex = m_ClearanceListBox->GetSelection();
636 
637  if( selectedIndex != wxNOT_FOUND )
638  {
639  m_ClearanceListBox->DeleteItem( selectedIndex );
640 
641  // redraw the pcb
642  RedrawDrawPanel();
643  }
644  }
645  else if( curTab == 1 )
646  {
647  selectedIndex = m_UnconnectedListBox->GetSelection();
648 
649  if( selectedIndex != wxNOT_FOUND )
650  {
651  m_UnconnectedListBox->DeleteItem( selectedIndex );
652 
653  /* these unconnected DRC_ITEMs are not currently visible on the pcb
654  * RedrawDrawPanel();
655  */
656  }
657  }
658 
660 }
void DeleteItem(int aIndex)
Function DeleteElement will delete one of the items in the list.
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:663
DRCLISTBOX * m_UnconnectedListBox
DRCLISTBOX * m_ClearanceListBox

◆ OnLeftDClickClearance()

void DIALOG_DRC_CONTROL::OnLeftDClickClearance ( wxMouseEvent &  event)
overrideprivatevirtual

wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 368 of file dialog_drc.cpp.

References EDA_DRAW_FRAME::FocusOnLocation(), DRCLISTBOX::GetItem(), DRC_ITEM::GetParent(), DRC_ITEM::GetPointA(), EDA_DRAW_FRAME::IsGalCanvasActive(), m_brdEditor, DIALOG_DRC_CONTROL_BASE::m_ClearanceListBox, DIALOG_SHIM::Show(), and EDA_DRAW_FRAME::SkipNextLeftButtonReleaseEvent().

Referenced by DIALOG_DRC_CONTROL(), and ~DIALOG_DRC_CONTROL().

369 {
370  event.Skip();
371 
372  int selection = m_ClearanceListBox->GetSelection();
373 
374  if( selection != wxNOT_FOUND )
375  {
376  // Find the selected MARKER in the PCB, position cursor there.
377  // Then close the dialog.
378  const DRC_ITEM* item = m_ClearanceListBox->GetItem( selection );
379 
380  if( item )
381  {
382  auto pos = item->GetPointA();
383 
384  if( auto marker = item->GetParent() )
385  pos = marker->GetPos();
386 
387  // When selecting a item, center it on GAL and just move the graphic
388  // cursor in legacy mode gives the best result
389  bool center = m_brdEditor->IsGalCanvasActive() ? true : false;
390  m_brdEditor->FocusOnLocation( pos, true, center );
391 
392  if( !IsModal() )
393  {
394  // turn control over to m_brdEditor, hide this DIALOG_DRC_CONTROL window,
395  // no destruction so we can preserve listbox cursor
396  Show( false );
397 
398  // We do not want the clarify selection popup when releasing the
399  // left button in the main window
401  }
402  }
403  }
404 }
Class DRC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item. ...
Definition: drc_item.h:48
MARKER_BASE * GetParent() const
Definition: drc_item.h:153
void SkipNextLeftButtonReleaseEvent()
After calling this function, if the left mouse button is down, the next left mouse button release eve...
void FocusOnLocation(const wxPoint &aPos, bool aWarpCursor=true, bool aCenterView=false)
Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor...
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:927
DRCLISTBOX * m_ClearanceListBox
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
const wxPoint & GetPointA() const
Definition: drc_item.h:214
bool Show(bool show) override
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150

◆ OnLeftDClickUnconnected()

void DIALOG_DRC_CONTROL::OnLeftDClickUnconnected ( wxMouseEvent &  event)
overrideprivatevirtual

wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 445 of file dialog_drc.cpp.

References EDA_DRAW_FRAME::FocusOnLocation(), DRCLISTBOX::GetItem(), DRC_ITEM::GetPointA(), EDA_DRAW_FRAME::IsGalCanvasActive(), m_brdEditor, DIALOG_DRC_CONTROL_BASE::m_UnconnectedListBox, DIALOG_SHIM::Show(), and EDA_DRAW_FRAME::SkipNextLeftButtonReleaseEvent().

Referenced by DIALOG_DRC_CONTROL(), and ~DIALOG_DRC_CONTROL().

446 {
447  event.Skip();
448 
449  int selection = m_UnconnectedListBox->GetSelection();
450 
451  if( selection != wxNOT_FOUND )
452  {
453  // Find the selected DRC_ITEM in the listbox, position cursor there.
454  // Then hide the dialog.
455  const DRC_ITEM* item = m_UnconnectedListBox->GetItem( selection );
456  if( item )
457  {
458  // When selecting a item, center it on GAL and just move the graphic
459  // cursor in legacy mode gives the best result
460  bool center = m_brdEditor->IsGalCanvasActive() ? true : false;
461  m_brdEditor->FocusOnLocation( item->GetPointA(), true, center );
462 
463  if( !IsModal() )
464  {
465  Show( false );
466 
467  // We do not want the clarify selection popup when releasing the
468  // left button in the main window
470  }
471  }
472  }
473 }
Class DRC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item. ...
Definition: drc_item.h:48
void SkipNextLeftButtonReleaseEvent()
After calling this function, if the left mouse button is down, the next left mouse button release eve...
void FocusOnLocation(const wxPoint &aPos, bool aWarpCursor=true, bool aCenterView=false)
Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor...
DRCLISTBOX * m_UnconnectedListBox
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:927
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
const wxPoint & GetPointA() const
Definition: drc_item.h:214
bool Show(bool show) override
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150

◆ OnListUnconnectedClick()

void DIALOG_DRC_CONTROL::OnListUnconnectedClick ( wxCommandEvent &  event)
overrideprivatevirtual

wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIST_UNCONNECTED

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 262 of file dialog_drc.cpp.

References DelDRCMarkers(), DisplayError(), GetChars(), DRC::ListUnconnectedPads(), DIALOG_DRC_CONTROL_BASE::m_cbRefillZones, DIALOG_DRC_CONTROL_BASE::m_cbReportAllTrackErrors, DIALOG_DRC_CONTROL_BASE::m_CreateRptCtrl, DIALOG_DRC_CONTROL_BASE::m_Messages, DIALOG_DRC_CONTROL_BASE::m_Notebook, DIALOG_DRC_CONTROL_BASE::m_RptFilenameCtrl, m_tester, makeValidFileNameReport(), OnButtonBrowseRptFileClick(), SetDrcParmeters(), DRC::SetSettings(), UpdateDisplayedCounts(), and writeReport().

263 {
264  wxString reportName, msg;
265 
266  bool make_report = m_CreateRptCtrl->IsChecked();
267 
268  if( make_report ) // Create a file rpt
269  {
270  reportName = m_RptFilenameCtrl->GetValue();
271 
272  if( reportName.IsEmpty() )
273  {
274  wxCommandEvent junk;
276  }
277 
278  if( !reportName.IsEmpty() )
279  reportName = makeValidFileNameReport();
280  }
281 
282  SetDrcParmeters();
283 
284  m_tester->SetSettings( true, // Pad to pad DRC test enabled
285  true, // unconnected pads DRC test enabled
286  true, // DRC test for zones enabled
287  true, // DRC test for keepout areas enabled
288  m_cbRefillZones->GetValue(),
289  m_cbReportAllTrackErrors->GetValue(),
290  reportName, make_report );
291 
292  DelDRCMarkers();
293 
294  wxBeginBusyCursor();
295 
296  m_Messages->Clear();
298 
299  m_Notebook->ChangeSelection( 1 ); // display the "Unconnected" tab
300 
301  // Generate the report
302  if( !reportName.IsEmpty() )
303  {
304  if( writeReport( reportName ) )
305  {
306  msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) );
307  wxMessageDialog popupWindow( this, msg, _( "Disk File Report Completed" ) );
308  popupWindow.ShowModal();
309  }
310  else
311  {
312  msg.Printf( _( "Unable to create report file \"%s\"" ), GetChars( reportName ) );
313  DisplayError( this, msg );
314  }
315  }
316 
318 
319  wxEndBusyCursor();
320 
321  /* there is currently nothing visible on the DrawPanel for unconnected pads
322  * RedrawDrawPanel();
323  */
324 }
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:663
wxCheckBox * m_cbRefillZones
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl
const wxString makeValidFileNameReport()
filenames can be entered by name.
Definition: dialog_drc.cpp:567
void ListUnconnectedPads()
Gather a list of all the unconnected pads and shows them in the dialog, and optionally prints a repor...
Definition: drc.cpp:544
void OnButtonBrowseRptFileClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
Definition: dialog_drc.cpp:327
bool writeReport(const wxString &aFullFileName)
Function writeReport outputs the MARKER items and unconnecte DRC_ITEMs with commentary to an open tex...
Definition: dialog_drc.cpp:589
wxCheckBox * m_cbReportAllTrackErrors
void SetSettings(bool aPad2PadTest, bool aUnconnectedTest, bool aZonesTest, bool aKeepoutTest, bool aRefillZones, bool aReportAllTrackErrors, const wxString &aReportName, bool aSaveReport)
Save all the UI or test settings and may be called before running the tests.
Definition: drc.h:517
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:245

◆ OnMarkerSelectionEvent()

void DIALOG_DRC_CONTROL::OnMarkerSelectionEvent ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 490 of file dialog_drc.cpp.

References EDA_DRAW_FRAME::FocusOnLocation(), DRCLISTBOX::GetItem(), DRC_ITEM::GetParent(), DRC_ITEM::GetPointA(), EDA_DRAW_FRAME::IsGalCanvasActive(), m_brdEditor, DIALOG_DRC_CONTROL_BASE::m_ClearanceListBox, DIALOG_DRC_CONTROL_BASE::m_DeleteCurrentMarkerButton, and RedrawDrawPanel().

491 {
492  int selection = event.GetSelection();
493 
494  if( selection != wxNOT_FOUND )
495  {
496  // until a MARKER is selected, this button is not enabled.
497  m_DeleteCurrentMarkerButton->Enable( true );
498 
499  // Find the selected DRC_ITEM in the listbox, position cursor there.
500  const DRC_ITEM* item = m_ClearanceListBox->GetItem( selection );
501  if( item )
502  {
503  auto pos = item->GetPointA();
504 
505  if( auto marker = item->GetParent() )
506  pos = marker->GetPos();
507 
508  // When selecting a item, center it on GAL and just move the graphic
509  // cursor in legacy mode gives the best result
510  bool center = m_brdEditor->IsGalCanvasActive() ? true : false;
511  m_brdEditor->FocusOnLocation( pos, false, center );
512  RedrawDrawPanel();
513  }
514  }
515 
516  event.Skip();
517 }
Class DRC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item. ...
Definition: drc_item.h:48
MARKER_BASE * GetParent() const
Definition: drc_item.h:153
wxButton * m_DeleteCurrentMarkerButton
void FocusOnLocation(const wxPoint &aPos, bool aWarpCursor=true, bool aCenterView=false)
Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor...
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:927
DRCLISTBOX * m_ClearanceListBox
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
const wxPoint & GetPointA() const
Definition: drc_item.h:214
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150

◆ OnPaint()

void DIALOG_SHIM::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 292 of file dialog_shim.cpp.

References DIALOG_SHIM::m_firstPaintEvent, and DIALOG_SHIM::m_initialFocusTarget.

Referenced by DIALOG_SHIM::DIALOG_SHIM().

293 {
294  if( m_firstPaintEvent )
295  {
296 #ifdef __WXMAC__
297  fixOSXCancelButtonIssue( this );
298  selectAllInTextCtrls( GetChildren() );
299 #endif
300 
302  m_initialFocusTarget->SetFocus();
303  else
304  SetFocus(); // Focus the dialog itself
305 
306  m_firstPaintEvent = false;
307  }
308 
309  event.Skip();
310 }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:180
bool m_firstPaintEvent
Definition: dialog_shim.h:179

◆ OnReportCheckBoxClicked()

void DIALOG_DRC_CONTROL::OnReportCheckBoxClicked ( wxCommandEvent &  event)
overrideprivatevirtual

wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_RPT_FILE

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 355 of file dialog_drc.cpp.

References DIALOG_DRC_CONTROL_BASE::m_CreateRptCtrl, and DIALOG_DRC_CONTROL_BASE::m_RptFilenameCtrl.

356 {
357  if( m_CreateRptCtrl->IsChecked() )
358  m_RptFilenameCtrl->SetFocus();
359 }
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl

◆ OnReportFilenameEdited()

void DIALOG_DRC_CONTROL::OnReportFilenameEdited ( wxCommandEvent &  event)
overrideprivatevirtual

wxEVT_COMMAND_TEXT_UPDATED event handler for m_RptFilenameCtrl

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 362 of file dialog_drc.cpp.

References DIALOG_DRC_CONTROL_BASE::m_CreateRptCtrl.

363 {
364  m_CreateRptCtrl->SetValue( event.GetString().Length() );
365 }
wxCheckBox * m_CreateRptCtrl

◆ OnRightUpClearance()

void DIALOG_DRC_CONTROL::OnRightUpClearance ( wxMouseEvent &  event)
overrideprivatevirtual

wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 418 of file dialog_drc.cpp.

References doSelectionMenu(), DRCLISTBOX::GetItem(), and DIALOG_DRC_CONTROL_BASE::m_ClearanceListBox.

Referenced by DIALOG_DRC_CONTROL(), and ~DIALOG_DRC_CONTROL().

419 {
420  // popup menu to go to either of the items listed in the DRC_ITEM.
421 
422  int selection = m_ClearanceListBox->GetSelection();
423 
424  if( selection != wxNOT_FOUND )
425  doSelectionMenu( m_ClearanceListBox->GetItem( selection ) );
426 }
DRCLISTBOX * m_ClearanceListBox
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
void doSelectionMenu(const DRC_ITEM *aItem)
Run the SELECTION_TOOL&#39;s disambiguation menu to highlight the two BOARD_ITEMs in the DRC_ITEM...
Definition: dialog_drc.cpp:429

◆ OnRightUpUnconnected()

void DIALOG_DRC_CONTROL::OnRightUpUnconnected ( wxMouseEvent &  event)
overrideprivatevirtual

wxEVT_RIGHT_UP event handler for ID_UNCONNECTED_LIST

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 407 of file dialog_drc.cpp.

References doSelectionMenu(), DRCLISTBOX::GetItem(), and DIALOG_DRC_CONTROL_BASE::m_UnconnectedListBox.

Referenced by DIALOG_DRC_CONTROL(), and ~DIALOG_DRC_CONTROL().

408 {
409  // popup menu to go to either of the items listed in the DRC_ITEM.
410 
411  int selection = m_UnconnectedListBox->GetSelection();
412 
413  if( selection != wxNOT_FOUND )
415 }
DRCLISTBOX * m_UnconnectedListBox
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
void doSelectionMenu(const DRC_ITEM *aItem)
Run the SELECTION_TOOL&#39;s disambiguation menu to highlight the two BOARD_ITEMs in the DRC_ITEM...
Definition: dialog_drc.cpp:429

◆ OnStartdrcClick()

void DIALOG_DRC_CONTROL::OnStartdrcClick ( wxCommandEvent &  event)
overrideprivatevirtual

wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STARTDRC

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 191 of file dialog_drc.cpp.

References DelDRCMarkers(), DisplayError(), dummy(), PCB_BASE_FRAME::GetBoard(), GetChars(), m_brdEditor, DIALOG_DRC_CONTROL_BASE::m_cbRefillZones, DIALOG_DRC_CONTROL_BASE::m_cbReportAllTrackErrors, DIALOG_DRC_CONTROL_BASE::m_CreateRptCtrl, DIALOG_DRC_CONTROL_BASE::m_Messages, DIALOG_DRC_CONTROL_BASE::m_Notebook, DIALOG_DRC_CONTROL_BASE::m_RptFilenameCtrl, BOARD::m_Status_Pcb, m_tester, makeValidFileNameReport(), OnButtonBrowseRptFileClick(), RedrawDrawPanel(), DRC::RunTests(), SetDrcParmeters(), DRC::SetSettings(), and writeReport().

192 {
193  wxString reportName, msg;
194 
195  bool make_report = m_CreateRptCtrl->IsChecked();
196 
197  if( make_report ) // Create a rpt file
198  {
199  reportName = m_RptFilenameCtrl->GetValue();
200 
201  if( reportName.IsEmpty() )
202  {
203  wxCommandEvent dummy;
205  }
206 
207  if( !reportName.IsEmpty() )
208  reportName = makeValidFileNameReport();
209  }
210 
211  SetDrcParmeters();
212  m_tester->SetSettings( true, // Pad to pad DRC test enabled
213  true, // unconnected pads DRC test enabled
214  true, // DRC test for zones enabled
215  true, // DRC test for keepout areas enabled
216  m_cbRefillZones->GetValue(),
217  m_cbReportAllTrackErrors->GetValue(),
218  reportName, make_report );
219 
220  DelDRCMarkers();
221 
222  wxBeginBusyCursor();
223  wxWindowDisabler disabler;
224 
225  // run all the tests, with no UI at this time.
226  m_Messages->Clear();
227  wxSafeYield(); // Allows time slice to refresh the Messages
228  m_brdEditor->GetBoard()->m_Status_Pcb = 0; // Force full connectivity and ratsnest calculations
230  m_Notebook->ChangeSelection( 0 ); // display the "Problems/Markers" tab
231 
232  // Generate the report
233  if( !reportName.IsEmpty() )
234  {
235  if( writeReport( reportName ) )
236  {
237  msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) );
238  wxMessageDialog popupWindow( this, msg, _( "Disk File Report Completed" ) );
239  popupWindow.ShowModal();
240  }
241  else
242  {
243  msg.Printf( _( "Unable to create report file \"%s\"" ), GetChars( reportName ) );
244  DisplayError( this, msg );
245  }
246  }
247 
248  wxEndBusyCursor();
249 
250  RedrawDrawPanel();
251 }
wxCheckBox * m_cbRefillZones
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl
const wxString makeValidFileNameReport()
filenames can be entered by name.
Definition: dialog_drc.cpp:567
void OnButtonBrowseRptFileClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
Definition: dialog_drc.cpp:327
bool writeReport(const wxString &aFullFileName)
Function writeReport outputs the MARKER items and unconnecte DRC_ITEMs with commentary to an open tex...
Definition: dialog_drc.cpp:589
wxCheckBox * m_cbReportAllTrackErrors
void SetSettings(bool aPad2PadTest, bool aUnconnectedTest, bool aZonesTest, bool aKeepoutTest, bool aRefillZones, bool aReportAllTrackErrors, const wxString &aReportName, bool aSaveReport)
Save all the UI or test settings and may be called before running the tests.
Definition: drc.h:517
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
BOARD * GetBoard() const
void RunTests(wxTextCtrl *aMessages=NULL)
Run all the tests specified with a previous call to SetSettings()
Definition: drc.cpp:390
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:245
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:241

◆ OnUnconnectedSelectionEvent()

void DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 520 of file dialog_drc.cpp.

References EDA_DRAW_FRAME::FocusOnLocation(), DRCLISTBOX::GetItem(), DRC_ITEM::GetPointA(), EDA_DRAW_FRAME::IsGalCanvasActive(), m_brdEditor, DIALOG_DRC_CONTROL_BASE::m_DeleteCurrentMarkerButton, DIALOG_DRC_CONTROL_BASE::m_UnconnectedListBox, and RedrawDrawPanel().

521 {
522  int selection = event.GetSelection();
523 
524  if( selection != wxNOT_FOUND )
525  {
526  // until a MARKER is selected, this button is not enabled.
527  m_DeleteCurrentMarkerButton->Enable( true );
528 
529  // Find the selected DRC_ITEM in the listbox, position cursor there.
530  const DRC_ITEM* item = m_UnconnectedListBox->GetItem( selection );
531 
532  if( item )
533  {
534  // When selecting a item, center it on GAL and just move the graphic
535  // cursor in legacy mode gives the best result
536  bool center = m_brdEditor->IsGalCanvasActive() ? true : false;
537  m_brdEditor->FocusOnLocation( item->GetPointA(), false, center );
538  RedrawDrawPanel();
539  }
540  }
541 
542  event.Skip();
543 }
Class DRC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item. ...
Definition: drc_item.h:48
wxButton * m_DeleteCurrentMarkerButton
void FocusOnLocation(const wxPoint &aPos, bool aWarpCursor=true, bool aCenterView=false)
Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor...
DRCLISTBOX * m_UnconnectedListBox
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:927
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
const wxPoint & GetPointA() const
Definition: drc_item.h:214
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150

◆ Prj()

PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

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

Definition at line 34 of file kiway_holder.cpp.

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(), LIB_VIEW_FRAME::BestZoom(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkAliasName(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), KICAD_MANAGER_FRAME::CreateNewProject(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromLibrary(), 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_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), LIB_VIEW_FRAME::DisplayLibInfos(), SCH_BASE_FRAME::DisplayListComponentsInLib(), PCB_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::doUpdatePcb(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::ExportVRML_File(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), NETLIST_DIALOG::GenNetlist(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SCH_BASE_FRAME::GetLibAlias(), SCH_BASE_FRAME::GetLibPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), KICAD_MANAGER_FRAME::GetProjectFileName(), LIB_VIEW_FRAME::getSelectedAlias(), FP_THREAD_IFACE::GetTable(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), PCB_EDIT_FRAME::InstallNetlistFrame(), SCH_EDIT_FRAME::IsSearchCacheObsolete(), LIB_EDIT_FRAME::KiwayMailIn(), EDA_DRAW_FRAME::LibraryFileBrowser(), SCH_EDIT_FRAME::Load_Component(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), KICAD_MANAGER_FRAME::LoadProject(), CVPCB_MAINFRAME::LoadProjectFile(), SCH_EDIT_FRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), makeValidFileNameReport(), 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_GENCAD_EXPORT_OPTIONS::onBrowse(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), OnButtonBrowseRptFileClick(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), SCH_EDIT_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnConfigurePaths(), FOOTPRINT_EDIT_FRAME::OnConfigurePaths(), KICAD_MANAGER_FRAME::OnCreateProjectFromTemplate(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnLoadProject(), SCH_EDIT_FRAME::OnOpenCvpcb(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), SCH_EDIT_FRAME::OnOpenLibraryEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), SCH_EDIT_FRAME::OnOpenPcbModuleEditor(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), SCH_EDIT_FRAME::OnPrint(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), SCH_EDIT_FRAME::OnRightClick(), KICAD_MANAGER_FRAME::OnRunGerbview(), DIALOG_BOM::OnRunPlugin(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), KICAD_MANAGER_FRAME::OnSaveProject(), DIALOG_SPICE_MODEL::onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), LIB_EDIT_FRAME::OnViewEntryDoc(), LIB_VIEW_FRAME::onViewSymbolDocument(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PANEL_PREV_3D::PANEL_PREV_3D(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDIT_FRAME::PrintPage(), SCH_EDIT_FRAME::Process_Config(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SCH_EDIT_FRAME::RescueLegacyProject(), SCH_EDIT_FRAME::RescueSymbolLibTableProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), 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(), SCH_EDIT_FRAME::SaveProject(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), SCH_BASE_FRAME::saveSymbolLibTables(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectComponentFromLibTree(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), LIB_EDIT_FRAME::selectSymLibTable(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), KICAD_MANAGER_FRAME::SetProjectFileName(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::symTable(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), EDA_3D_VIEWER::takeScreenshot(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), SIM_PLOT_FRAME::updateNetlistExporter(), SCH_SCREEN::UpdateSymbolLinks(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::UpdateTitle(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::~DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::~DIALOG_FOOTPRINT_FP_EDITOR(), and PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME().

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

◆ RedrawDrawPanel()

void DIALOG_DRC_CONTROL::RedrawDrawPanel ( )
private

Definition at line 546 of file dialog_drc.cpp.

References EDA_DRAW_FRAME::GetCanvas(), m_brdEditor, and EDA_DRAW_PANEL::Refresh().

Referenced by OnDeleteAllClick(), OnDeleteOneClick(), OnMarkerSelectionEvent(), OnStartdrcClick(), and OnUnconnectedSelectionEvent().

547 {
548  WINDOW_THAWER thawer( m_brdEditor );
549 
551 }
virtual EDA_DRAW_PANEL * GetCanvas() const
Definition: draw_frame.h:394
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150

◆ SetDrcParmeters()

void DIALOG_DRC_CONTROL::SetDrcParmeters ( )
private

Definition at line 167 of file dialog_drc.cpp.

References PCB_BASE_FRAME::GetBoard(), UNIT_BINDER::GetValue(), m_brdEditor, m_BrdSettings, BOARD_DESIGN_SETTINGS::m_MicroViasMinSize, m_trackMinWidth, BOARD_DESIGN_SETTINGS::m_TrackMinWidth, m_uviaMinSize, m_viaMinSize, BOARD_DESIGN_SETTINGS::m_ViasMinSize, and BOARD::SetDesignSettings().

Referenced by OnCancelClick(), OnListUnconnectedClick(), and OnStartdrcClick().

168 {
172 
174 }
UNIT_BINDER m_viaMinSize
Definition: dialog_drc.h:157
BOARD_DESIGN_SETTINGS m_BrdSettings
Definition: dialog_drc.h:56
virtual int GetValue()
Function GetValue Returns the current value in Internal Units.
int m_TrackMinWidth
track min value for width ((min copper size value
int m_ViasMinSize
vias (not micro vias) min diameter
void SetDesignSettings(const BOARD_DESIGN_SETTINGS &aDesignSettings)
Function SetDesignSettings.
Definition: class_board.h:549
int m_MicroViasMinSize
micro vias (not vias) min diameter
UNIT_BINDER m_uviaMinSize
Definition: dialog_drc.h:158
UNIT_BINDER m_trackMinWidth
Definition: dialog_drc.h:156
BOARD * GetBoard() const
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150

◆ 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 116 of file dialog_shim.h.

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_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), 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_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_SET_GRID::DIALOG_SET_GRID(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), 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(), and LIB_EDIT_FRAME::savePartAs().

117  {
118  m_initialFocusTarget = aWindow;
119  }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:180

◆ 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 47 of file kiway_holder.cpp.

References KIWAY_HOLDER::m_kiway, and name.

Referenced by InvokePcbLibTableEditor(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

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

◆ SetRptSettings()

void DIALOG_DRC_CONTROL::SetRptSettings ( bool  aEnable,
const wxString &  aFileName 
)

Enable/disable the report file creation.

Parameters
aEnable= true to ask for creation
aFileName= the filename or the report file

Definition at line 177 of file dialog_drc.cpp.

References DIALOG_DRC_CONTROL_BASE::m_CreateRptCtrl, and DIALOG_DRC_CONTROL_BASE::m_RptFilenameCtrl.

Referenced by DRC::ShowDRCDialog().

178 {
179  m_RptFilenameCtrl->SetValue( aFileName );
180  m_CreateRptCtrl->SetValue( aEnable );
181 }
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl

◆ 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 143 of file dialog_shim.cpp.

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

144 {
145  wxSize sz( x, y );
146  SetSize( ConvertDialogToPixels( sz ) );
147 }

◆ Show()

bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 171 of file dialog_shim.cpp.

References class_map, EDA_RECT::GetPosition(), EDA_RECT::GetSize(), DIALOG_SHIM::m_hash_key, and max.

Referenced by DIALOG_SHIM::EndQuasiModal(), InvokeDialogERC(), SCH_EDIT_FRAME::OnAnnotate(), DIALOG_SCH_FIND::OnCancel(), SCH_EDIT_FRAME::OnFindItems(), OnLeftDClickClearance(), OnLeftDClickUnconnected(), POSITION_RELATIVE_TOOL::PositionRelative(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), DRC::ShowDRCDialog(), DIALOG_SHIM::ShowQuasiModal(), and DIALOG_POSITION_RELATIVE::UpdateAnchor().

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

◆ ShowQuasiModal()

int DIALOG_SHIM::ShowQuasiModal ( )
inherited

Definition at line 336 of file dialog_shim.cpp.

References DBG, DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, DIALOG_SHIM::m_qmodal_showing, DIALOG_SHIM::Show(), and WX_EVENT_LOOP.

Referenced by SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditField(), EDIT_TOOL::ExchangeFootprints(), PCB_EDIT_FRAME::InstallExchangeModuleFrame(), SCH_EDIT_FRAME::InstallHierarchyFrame(), PCB_BASE_FRAME::InstallPadOptionsFrame(), InvokeDialogEditComponentsLibId(), InvokeDialogUpdateFields(), LIB_EDIT_FRAME::OnEditComponentProperties(), PCB_EDIT_FRAME::OnEditTracksAndVias(), SCH_EDIT_FRAME::OnLaunchBomManager(), SCH_EDIT_FRAME::OnRemapSymbols(), LIB_VIEW_FRAME::OnSelectSymbol(), SCH_EDIT_FRAME::OpenProjectFiles(), EDIT_TOOL::Properties(), SCH_BASE_FRAME::SelectComponentFromLibTree(), and PCB_BASE_FRAME::SelectFootprintFromLibTree().

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

◆ UpdateDisplayedCounts()

void DIALOG_DRC_CONTROL::UpdateDisplayedCounts ( )

Definition at line 663 of file dialog_drc.cpp.

References Format(), DIALOG_DRC_CONTROL_BASE::m_ClearanceListBox, m_markersTitleTemplate, DIALOG_DRC_CONTROL_BASE::m_Notebook, DIALOG_DRC_CONTROL_BASE::m_UnconnectedListBox, and m_unconnectedTitleTemplate.

Referenced by OnDeleteAllClick(), OnDeleteOneClick(), OnListUnconnectedClick(), and DRC::updatePointers().

664 {
665  int marker_count = m_ClearanceListBox->GetItemCount();
666  int unconnected_count = m_UnconnectedListBox->GetItemCount();
667 
668  m_Notebook->SetPageText( 0, wxString::Format( m_markersTitleTemplate, marker_count ) );
669  m_Notebook->SetPageText( 1, wxString::Format( m_unconnectedTitleTemplate, unconnected_count ) );
670 
671 }
DRCLISTBOX * m_UnconnectedListBox
wxString m_unconnectedTitleTemplate
Definition: dialog_drc.h:154
wxString m_markersTitleTemplate
Definition: dialog_drc.h:153
DRCLISTBOX * m_ClearanceListBox
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:205

◆ 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 157 of file dialog_shim.cpp.

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

158 {
159  wxSize sz( 0, y );
160  return ConvertDialogToPixels( sz ).y;
161 }

◆ writeReport()

bool DIALOG_DRC_CONTROL::writeReport ( const wxString &  aFullFileName)
private

Function writeReport outputs the MARKER items and unconnecte DRC_ITEMs with commentary to an open text file.

Parameters
aFullFileNameThe text filename to write the report to.
Returns
true if OK, false on error

Definition at line 589 of file dialog_drc.cpp.

References PCB_BASE_FRAME::GetBoard(), BOARD::GetFileName(), DRCLISTBOX::GetItem(), DIALOG_SHIM::GetUserUnits(), i, m_brdEditor, DIALOG_DRC_CONTROL_BASE::m_ClearanceListBox, DIALOG_DRC_CONTROL_BASE::m_UnconnectedListBox, DRC_ITEM::ShowReport(), and TO_UTF8.

Referenced by OnListUnconnectedClick(), and OnStartdrcClick().

590 {
591  FILE* fp = wxFopen( aFullFileName, wxT( "w" ) );
592 
593  if( fp == NULL )
594  return false;
595 
596  int count;
597  EDA_UNITS_T units = GetUserUnits();
598 
599  fprintf( fp, "** Drc report for %s **\n",
601 
602  wxDateTime now = wxDateTime::Now();
603 
604  fprintf( fp, "** Created on %s **\n", TO_UTF8( now.Format( wxT( "%F %T" ) ) ) );
605 
606  count = m_ClearanceListBox->GetItemCount();
607 
608  fprintf( fp, "\n** Found %d DRC errors **\n", count );
609 
610  for( int i = 0; i<count; ++i )
611  fprintf( fp, "%s", TO_UTF8( m_ClearanceListBox->GetItem( i )->ShowReport( units ) ) );
612 
613  count = m_UnconnectedListBox->GetItemCount();
614 
615  fprintf( fp, "\n** Found %d unconnected pads **\n", count );
616 
617  for( int i = 0; i<count; ++i )
618  fprintf( fp, "%s", TO_UTF8( m_UnconnectedListBox->GetItem( i )->ShowReport( units ) ) );
619 
620  fprintf( fp, "\n** End of Report **\n" );
621 
622  fclose( fp );
623 
624  return true;
625 }
const wxString & GetFileName() const
Definition: class_board.h:238
DRCLISTBOX * m_UnconnectedListBox
#define TO_UTF8(wxstring)
Macro TO_UTF8 converts a wxString to a UTF8 encoded C string for all wxWidgets build modes...
Definition: macros.h:47
DRCLISTBOX * m_ClearanceListBox
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
size_t i
Definition: json11.cpp:597
wxString ShowReport(EDA_UNITS_T aUnits) const
Function ShowReport translates this object into a text string suitable for saving to disk in a report...
Definition: drc_item.cpp:205
BOARD * GetBoard() const
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
EDA_UNITS_T
Definition: common.h:160
EDA_UNITS_T GetUserUnits() const override
Definition: dialog_shim.h:133

Member Data Documentation

◆ m_brdEditor

◆ m_BrdSettings

BOARD_DESIGN_SETTINGS DIALOG_DRC_CONTROL::m_BrdSettings

Definition at line 56 of file dialog_drc.h.

Referenced by DIALOG_DRC_CONTROL(), DisplayDRCValues(), OnActivateDlg(), and SetDrcParmeters().

◆ m_BrowseButton

wxBitmapButton* DIALOG_DRC_CONTROL_BASE::m_BrowseButton
protectedinherited

◆ m_cbRefillZones

wxCheckBox* DIALOG_DRC_CONTROL_BASE::m_cbRefillZones
protectedinherited

◆ m_cbReportAllTrackErrors

wxCheckBox* DIALOG_DRC_CONTROL_BASE::m_cbReportAllTrackErrors
protectedinherited

◆ m_ClearanceListBox

◆ m_ClearanceTitle

wxStaticText* DIALOG_DRC_CONTROL_BASE::m_ClearanceTitle
protectedinherited

Definition at line 54 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_config

wxConfigBase* DIALOG_DRC_CONTROL::m_config
private

Definition at line 151 of file dialog_drc.h.

Referenced by DIALOG_DRC_CONTROL(), InitValues(), and ~DIALOG_DRC_CONTROL().

◆ m_CreateRptCtrl

◆ m_currentBoard

BOARD* DIALOG_DRC_CONTROL::m_currentBoard
private

Definition at line 148 of file dialog_drc.h.

Referenced by DIALOG_DRC_CONTROL(), and OnActivateDlg().

◆ m_DeleteAllMarkersButton

wxButton* DIALOG_DRC_CONTROL_BASE::m_DeleteAllMarkersButton
protectedinherited

◆ m_DeleteCurrentMarkerButton

◆ m_firstPaintEvent

bool DIALOG_SHIM::m_firstPaintEvent
protectedinherited

Definition at line 179 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint().

◆ m_hash_key

◆ m_initialFocusTarget

wxWindow* DIALOG_SHIM::m_initialFocusTarget
protectedinherited

Definition at line 180 of file dialog_shim.h.

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

◆ m_markersTitleTemplate

wxString DIALOG_DRC_CONTROL::m_markersTitleTemplate
private

Definition at line 153 of file dialog_drc.h.

Referenced by InitValues(), and UpdateDisplayedCounts().

◆ m_Messages

wxTextCtrl* DIALOG_DRC_CONTROL_BASE::m_Messages
protectedinherited

◆ m_messagesLabel

wxStaticText* DIALOG_DRC_CONTROL_BASE::m_messagesLabel
protectedinherited

◆ m_MicroViaMinTitle

wxStaticText* DIALOG_DRC_CONTROL_BASE::m_MicroViaMinTitle
protectedinherited

Definition at line 59 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_MicroViaMinUnit

wxStaticText* DIALOG_DRC_CONTROL_BASE::m_MicroViaMinUnit
protectedinherited

Definition at line 60 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_Notebook

◆ m_panelClearanceListBox

wxPanel* DIALOG_DRC_CONTROL_BASE::m_panelClearanceListBox
protectedinherited

Definition at line 69 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_qmodal_loop

WX_EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 183 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 184 of file dialog_shim.h.

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

◆ m_RptFilenameCtrl

◆ m_sdbSizer1

wxStdDialogButtonSizer* DIALOG_DRC_CONTROL_BASE::m_sdbSizer1
protectedinherited

Definition at line 73 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_sdbSizer1Apply

wxButton* DIALOG_DRC_CONTROL_BASE::m_sdbSizer1Apply
protectedinherited

◆ m_sdbSizer1Cancel

wxButton* DIALOG_DRC_CONTROL_BASE::m_sdbSizer1Cancel
protectedinherited

◆ m_sdbSizer1OK

wxButton* DIALOG_DRC_CONTROL_BASE::m_sdbSizer1OK
protectedinherited

◆ m_SetClearance

wxTextCtrl* DIALOG_DRC_CONTROL_BASE::m_SetClearance
inherited

Definition at line 98 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_SetMicroViakMinSizeCtrl

wxTextCtrl* DIALOG_DRC_CONTROL_BASE::m_SetMicroViakMinSizeCtrl
inherited

Definition at line 101 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_SetTrackMinWidthCtrl

wxTextCtrl* DIALOG_DRC_CONTROL_BASE::m_SetTrackMinWidthCtrl
inherited

Definition at line 99 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_SetViaMinSizeCtrl

wxTextCtrl* DIALOG_DRC_CONTROL_BASE::m_SetViaMinSizeCtrl
inherited

Definition at line 100 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_sizerButtons

wxBoxSizer* DIALOG_DRC_CONTROL_BASE::m_sizerButtons
protectedinherited

◆ m_tester

DRC* DIALOG_DRC_CONTROL::m_tester
private

◆ m_trackMinWidth

UNIT_BINDER DIALOG_DRC_CONTROL::m_trackMinWidth
private

Definition at line 156 of file dialog_drc.h.

Referenced by DisplayDRCValues(), and SetDrcParmeters().

◆ m_TrackMinWidthTitle

wxStaticText* DIALOG_DRC_CONTROL_BASE::m_TrackMinWidthTitle
protectedinherited

Definition at line 55 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_TrackMinWidthUnit

wxStaticText* DIALOG_DRC_CONTROL_BASE::m_TrackMinWidthUnit
protectedinherited

Definition at line 56 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_UnconnectedListBox

◆ m_unconnectedTitleTemplate

wxString DIALOG_DRC_CONTROL::m_unconnectedTitleTemplate
private

Definition at line 154 of file dialog_drc.h.

Referenced by InitValues(), and UpdateDisplayedCounts().

◆ m_units

◆ m_uviaMinSize

UNIT_BINDER DIALOG_DRC_CONTROL::m_uviaMinSize
private

Definition at line 158 of file dialog_drc.h.

Referenced by DisplayDRCValues(), and SetDrcParmeters().

◆ m_viaMinSize

UNIT_BINDER DIALOG_DRC_CONTROL::m_viaMinSize
private

Definition at line 157 of file dialog_drc.h.

Referenced by DisplayDRCValues(), and SetDrcParmeters().

◆ m_ViaMinTitle

wxStaticText* DIALOG_DRC_CONTROL_BASE::m_ViaMinTitle
protectedinherited

Definition at line 57 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().

◆ m_ViaMinUnit

wxStaticText* DIALOG_DRC_CONTROL_BASE::m_ViaMinUnit
protectedinherited

Definition at line 58 of file dialog_drc_base.h.

Referenced by DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE().


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