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
Show 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
Please add newer entries at the top, list the date and your name with
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>
================================================================================
+eeschema:
...
...
@@ -14,8 +27,7 @@ email address.
2007-Dec-2 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
drc.cpp and dialog_drc.cpp intermediate update. More hours to go
before completion.
drc.cpp and dialog_drc.cpp intermediate update.
2007-Nov-30 UPDATE Dick Hollenbeck <dick@softplc.com>
...
...
include/wxstruct.h
View file @
36c316e7
...
...
@@ -440,6 +440,16 @@ public:
*/
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 */
void
place_marqueur
(
wxDC
*
DC
,
const
wxPoint
&
pos
,
char
*
pt_bitmap
,
int
DrawMode
,
int
color
,
int
type
);
...
...
pcbnew/basepcbframe.cpp
View file @
36c316e7
...
...
@@ -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
)
/*************************************************/
...
...
pcbnew/dialog_drc.cpp
View file @
36c316e7
...
...
@@ -139,6 +139,20 @@ public:
}
/**
* 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
* returns the html text associated with the DRC_ITEM given by index 'n'.
...
...
@@ -677,7 +691,7 @@ void DrcDialog::OnOkClick( wxCommandEvent& event )
SetReturnCode
(
wxID_OK
);
m_tester
->
DestroyDialog
();
event
.
Skip
();
//
event.Skip();
}
...
...
@@ -693,7 +707,7 @@ void DrcDialog::OnCancelClick( wxCommandEvent& event )
SetReturnCode
(
wxID_CANCEL
);
m_tester
->
DestroyDialog
();
event
.
Skip
();
//
event.Skip();
}
...
...
@@ -713,7 +727,7 @@ void DrcDialog::OnReportCheckBoxClicked( wxCommandEvent& event )
m_RptFilenameCtrl
->
Enable
(
false
);
m_BrowseButton
->
Enable
(
false
);
}
event
.
Skip
();
//
event.Skip();
}
...
...
@@ -749,13 +763,24 @@ void DrcDialog::OnLeftDClickClearance( wxMouseEvent& event )
if
(
selection
!=
wxNOT_FOUND
)
{
//printf("get item number %d\n", selection );
// 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
()
);
}
}
event
.
Skip
();
// On linux, the double click is being propagated to the parent. The
// call to StopPropagation was an attempt to prevent this.
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 )
void
DrcDialog
::
OnRightUpUnconnected
(
wxMouseEvent
&
event
)
{
// @todo: add popup menu support to go to either of the items listed in the DRC_ITEM.
event
.
Skip
();
}
...
...
@@ -775,10 +801,8 @@ void DrcDialog::OnRightUpUnconnected( wxMouseEvent& event )
void
DrcDialog
::
OnRightUpClearance
(
wxMouseEvent
&
event
)
{
////@begin wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST in WinEDA_DrcFrame.
// Before editing this code, remove the block markers.
// @todo: add popup menu support to go to either of the items listed in the DRC_ITEM.
event
.
Skip
();
////@end wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST in WinEDA_DrcFrame.
}
...
...
@@ -792,10 +816,24 @@ void DrcDialog::OnLeftDClickUnconnected( wxMouseEvent& event )
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
()
);
}
}
event
.
Skip
();
// On linux, the double click is being propagated to the parent. The
// call to StopPropagation was an attempt to prevent this.
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 )
{
// until a MARKER is selected, this button is not enabled.
m_DeleteCurrentMarkerButton
->
Enable
(
true
);
//printf("get Marker number %d\n", selection );
}
event
.
Skip
();
...
...
@@ -819,7 +856,8 @@ void DrcDialog::OnUnconnectedSelectionEvent( wxCommandEvent& event )
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
();
...
...
@@ -857,7 +895,7 @@ void DrcDialog::OnDeleteOneClick( wxCommandEvent& event )
if
(
selectedIndex
!=
wxNOT_FOUND
)
{
m_ClearanceListBox
->
DeleteItem
(
selectedIndex
);
m_Parent
->
Re
DrawPanel
();
Redraw
DrawPanel
();
}
}
...
...
@@ -867,13 +905,10 @@ void DrcDialog::OnDeleteOneClick( wxCommandEvent& event )
if
(
selectedIndex
!=
wxNOT_FOUND
)
{
m_UnconnectedListBox
->
DeleteItem
(
selectedIndex
);
m_Parent
->
Re
DrawPanel
();
Redraw
DrawPanel
();
}
}
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ONE in DrcDialog.
// Before editing this code, remove the block markers.
event
.
Skip
();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ONE in DrcDialog.
// event.Skip();
}
pcbnew/drc_stuff.h
View file @
36c316e7
...
...
@@ -299,6 +299,9 @@ private:
BOARD
*
m_pcb
;
DrcDialog
*
m_ui
;
std
::
vector
<
DRC_ITEM
>
m_unconnected
;
/**
* Function updatePointers
* is a private helper function used to update needed pointers from the
...
...
pcbnew/find.cpp
View file @
36c316e7
...
...
@@ -119,21 +119,7 @@ void WinEDA_PcbFindFrame::FindItem( wxCommandEvent& event )
m_Parent
->
Affiche_Message
(
msg
);
/* Il y a peut-etre necessite de recadrer le dessin: */
if
(
!
m_Parent
->
DrawPanel
->
IsPointOnDisplay
(
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
);
}
m_Parent
->
CursorGoto
(
locate_pos
);
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