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
ff68ae0b
Commit
ff68ae0b
authored
Apr 18, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added: handling multiple user paths in library path list (currently, only in Eeschema)
parent
bb5832c8
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
313 additions
and
163 deletions
+313
-163
edaappl.cpp
common/edaappl.cpp
+95
-73
dialog_eeschema_config.cpp
eeschema/dialog_eeschema_config.cpp
+93
-20
dialog_eeschema_config_fbp.cpp
eeschema/dialog_eeschema_config_fbp.cpp
+25
-27
dialog_eeschema_config_fbp.fbp
eeschema/dialog_eeschema_config_fbp.fbp
+81
-32
dialog_eeschema_config_fbp.h
eeschema/dialog_eeschema_config_fbp.h
+8
-6
appl_wxstruct.h
include/appl_wxstruct.h
+11
-5
No files found.
common/edaappl.cpp
View file @
ff68ae0b
This diff is collapsed.
Click to expand it.
eeschema/dialog_eeschema_config.cpp
View file @
ff68ae0b
...
...
@@ -9,6 +9,7 @@
/////////////////////////////////////////////////////////////////////////////
#include "fctsys.h"
#include <wx/tokenzr.h>
#include "appl_wxstruct.h"
#include "common.h"
#include "confirm.h"
...
...
@@ -30,6 +31,8 @@ class DIALOG_EESCHEMA_CONFIG : public DIALOG_EESCHEMA_CONFIG_FBP
private
:
WinEDA_SchematicFrame
*
m_Parent
;
bool
m_LibListChanged
;
bool
m_LibPathChanged
;
wxString
m_UserLibDirBufferImg
;
// Copy of original g_UserLibDirBuffer
private
:
...
...
@@ -39,7 +42,7 @@ private:
void
OnSaveCfgClick
(
wxCommandEvent
&
event
);
void
OnRemoveLibClick
(
wxCommandEvent
&
event
);
void
OnAddOrInsertLibClick
(
wxCommandEvent
&
event
);
void
On
LibPathSelClick
(
wxCommandEvent
&
event
);
void
On
AddOrInsertPath
(
wxCommandEvent
&
event
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
OnRemoveUserPath
(
wxCommandEvent
&
event
);
...
...
@@ -69,7 +72,6 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( WinEDA_SchematicFrame* parent )
wxString
msg
;
m_Parent
=
parent
;
m_LibListChanged
=
false
;
Init
();
...
...
@@ -88,6 +90,10 @@ void DIALOG_EESCHEMA_CONFIG::Init()
SetFont
(
*
g_DialogFont
);
SetFocus
();
m_LibListChanged
=
false
;
m_LibPathChanged
=
false
;
m_UserLibDirBufferImg
=
g_UserLibDirBuffer
;
// Save the original lib path
// Display current files extension (info)
wxString
msg
=
m_InfoCmpFileExt
->
GetLabel
()
+
g_NetCmpExtBuffer
;
m_InfoCmpFileExt
->
SetLabel
(
msg
);
...
...
@@ -126,7 +132,15 @@ void DIALOG_EESCHEMA_CONFIG::Init()
m_NetFormatBox
->
SetSelection
(
g_NetFormat
-
NET_TYPE_PCBNEW
);
m_ListLibr
->
InsertItems
(
g_LibName_List
,
0
);
m_LibDirCtrl
->
SetValue
(
g_UserLibDirBuffer
);
// Load user libs paths:
wxStringTokenizer
Token
(
m_UserLibDirBufferImg
,
wxT
(
";
\n\r
"
)
);
while
(
Token
.
HasMoreTokens
()
)
{
wxString
path
=
Token
.
GetNextToken
();
if
(
wxFileName
::
DirExists
(
path
)
)
m_listUserPaths
->
Append
(
path
);
}
// Display actual libraries paths:
wxPathList
libpaths
=
wxGetApp
().
GetLibraryPathList
();
...
...
@@ -134,6 +148,10 @@ void DIALOG_EESCHEMA_CONFIG::Init()
{
m_DefaultLibraryPathslistBox
->
Append
(
libpaths
[
ii
]);
}
// select the first path afer the current path project
if
(
libpaths
.
GetCount
()
>
1
)
m_DefaultLibraryPathslistBox
->
Select
(
1
);
}
...
...
@@ -141,6 +159,13 @@ void DIALOG_EESCHEMA_CONFIG::Init()
void
DIALOG_EESCHEMA_CONFIG
::
OnCancelClick
(
wxCommandEvent
&
event
)
/******************************************************************/
{
// Recreate the user lib path
if
(
m_LibPathChanged
)
{
for
(
unsigned
ii
=
0
;
ii
<
m_ListLibr
->
GetCount
();
ii
++
)
wxGetApp
().
RemoveLibraryPath
(
m_listUserPaths
->
GetString
(
ii
))
;
wxGetApp
().
InsertLibraryPath
(
g_UserLibDirBuffer
,
1
);
}
EndModal
(
-
1
);
}
...
...
@@ -152,17 +177,21 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
// Set new netlist format
g_NetFormat
=
m_NetFormatBox
->
GetSelection
()
+
NET_TYPE_PCBNEW
;
//
Set new default path lib
if
(
g_UserLibDirBuffer
!=
m_LibDirCtrl
->
GetValue
()
)
//
Recreate the user lib path
if
(
m_LibPathChanged
)
{
wxGetApp
().
RemoveLibraryPath
(
g_UserLibDirBuffer
);
g_UserLibDirBuffer
=
m_LibDirCtrl
->
GetValue
();
wxGetApp
().
InsertLibraryPath
(
g_UserLibDirBuffer
,
1
);
m_LibListChanged
=
true
;
g_UserLibDirBuffer
.
Empty
();
for
(
unsigned
ii
=
0
;
ii
<
m_listUserPaths
->
GetCount
();
ii
++
)
{
if
(
ii
>
0
)
g_UserLibDirBuffer
<<
wxT
(
";"
);
g_UserLibDirBuffer
<<
m_listUserPaths
->
GetString
(
ii
);
}
}
// Set new active library list if the list of default path was modified
if
(
m_LibListChanged
)
// Set new active library list if the lib list of if default path list was modified
if
(
m_LibListChanged
||
m_LibPathChanged
)
{
// Recreate lib list
g_LibName_List
.
Clear
();
...
...
@@ -223,7 +252,8 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
if
(
ii
==
wxNOT_FOUND
&&
event
.
GetId
()
!=
ID_ADD_LIB
)
ii
=
0
;
wxString
libpath
=
m_LibDirCtrl
->
GetValue
();
wxString
libpath
;
libpath
=
m_DefaultLibraryPathslistBox
->
GetStringSelection
();
if
(
libpath
.
IsEmpty
()
)
libpath
=
wxGetApp
().
ReturnLastVisitedLibraryPath
();
...
...
@@ -295,14 +325,12 @@ void DIALOG_EESCHEMA_CONFIG::OnSaveCfgClick( wxCommandEvent& event )
/***********************************************************************/
void
DIALOG_EESCHEMA_CONFIG
::
On
LibPathSelClick
(
wxCommandEvent
&
event
)
void
DIALOG_EESCHEMA_CONFIG
::
On
AddOrInsertPath
(
wxCommandEvent
&
event
)
/***********************************************************************/
{
wxString
path
=
m_LibDirCtrl
->
GetValue
();
if
(
path
.
IsEmpty
()
)
path
=
wxGetApp
().
ReturnLastVisitedLibraryPath
();
wxString
path
=
wxGetApp
().
ReturnLastVisitedLibraryPath
();
bool
select
=
EDA_DirectorySelector
(
_
(
"
Default Path for l
ibraries"
),
/* Titre de la fenetre */
bool
select
=
EDA_DirectorySelector
(
_
(
"
Default Path for L
ibraries"
),
/* Titre de la fenetre */
path
,
/* Chemin par defaut */
wxDD_DEFAULT_STYLE
,
this
,
/* parent frame */
...
...
@@ -311,7 +339,36 @@ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event )
if
(
!
select
)
return
;
m_LibDirCtrl
->
SetValue
(
path
);
if
(
!
wxFileName
::
DirExists
(
path
)
)
// Should not occurs
return
;
// Add or insert path if not already in list
if
(
m_listUserPaths
->
FindString
(
path
)
==
wxNOT_FOUND
)
{
int
ipos
=
m_listUserPaths
->
GetCount
();
if
(
event
.
GetId
()
==
wxID_INSERT_PATH
)
{
if
(
ipos
)
ipos
--
;
int
jj
=
m_listUserPaths
->
GetSelection
();
if
(
jj
>=
0
)
ipos
=
jj
;
}
m_listUserPaths
->
Insert
(
path
,
ipos
);
m_LibPathChanged
=
true
;
wxGetApp
().
InsertLibraryPath
(
path
,
ipos
+
1
);
// Display actual libraries paths:
wxPathList
libpaths
=
wxGetApp
().
GetLibraryPathList
();
m_DefaultLibraryPathslistBox
->
Clear
();
for
(
unsigned
ii
=
0
;
ii
<
libpaths
.
GetCount
();
ii
++
)
{
m_DefaultLibraryPathslistBox
->
Append
(
libpaths
[
ii
]);
}
}
else
DisplayError
(
this
,
_
(
"Path already in use"
)
);
wxGetApp
().
SaveLastVisitedLibraryPath
(
path
);
}
...
...
@@ -321,5 +378,21 @@ void DIALOG_EESCHEMA_CONFIG::OnLibPathSelClick( wxCommandEvent& event )
void
DIALOG_EESCHEMA_CONFIG
::
OnRemoveUserPath
(
wxCommandEvent
&
event
)
/***********************************************************************/
{
m_LibDirCtrl
->
Clear
(
);
}
int
ii
=
m_listUserPaths
->
GetSelection
();
if
(
ii
<
0
)
ii
=
m_listUserPaths
->
GetCount
()
-
1
;
if
(
ii
>=
0
)
{
wxGetApp
().
RemoveLibraryPath
(
m_listUserPaths
->
GetStringSelection
()
);
m_listUserPaths
->
Delete
(
ii
);
m_LibPathChanged
=
true
;
}
// Display actual libraries paths:
wxPathList
libpaths
=
wxGetApp
().
GetLibraryPathList
();
m_DefaultLibraryPathslistBox
->
Clear
();
for
(
unsigned
ii
=
0
;
ii
<
libpaths
.
GetCount
();
ii
++
)
{
m_DefaultLibraryPathslistBox
->
Append
(
libpaths
[
ii
]);
}
}
eeschema/dialog_eeschema_config_fbp.cpp
View file @
ff68ae0b
...
...
@@ -83,38 +83,33 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind
bRightSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_buttonRemoveLib
=
new
wxButton
(
this
,
ID_REMOVE_LIB
,
_
(
"Remove"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonRemoveLib
->
SetForegroundColour
(
wxColour
(
186
,
1
,
38
)
);
m_buttonRemoveLib
->
SetToolTip
(
_
(
"Unload the selected library"
)
);
bRightSizer
->
Add
(
m_buttonRemoveLib
,
0
,
wxALL
,
5
);
bRightSizer
->
Add
(
m_buttonRemoveLib
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
m_buttonAdd
=
new
wxButton
(
this
,
ID_ADD_LIB
,
_
(
"Add"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonAdd
->
SetForegroundColour
(
wxColour
(
13
,
118
,
1
)
);
m_buttonAdd
->
SetToolTip
(
_
(
"Add a new library after the selected library, and load it"
)
);
m_buttonAddLib
=
new
wxButton
(
this
,
ID_ADD_LIB
,
_
(
"Add"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonAddLib
->
SetToolTip
(
_
(
"Add a new library after the selected library, and load it"
)
);
bRightSizer
->
Add
(
m_buttonAdd
,
0
,
wxRIGHT
|
wxLEFT
,
5
);
bRightSizer
->
Add
(
m_buttonAdd
Lib
,
0
,
wxRIGHT
|
wxLEFT
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
m_buttonIns
=
new
wxButton
(
this
,
wxID_ANY
,
_
(
"Ins"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonIns
->
SetForegroundColour
(
wxColour
(
0
,
65
,
130
)
);
m_buttonIns
=
new
wxButton
(
this
,
wxID_ANY
,
_
(
"Insert"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonIns
->
SetToolTip
(
_
(
"Add a new library before the selected library, and load it"
)
);
bRightSizer
->
Add
(
m_buttonIns
,
0
,
wxALL
,
5
);
bRightSizer
->
Add
(
m_buttonIns
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bRightSizer
->
Add
(
0
,
20
,
1
,
wxEXPAND
,
5
);
m_buttonOk
=
new
wxButton
(
this
,
wxID_OK
,
_
(
"Ok"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bRightSizer
->
Add
(
m_buttonOk
,
0
,
wxALL
,
5
);
bRightSizer
->
Add
(
m_buttonOk
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
m_buttonCancel
=
new
wxButton
(
this
,
wxID_CANCEL
,
_
(
"Cancel"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonCancel
->
SetForegroundColour
(
wxColour
(
14
,
0
,
179
)
);
bRightSizer
->
Add
(
m_buttonCancel
,
0
,
wxRIGHT
|
wxLEFT
,
5
);
bRightSizer
->
Add
(
m_buttonCancel
,
0
,
wxRIGHT
|
wxLEFT
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
m_buttonSave
=
new
wxButton
(
this
,
ID_SAVE_CFG
,
_
(
"Save Cfg"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_buttonSave
->
SetToolTip
(
_
(
"Accept and save current configuration setting in the local .pro file"
)
);
bRightSizer
->
Add
(
m_buttonSave
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
|
wxEXPAND
,
5
);
bRightSizer
->
Add
(
m_buttonSave
,
0
,
wxALL
|
wxALIGN_CENTER_HORIZONTAL
,
5
);
bUpperSizer
->
Add
(
bRightSizer
,
0
,
wxALIGN_CENTER_VERTICAL
,
5
);
...
...
@@ -135,21 +130,22 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind
wxBoxSizer
*
bUserListSizer
;
bUserListSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_LibDirCtrl
=
new
wxTextCtrl
(
this
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
m_LibDirCtrl
->
SetToolTip
(
_
(
"Default path to search libraries which have no absolute path in name,
\n
or a name which does not start by ./ or ../
\n
If void, the default path is kicad/share/library"
)
);
bUserListSizer
->
Add
(
m_LibDirCtrl
,
0
,
wxBOTTOM
|
wxRIGHT
|
wxLEFT
|
wxEXPAND
,
5
);
m_listUserPaths
=
new
wxListBox
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
0
,
NULL
,
0
);
bUserListSizer
->
Add
(
m_listUserPaths
,
1
,
wxALL
|
wxEXPAND
,
5
);
sbSizer4
->
Add
(
bUserListSizer
,
1
,
wxALIGN_CENTER_VERTICAL
,
5
);
sbSizer4
->
Add
(
bUserListSizer
,
1
,
wxALIGN_CENTER_VERTICAL
|
wxEXPAND
,
5
);
wxBoxSizer
*
bUserPathsButtonsSizer
;
bUserPathsButtonsSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_buttonBrowse
=
new
wxButton
(
this
,
ID_LIB_PATH_SEL
,
_
(
"Browse"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bUserPathsButtonsSizer
->
Add
(
m_buttonBrowse
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxRIGHT
|
wxLEFT
,
5
);
m_buttonRemovePath
=
new
wxButton
(
this
,
wxID_REMOVE_PATH
,
_
(
"Remove"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bUserPathsButtonsSizer
->
Add
(
m_buttonRemovePath
,
0
,
wxRIGHT
|
wxLEFT
,
5
);
m_buttonAddPath
=
new
wxButton
(
this
,
ID_LIB_PATH_SEL
,
_
(
"Add"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bUserPathsButtonsSizer
->
Add
(
m_buttonAddPath
,
0
,
wxALIGN_CENTER_VERTICAL
|
wxRIGHT
|
wxLEFT
,
5
);
m_button
RemovePath
=
new
wxButton
(
this
,
wxID_ANY
,
_
(
"Remove
"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bUserPathsButtonsSizer
->
Add
(
m_button
Remove
Path
,
0
,
wxBOTTOM
|
wxRIGHT
|
wxLEFT
,
5
);
m_button
InsPath
=
new
wxButton
(
this
,
wxID_INSERT_PATH
,
_
(
"Insert
"
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
bUserPathsButtonsSizer
->
Add
(
m_button
Ins
Path
,
0
,
wxBOTTOM
|
wxRIGHT
|
wxLEFT
,
5
);
sbSizer4
->
Add
(
bUserPathsButtonsSizer
,
0
,
wxEXPAND
,
5
);
...
...
@@ -175,13 +171,14 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind
// Connect Events
this
->
Connect
(
wxEVT_CLOSE_WINDOW
,
wxCloseEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnCloseWindow
)
);
m_buttonRemoveLib
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnRemoveLibClick
),
NULL
,
this
);
m_buttonAdd
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnAddOrInsertLibClick
),
NULL
,
this
);
m_buttonAdd
Lib
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnAddOrInsertLibClick
),
NULL
,
this
);
m_buttonIns
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnAddOrInsertLibClick
),
NULL
,
this
);
m_buttonOk
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnOkClick
),
NULL
,
this
);
m_buttonCancel
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnCancelClick
),
NULL
,
this
);
m_buttonSave
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnSaveCfgClick
),
NULL
,
this
);
m_buttonBrowse
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnLibPathSelClick
),
NULL
,
this
);
m_buttonRemovePath
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnRemoveUserPath
),
NULL
,
this
);
m_buttonAddPath
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnAddOrInsertPath
),
NULL
,
this
);
m_buttonInsPath
->
Connect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnAddOrInsertPath
),
NULL
,
this
);
}
DIALOG_EESCHEMA_CONFIG_FBP
::~
DIALOG_EESCHEMA_CONFIG_FBP
()
...
...
@@ -189,11 +186,12 @@ DIALOG_EESCHEMA_CONFIG_FBP::~DIALOG_EESCHEMA_CONFIG_FBP()
// Disconnect Events
this
->
Disconnect
(
wxEVT_CLOSE_WINDOW
,
wxCloseEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnCloseWindow
)
);
m_buttonRemoveLib
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnRemoveLibClick
),
NULL
,
this
);
m_buttonAdd
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnAddOrInsertLibClick
),
NULL
,
this
);
m_buttonAdd
Lib
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnAddOrInsertLibClick
),
NULL
,
this
);
m_buttonIns
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnAddOrInsertLibClick
),
NULL
,
this
);
m_buttonOk
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnOkClick
),
NULL
,
this
);
m_buttonCancel
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnCancelClick
),
NULL
,
this
);
m_buttonSave
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnSaveCfgClick
),
NULL
,
this
);
m_buttonBrowse
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnLibPathSelClick
),
NULL
,
this
);
m_buttonRemovePath
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnRemoveUserPath
),
NULL
,
this
);
m_buttonAddPath
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnAddOrInsertPath
),
NULL
,
this
);
m_buttonInsPath
->
Disconnect
(
wxEVT_COMMAND_BUTTON_CLICKED
,
wxCommandEventHandler
(
DIALOG_EESCHEMA_CONFIG_FBP
::
OnAddOrInsertPath
),
NULL
,
this
);
}
eeschema/dialog_eeschema_config_fbp.fbp
View file @
ff68ae0b
This diff is collapsed.
Click to expand it.
eeschema/dialog_eeschema_config_fbp.h
View file @
ff68ae0b
...
...
@@ -21,7 +21,6 @@
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/statline.h>
#include <wx/textctrl.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
...
...
@@ -39,7 +38,9 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog
ID_REMOVE_LIB
=
1000
,
ID_ADD_LIB
,
ID_SAVE_CFG
,
wxID_REMOVE_PATH
,
ID_LIB_PATH_SEL
,
wxID_INSERT_PATH
,
};
wxStaticText
*
m_staticTextNetListFormats
;
...
...
@@ -53,16 +54,17 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog
wxStaticText
*
m_staticTextlibList
;
wxListBox
*
m_ListLibr
;
wxButton
*
m_buttonRemoveLib
;
wxButton
*
m_buttonAdd
;
wxButton
*
m_buttonAdd
Lib
;
wxButton
*
m_buttonIns
;
wxButton
*
m_buttonOk
;
wxButton
*
m_buttonCancel
;
wxButton
*
m_buttonSave
;
wxStaticLine
*
m_staticline1
;
wxTextCtrl
*
m_LibDirCtrl
;
wxButton
*
m_buttonBrowse
;
wxListBox
*
m_listUserPaths
;
wxButton
*
m_buttonRemovePath
;
wxButton
*
m_buttonAddPath
;
wxButton
*
m_buttonInsPath
;
wxStaticText
*
m_staticTextcurrenpaths
;
wxListBox
*
m_DefaultLibraryPathslistBox
;
...
...
@@ -73,12 +75,12 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public wxDialog
virtual
void
OnOkClick
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnCancelClick
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnSaveCfgClick
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnLibPathSelClick
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnRemoveUserPath
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
virtual
void
OnAddOrInsertPath
(
wxCommandEvent
&
event
){
event
.
Skip
();
}
public
:
DIALOG_EESCHEMA_CONFIG_FBP
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
wxEmptyString
,
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
593
,
5
00
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
DIALOG_EESCHEMA_CONFIG_FBP
(
wxWindow
*
parent
,
wxWindowID
id
=
wxID_ANY
,
const
wxString
&
title
=
wxEmptyString
,
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxSize
(
593
,
5
59
),
long
style
=
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
);
~
DIALOG_EESCHEMA_CONFIG_FBP
();
};
...
...
include/appl_wxstruct.h
View file @
ff68ae0b
...
...
@@ -185,13 +185,19 @@ public:
* @param aFullFilename = filename with path and extension.
*/
wxString
ReturnFilenameWithRelativePathInLibPath
(
const
wxString
&
aFullFilename
);
/** Function RemoveLibraryPath
* Removes the given ptah from the libary path list
* @param path = the path to remove
* Removes the given path(s) from the library path list
* @param aPaths = path or path list to remove. paths must be separated by ";"
*/
void
RemoveLibraryPath
(
const
wxString
&
aPaths
);
/** Function InsertLibraryPath
* insert path(s) int lib paths list.
* @param aPaths = path or path list to add. paths must be separated by ";"
* @param aIndex = insertion point
*/
void
RemoveLibraryPath
(
const
wxString
&
path
);
void
InsertLibraryPath
(
const
wxString
&
path
,
size_t
index
);
void
InsertLibraryPath
(
const
wxString
&
aPaths
,
size_t
aIndex
);
};
/*
...
...
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