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
86b6feb9
Commit
86b6feb9
authored
Apr 19, 2011
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace WinEDA_TextFrame with wxSingleChoiceDialog.
parent
1bfe8306
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
123 deletions
+44
-123
common.cpp
common/common.cpp
+3
-59
gerbview_frame.cpp
gerbview/gerbview_frame.cpp
+6
-9
common.h
include/common.h
+1
-23
netlist.cpp
pcbnew/netlist.cpp
+24
-24
surbrill.cpp
pcbnew/surbrill.cpp
+10
-8
No files found.
common/common.cpp
View file @
86b6feb9
...
...
@@ -606,74 +606,18 @@ void MyFree( void* pt_mem )
free
(
pt_mem
);
}
enum
textbox
{
ID_TEXTBOX_LIST
=
8010
};
BEGIN_EVENT_TABLE
(
WinEDA_TextFrame
,
wxDialog
)
EVT_LISTBOX_DCLICK
(
ID_TEXTBOX_LIST
,
WinEDA_TextFrame
::
D_ClickOnList
)
EVT_LISTBOX
(
ID_TEXTBOX_LIST
,
WinEDA_TextFrame
::
D_ClickOnList
)
EVT_CLOSE
(
WinEDA_TextFrame
::
OnClose
)
END_EVENT_TABLE
()
WinEDA_TextFrame
::
WinEDA_TextFrame
(
wxWindow
*
parent
,
const
wxString
&
title
)
:
wxDialog
(
parent
,
-
1
,
title
,
wxPoint
(
-
1
,
-
1
),
wxSize
(
250
,
350
),
wxDEFAULT_DIALOG_STYLE
|
wxFRAME_FLOAT_ON_PARENT
|
MAYBE_RESIZE_BORDER
)
{
wxSize
size
;
m_Parent
=
parent
;
CentreOnParent
();
size
=
GetClientSize
();
m_List
=
new
wxListBox
(
this
,
ID_TEXTBOX_LIST
,
wxPoint
(
0
,
0
),
size
,
0
,
NULL
,
wxLB_ALWAYS_SB
|
wxLB_SINGLE
);
SetReturnCode
(
-
1
);
}
void
WinEDA_TextFrame
::
Append
(
const
wxString
&
text
)
{
m_List
->
Append
(
text
);
}
void
WinEDA_TextFrame
::
D_ClickOnList
(
wxCommandEvent
&
event
)
{
int
ii
=
m_List
->
GetSelection
();
EndModal
(
ii
);
}
void
WinEDA_TextFrame
::
OnClose
(
wxCloseEvent
&
event
)
{
EndModal
(
-
1
);
}
int
GetTimeStamp
()
{
static
int
OldTimeStamp
,
NewTimeStamp
;
NewTimeStamp
=
time
(
NULL
);
if
(
NewTimeStamp
<=
OldTimeStamp
)
NewTimeStamp
=
OldTimeStamp
+
1
;
OldTimeStamp
=
NewTimeStamp
;
return
NewTimeStamp
;
}
...
...
gerbview/gerbview_frame.cpp
View file @
86b6feb9
...
...
@@ -395,12 +395,10 @@ void GERBVIEW_FRAME::Liste_D_Codes()
int
ii
,
jj
;
D_CODE
*
pt_D_code
;
wxString
Line
;
WinEDA_TextFrame
*
L
ist
;
wxArrayString
l
ist
;
int
scale
=
10000
;
int
curr_layer
=
getActiveLayer
();
List
=
new
WinEDA_TextFrame
(
this
,
_
(
"List D codes"
)
);
for
(
int
layer
=
0
;
layer
<
32
;
layer
++
)
{
GERBER_IMAGE
*
gerber
=
g_GERBER_List
[
layer
];
...
...
@@ -416,7 +414,7 @@ void GERBVIEW_FRAME::Liste_D_Codes()
else
Line
.
Printf
(
wxT
(
"*** layer %2.2d ***"
),
layer
+
1
);
List
->
Appen
d
(
Line
);
list
.
Ad
d
(
Line
);
for
(
ii
=
0
,
jj
=
1
;
ii
<
TOOLS_MAX_COUNT
;
ii
++
)
{
...
...
@@ -442,16 +440,15 @@ void GERBVIEW_FRAME::Liste_D_Codes()
if
(
!
pt_D_code
->
m_InUse
)
Line
+=
wxT
(
" *"
);
List
->
Appen
d
(
Line
);
list
.
Ad
d
(
Line
);
jj
++
;
}
}
ii
=
List
->
ShowModal
();
List
->
Destroy
(
);
wxSingleChoiceDialog
dlg
(
this
,
wxEmptyString
,
_
(
"D Codes"
),
list
,
NULL
,
wxCHOICEDLG_STYLE
&
~
wxCANCEL
);
if
(
ii
<
0
)
return
;
dlg
.
ShowModal
();
}
...
...
include/common.h
View file @
86b6feb9
...
...
@@ -95,27 +95,6 @@ enum UserUnitType {
class
LibNameList
;
/***********************************/
/* Class to display text */
/***********************************/
class
WinEDA_TextFrame
:
public
wxDialog
{
private
:
wxWindow
*
m_Parent
;
wxListBox
*
m_List
;
public
:
WinEDA_TextFrame
(
wxWindow
*
parent
,
const
wxString
&
title
);
void
Append
(
const
wxString
&
text
);
private
:
void
D_ClickOnList
(
wxCommandEvent
&
event
);
void
OnClose
(
wxCloseEvent
&
event
);
DECLARE_EVENT_TABLE
()
};
/* Class to handle pages sizes:
*/
class
Ki_PageDescr
...
...
@@ -131,8 +110,7 @@ public:
int
m_BottomMargin
;
public
:
Ki_PageDescr
(
const
wxSize
&
size
,
const
wxPoint
&
offset
,
const
wxString
&
name
);
Ki_PageDescr
(
const
wxSize
&
size
,
const
wxPoint
&
offset
,
const
wxString
&
name
);
};
...
...
pcbnew/netlist.cpp
View file @
86b6feb9
...
...
@@ -689,47 +689,44 @@ void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* aFrame,
#define MAX_LEN_TXT 32
{
int
ii
;
MODULE
*
Module
,
*
pt_aux
;
int
NbModulesNetListe
,
nberr
=
0
;
WinEDA_TextFrame
*
List
;
wxArrayString
ModuleListFromNet
list
;
MODULE
*
Module
,
*
pt_aux
;
int
NbModulesNetListe
,
nberr
=
0
;
wxArrayString
tmp
;
wxArrayString
list
;
if
(
aPcb
->
m_Modules
==
NULL
)
{
DisplayInfoMessage
(
aFrame
,
_
(
"No modules"
)
,
10
);
DisplayInfoMessage
(
aFrame
,
_
(
"No modules"
)
);
return
;
}
/* Build the list of references of the net list modules. */
NbModulesNetListe
=
BuildFootprintsListFromNetlistFile
(
aNetlistFullFilename
,
ModuleListFromNetlist
);
NbModulesNetListe
=
BuildFootprintsListFromNetlistFile
(
aNetlistFullFilename
,
tmp
);
if
(
NbModulesNetListe
<
0
)
return
;
/* File not found */
if
(
NbModulesNetListe
==
0
)
{
DisplayError
(
aFrame
,
_
(
"No modules in NetList"
)
,
10
);
DisplayError
(
aFrame
,
_
(
"No modules in NetList"
)
);
return
;
}
List
=
new
WinEDA_TextFrame
(
aFrame
,
_
(
"Check Modules"
)
);
/* Search for duplicate footprints. */
List
->
Appen
d
(
_
(
"Duplicates"
)
);
list
.
Ad
d
(
_
(
"Duplicates"
)
);
Module
=
aPcb
->
m_Modules
;
for
(
;
Module
!=
NULL
;
Module
=
Module
->
Next
()
)
{
pt_aux
=
Module
->
Next
();
for
(
;
pt_aux
!=
NULL
;
pt_aux
=
pt_aux
->
Next
()
)
{
if
(
Module
->
m_Reference
->
m_Text
.
CmpNoCase
(
pt_aux
->
m_Reference
->
m_Text
)
==
0
)
if
(
Module
->
m_Reference
->
m_Text
.
CmpNoCase
(
pt_aux
->
m_Reference
->
m_Text
)
==
0
)
{
List
->
Appen
d
(
Module
->
m_Reference
->
m_Text
);
list
.
Ad
d
(
Module
->
m_Reference
->
m_Text
);
nberr
++
;
break
;
}
...
...
@@ -737,15 +734,15 @@ void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* aFrame,
}
/* Search for the missing module by the net list. */
List
->
Append
(
_
(
"Lack
:"
)
);
list
.
Add
(
_
(
"Missing
:"
)
);
for
(
ii
=
0
;
ii
<
NbModulesNetListe
;
ii
++
)
{
Module
=
(
MODULE
*
)
aPcb
->
m_Modules
;
for
(
;
Module
!=
NULL
;
Module
=
Module
->
Next
()
)
{
if
(
Module
->
m_Reference
->
m_Text
.
CmpNoCase
(
ModuleListFromNetlist
[
ii
]
)
==
0
)
if
(
Module
->
m_Reference
->
m_Text
.
CmpNoCase
(
tmp
[
ii
]
)
==
0
)
{
break
;
}
...
...
@@ -753,21 +750,21 @@ void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* aFrame,
if
(
Module
==
NULL
)
// Module missing, not found in board
{
List
->
Append
(
ModuleListFromNetlist
[
ii
]
);
list
.
Add
(
tmp
[
ii
]
);
nberr
++
;
}
}
/* Search for modules not in net list. */
List
->
Appen
d
(
_
(
"Not in Netlist:"
)
);
list
.
Ad
d
(
_
(
"Not in Netlist:"
)
);
Module
=
(
MODULE
*
)
aPcb
->
m_Modules
;
for
(
;
Module
!=
NULL
;
Module
=
Module
->
Next
()
)
{
for
(
ii
=
0
;
ii
<
NbModulesNetListe
;
ii
++
)
{
if
(
Module
->
m_Reference
->
m_Text
.
CmpNoCase
(
ModuleListFromNetlist
[
ii
]
)
==
0
)
if
(
Module
->
m_Reference
->
m_Text
.
CmpNoCase
(
tmp
[
ii
]
)
==
0
)
{
break
;
/* Module is in net list. */
}
...
...
@@ -775,12 +772,15 @@ void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* aFrame,
if
(
ii
==
NbModulesNetListe
)
/* Module not found in netlist */
{
List
->
Appen
d
(
Module
->
m_Reference
->
m_Text
);
list
.
Ad
d
(
Module
->
m_Reference
->
m_Text
);
nberr
++
;
}
}
List
->
ShowModal
();
List
->
Destroy
();
wxSingleChoiceDialog
dlg
(
aFrame
,
wxEmptyString
,
_
(
"Check Modules"
),
list
,
NULL
,
wxCHOICEDLG_STYLE
&
~
wxCANCEL
);
dlg
.
ShowModal
();
}
...
...
pcbnew/surbrill.cpp
View file @
86b6feb9
...
...
@@ -26,43 +26,45 @@ void PCB_EDIT_FRAME::ListNetsAndSelect( wxCommandEvent& event )
{
NETINFO_ITEM
*
net
;
wxString
netFilter
;
int
selection
;
wxArrayString
list
;
netFilter
=
wxT
(
"*"
);
wxTextEntryDialog
dlg
(
this
,
_
(
"Filter for net names:"
),
_
(
"Net Filter"
),
netFilter
);
wxTextEntryDialog
dlg
(
this
,
_
(
"Filter Net Names"
),
_
(
"Net Filter"
),
netFilter
);
if
(
dlg
.
ShowModal
()
!=
wxID_OK
)
return
;
// cancelled by user
netFilter
=
dlg
.
GetValue
(
);
if
(
netFilter
.
IsEmpty
()
)
return
;
WinEDA_TextFrame
List
(
this
,
_
(
"List Nets"
)
);
for
(
unsigned
ii
=
0
;
ii
<
GetBoard
()
->
m_NetInfo
->
GetCount
();
ii
++
)
{
net
=
GetBoard
()
->
m_NetInfo
->
GetNetItem
(
ii
);
wxString
Line
;
if
(
!
WildCompareString
(
netFilter
,
net
->
GetNetname
(),
false
)
)
continue
;
Line
.
Printf
(
wxT
(
"net_code = %3.3d [%.16s] "
),
net
->
GetNet
(),
GetChars
(
net
->
GetNetname
()
)
);
List
.
Appen
d
(
Line
);
list
.
Ad
d
(
Line
);
}
selection
=
List
.
ShowModal
(
);
wxSingleChoiceDialog
choiceDlg
(
this
,
wxEmptyString
,
_
(
"Select Net"
),
list
,
NULL
);
if
(
selection
<
0
)
if
(
(
choiceDlg
.
ShowModal
()
==
wxID_CANCEL
)
||
(
choiceDlg
.
GetSelection
()
==
wxNOT_FOUND
)
)
return
;
bool
found
=
false
;
unsigned
netcode
=
(
unsigned
)
selection
;
unsigned
netcode
=
(
unsigned
)
choiceDlg
.
GetSelection
()
;
// Search for the net selected.
for
(
unsigned
ii
=
0
;
ii
<
GetBoard
()
->
m_NetInfo
->
GetCount
();
ii
++
)
{
net
=
GetBoard
()
->
m_NetInfo
->
GetNetItem
(
ii
);
if
(
!
WildCompareString
(
netFilter
,
net
->
GetNetname
(),
false
)
)
continue
;
...
...
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