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
36c316e7
Commit
36c316e7
authored
Dec 04, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DRC dialog work
parent
15b70020
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
112 additions
and
40 deletions
+112
-40
change_log.txt
change_log.txt
+14
-2
wxstruct.h
include/wxstruct.h
+10
-0
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+26
-0
dialog_drc.cpp
pcbnew/dialog_drc.cpp
+55
-20
drc_stuff.h
pcbnew/drc_stuff.h
+3
-0
find.cpp
pcbnew/find.cpp
+4
-18
No files found.
change_log.txt
View file @
36c316e7
...
@@ -4,6 +4,19 @@ Started 2007-June-11
...
@@ -4,6 +4,19 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.
2007-Dec-4 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
* drc.cpp and dialog_drc.cpp intermediate update.
Added double click support on a MARKER in the listbox. On Linux, it pops up the
menu from PcbGeneralLocateAndDisplay() for some reason after repositioning the
cursor. That is not intended, but after several attempts to work around
it, I realized it is not so bad to have this happen.
A few more hours to go for the unconnected tab.
* Added WinEDA_BasePcbFrame::CursorGoto( const wxPoint& ) by factoring it
out of pcbnew/find.cpp
2007-Dec-02 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2007-Dec-02 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+eeschema:
+eeschema:
...
@@ -14,8 +27,7 @@ email address.
...
@@ -14,8 +27,7 @@ email address.
2007-Dec-2 UPDATE Dick Hollenbeck <dick@softplc.com>
2007-Dec-2 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+pcbnew
+pcbnew
drc.cpp and dialog_drc.cpp intermediate update. More hours to go
drc.cpp and dialog_drc.cpp intermediate update.
before completion.
2007-Nov-30 UPDATE Dick Hollenbeck <dick@softplc.com>
2007-Nov-30 UPDATE Dick Hollenbeck <dick@softplc.com>
...
...
include/wxstruct.h
View file @
36c316e7
...
@@ -440,6 +440,16 @@ public:
...
@@ -440,6 +440,16 @@ public:
*/
*/
GENERAL_COLLECTORS_GUIDE
GetCollectorsGuide
();
GENERAL_COLLECTORS_GUIDE
GetCollectorsGuide
();
/**
* Function CursorGoto
* positions the cursor at a given coordinate and reframes the drawing if the
* requested point is out of view.
* @param aPos The point to go to.
*/
void
CursorGoto
(
const
wxPoint
&
aPos
);
/* Place un repere sur l'ecran au point de coordonnees PCB pos */
/* Place un repere sur l'ecran au point de coordonnees PCB pos */
void
place_marqueur
(
wxDC
*
DC
,
const
wxPoint
&
pos
,
char
*
pt_bitmap
,
void
place_marqueur
(
wxDC
*
DC
,
const
wxPoint
&
pos
,
char
*
pt_bitmap
,
int
DrawMode
,
int
color
,
int
type
);
int
DrawMode
,
int
color
,
int
type
);
...
...
pcbnew/basepcbframe.cpp
View file @
36c316e7
...
@@ -96,6 +96,32 @@ int WinEDA_BasePcbFrame::BestZoom( void )
...
@@ -96,6 +96,32 @@ int WinEDA_BasePcbFrame::BestZoom( void )
}
}
void
WinEDA_BasePcbFrame
::
CursorGoto
(
const
wxPoint
&
aPos
)
{
// factored out of pcbnew/find.cpp
PCB_SCREEN
*
screen
=
GetScreen
();
wxClientDC
dc
(
DrawPanel
);
/* Il y a peut-etre necessite de recadrer le dessin: */
if
(
!
DrawPanel
->
IsPointOnDisplay
(
aPos
)
)
{
screen
->
m_Curseur
=
aPos
;
Recadre_Trace
(
TRUE
);
}
else
{
// Positionnement du curseur sur l'item
DrawPanel
->
CursorOff
(
&
dc
);
screen
->
m_Curseur
=
aPos
;
GRMouseWarp
(
DrawPanel
,
screen
->
m_Curseur
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
CursorOn
(
&
dc
);
}
}
/*************************************************/
/*************************************************/
void
WinEDA_BasePcbFrame
::
ReCreateMenuBar
(
void
)
void
WinEDA_BasePcbFrame
::
ReCreateMenuBar
(
void
)
/*************************************************/
/*************************************************/
...
...
pcbnew/dialog_drc.cpp
View file @
36c316e7
...
@@ -138,6 +138,20 @@ public:
...
@@ -138,6 +138,20 @@ public:
Refresh
();
Refresh
();
}
}
/**
* Function GetItem
* returns a requested DRC_ITEM* or NULL.
*/
const
DRC_ITEM
*
GetItem
(
int
aIndex
)
{
if
(
m_list
)
{
return
m_list
->
GetItem
(
aIndex
);
}
return
NULL
;
}
/**
/**
* Function OnGetItem
* Function OnGetItem
...
@@ -677,7 +691,7 @@ void DrcDialog::OnOkClick( wxCommandEvent& event )
...
@@ -677,7 +691,7 @@ void DrcDialog::OnOkClick( wxCommandEvent& event )
SetReturnCode
(
wxID_OK
);
SetReturnCode
(
wxID_OK
);
m_tester
->
DestroyDialog
();
m_tester
->
DestroyDialog
();
event
.
Skip
();
//
event.Skip();
}
}
...
@@ -693,7 +707,7 @@ void DrcDialog::OnCancelClick( wxCommandEvent& event )
...
@@ -693,7 +707,7 @@ void DrcDialog::OnCancelClick( wxCommandEvent& event )
SetReturnCode
(
wxID_CANCEL
);
SetReturnCode
(
wxID_CANCEL
);
m_tester
->
DestroyDialog
();
m_tester
->
DestroyDialog
();
event
.
Skip
();
//
event.Skip();
}
}
...
@@ -713,7 +727,7 @@ void DrcDialog::OnReportCheckBoxClicked( wxCommandEvent& event )
...
@@ -713,7 +727,7 @@ void DrcDialog::OnReportCheckBoxClicked( wxCommandEvent& event )
m_RptFilenameCtrl
->
Enable
(
false
);
m_RptFilenameCtrl
->
Enable
(
false
);
m_BrowseButton
->
Enable
(
false
);
m_BrowseButton
->
Enable
(
false
);
}
}
event
.
Skip
();
//
event.Skip();
}
}
...
@@ -749,13 +763,24 @@ void DrcDialog::OnLeftDClickClearance( wxMouseEvent& event )
...
@@ -749,13 +763,24 @@ void DrcDialog::OnLeftDClickClearance( wxMouseEvent& event )
if
(
selection
!=
wxNOT_FOUND
)
if
(
selection
!=
wxNOT_FOUND
)
{
{
//printf("get item number %d\n", selection );
// Find the selected MARKER in the PCB, position cursor there.
// Find the selected MARKER in the PCB, position cursor there.
// Do not close this dialog for users with dual screens.
// Then close the dialog.
const
DRC_ITEM
*
item
=
m_ClearanceListBox
->
GetItem
(
selection
);
if
(
item
)
{
// after the goto, process a button OK command later.
wxCommandEvent
cmd
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxID_OK
);
::
wxPostEvent
(
GetEventHandler
(),
cmd
);
m_Parent
->
CursorGoto
(
item
->
GetPosition
()
);
}
}
}
// On linux, the double click is being propagated to the parent. The
// call to StopPropagation was an attempt to prevent this.
event
.
Skip
();
event
.
StopPropagation
();
// we handled the double click event here.
// well that didn't work, we still get a popup menu
}
}
...
@@ -765,6 +790,7 @@ void DrcDialog::OnLeftDClickClearance( wxMouseEvent& event )
...
@@ -765,6 +790,7 @@ void DrcDialog::OnLeftDClickClearance( wxMouseEvent& event )
void
DrcDialog
::
OnRightUpUnconnected
(
wxMouseEvent
&
event
)
void
DrcDialog
::
OnRightUpUnconnected
(
wxMouseEvent
&
event
)
{
{
// @todo: add popup menu support to go to either of the items listed in the DRC_ITEM.
event
.
Skip
();
event
.
Skip
();
}
}
...
@@ -775,10 +801,8 @@ void DrcDialog::OnRightUpUnconnected( wxMouseEvent& event )
...
@@ -775,10 +801,8 @@ void DrcDialog::OnRightUpUnconnected( wxMouseEvent& event )
void
DrcDialog
::
OnRightUpClearance
(
wxMouseEvent
&
event
)
void
DrcDialog
::
OnRightUpClearance
(
wxMouseEvent
&
event
)
{
{
////@begin wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST in WinEDA_DrcFrame.
// @todo: add popup menu support to go to either of the items listed in the DRC_ITEM.
// Before editing this code, remove the block markers.
event
.
Skip
();
event
.
Skip
();
////@end wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST in WinEDA_DrcFrame.
}
}
...
@@ -792,10 +816,24 @@ void DrcDialog::OnLeftDClickUnconnected( wxMouseEvent& event )
...
@@ -792,10 +816,24 @@ void DrcDialog::OnLeftDClickUnconnected( wxMouseEvent& event )
if
(
selection
!=
wxNOT_FOUND
)
if
(
selection
!=
wxNOT_FOUND
)
{
{
//printf("get item number %d\n", selection );
// Find the selected DRC_ITEM in the DRC, position cursor there.
// Then close the dialog.
const
DRC_ITEM
*
item
=
m_UnconnectedListBox
->
GetItem
(
selection
);
if
(
item
)
{
// after the goto, process a button OK command later.
wxCommandEvent
cmd
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxID_OK
);
::
wxPostEvent
(
GetEventHandler
(),
cmd
);
m_Parent
->
CursorGoto
(
item
->
GetPosition
()
);
}
}
}
// On linux, the double click is being propagated to the parent. The
// call to StopPropagation was an attempt to prevent this.
event
.
Skip
();
event
.
StopPropagation
();
// we handled the double click event here.
// well that didn't work, we still get a popup menu
}
}
...
@@ -807,7 +845,6 @@ void DrcDialog::OnMarkerSelectionEvent( wxCommandEvent& event )
...
@@ -807,7 +845,6 @@ void DrcDialog::OnMarkerSelectionEvent( wxCommandEvent& event )
{
{
// until a MARKER is selected, this button is not enabled.
// until a MARKER is selected, this button is not enabled.
m_DeleteCurrentMarkerButton
->
Enable
(
true
);
m_DeleteCurrentMarkerButton
->
Enable
(
true
);
//printf("get Marker number %d\n", selection );
}
}
event
.
Skip
();
event
.
Skip
();
...
@@ -819,7 +856,8 @@ void DrcDialog::OnUnconnectedSelectionEvent( wxCommandEvent& event )
...
@@ -819,7 +856,8 @@ void DrcDialog::OnUnconnectedSelectionEvent( wxCommandEvent& event )
if
(
selection
!=
wxNOT_FOUND
)
if
(
selection
!=
wxNOT_FOUND
)
{
{
printf
(
"get Unconnected item number %d
\n
"
,
selection
);
// until a MARKER is selected, this button is not enabled.
m_DeleteCurrentMarkerButton
->
Enable
(
true
);
}
}
event
.
Skip
();
event
.
Skip
();
...
@@ -857,7 +895,7 @@ void DrcDialog::OnDeleteOneClick( wxCommandEvent& event )
...
@@ -857,7 +895,7 @@ void DrcDialog::OnDeleteOneClick( wxCommandEvent& event )
if
(
selectedIndex
!=
wxNOT_FOUND
)
if
(
selectedIndex
!=
wxNOT_FOUND
)
{
{
m_ClearanceListBox
->
DeleteItem
(
selectedIndex
);
m_ClearanceListBox
->
DeleteItem
(
selectedIndex
);
m_Parent
->
Re
DrawPanel
();
Redraw
DrawPanel
();
}
}
}
}
...
@@ -867,13 +905,10 @@ void DrcDialog::OnDeleteOneClick( wxCommandEvent& event )
...
@@ -867,13 +905,10 @@ void DrcDialog::OnDeleteOneClick( wxCommandEvent& event )
if
(
selectedIndex
!=
wxNOT_FOUND
)
if
(
selectedIndex
!=
wxNOT_FOUND
)
{
{
m_UnconnectedListBox
->
DeleteItem
(
selectedIndex
);
m_UnconnectedListBox
->
DeleteItem
(
selectedIndex
);
m_Parent
->
Re
DrawPanel
();
Redraw
DrawPanel
();
}
}
}
}
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ONE in DrcDialog.
// event.Skip();
// Before editing this code, remove the block markers.
event
.
Skip
();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ONE in DrcDialog.
}
}
pcbnew/drc_stuff.h
View file @
36c316e7
...
@@ -299,6 +299,9 @@ private:
...
@@ -299,6 +299,9 @@ private:
BOARD
*
m_pcb
;
BOARD
*
m_pcb
;
DrcDialog
*
m_ui
;
DrcDialog
*
m_ui
;
std
::
vector
<
DRC_ITEM
>
m_unconnected
;
/**
/**
* Function updatePointers
* Function updatePointers
* is a private helper function used to update needed pointers from the
* is a private helper function used to update needed pointers from the
...
...
pcbnew/find.cpp
View file @
36c316e7
...
@@ -115,25 +115,11 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
...
@@ -115,25 +115,11 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
if
(
FindMarker
)
if
(
FindMarker
)
msg
=
_
(
"Marker found"
);
msg
=
_
(
"Marker found"
);
else
else
msg
.
Printf
(
_
(
"<%s> Found"
),
s_OldStringFound
.
GetData
()
);
msg
.
Printf
(
_
(
"<%s> Found"
),
s_OldStringFound
.
GetData
()
);
m_Parent
->
Affiche_Message
(
msg
);
/* Il y a peut-etre necessite de recadrer le dessin: */
m_Parent
->
Affiche_Message
(
msg
);
if
(
!
m_Parent
->
DrawPanel
->
IsPointOnDisplay
(
locate_pos
)
)
{
m_Parent
->
CursorGoto
(
locate_pos
);
screen
->
m_Curseur
=
locate_pos
;
m_Parent
->
Recadre_Trace
(
TRUE
);
}
else
{
// Positionnement du curseur sur l'item
m_Parent
->
DrawPanel
->
CursorOff
(
m_DC
);
screen
->
m_Curseur
=
locate_pos
;
GRMouseWarp
(
m_Parent
->
DrawPanel
,
screen
->
m_Curseur
);
m_Parent
->
DrawPanel
->
MouseToCursorSchema
();
m_Parent
->
DrawPanel
->
CursorOn
(
m_DC
);
}
EndModal
(
1
);
EndModal
(
1
);
}
}
...
...
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