Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
c4f16f80
Commit
c4f16f80
authored
Nov 05, 2009
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
double click on drc problem should preserve window size and pos also
parent
077fff6f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
42 deletions
+74
-42
dialog_drc.cpp
pcbnew/dialog_drc.cpp
+37
-14
dialog_drc.h
pcbnew/dialog_drc.h
+8
-0
dialog_drc_base.cpp
pcbnew/dialog_drc_base.cpp
+14
-13
dialog_drc_base.fbp
pcbnew/dialog_drc_base.fbp
+15
-15
No files found.
pcbnew/dialog_drc.cpp
View file @
c4f16f80
...
...
@@ -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
(
s
how
)
{
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
();
...
...
pcbnew/dialog_drc.h
View file @
c4f16f80
...
...
@@ -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
...
...
pcbnew/dialog_drc_base.cpp
View file @
c4f16f80
...
...
@@ -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 W
idth"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_TrackMinWidthTitle
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"
Min track w
idth"
),
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 S
ize"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_ViaMinTitle
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"
Min via s
ize"
),
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
,
_
(
"Mi
croVia Min S
ize"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_MicroViaMinTitle
=
new
wxStaticText
(
this
,
wxID_ANY
,
_
(
"Mi
n uVia s
ize"
),
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
(
25
0
,
-
1
)
);
m_RptFilenameCtrl
->
SetMinSize
(
wxSize
(
18
0
,
-
1
)
);
ReportFileSizer
->
Add
(
m_RptFilenameCtrl
,
1
,
wxALL
|
wxEXPAND
|
wxALIGN_CENTER_VERTICAL
,
5
);
m_BrowseButton
=
new
wxButton
(
this
,
ID_BUTTON_BROWSE_RPT_FILE
,
_
(
"..."
),
wxDefaultPosition
,
wx
DefaultSize
,
0
);
ReportFileSizer
->
Add
(
m_BrowseButton
,
0
,
wxAL
L
|
wxALIGN_CENTER_VERTICAL
,
5
);
m_BrowseButton
=
new
wxButton
(
this
,
ID_BUTTON_BROWSE_RPT_FILE
,
_
(
"..."
),
wxDefaultPosition
,
wx
Size
(
50
,
-
1
)
,
0
);
ReportFileSizer
->
Add
(
m_BrowseButton
,
0
,
wxAL
IGN_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
,
wx
TOP
|
wxRIGHT
|
wxLEFT
|
wxALIGN_CENTER_HORIZONTA
L
|
wxEXPAND
,
5
);
bSizer11
->
Add
(
m_buttonRunDRC
,
0
,
wx
ALIGN_CENTER_HORIZONTAL
|
wxAL
L
|
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
|
wx
EXPAND
|
wxTOP
|
wxRIGHT
|
wxLEFT
,
5
);
bSizer11
->
Add
(
m_buttonListUnconnected
,
0
,
wxALIGN_CENTER_HORIZONTAL
|
wx
ALL
|
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
|
wx
EXPAND
|
wxTOP
|
wxRIGHT
|
wxLEFT
,
5
);
bSizer11
->
Add
(
m_DeleteAllButton
,
0
,
wxALIGN_CENTER_HORIZONTAL
|
wx
ALL
|
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
,
wx
EXPAND
|
wxTOP
|
wxBOTTOM
,
5
);
m_MainSizer
->
Add
(
m_CommandSizer
,
0
,
wx
ALL
|
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
,
wxAL
IGN_RIGHT
|
wxALL
,
5
);
m_MainSizer
->
Add
(
m_sdbSizer1
,
0
,
wxAL
L
|
wxEXPAND
,
5
);
this
->
SetSizer
(
m_MainSizer
);
this
->
Layout
();
...
...
pcbnew/dialog_drc_base.fbp
View file @
c4f16f80
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment