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
f477464f
Commit
f477464f
authored
Dec 09, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
embellish fp_lib_table editor with beginnings of cut, copy, paste
parent
9a806749
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
237 additions
and
45 deletions
+237
-45
fp_lib_table.cpp
common/fp_lib_table.cpp
+7
-7
dialog_fp_lib_table.cpp
pcbnew/dialogs/dialog_fp_lib_table.cpp
+198
-26
dialog_fp_lib_table_base.cpp
pcbnew/dialogs/dialog_fp_lib_table_base.cpp
+18
-2
dialog_fp_lib_table_base.fbp
pcbnew/dialogs/dialog_fp_lib_table_base.fbp
+10
-10
dialog_fp_lib_table_base.h
pcbnew/dialogs/dialog_fp_lib_table_base.h
+4
-0
No files found.
common/fp_lib_table.cpp
View file @
f477464f
...
...
@@ -59,7 +59,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
T
tok
;
// This table may be nested within a larger s-expression, or not.
// Allow for parser of that optional
outter
s-epression to have looked ahead.
// Allow for parser of that optional
containing
s-epression to have looked ahead.
if
(
in
->
CurTok
()
!=
T_fp_lib_table
)
{
in
->
NeedLEFT
();
...
...
@@ -84,7 +84,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
if
(
(
tok
=
in
->
NextTok
()
)
!=
T_lib
)
in
->
Expecting
(
T_lib
);
// (name
LOGICAL_
NAME)
// (name
NICK
NAME)
in
->
NeedLEFT
();
if
(
(
tok
=
in
->
NextTok
()
)
!=
T_name
)
...
...
@@ -97,7 +97,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
in
->
NeedRIGHT
();
// After (name), remaining (lib) elements are order independent, and in
//
the future, perhaps optional. Flexibility for future changes
.
//
some cases optional
.
bool
sawType
=
false
;
bool
sawOpts
=
false
;
...
...
@@ -191,12 +191,12 @@ void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const
void
FP_LIB_TABLE
::
ROW
::
Format
(
OUTPUTFORMATTER
*
out
,
int
nestLevel
)
const
throw
(
IO_ERROR
)
{
out
->
Print
(
nestLevel
,
"(lib (name %s)(
descr %s)(uri %s)(type %s)(options
%s))
\n
"
,
out
->
Print
(
nestLevel
,
"(lib (name %s)(
type %s)(uri %s)(options %s)(descr
%s))
\n
"
,
out
->
Quotew
(
GetNickName
()
).
c_str
(),
out
->
Quotew
(
GetDescr
()
).
c_str
(),
out
->
Quotew
(
GetFullURI
()
).
c_str
(),
out
->
Quotew
(
GetType
()
).
c_str
(),
out
->
Quotew
(
GetOptions
()
).
c_str
()
out
->
Quotew
(
GetFullURI
()
).
c_str
(),
out
->
Quotew
(
GetOptions
()
).
c_str
(),
out
->
Quotew
(
GetDescr
()
).
c_str
()
);
}
...
...
pcbnew/dialogs/dialog_fp_lib_table.cpp
View file @
f477464f
This diff is collapsed.
Click to expand it.
pcbnew/dialogs/dialog_fp_lib_table_base.cpp
View file @
f477464f
...
...
@@ -34,7 +34,7 @@ DIALOG_FP_LIB_TABLE_BASE::DIALOG_FP_LIB_TABLE_BASE( wxWindow* parent, wxWindowID
m_global_grid
=
new
wxGrid
(
m_global_panel
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
// Grid
m_global_grid
->
CreateGrid
(
1
,
4
);
m_global_grid
->
CreateGrid
(
1
,
5
);
m_global_grid
->
EnableEditing
(
true
);
m_global_grid
->
EnableGridLines
(
true
);
m_global_grid
->
EnableDragGridSize
(
true
);
...
...
@@ -70,7 +70,7 @@ DIALOG_FP_LIB_TABLE_BASE::DIALOG_FP_LIB_TABLE_BASE( wxWindow* parent, wxWindowID
m_project_grid
=
new
wxGrid
(
m_project_panel
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
// Grid
m_project_grid
->
CreateGrid
(
1
,
4
);
m_project_grid
->
CreateGrid
(
1
,
5
);
m_project_grid
->
EnableEditing
(
true
);
m_project_grid
->
EnableGridLines
(
true
);
m_project_grid
->
EnableDragGridSize
(
true
);
...
...
@@ -199,6 +199,14 @@ DIALOG_FP_LIB_TABLE_BASE::DIALOG_FP_LIB_TABLE_BASE( wxWindow* parent, wxWindowID
// Connect Events
m_auinotebook
->
Connect
(
wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED
,
wxAuiNotebookEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
pageChangedHandler
),
NULL
,
this
);
m_global_grid
->
Connect
(
wxEVT_GRID_CELL_LEFT_CLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellLeftClick
),
NULL
,
this
);
m_global_grid
->
Connect
(
wxEVT_GRID_CELL_LEFT_DCLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellLeftDClick
),
NULL
,
this
);
m_global_grid
->
Connect
(
wxEVT_GRID_CELL_RIGHT_CLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellRightClick
),
NULL
,
this
);
m_global_grid
->
Connect
(
wxEVT_GRID_SELECT_CELL
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCmdSelectCell
),
NULL
,
this
);
m_project_grid
->
Connect
(
wxEVT_GRID_CELL_LEFT_CLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellLeftClick
),
NULL
,
this
);
m_project_grid
->
Connect
(
wxEVT_GRID_CELL_LEFT_DCLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellLeftDClick
),
NULL
,
this
);
m_project_grid
->
Connect
(
wxEVT_GRID_CELL_RIGHT_CLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellRightClick
),
NULL
,
this
);
m_project_grid
->
Connect
(
wxEVT_GRID_SELECT_CELL
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCmdSelectCell
),
NULL
,
this
);
m_append_button
->
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
appendRowHandler
),
NULL
,
this
);
m_delete_button
->
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
deleteRowHandler
),
NULL
,
this
);
m_move_up_button
->
Connect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
moveUpHandler
),
NULL
,
this
);
...
...
@@ -211,6 +219,14 @@ DIALOG_FP_LIB_TABLE_BASE::~DIALOG_FP_LIB_TABLE_BASE()
{
// Disconnect Events
m_auinotebook
->
Disconnect
(
wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED
,
wxAuiNotebookEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
pageChangedHandler
),
NULL
,
this
);
m_global_grid
->
Disconnect
(
wxEVT_GRID_CELL_LEFT_CLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellLeftClick
),
NULL
,
this
);
m_global_grid
->
Disconnect
(
wxEVT_GRID_CELL_LEFT_DCLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellLeftDClick
),
NULL
,
this
);
m_global_grid
->
Disconnect
(
wxEVT_GRID_CELL_RIGHT_CLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellRightClick
),
NULL
,
this
);
m_global_grid
->
Disconnect
(
wxEVT_GRID_SELECT_CELL
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCmdSelectCell
),
NULL
,
this
);
m_project_grid
->
Disconnect
(
wxEVT_GRID_CELL_LEFT_CLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellLeftClick
),
NULL
,
this
);
m_project_grid
->
Disconnect
(
wxEVT_GRID_CELL_LEFT_DCLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellLeftDClick
),
NULL
,
this
);
m_project_grid
->
Disconnect
(
wxEVT_GRID_CELL_RIGHT_CLICK
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCellRightClick
),
NULL
,
this
);
m_project_grid
->
Disconnect
(
wxEVT_GRID_SELECT_CELL
,
wxGridEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
onGridCmdSelectCell
),
NULL
,
this
);
m_append_button
->
Disconnect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
appendRowHandler
),
NULL
,
this
);
m_delete_button
->
Disconnect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
deleteRowHandler
),
NULL
,
this
);
m_move_up_button
->
Disconnect
(
wxEVT_LEFT_DOWN
,
wxMouseEventHandler
(
DIALOG_FP_LIB_TABLE_BASE
::
moveUpHandler
),
NULL
,
this
);
...
...
pcbnew/dialogs/dialog_fp_lib_table_base.fbp
View file @
f477464f
...
...
@@ -464,7 +464,7 @@
<property
name=
"col_label_size"
>
30
</property>
<property
name=
"col_label_values"
></property>
<property
name=
"col_label_vert_alignment"
>
wxALIGN_CENTRE
</property>
<property
name=
"cols"
>
4
</property>
<property
name=
"cols"
>
5
</property>
<property
name=
"column_sizes"
></property>
<property
name=
"context_help"
></property>
<property
name=
"context_menu"
>
1
</property>
...
...
@@ -524,9 +524,9 @@
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
<event
name=
"OnGridCellChange"
></event>
<event
name=
"OnGridCellLeftClick"
></event>
<event
name=
"OnGridCellLeftDClick"
></event>
<event
name=
"OnGridCellRightClick"
></event>
<event
name=
"OnGridCellLeftClick"
>
onGridCellLeftClick
</event>
<event
name=
"OnGridCellLeftDClick"
>
onGridCellLeftDClick
</event>
<event
name=
"OnGridCellRightClick"
>
onGridCellRightClick
</event>
<event
name=
"OnGridCellRightDClick"
></event>
<event
name=
"OnGridCmdCellChange"
></event>
<event
name=
"OnGridCmdCellLeftClick"
></event>
...
...
@@ -543,7 +543,7 @@
<event
name=
"OnGridCmdLabelRightDClick"
></event>
<event
name=
"OnGridCmdRangeSelect"
></event>
<event
name=
"OnGridCmdRowSize"
></event>
<event
name=
"OnGridCmdSelectCell"
></event>
<event
name=
"OnGridCmdSelectCell"
>
onGridCmdSelectCell
</event>
<event
name=
"OnGridColSize"
></event>
<event
name=
"OnGridEditorCreated"
></event>
<event
name=
"OnGridEditorHidden"
></event>
...
...
@@ -693,7 +693,7 @@
<property
name=
"col_label_size"
>
30
</property>
<property
name=
"col_label_values"
></property>
<property
name=
"col_label_vert_alignment"
>
wxALIGN_CENTRE
</property>
<property
name=
"cols"
>
4
</property>
<property
name=
"cols"
>
5
</property>
<property
name=
"column_sizes"
></property>
<property
name=
"context_help"
></property>
<property
name=
"context_menu"
>
1
</property>
...
...
@@ -753,9 +753,9 @@
<event
name=
"OnEnterWindow"
></event>
<event
name=
"OnEraseBackground"
></event>
<event
name=
"OnGridCellChange"
></event>
<event
name=
"OnGridCellLeftClick"
></event>
<event
name=
"OnGridCellLeftDClick"
></event>
<event
name=
"OnGridCellRightClick"
></event>
<event
name=
"OnGridCellLeftClick"
>
onGridCellLeftClick
</event>
<event
name=
"OnGridCellLeftDClick"
>
onGridCellLeftDClick
</event>
<event
name=
"OnGridCellRightClick"
>
onGridCellRightClick
</event>
<event
name=
"OnGridCellRightDClick"
></event>
<event
name=
"OnGridCmdCellChange"
></event>
<event
name=
"OnGridCmdCellLeftClick"
></event>
...
...
@@ -772,7 +772,7 @@
<event
name=
"OnGridCmdLabelRightDClick"
></event>
<event
name=
"OnGridCmdRangeSelect"
></event>
<event
name=
"OnGridCmdRowSize"
></event>
<event
name=
"OnGridCmdSelectCell"
></event>
<event
name=
"OnGridCmdSelectCell"
>
onGridCmdSelectCell
</event>
<event
name=
"OnGridColSize"
></event>
<event
name=
"OnGridEditorCreated"
></event>
<event
name=
"OnGridEditorHidden"
></event>
...
...
pcbnew/dialogs/dialog_fp_lib_table_base.h
View file @
f477464f
...
...
@@ -61,6 +61,10 @@ class DIALOG_FP_LIB_TABLE_BASE : public DIALOG_SHIM
// Virtual event handlers, overide them in your derived class
virtual
void
pageChangedHandler
(
wxAuiNotebookEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
onGridCellLeftClick
(
wxGridEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
onGridCellLeftDClick
(
wxGridEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
onGridCellRightClick
(
wxGridEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
onGridCmdSelectCell
(
wxGridEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
appendRowHandler
(
wxMouseEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
deleteRowHandler
(
wxMouseEvent
&
event
)
{
event
.
Skip
();
}
virtual
void
moveUpHandler
(
wxMouseEvent
&
event
)
{
event
.
Skip
();
}
...
...
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