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
29446320
Commit
29446320
authored
Jan 19, 2014
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup and minor fix in viewlib.
parent
a094f7d5
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
149 deletions
+84
-149
tool_viewlib.cpp
eeschema/tool_viewlib.cpp
+9
-9
viewlib_frame.cpp
eeschema/viewlib_frame.cpp
+59
-116
viewlib_frame.h
eeschema/viewlib_frame.h
+9
-17
viewlibs.cpp
eeschema/viewlibs.cpp
+7
-7
No files found.
eeschema/tool_viewlib.cpp
View file @
29446320
...
@@ -105,10 +105,10 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
...
@@ -105,10 +105,10 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
m_mainToolBar
->
AddSeparator
();
m_mainToolBar
->
AddSeparator
();
S
elpartBox
=
new
wxComboBox
(
m_mainToolBar
,
ID_LIBVIEW_SELECT_PART_NUMBER
,
m_s
elpartBox
=
new
wxComboBox
(
m_mainToolBar
,
ID_LIBVIEW_SELECT_PART_NUMBER
,
wxEmptyString
,
wxDefaultPosition
,
wxEmptyString
,
wxDefaultPosition
,
wxSize
(
150
,
-
1
),
0
,
NULL
,
wxCB_READONLY
);
wxSize
(
150
,
-
1
),
0
,
NULL
,
wxCB_READONLY
);
m_mainToolBar
->
AddControl
(
S
elpartBox
);
m_mainToolBar
->
AddControl
(
m_s
elpartBox
);
m_mainToolBar
->
AddSeparator
();
m_mainToolBar
->
AddSeparator
();
m_mainToolBar
->
AddTool
(
ID_LIBVIEW_VIEWDOC
,
wxEmptyString
,
m_mainToolBar
->
AddTool
(
ID_LIBVIEW_VIEWDOC
,
wxEmptyString
,
...
@@ -116,7 +116,7 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
...
@@ -116,7 +116,7 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
_
(
"View component documents"
)
);
_
(
"View component documents"
)
);
m_mainToolBar
->
EnableTool
(
ID_LIBVIEW_VIEWDOC
,
false
);
m_mainToolBar
->
EnableTool
(
ID_LIBVIEW_VIEWDOC
,
false
);
if
(
m_
S
emaphore
)
if
(
m_
s
emaphore
)
{
{
// The library browser is called from a "load component" command
// The library browser is called from a "load component" command
m_mainToolBar
->
AddSeparator
();
m_mainToolBar
->
AddSeparator
();
...
@@ -167,17 +167,17 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
...
@@ -167,17 +167,17 @@ void LIB_VIEW_FRAME::ReCreateHToolbar()
if
(
component
)
if
(
component
)
parts_count
=
std
::
max
(
component
->
GetPartCount
(),
1
);
parts_count
=
std
::
max
(
component
->
GetPartCount
(),
1
);
S
elpartBox
->
Clear
();
m_s
elpartBox
->
Clear
();
for
(
ii
=
0
;
ii
<
parts_count
;
ii
++
)
for
(
ii
=
0
;
ii
<
parts_count
;
ii
++
)
{
{
wxString
msg
;
wxString
msg
;
msg
.
Printf
(
_
(
"Unit %c"
),
'A'
+
ii
);
msg
.
Printf
(
_
(
"Unit %c"
),
'A'
+
ii
);
S
elpartBox
->
Append
(
msg
);
m_s
elpartBox
->
Append
(
msg
);
}
}
S
elpartBox
->
SetSelection
(
(
m_unit
>
0
)
?
m_unit
-
1
:
0
);
m_s
elpartBox
->
SetSelection
(
(
m_unit
>
0
)
?
m_unit
-
1
:
0
);
S
elpartBox
->
Enable
(
parts_count
>
1
);
m_s
elpartBox
->
Enable
(
parts_count
>
1
);
m_mainToolBar
->
EnableTool
(
ID_LIBVIEW_VIEWDOC
,
m_mainToolBar
->
EnableTool
(
ID_LIBVIEW_VIEWDOC
,
entry
&&
(
entry
->
GetDocFileName
()
!=
wxEmptyString
)
);
entry
&&
(
entry
->
GetDocFileName
()
!=
wxEmptyString
)
);
...
...
eeschema/viewlib_frame.cpp
View file @
29446320
This diff is collapsed.
Click to expand it.
eeschema/viewlib_frame.h
View file @
29446320
/*
/*
* This program source code file is part of KiCad, a free EDA CAD application.
* This program source code file is part of KiCad, a free EDA CAD application.
*
*
* Copyright (C) 20
04 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 20
14 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-201
1
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2008-201
4
Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2004-201
1
KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-201
4
KiCad Developers, see change_log.txt for contributors.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* modify it under the terms of the GNU General Public License
...
@@ -48,20 +48,18 @@ class CMP_LIBRARY;
...
@@ -48,20 +48,18 @@ class CMP_LIBRARY;
class
LIB_VIEW_FRAME
:
public
SCH_BASE_FRAME
class
LIB_VIEW_FRAME
:
public
SCH_BASE_FRAME
{
{
private
:
private
:
wxComboBox
*
S
elpartBox
;
wxComboBox
*
m_s
elpartBox
;
// List of libraries (for selection )
// List of libraries (for selection )
wxSashLayoutWindow
*
m_LibListWindow
;
wxListBox
*
m_libList
;
// The list of libs
wxListBox
*
m_LibList
;
// The list of libs
int
m_libListWidth
;
// Last width of the window
wxSize
m_LibListSize
;
// size of the window
// List of components in the selected library
// List of components in the selected library
wxSashLayoutWindow
*
m_CmpListWindow
;
wxListBox
*
m_cmpList
;
// The list of components
wxListBox
*
m_CmpList
;
// The list of components
int
m_cmpListWidth
;
// Last width of the window
wxSize
m_CmpListSize
;
// size of the window
// Flags
// Flags
wxSemaphore
*
m_
S
emaphore
;
// != NULL if the frame must emulate a modal dialog
wxSemaphore
*
m_
s
emaphore
;
// != NULL if the frame must emulate a modal dialog
wxString
m_configPath
;
// subpath for configuration
wxString
m_configPath
;
// subpath for configuration
protected
:
protected
:
...
@@ -95,12 +93,6 @@ public:
...
@@ -95,12 +93,6 @@ public:
void
OnSize
(
wxSizeEvent
&
event
);
void
OnSize
(
wxSizeEvent
&
event
);
/**
* Function OnSashDrag
* resizes the child windows when dragging a sash window border.
*/
void
OnSashDrag
(
wxSashEvent
&
event
);
/**
/**
* Function ReCreateListLib
* Function ReCreateListLib
*
*
...
...
eeschema/viewlibs.cpp
View file @
29446320
...
@@ -70,7 +70,7 @@ void LIB_VIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
...
@@ -70,7 +70,7 @@ void LIB_VIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
break
;
break
;
case
ID_LIBVIEW_SELECT_PART_NUMBER
:
case
ID_LIBVIEW_SELECT_PART_NUMBER
:
ii
=
S
elpartBox
->
GetCurrentSelection
();
ii
=
m_s
elpartBox
->
GetCurrentSelection
();
if
(
ii
<
0
)
if
(
ii
<
0
)
return
;
return
;
m_unit
=
ii
+
1
;
m_unit
=
ii
+
1
;
...
@@ -132,16 +132,16 @@ void LIB_VIEW_FRAME::SelectCurrentLibrary()
...
@@ -132,16 +132,16 @@ void LIB_VIEW_FRAME::SelectCurrentLibrary()
m_libraryName
=
Lib
->
GetName
();
m_libraryName
=
Lib
->
GetName
();
DisplayLibInfos
();
DisplayLibInfos
();
if
(
m_
L
ibList
)
if
(
m_
l
ibList
)
{
{
ReCreateListCmp
();
ReCreateListCmp
();
m_canvas
->
Refresh
();
m_canvas
->
Refresh
();
DisplayLibInfos
();
DisplayLibInfos
();
ReCreateHToolbar
();
ReCreateHToolbar
();
int
id
=
m_
L
ibList
->
FindString
(
m_libraryName
.
GetData
()
);
int
id
=
m_
l
ibList
->
FindString
(
m_libraryName
.
GetData
()
);
if
(
id
>=
0
)
if
(
id
>=
0
)
m_
L
ibList
->
SetSelection
(
id
);
m_
l
ibList
->
SetSelection
(
id
);
}
}
}
}
}
}
...
@@ -234,11 +234,11 @@ void LIB_VIEW_FRAME::ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag )
...
@@ -234,11 +234,11 @@ void LIB_VIEW_FRAME::ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag )
Zoom_Automatique
(
false
);
Zoom_Automatique
(
false
);
m_canvas
->
Refresh
(
);
m_canvas
->
Refresh
(
);
if
(
m_
C
mpList
)
if
(
m_
c
mpList
)
{
{
int
id
=
m_
C
mpList
->
FindString
(
m_entryName
.
GetData
()
);
int
id
=
m_
c
mpList
->
FindString
(
m_entryName
.
GetData
()
);
if
(
id
>=
0
)
if
(
id
>=
0
)
m_
C
mpList
->
SetSelection
(
id
);
m_
c
mpList
->
SetSelection
(
id
);
}
}
ReCreateHToolbar
();
ReCreateHToolbar
();
}
}
...
...
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