Commit c4f16f80 authored by dickelbeck's avatar dickelbeck

double click on drc problem should preserve window size and pos also

parent 077fff6f
......@@ -34,15 +34,46 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, WinEDA_PcbFrame* parent )
{
GetSizer()->SetSizeHints( this );
}
}
bool DIALOG_DRC_CONTROL::Show( bool show )
{
bool ret;
D(printf("%s %d\n", __func__, show );)
if( s_LastPos.x != -1 )
if( show )
{
SetSize( s_LastSize );
SetPosition( s_LastPos );
ret = DIALOG_DRC_CONTROL_BASE::Show( show );
if( s_LastPos.x != -1 )
{
D(printf("setting window pos to (%d,%d)\n", s_LastPos.x, s_LastPos.y );)
//SetPosition( s_LastPos );
SetSize( s_LastPos.x, s_LastPos.y, s_LastSize.x, s_LastSize.y, 0 );
}
else
{
D(printf("not setting window pos (%d,%d)\n", s_LastPos.x, s_LastPos.y );)
}
}
else
{
// Save the dialog's position before hiding
s_LastPos = GetPosition();
s_LastSize = GetSize();
D(printf("saving window pos as (%d,%d)\n", s_LastPos.x, s_LastPos.y );)
ret = DIALOG_DRC_CONTROL_BASE::Show( show );
}
return ret;
}
void DIALOG_DRC_CONTROL::InitValues()
{
// Connect events and objects
......@@ -268,10 +299,6 @@ void DIALOG_DRC_CONTROL::OnOkClick( wxCommandEvent& event )
SetReturnCode( wxID_OK );
SetDrcParmeters( );
// Save the dialog's position before finishing
s_LastPos = GetPosition();
s_LastSize = GetSize();
m_tester->DestroyDialog( wxID_OK );
}
......@@ -284,10 +311,6 @@ void DIALOG_DRC_CONTROL::OnCancelClick( wxCommandEvent& event )
{
SetReturnCode( wxID_CANCEL );
// Save the dialog's position before finishing
s_LastPos = GetPosition();
s_LastSize = GetSize();
m_tester->DestroyDialog( wxID_CANCEL );
}
......@@ -340,7 +363,7 @@ void DIALOG_DRC_CONTROL::OnLeftDClickClearance( wxMouseEvent& event )
// turn control over to m_Parent, hide this DIALOG_DRC_CONTROL window,
// no destruction so we can preserve listbox cursor
Hide();
Show( false );
event.StopPropagation(); // still get the popup window.
}
......@@ -387,7 +410,7 @@ void DIALOG_DRC_CONTROL::OnPopupMenu( wxCommandEvent& event )
if( item )
{
m_Parent->CursorGoto( pos );
Hide();
Show( false );
}
}
......@@ -478,7 +501,7 @@ void DIALOG_DRC_CONTROL::OnLeftDClickUnconnected( wxMouseEvent& event )
{
m_Parent->CursorGoto( item->GetPointA() );
Hide();
Show( false );
// intermittently, still get the popup window, even with this.
event.StopPropagation();
......
......@@ -42,6 +42,14 @@ public:
DIALOG_DRC_CONTROL( DRC* aTester, WinEDA_PcbFrame* parent );
~DIALOG_DRC_CONTROL(){};
/**
* Function Show
* overloads the wxDialog::Show() function so it can position the
* dialog at its remembered size and position.
*/
bool Show( bool show );
private:
static wxSize s_LastSize; ///< last position and size
......
......@@ -22,7 +22,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_CommandSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbSizerOptions;
sbSizerOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxHORIZONTAL );
sbSizerOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxHORIZONTAL );
wxBoxSizer* bSizer7;
bSizer7 = new wxBoxSizer( wxVERTICAL );
......@@ -42,7 +42,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
fgMinValuesSizer->Add( m_SetClearance, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
m_TrackMinWidthTitle = new wxStaticText( this, wxID_ANY, _("Track Min Width"), wxDefaultPosition, wxDefaultSize, 0 );
m_TrackMinWidthTitle = new wxStaticText( this, wxID_ANY, _("Min track width"), wxDefaultPosition, wxDefaultSize, 0 );
m_TrackMinWidthTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_TrackMinWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
......@@ -51,7 +51,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
fgMinValuesSizer->Add( m_SetTrackMinWidthCtrl, 0, wxALL|wxEXPAND, 5 );
m_ViaMinTitle = new wxStaticText( this, wxID_ANY, _("Via Min Size"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinTitle = new wxStaticText( this, wxID_ANY, _("Min via size"), wxDefaultPosition, wxDefaultSize, 0 );
m_ViaMinTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_ViaMinTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
......@@ -60,9 +60,9 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
fgMinValuesSizer->Add( m_SetViaMinSizeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
m_MicroViaMinTitle = new wxStaticText( this, wxID_ANY, _("MicroVia Min Size"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinTitle = new wxStaticText( this, wxID_ANY, _("Min uVia size"), wxDefaultPosition, wxDefaultSize, 0 );
m_MicroViaMinTitle->Wrap( -1 );
fgMinValuesSizer->Add( m_MicroViaMinTitle, 0, wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 );
fgMinValuesSizer->Add( m_MicroViaMinTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
m_SetMicroViakMinSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetMicroViakMinSizeCtrl->SetToolTip( _("In the clearance units, enter the clearance distance") );
......@@ -82,12 +82,12 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_RptFilenameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_RptFilenameCtrl->SetToolTip( _("Enter the report filename") );
m_RptFilenameCtrl->SetMinSize( wxSize( 250,-1 ) );
m_RptFilenameCtrl->SetMinSize( wxSize( 180,-1 ) );
ReportFileSizer->Add( m_RptFilenameCtrl, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_BrowseButton = new wxButton( this, ID_BUTTON_BROWSE_RPT_FILE, _("..."), wxDefaultPosition, wxDefaultSize, 0 );
ReportFileSizer->Add( m_BrowseButton, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_BrowseButton = new wxButton( this, ID_BUTTON_BROWSE_RPT_FILE, _("..."), wxDefaultPosition, wxSize( 50,-1 ), 0 );
ReportFileSizer->Add( m_BrowseButton, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
bSizer7->Add( ReportFileSizer, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
......@@ -114,17 +114,17 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_buttonRunDRC->SetDefault();
m_buttonRunDRC->SetToolTip( _("Start the Design Rule Checker") );
bSizer11->Add( m_buttonRunDRC, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bSizer11->Add( m_buttonRunDRC, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 );
m_buttonListUnconnected = new wxButton( this, ID_LIST_UNCONNECTED, _("List Unconnected"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonListUnconnected->SetToolTip( _("List unconnected pads or tracks") );
bSizer11->Add( m_buttonListUnconnected, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bSizer11->Add( m_buttonListUnconnected, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 );
m_DeleteAllButton = new wxButton( this, ID_DELETE_ALL, _("Delete All Markers"), wxDefaultPosition, wxDefaultSize, 0 );
m_DeleteAllButton->SetToolTip( _("Delete every marker") );
bSizer11->Add( m_DeleteAllButton, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bSizer11->Add( m_DeleteAllButton, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 );
m_DeleteCurrentMarkerButton = new wxButton( this, wxID_ANY, _("Delete Current Marker"), wxDefaultPosition, wxDefaultSize, 0 );
m_DeleteCurrentMarkerButton->SetToolTip( _("Delete the marker selected in the listBox below") );
......@@ -133,7 +133,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_CommandSizer->Add( bSizer11, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_MainSizer->Add( m_CommandSizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_MainSizer->Add( m_CommandSizer, 0, wxALL|wxEXPAND, 5 );
m_staticTextErrMsg = new wxStaticText( this, wxID_ANY, _("Error Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextErrMsg->Wrap( -1 );
......@@ -146,6 +146,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_ClearanceListBox = new DRCLISTBOX( m_panelClearanceListBox, ID_CLEARANCE_LIST, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_ClearanceListBox->SetToolTip( _("MARKERs, double click any to go there in PCB, right click for popup menu") );
m_ClearanceListBox->SetMinSize( wxSize( -1,80 ) );
bSizeClearanceBox->Add( m_ClearanceListBox, 1, wxALL|wxEXPAND, 5 );
......@@ -175,7 +176,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
m_MainSizer->Add( m_sdbSizer1, 0, wxALIGN_RIGHT|wxALL, 5 );
m_MainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( m_MainSizer );
this->Layout();
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment