Bug fix for double-click in DRC dialog.
Also better clean-up of highlighting in board editor window.
This commit is contained in:
parent
cc588471ca
commit
cdad62022b
|
@ -67,6 +67,8 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFra
|
|||
m_footprintsTreeModel = new DRC_TREE_MODEL( m_footprintsDataView );
|
||||
m_footprintsDataView->AssociateModel( m_footprintsTreeModel );
|
||||
|
||||
m_Notebook->SetSelection( 0 );
|
||||
|
||||
// We use a sdbSizer here to get the order right, which is platform-dependent
|
||||
m_sdbSizer1OK->SetLabel( _( "Run DRC" ) );
|
||||
m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
|
||||
|
@ -82,11 +84,12 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFra
|
|||
|
||||
DIALOG_DRC_CONTROL::~DIALOG_DRC_CONTROL()
|
||||
{
|
||||
auto cfg = m_brdEditor->GetSettings();
|
||||
m_brdEditor->FocusOnItem( nullptr );
|
||||
|
||||
cfg->m_DrcDialog.refill_zones = m_cbRefillZones->GetValue();
|
||||
cfg->m_DrcDialog.test_track_to_zone = m_cbReportAllTrackErrors->GetValue();
|
||||
cfg->m_DrcDialog.test_footprints = m_cbTestFootprints->GetValue();
|
||||
PCBNEW_SETTINGS* settings = m_brdEditor->GetSettings();
|
||||
settings->m_DrcDialog.refill_zones = m_cbRefillZones->GetValue();
|
||||
settings->m_DrcDialog.test_track_to_zone = m_cbReportAllTrackErrors->GetValue();
|
||||
settings->m_DrcDialog.test_footprints = m_cbTestFootprints->GetValue();
|
||||
|
||||
m_markerTreeModel->DecRef();
|
||||
}
|
||||
|
@ -222,7 +225,8 @@ void DIALOG_DRC_CONTROL::OnRunDRCClick( wxCommandEvent& event )
|
|||
|
||||
wxEndBusyCursor();
|
||||
|
||||
RedrawDrawPanel();
|
||||
RefreshBoardEditor();
|
||||
SetFocus();
|
||||
}
|
||||
|
||||
|
||||
|
@ -256,43 +260,17 @@ void DIALOG_DRC_CONTROL::OnDRCItemSelected( wxDataViewEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_DRC_CONTROL::OnDClick( wxDataViewCtrl* ctrl, wxMouseEvent& event )
|
||||
void DIALOG_DRC_CONTROL::OnDRCItemDClick( wxDataViewEvent& event )
|
||||
{
|
||||
event.Skip();
|
||||
|
||||
if( ctrl->GetCurrentItem().IsOk() )
|
||||
if( event.GetItem().IsOk() )
|
||||
{
|
||||
// turn control over to m_brdEditor, hide this DIALOG_DRC_CONTROL window,
|
||||
// no destruction so we can preserve listbox cursor
|
||||
if( !IsModal() )
|
||||
Show( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_DRC_CONTROL::OnMarkerDClick( wxMouseEvent& event )
|
||||
{
|
||||
OnDClick( m_markerDataView, event );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_DRC_CONTROL::OnLeftDClickUnconnected( wxMouseEvent& event )
|
||||
{
|
||||
OnDClick( m_unconnectedDataView, event );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_DRC_CONTROL::OnLeftDClickFootprints( wxMouseEvent& event )
|
||||
{
|
||||
OnDClick( m_footprintsDataView, event );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_DRC_CONTROL::OnDeleteAllClick( wxCommandEvent& event )
|
||||
{
|
||||
DelDRCMarkers();
|
||||
RedrawDrawPanel();
|
||||
UpdateDisplayedCounts();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
|
@ -315,6 +293,8 @@ void DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick( wxCommandEvent& )
|
|||
|
||||
void DIALOG_DRC_CONTROL::OnCancelClick( wxCommandEvent& event )
|
||||
{
|
||||
m_brdEditor->FocusOnItem( nullptr );
|
||||
|
||||
SetReturnCode( wxID_CANCEL );
|
||||
SetDRCParameters();
|
||||
|
||||
|
@ -349,7 +329,7 @@ void DIALOG_DRC_CONTROL::OnChangingNotebookPage( wxNotebookEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_DRC_CONTROL::RedrawDrawPanel()
|
||||
void DIALOG_DRC_CONTROL::RefreshBoardEditor()
|
||||
{
|
||||
WINDOW_THAWER thawer( m_brdEditor );
|
||||
|
||||
|
@ -445,7 +425,7 @@ void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
|
|||
m_markerTreeModel->DeleteCurrentItem();
|
||||
|
||||
// redraw the pcb
|
||||
RedrawDrawPanel();
|
||||
RefreshBoardEditor();
|
||||
}
|
||||
else if( m_Notebook->GetSelection() == 1 )
|
||||
{
|
||||
|
@ -456,6 +436,14 @@ void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
void DIALOG_DRC_CONTROL::OnDeleteAllClick( wxCommandEvent& event )
|
||||
{
|
||||
DelDRCMarkers();
|
||||
RefreshBoardEditor();
|
||||
UpdateDisplayedCounts();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_DRC_CONTROL::UpdateDisplayedCounts()
|
||||
{
|
||||
wxString msg;
|
||||
|
|
|
@ -105,11 +105,7 @@ private:
|
|||
void OnDeleteOneClick( wxCommandEvent& event ) override;
|
||||
|
||||
void OnDRCItemSelected( wxDataViewEvent& event ) override;
|
||||
|
||||
void OnDClick( wxDataViewCtrl* ctrl, wxMouseEvent& event );
|
||||
void OnMarkerDClick( wxMouseEvent& event ) override;
|
||||
void OnLeftDClickUnconnected( wxMouseEvent& event ) override;
|
||||
void OnLeftDClickFootprints( wxMouseEvent& event ) override;
|
||||
void OnDRCItemDClick( wxDataViewEvent& event ) override;
|
||||
|
||||
void OnCancelClick( wxCommandEvent& event ) override;
|
||||
|
||||
|
@ -120,7 +116,7 @@ private:
|
|||
void OnChangingNotebookPage( wxNotebookEvent& event ) override;
|
||||
|
||||
void DelDRCMarkers();
|
||||
void RedrawDrawPanel();
|
||||
void RefreshBoardEditor();
|
||||
|
||||
BOARD* m_currentBoard; // the board currently on test
|
||||
DRC* m_tester;
|
||||
|
|
|
@ -160,7 +160,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
|
|||
wxBoxSizer* bSizerUnconnectedBox;
|
||||
bSizerUnconnectedBox = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_unconnectedDataView = new wxDataViewCtrl( m_panelUnconnectedItems, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_unconnectedDataView = new wxDataViewCtrl( m_panelUnconnectedItems, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_NO_HEADER );
|
||||
bSizerUnconnectedBox->Add( m_unconnectedDataView, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
@ -172,7 +172,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
|
|||
wxBoxSizer* bSizerFootprintsBox;
|
||||
bSizerFootprintsBox = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_footprintsDataView = new wxDataViewCtrl( m_panelFootprintWarnings, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_footprintsDataView = new wxDataViewCtrl( m_panelFootprintWarnings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_NO_HEADER );
|
||||
bSizerFootprintsBox->Add( m_footprintsDataView, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
|
@ -214,12 +214,12 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
|
|||
m_RptFilenameCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnReportFilenameEdited ), NULL, this );
|
||||
m_BrowseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnButtonBrowseRptFileClick ), NULL, this );
|
||||
m_Notebook->Connect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_DRC_CONTROL_BASE::OnChangingNotebookPage ), NULL, this );
|
||||
m_markerDataView->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemDClick ), NULL, this );
|
||||
m_markerDataView->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemSelected ), NULL, this );
|
||||
m_markerDataView->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnMarkerDClick ), NULL, this );
|
||||
m_unconnectedDataView->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemDClick ), NULL, this );
|
||||
m_unconnectedDataView->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemSelected ), NULL, this );
|
||||
m_unconnectedDataView->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnLeftDClickUnconnected ), NULL, this );
|
||||
m_footprintsDataView->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemDClick ), NULL, this );
|
||||
m_footprintsDataView->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemSelected ), NULL, this );
|
||||
m_footprintsDataView->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnLeftDClickFootprints ), NULL, this );
|
||||
m_DeleteCurrentMarkerButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnDeleteOneClick ), NULL, this );
|
||||
m_DeleteAllMarkersButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnDeleteAllClick ), NULL, this );
|
||||
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnCancelClick ), NULL, this );
|
||||
|
@ -234,12 +234,12 @@ DIALOG_DRC_CONTROL_BASE::~DIALOG_DRC_CONTROL_BASE()
|
|||
m_RptFilenameCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnReportFilenameEdited ), NULL, this );
|
||||
m_BrowseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnButtonBrowseRptFileClick ), NULL, this );
|
||||
m_Notebook->Disconnect( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler( DIALOG_DRC_CONTROL_BASE::OnChangingNotebookPage ), NULL, this );
|
||||
m_markerDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemDClick ), NULL, this );
|
||||
m_markerDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemSelected ), NULL, this );
|
||||
m_markerDataView->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnMarkerDClick ), NULL, this );
|
||||
m_unconnectedDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemDClick ), NULL, this );
|
||||
m_unconnectedDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemSelected ), NULL, this );
|
||||
m_unconnectedDataView->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnLeftDClickUnconnected ), NULL, this );
|
||||
m_footprintsDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemDClick ), NULL, this );
|
||||
m_footprintsDataView->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_DRC_CONTROL_BASE::OnDRCItemSelected ), NULL, this );
|
||||
m_footprintsDataView->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnLeftDClickFootprints ), NULL, this );
|
||||
m_DeleteCurrentMarkerButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnDeleteOneClick ), NULL, this );
|
||||
m_DeleteAllMarkersButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnDeleteAllClick ), NULL, this );
|
||||
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnCancelClick ), NULL, this );
|
||||
|
|
|
@ -1367,8 +1367,8 @@
|
|||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnDataViewCtrlItemActivated">OnDRCItemDClick</event>
|
||||
<event name="OnDataViewCtrlSelectionChanged">OnDRCItemSelected</event>
|
||||
<event name="OnLeftDClick">OnMarkerDClick</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
@ -1453,14 +1453,14 @@
|
|||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="style">wxDV_NO_HEADER</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnDataViewCtrlItemActivated">OnDRCItemDClick</event>
|
||||
<event name="OnDataViewCtrlSelectionChanged">OnDRCItemSelected</event>
|
||||
<event name="OnLeftDClick">OnLeftDClickUnconnected</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
@ -1545,14 +1545,14 @@
|
|||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="style">wxDV_NO_HEADER</property>
|
||||
<property name="subclass">; ; forward_declare</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnDataViewCtrlItemActivated">OnDRCItemDClick</event>
|
||||
<event name="OnDataViewCtrlSelectionChanged">OnDRCItemSelected</event>
|
||||
<event name="OnLeftDClick">OnLeftDClickFootprints</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
|
|
@ -79,10 +79,8 @@ class DIALOG_DRC_CONTROL_BASE : public DIALOG_SHIM
|
|||
virtual void OnReportFilenameEdited( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnButtonBrowseRptFileClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnChangingNotebookPage( wxNotebookEvent& event ) { event.Skip(); }
|
||||
virtual void OnDRCItemDClick( wxDataViewEvent& event ) { event.Skip(); }
|
||||
virtual void OnDRCItemSelected( wxDataViewEvent& event ) { event.Skip(); }
|
||||
virtual void OnMarkerDClick( wxMouseEvent& event ) { event.Skip(); }
|
||||
virtual void OnLeftDClickUnconnected( wxMouseEvent& event ) { event.Skip(); }
|
||||
virtual void OnLeftDClickFootprints( wxMouseEvent& event ) { event.Skip(); }
|
||||
virtual void OnDeleteOneClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnDeleteAllClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
|
|
@ -213,6 +213,8 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
// Single click? Select single object
|
||||
if( evt->IsClick( BUT_LEFT ) )
|
||||
{
|
||||
m_frame->FocusOnItem( nullptr );
|
||||
|
||||
selectPoint( evt->Position() );
|
||||
}
|
||||
|
||||
|
@ -236,6 +238,8 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
// double click? Display the properties window
|
||||
else if( evt->IsDblClick( BUT_LEFT ) )
|
||||
{
|
||||
m_frame->FocusOnItem( nullptr );
|
||||
|
||||
if( m_selection.Empty() )
|
||||
selectPoint( evt->Position() );
|
||||
|
||||
|
@ -245,6 +249,8 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
// drag with LMB? Select multiple objects (or at least draw a selection box) or drag them
|
||||
else if( evt->IsDrag( BUT_LEFT ) )
|
||||
{
|
||||
m_frame->FocusOnItem( nullptr );
|
||||
|
||||
if( m_additive || m_subtractive || m_exclusive_or || dragAlwaysSelects )
|
||||
{
|
||||
selectMultiple();
|
||||
|
@ -272,6 +278,8 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
|
||||
else if( evt->IsCancel() )
|
||||
{
|
||||
m_frame->FocusOnItem( nullptr );
|
||||
|
||||
ClearSelection();
|
||||
|
||||
if( evt->FirstResponder() == this )
|
||||
|
|
Loading…
Reference in New Issue