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 ( DRC aTester,
PCB_EDIT_FRAME aEditorFrame,
wxWindow *  aParent 
)

Constructors.

Definition at line 86 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().

87  :
88  DIALOG_DRC_CONTROL_BASE( aParent ),
92 {
94  m_tester = aTester;
95  m_brdEditor = aEditorFrame;
98 
99  wxFont messagesLabelFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
100  messagesLabelFont.SetSymbolicSize( wxFONTSIZE_SMALL );
101  m_messagesLabel->SetFont( messagesLabelFont );
102 
103  m_BrowseButton->SetBitmap( KiBitmap( folder_xpm ) );
104 
105  // We use a sdbSizer here to get the order right, which is platform-dependent
106  m_sdbSizer1OK->SetLabel( _( "Run DRC" ) );
107  m_sdbSizer1Apply->SetLabel( _( "List Unconnected" ) );
108  m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
109  m_sizerButtons->Layout();
110 
111  m_sdbSizer1OK->SetDefault();
112 
113  InitValues();
114 
115  // Connect events
116  m_ClearanceListBox->Connect( ID_CLEARANCE_LIST, wxEVT_LEFT_DCLICK,
117  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnLeftDClickClearance ), NULL, this );
118  m_ClearanceListBox->Connect( ID_CLEARANCE_LIST, wxEVT_RIGHT_UP,
119  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnRightUpClearance ), NULL, this );
120  m_UnconnectedListBox->Connect( ID_UNCONNECTED_LIST, wxEVT_LEFT_DCLICK,
121  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnLeftDClickUnconnected ), NULL, this );
122  m_UnconnectedListBox->Connect( ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP,
123  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnRightUpUnconnected ), NULL, this );
124 
125  // Now all widgets have the size fixed, call FinishDialogSettings
127 }
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:447
wxStaticText * m_TrackMinWidthTitle
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:397
BOARD * GetBoard() const
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:474
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:538
wxBitmapButton * m_BrowseButton
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:103
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:436
wxTextCtrl * m_SetTrackMinWidthCtrl
#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 ( )

Definition at line 130 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.

131 {
132  m_config->Write( RefillZonesBeforeDrc, m_cbRefillZones->GetValue() );
133 
134  // Disconnect events
135  m_ClearanceListBox->Disconnect( ID_CLEARANCE_LIST, wxEVT_LEFT_DCLICK,
136  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnLeftDClickClearance ), NULL, this );
137  m_ClearanceListBox->Disconnect( ID_CLEARANCE_LIST, wxEVT_RIGHT_UP,
138  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnRightUpClearance ), NULL, this );
139  m_UnconnectedListBox->Disconnect( ID_UNCONNECTED_LIST, wxEVT_LEFT_DCLICK,
140  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnLeftDClickUnconnected ), NULL, this );
141  m_UnconnectedListBox->Disconnect( ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP,
142  wxMouseEventHandler( DIALOG_DRC_CONTROL::OnRightUpUnconnected ), NULL, this );
143 }
#define ID_CLEARANCE_LIST
void OnRightUpClearance(wxMouseEvent &event) override
wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:447
wxCheckBox * m_cbRefillZones
void OnLeftDClickClearance(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
Definition: dialog_drc.cpp:397
DRCLISTBOX * m_UnconnectedListBox
DRCLISTBOX * m_ClearanceListBox
void OnLeftDClickUnconnected(wxMouseEvent &event) override
wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST
Definition: dialog_drc.cpp:474
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:436
#define ID_UNCONNECTED_LIST

Member Function Documentation

void DIALOG_DRC_CONTROL::DelDRCMarkers ( )
private

Definition at line 583 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().

584 {
585  m_brdEditor->SetCurItem( NULL ); // clear curr item, because it could be a DRC marker
586 
587  // Clear current selection list to avoid selection of deleted items
589 
592  m_DeleteCurrentMarkerButton->Enable( false );
593 }
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
void DeleteAllItems()
Function DeleteAllItems deletes all items in the list.
DRCLISTBOX * m_ClearanceListBox
TOOL_MANAGER * GetToolManager() const
Return the tool manager instance, if any.
Definition: draw_frame.h:914
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
void DIALOG_DRC_CONTROL::DisplayDRCValues ( )
private

Definition at line 167 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().

168 {
172 }
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...
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 458 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().

459 {
460  // popup menu to go to either of the items listed in the DRC_ITEM.
461  GENERAL_COLLECTOR items;
462 
463  items.Append( aItem->GetMainItem( m_brdEditor->GetBoard() ) );
464 
465  if( aItem->HasSecondItem() )
466  items.Append( aItem->GetAuxiliaryItem( m_brdEditor->GetBoard() ) );
467 
468  BOARD_THAWER thawer( m_brdEditor );
471 }
BOARD_ITEM * GetAuxiliaryItem(BOARD *aBoard) const
Definition: drc_item.cpp:230
virtual EDA_DRAW_PANEL * GetCanvas() const
Definition: draw_frame.h:388
bool HasSecondItem() const
Definition: drc_item.h:155
BOARD_ITEM * GetMainItem(BOARD *aBoard) const
Access to A and B items for BOARDs.
Definition: drc_item.cpp:224
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
BOARD * GetBoard() const
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:914
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:242
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 221 of file dialog_shim.cpp.

Referenced by DIALOG_SHIM::IsQuasiModal().

222 {
223  // so we can do logging of this state change:
224 
225 #if defined(DEBUG)
226  const char* type_id = typeid( *this ).name();
227  printf( "wxDialog %s: %s\n", type_id, enable ? "enabled" : "disabled" );
228 #endif
229 
230  return wxDialog::Enable( enable );
231 }
void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 381 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 DIALOG_SHIM::OnButton(), DIALOG_PRINT_GENERIC::onCloseButton(), DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer(), DIALOG_CHOOSE_COMPONENT::OnCloseTimer(), DIALOG_SHIM::OnCloseWindow(), DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser(), DIALOG_CHOOSE_COMPONENT::OnUseBrowser(), DIALOG_SHIM::SetInitialFocus(), and DIALOG_SHIM::~DIALOG_SHIM().

382 {
383  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
384  // handle validation in the same way as other dialogs.
385  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
386  return;
387 
388  SetReturnCode( retCode );
389 
390  if( !IsQuasiModal() )
391  {
392  wxFAIL_MSG( wxT( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal wasn't called" ) );
393  return;
394  }
395 
396  if( m_qmodal_loop )
397  {
398  if( m_qmodal_loop->IsRunning() )
399  m_qmodal_loop->Exit( 0 );
400  else
401  m_qmodal_loop->ScheduleExit( 0 );
402 
403  m_qmodal_loop = NULL;
404  }
405 
408 
409  Show( false );
410 }
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:153
bool IsQuasiModal()
Definition: dialog_shim.h:95
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:155
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 120 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_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_SYM_LIB_TABLE_CONFIG::DIALOG_GLOBAL_SYM_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_SHIM::GetUserUnits(), DIALOG_EDIT_ONE_FIELD::init(), DIALOG_EDIT_LIBRARY_TABLES::InstallPanel(), NETLIST_DIALOG::NETLIST_DIALOG(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), DIALOG_SIM_SETTINGS::onInitDlg(), DIALOG_SPICE_MODEL::onInitDlg(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnInitDlg(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_UPDATE_FIELDS::TransferDataToWindow(), and DIALOG_COLOR_PICKER::TransferDataToWindow().

121 {
122  // must be called from the constructor of derived classes,
123  // when all widgets are initialized, and therefore their size fixed
124 
125  // SetSizeHints fixes the minimal size of sizers in the dialog
126  // (SetSizeHints calls Fit(), so no need to call it)
127  GetSizer()->SetSizeHints( this );
128 
129  // the default position, when calling the first time the dlg
130  Center();
131 }
void DIALOG_DRC_CONTROL::GetRptSettings ( bool *  aEnable,
wxString &  aFileName 
)

Definition at line 213 of file dialog_drc.cpp.

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

Referenced by DRC::DestroyDRCDialog().

214 {
215  *aEnable = m_CreateRptCtrl->GetValue();
216  aFileName = m_RptFilenameCtrl->GetValue();
217 }
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl
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 141 of file dialog_shim.cpp.

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

142 {
143  wxSize sz( x, 0 );
144  return ConvertDialogToPixels( sz ).x;
145 }
void DIALOG_DRC_CONTROL::InitValues ( )
private

Definition at line 175 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().

176 {
177  m_markersTitleTemplate = m_Notebook->GetPageText( 0 );
178  m_unconnectedTitleTemplate = m_Notebook->GetPageText( 1 );
179 
180  m_DeleteCurrentMarkerButton->Enable( false );
181 
183 
184  // read options
185  bool value;
186  m_config->Read( RefillZonesBeforeDrc, &value, false );
187  m_cbRefillZones->SetValue( value );
188 
189  Layout(); // adding the units above expanded Clearance text, now resize.
190 
191  SetFocus();
192 }
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
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::GetUserUnits(), KIWAY_HOLDER::m_kiway, KIWAY_HOLDER::Prj(), KIWAY_HOLDER::SetKiway(), and VTBL_ENTRY.

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(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), 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(), 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_BASE_FRAME::OnOpenLibraryViewer(), 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(), FOOTPRINT_WIZARD_FRAME::ReCreateVToolbar(), LIB_EDIT_FRAME::refreshSchematic(), 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
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 596 of file dialog_drc.cpp.

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

Referenced by OnListUnconnectedClick(), and OnStartdrcClick().

597 {
598  wxFileName fn = m_RptFilenameCtrl->GetValue();
599 
600  if( !fn.HasExt() )
601  {
602  fn.SetExt( ReportFileExtension );
603  m_RptFilenameCtrl->SetValue( fn.GetFullPath() );
604  }
605 
606  // Ensure it is an absolute filename. if it is given relative
607  // it will be made relative to the project
608  if( !fn.IsAbsolute() )
609  {
610  wxString prj_path = Prj().GetProjectPath();
611  fn.MakeAbsolute( prj_path );
612  }
613 
614  return fn.GetFullPath();
615 }
wxTextCtrl * m_RptFilenameCtrl
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
const std::string ReportFileExtension
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
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 146 of file dialog_drc.cpp.

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

147 {
149  {
150  // If m_currentBoard is not the current parent board,
151  // (for instance because a new board was loaded),
152  // close the dialog, because many pointers are now invalid
153  // in lists
154  SetReturnCode( wxID_CANCEL );
155  Close();
156  m_tester->DestroyDRCDialog( wxID_CANCEL );
157  return;
158  }
159 
160  // updating data which can be modified outside the dialog (DRC parameters, units ...)
161  // because the dialog is not modal
164 }
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 * GetBoard() const
BOARD_DESIGN_SETTINGS m_BrdSettings
Definition: dialog_drc.h:56
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:538
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
BOARD * m_currentBoard
Definition: dialog_drc.h:148
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 356 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().

357 {
358  wxFileName fn = m_brdEditor->GetBoard()->GetFileName();
359  fn.SetExt( ReportFileExtension );
360  wxString prj_path = Prj().GetProjectPath();
361 
362  wxFileDialog dlg( this, _( "Save DRC Report File" ), prj_path, fn.GetFullName(),
363  ReportFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
364 
365  if( dlg.ShowModal() == wxID_CANCEL )
366  return;
367 
368  m_CreateRptCtrl->SetValue( true );
369  m_RptFilenameCtrl->SetValue( dlg.GetPath() );
370 }
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl
BOARD * GetBoard() const
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxString ReportFileWildcard()
const wxString & GetFileName() const
Definition: class_board.h:237
const std::string ReportFileExtension
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:102
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
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 373 of file dialog_drc.cpp.

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

374 {
375  SetReturnCode( wxID_CANCEL );
376  SetDrcParmeters();
377 
378  // The dialog can be modal or not modal.
379  // Leave the DRC caller destroy (or not) the dialog
380  m_tester->DestroyDRCDialog( wxID_CANCEL );
381 }
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
void DIALOG_DRC_CONTROL::OnChangingMarkerList ( wxNotebookEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 508 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.

509 {
510  // Shouldn't be necessary, but is on at least OSX
511  m_Notebook->ChangeSelection( event.GetSelection() );
512 
513  m_DeleteCurrentMarkerButton->Enable( false );
514  m_ClearanceListBox->SetSelection( -1 );
515  m_UnconnectedListBox->SetSelection( -1 );
516 }
wxButton * m_DeleteCurrentMarkerButton
DRCLISTBOX * m_UnconnectedListBox
DRCLISTBOX * m_ClearanceListBox
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 283 of file dialog_drc.cpp.

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

284 {
285  DelDRCMarkers();
286  RedrawDrawPanel();
288 }
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:692
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 657 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().

658 {
659  int selectedIndex;
660  int curTab = m_Notebook->GetSelection();
661 
662  if( curTab == 0 )
663  {
664  selectedIndex = m_ClearanceListBox->GetSelection();
665 
666  if( selectedIndex != wxNOT_FOUND )
667  {
668  m_ClearanceListBox->DeleteItem( selectedIndex );
669 
670  // redraw the pcb
671  RedrawDrawPanel();
672  }
673  }
674  else if( curTab == 1 )
675  {
676  selectedIndex = m_UnconnectedListBox->GetSelection();
677 
678  if( selectedIndex != wxNOT_FOUND )
679  {
680  m_UnconnectedListBox->DeleteItem( selectedIndex );
681 
682  /* these unconnected DRC_ITEMs are not currently visible on the pcb
683  * RedrawDrawPanel();
684  */
685  }
686  }
687 
689 }
void DeleteItem(int aIndex)
Function DeleteElement will delete one of the items in the list.
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:692
DRCLISTBOX * m_UnconnectedListBox
DRCLISTBOX * m_ClearanceListBox
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 397 of file dialog_drc.cpp.

References PCB_BASE_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().

398 {
399  event.Skip();
400 
401  int selection = m_ClearanceListBox->GetSelection();
402 
403  if( selection != wxNOT_FOUND )
404  {
405  // Find the selected MARKER in the PCB, position cursor there.
406  // Then close the dialog.
407  const DRC_ITEM* item = m_ClearanceListBox->GetItem( selection );
408 
409  if( item )
410  {
411  auto pos = item->GetPointA();
412 
413  if( auto marker = item->GetParent() )
414  pos = marker->GetPos();
415 
416  // When selecting a item, center it on GAL and just move the graphic
417  // cursor in legacy mode gives the best result
418  bool center = m_brdEditor->IsGalCanvasActive() ? true : false;
419  m_brdEditor->FocusOnLocation( pos, true, center );
420 
421  if( !IsModal() )
422  {
423  // turn control over to m_brdEditor, hide this DIALOG_DRC_CONTROL window,
424  // no destruction so we can preserve listbox cursor
425  Show( false );
426 
427  // We do not want the clarify selection popup when releasing the
428  // left button in the main window
430  }
431  }
432  }
433 }
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 FocusOnLocation(const wxPoint &aPos, bool aWarpMouseCursor=true, bool aCenterView=false)
Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor...
void SkipNextLeftButtonReleaseEvent()
After calling this function, if the left mouse button is down, the next left mouse button release eve...
DRCLISTBOX * m_ClearanceListBox
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:901
bool Show(bool show) override
const wxPoint & GetPointA() const
Definition: drc_item.h:214
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
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 474 of file dialog_drc.cpp.

References PCB_BASE_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().

475 {
476  event.Skip();
477 
478  int selection = m_UnconnectedListBox->GetSelection();
479 
480  if( selection != wxNOT_FOUND )
481  {
482  // Find the selected DRC_ITEM in the listbox, position cursor there.
483  // Then hide the dialog.
484  const DRC_ITEM* item = m_UnconnectedListBox->GetItem( selection );
485  if( item )
486  {
487  // When selecting a item, center it on GAL and just move the graphic
488  // cursor in legacy mode gives the best result
489  bool center = m_brdEditor->IsGalCanvasActive() ? true : false;
490  m_brdEditor->FocusOnLocation( item->GetPointA(), true, center );
491 
492  if( !IsModal() )
493  {
494  Show( false );
495 
496  // We do not want the clarify selection popup when releasing the
497  // left button in the main window
499  }
500  }
501  }
502 }
Class DRC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item. ...
Definition: drc_item.h:48
void FocusOnLocation(const wxPoint &aPos, bool aWarpMouseCursor=true, bool aCenterView=false)
Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor...
void SkipNextLeftButtonReleaseEvent()
After calling this function, if the left mouse button is down, the next left mouse button release eve...
DRCLISTBOX * m_UnconnectedListBox
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:901
bool Show(bool show) override
const wxPoint & GetPointA() const
Definition: drc_item.h:214
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
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 291 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().

292 {
293  wxString reportName, msg;
294 
295  bool make_report = m_CreateRptCtrl->IsChecked();
296 
297  if( make_report ) // Create a file rpt
298  {
299  reportName = m_RptFilenameCtrl->GetValue();
300 
301  if( reportName.IsEmpty() )
302  {
303  wxCommandEvent junk;
305  }
306 
307  if( !reportName.IsEmpty() )
308  reportName = makeValidFileNameReport();
309  }
310 
311  SetDrcParmeters();
312 
313  m_tester->SetSettings( true, // Pad to pad DRC test enabled
314  true, // unconnected pads DRC test enabled
315  true, // DRC test for zones enabled
316  true, // DRC test for keepout areas enabled
317  m_cbRefillZones->GetValue(),
318  m_cbReportAllTrackErrors->GetValue(),
319  reportName, make_report );
320 
321  DelDRCMarkers();
322 
323  wxBeginBusyCursor();
324 
325  m_Messages->Clear();
327 
328  m_Notebook->ChangeSelection( 1 ); // display the "Unconnected" tab
329 
330  // Generate the report
331  if( !reportName.IsEmpty() )
332  {
333  if( writeReport( reportName ) )
334  {
335  msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) );
336  wxMessageDialog popupWindow( this, msg, _( "Disk File Report Completed" ) );
337  popupWindow.ShowModal();
338  }
339  else
340  {
341  msg.Printf( _( "Unable to create report file \"%s\"" ), GetChars( reportName ) );
342  DisplayError( this, msg );
343  }
344  }
345 
347 
348  wxEndBusyCursor();
349 
350  /* there is currently nothing visible on the DrawPanel for unconnected pads
351  * RedrawDrawPanel();
352  */
353 }
void UpdateDisplayedCounts()
Definition: dialog_drc.cpp:692
wxCheckBox * m_cbRefillZones
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl
const wxString makeValidFileNameReport()
filenames can be entered by name.
Definition: dialog_drc.cpp:596
void ListUnconnectedPads()
Gather a list of all the unconnected pads and shows them in the dialog, and optionally prints a repor...
Definition: drc.cpp:537
void OnButtonBrowseRptFileClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
Definition: dialog_drc.cpp:356
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:618
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:508
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
void DIALOG_DRC_CONTROL::OnMarkerSelectionEvent ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 519 of file dialog_drc.cpp.

References PCB_BASE_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().

520 {
521  int selection = event.GetSelection();
522 
523  if( selection != wxNOT_FOUND )
524  {
525  // until a MARKER is selected, this button is not enabled.
526  m_DeleteCurrentMarkerButton->Enable( true );
527 
528  // Find the selected DRC_ITEM in the listbox, position cursor there.
529  const DRC_ITEM* item = m_ClearanceListBox->GetItem( selection );
530  if( item )
531  {
532  auto pos = item->GetPointA();
533 
534  if( auto marker = item->GetParent() )
535  pos = marker->GetPos();
536 
537  // When selecting a item, center it on GAL and just move the graphic
538  // cursor in legacy mode gives the best result
539  bool center = m_brdEditor->IsGalCanvasActive() ? true : false;
540  m_brdEditor->FocusOnLocation( pos, false, center );
541  RedrawDrawPanel();
542  }
543  }
544 
545  event.Skip();
546 }
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 FocusOnLocation(const wxPoint &aPos, bool aWarpMouseCursor=true, bool aCenterView=false)
Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor...
wxButton * m_DeleteCurrentMarkerButton
DRCLISTBOX * m_ClearanceListBox
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:901
const wxPoint & GetPointA() const
Definition: drc_item.h:214
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
void DIALOG_SHIM::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 283 of file dialog_shim.cpp.

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

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

284 {
285  if( m_firstPaintEvent )
286  {
287 #ifdef __WXMAC__
288  fixOSXCancelButtonIssue( this );
289  selectAllInTextCtrls( GetChildren() );
290 #endif
291 
293  m_initialFocusTarget->SetFocus();
294  else
295  SetFocus(); // Focus the dialog itself
296 
297  m_firstPaintEvent = false;
298  }
299 
300  event.Skip();
301 }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:150
bool m_firstPaintEvent
Definition: dialog_shim.h:149
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 384 of file dialog_drc.cpp.

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

385 {
386  if( m_CreateRptCtrl->IsChecked() )
387  m_RptFilenameCtrl->SetFocus();
388 }
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl
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 391 of file dialog_drc.cpp.

References DIALOG_DRC_CONTROL_BASE::m_CreateRptCtrl.

392 {
393  m_CreateRptCtrl->SetValue( event.GetString().Length() );
394 }
wxCheckBox * m_CreateRptCtrl
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 447 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().

448 {
449  // popup menu to go to either of the items listed in the DRC_ITEM.
450 
451  int selection = m_ClearanceListBox->GetSelection();
452 
453  if( selection != wxNOT_FOUND )
454  doSelectionMenu( m_ClearanceListBox->GetItem( selection ) );
455 }
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:458
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 436 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().

437 {
438  // popup menu to go to either of the items listed in the DRC_ITEM.
439 
440  int selection = m_UnconnectedListBox->GetSelection();
441 
442  if( selection != wxNOT_FOUND )
444 }
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:458
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 220 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().

221 {
222  wxString reportName, msg;
223 
224  bool make_report = m_CreateRptCtrl->IsChecked();
225 
226  if( make_report ) // Create a rpt file
227  {
228  reportName = m_RptFilenameCtrl->GetValue();
229 
230  if( reportName.IsEmpty() )
231  {
232  wxCommandEvent dummy;
234  }
235 
236  if( !reportName.IsEmpty() )
237  reportName = makeValidFileNameReport();
238  }
239 
240  SetDrcParmeters();
241  m_tester->SetSettings( true, // Pad to pad DRC test enabled
242  true, // unconnected pads DRC test enabled
243  true, // DRC test for zones enabled
244  true, // DRC test for keepout areas enabled
245  m_cbRefillZones->GetValue(),
246  m_cbReportAllTrackErrors->GetValue(),
247  reportName, make_report );
248 
249  DelDRCMarkers();
250 
251  wxBeginBusyCursor();
252  wxWindowDisabler disabler;
253 
254  // run all the tests, with no UI at this time.
255  m_Messages->Clear();
256  wxSafeYield(); // Allows time slice to refresh the Messages
257  m_brdEditor->GetBoard()->m_Status_Pcb = 0; // Force full connectivity and ratsnest calculations
259  m_Notebook->ChangeSelection( 0 ); // display the "Problems/Markers" tab
260 
261  // Generate the report
262  if( !reportName.IsEmpty() )
263  {
264  if( writeReport( reportName ) )
265  {
266  msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) );
267  wxMessageDialog popupWindow( this, msg, _( "Disk File Report Completed" ) );
268  popupWindow.ShowModal();
269  }
270  else
271  {
272  msg.Printf( _( "Unable to create report file \"%s\"" ), GetChars( reportName ) );
273  DisplayError( this, msg );
274  }
275  }
276 
277  wxEndBusyCursor();
278 
279  RedrawDrawPanel();
280 }
wxCheckBox * m_cbRefillZones
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl
const wxString makeValidFileNameReport()
filenames can be entered by name.
Definition: dialog_drc.cpp:596
BOARD * GetBoard() const
void OnButtonBrowseRptFileClick(wxCommandEvent &event) override
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
Definition: dialog_drc.cpp:356
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:618
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:508
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...
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:240
void DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_DRC_CONTROL_BASE.

Definition at line 549 of file dialog_drc.cpp.

References PCB_BASE_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().

550 {
551  int selection = event.GetSelection();
552 
553  if( selection != wxNOT_FOUND )
554  {
555  // until a MARKER is selected, this button is not enabled.
556  m_DeleteCurrentMarkerButton->Enable( true );
557 
558  // Find the selected DRC_ITEM in the listbox, position cursor there.
559  const DRC_ITEM* item = m_UnconnectedListBox->GetItem( selection );
560 
561  if( item )
562  {
563  // When selecting a item, center it on GAL and just move the graphic
564  // cursor in legacy mode gives the best result
565  bool center = m_brdEditor->IsGalCanvasActive() ? true : false;
566  m_brdEditor->FocusOnLocation( item->GetPointA(), false, center );
567  RedrawDrawPanel();
568  }
569  }
570 
571  event.Skip();
572 }
Class DRC_ITEM is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item. ...
Definition: drc_item.h:48
void FocusOnLocation(const wxPoint &aPos, bool aWarpMouseCursor=true, bool aCenterView=false)
Useful to focus on a particular location, in find functions Move the graphic cursor (crosshair cursor...
wxButton * m_DeleteCurrentMarkerButton
DRCLISTBOX * m_UnconnectedListBox
const DRC_ITEM * GetItem(int aIndex)
Function GetItem returns a requested DRC_ITEM* or NULL.
bool IsGalCanvasActive() const
Function IsGalCanvasActive is used to check which canvas (GAL-based or standard) is currently in use...
Definition: draw_frame.h:901
const wxPoint & GetPointA() const
Definition: drc_item.h:214
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
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::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::Files_io_from_id(), 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(), DIALOG_BOM::getPluginFileName(), 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(), KIWAY_HOLDER::Kiway(), 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(), 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(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), 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::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(), 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(), 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(), LAUNCHER_PANEL::~LAUNCHER_PANEL(), 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
void DIALOG_DRC_CONTROL::RedrawDrawPanel ( )
private

Definition at line 575 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().

576 {
577  BOARD_THAWER thawer( m_brdEditor );
578 
580 }
virtual EDA_DRAW_PANEL * GetCanvas() const
Definition: draw_frame.h:388
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
void DIALOG_DRC_CONTROL::SetDrcParmeters ( )
private

Definition at line 196 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().

197 {
201 
203 }
BOARD * GetBoard() const
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:548
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
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
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 86 of file dialog_shim.h.

References DIALOG_SHIM::EndQuasiModal(), DIALOG_SHIM::m_initialFocusTarget, and DIALOG_SHIM::ShowQuasiModal().

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

87  {
88  m_initialFocusTarget = aWindow;
89  }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:150
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 DIALOG_SHIM::DIALOG_SHIM(), InvokePcbLibTableEditor(), KIWAY_HOLDER::Kiway(), 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
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 206 of file dialog_drc.cpp.

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

Referenced by DRC::ShowDRCDialog().

207 {
208  m_RptFilenameCtrl->SetValue( aFileName );
209  m_CreateRptCtrl->SetValue( aEnable );
210 }
wxCheckBox * m_CreateRptCtrl
wxTextCtrl * m_RptFilenameCtrl
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 134 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(), DIALOG_SHIM::GetUserUnits(), HTML_MESSAGE_BOX::HTML_MESSAGE_BOX(), and HTML_MESSAGE_BOX::SetDialogSizeInDU().

135 {
136  wxSize sz( x, y );
137  SetSize( ConvertDialogToPixels( sz ) );
138 }
bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 162 of file dialog_shim.cpp.

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

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

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

Definition at line 327 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(), PCB_BASE_FRAME::SelectFootprintFromLibTree(), and DIALOG_SHIM::SetInitialFocus().

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

Definition at line 692 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().

693 {
694  int marker_count = m_ClearanceListBox->GetItemCount();
695  int unconnected_count = m_UnconnectedListBox->GetItemCount();
696 
697  m_Notebook->SetPageText( 0, wxString::Format( m_markersTitleTemplate, marker_count ) );
698  m_Notebook->SetPageText( 1, wxString::Format( m_unconnectedTitleTemplate, unconnected_count ) );
699 
700 }
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
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 148 of file dialog_shim.cpp.

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

149 {
150  wxSize sz( 0, y );
151  return ConvertDialogToPixels( sz ).y;
152 }
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 618 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().

619 {
620  FILE* fp = wxFopen( aFullFileName, wxT( "w" ) );
621 
622  if( fp == NULL )
623  return false;
624 
625  int count;
626  EDA_UNITS_T units = GetUserUnits();
627 
628  fprintf( fp, "** Drc report for %s **\n",
630 
631  wxDateTime now = wxDateTime::Now();
632 
633  fprintf( fp, "** Created on %s **\n", TO_UTF8( now.Format( wxT( "%F %T" ) ) ) );
634 
635  count = m_ClearanceListBox->GetItemCount();
636 
637  fprintf( fp, "\n** Found %d DRC errors **\n", count );
638 
639  for( int i = 0; i<count; ++i )
640  fprintf( fp, "%s", TO_UTF8( m_ClearanceListBox->GetItem( i )->ShowReport( units ) ) );
641 
642  count = m_UnconnectedListBox->GetItemCount();
643 
644  fprintf( fp, "\n** Found %d unconnected pads **\n", count );
645 
646  for( int i = 0; i<count; ++i )
647  fprintf( fp, "%s", TO_UTF8( m_UnconnectedListBox->GetItem( i )->ShowReport( units ) ) );
648 
649  fprintf( fp, "\n** End of Report **\n" );
650 
651  fclose( fp );
652 
653  return true;
654 }
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:201
BOARD * GetBoard() const
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
const wxString & GetFileName() const
Definition: class_board.h:237
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
PCB_EDIT_FRAME * m_brdEditor
Definition: dialog_drc.h:150
EDA_UNITS_T
Definition: common.h:159
EDA_UNITS_T GetUserUnits() const override
Definition: dialog_shim.h:103

Member Data Documentation

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

wxBitmapButton* DIALOG_DRC_CONTROL_BASE::m_BrowseButton
protectedinherited
wxCheckBox* DIALOG_DRC_CONTROL_BASE::m_cbRefillZones
protectedinherited
wxCheckBox* DIALOG_DRC_CONTROL_BASE::m_cbReportAllTrackErrors
protectedinherited
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().

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

BOARD* DIALOG_DRC_CONTROL::m_currentBoard
private

Definition at line 148 of file dialog_drc.h.

Referenced by DIALOG_DRC_CONTROL(), and OnActivateDlg().

wxButton* DIALOG_DRC_CONTROL_BASE::m_DeleteAllMarkersButton
protectedinherited
bool DIALOG_SHIM::m_firstPaintEvent
protectedinherited

Definition at line 149 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint().

wxWindow* DIALOG_SHIM::m_initialFocusTarget
protectedinherited

Definition at line 150 of file dialog_shim.h.

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

wxString DIALOG_DRC_CONTROL::m_markersTitleTemplate
private

Definition at line 153 of file dialog_drc.h.

Referenced by InitValues(), and UpdateDisplayedCounts().

wxTextCtrl* DIALOG_DRC_CONTROL_BASE::m_Messages
protectedinherited
wxStaticText* DIALOG_DRC_CONTROL_BASE::m_messagesLabel
protectedinherited
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().

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

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

WX_EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 153 of file dialog_shim.h.

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

WDO_ENABLE_DISABLE* DIALOG_SHIM::m_qmodal_parent_disabler
protectedinherited
bool DIALOG_SHIM::m_qmodal_showing
protectedinherited

Definition at line 154 of file dialog_shim.h.

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

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

wxButton* DIALOG_DRC_CONTROL_BASE::m_sdbSizer1Apply
protectedinherited
wxButton* DIALOG_DRC_CONTROL_BASE::m_sdbSizer1Cancel
protectedinherited
wxButton* DIALOG_DRC_CONTROL_BASE::m_sdbSizer1OK
protectedinherited
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().

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

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

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

wxBoxSizer* DIALOG_DRC_CONTROL_BASE::m_sizerButtons
protectedinherited
DRC* DIALOG_DRC_CONTROL::m_tester
private
UNIT_BINDER DIALOG_DRC_CONTROL::m_trackMinWidth
private

Definition at line 156 of file dialog_drc.h.

Referenced by DisplayDRCValues(), and SetDrcParmeters().

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

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

wxString DIALOG_DRC_CONTROL::m_unconnectedTitleTemplate
private

Definition at line 154 of file dialog_drc.h.

Referenced by InitValues(), and UpdateDisplayedCounts().

UNIT_BINDER DIALOG_DRC_CONTROL::m_uviaMinSize
private

Definition at line 158 of file dialog_drc.h.

Referenced by DisplayDRCValues(), and SetDrcParmeters().

UNIT_BINDER DIALOG_DRC_CONTROL::m_viaMinSize
private

Definition at line 157 of file dialog_drc.h.

Referenced by DisplayDRCValues(), and SetDrcParmeters().

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

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: