Commit f477464f authored by Dick Hollenbeck's avatar Dick Hollenbeck

embellish fp_lib_table editor with beginnings of cut, copy, paste

parent 9a806749
...@@ -59,7 +59,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR ...@@ -59,7 +59,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
T tok; T tok;
// This table may be nested within a larger s-expression, or not. // 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 ) if( in->CurTok() != T_fp_lib_table )
{ {
in->NeedLEFT(); in->NeedLEFT();
...@@ -84,7 +84,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR ...@@ -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 ) if( ( tok = in->NextTok() ) != T_lib )
in->Expecting( T_lib ); in->Expecting( T_lib );
// (name LOGICAL_NAME) // (name NICKNAME)
in->NeedLEFT(); in->NeedLEFT();
if( ( tok = in->NextTok() ) != T_name ) 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 ...@@ -97,7 +97,7 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR
in->NeedRIGHT(); in->NeedRIGHT();
// After (name), remaining (lib) elements are order independent, and in // 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 sawType = false;
bool sawOpts = false; bool sawOpts = false;
...@@ -191,12 +191,12 @@ void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const ...@@ -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 void FP_LIB_TABLE::ROW::Format( OUTPUTFORMATTER* out, int nestLevel ) const
throw( IO_ERROR ) 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( GetNickName() ).c_str(),
out->Quotew( GetDescr() ).c_str(),
out->Quotew( GetFullURI() ).c_str(),
out->Quotew( GetType() ).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()
); );
} }
......
This diff is collapsed.
...@@ -34,7 +34,7 @@ DIALOG_FP_LIB_TABLE_BASE::DIALOG_FP_LIB_TABLE_BASE( wxWindow* parent, wxWindowID ...@@ -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 ); m_global_grid = new wxGrid( m_global_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid // Grid
m_global_grid->CreateGrid( 1, 4 ); m_global_grid->CreateGrid( 1, 5 );
m_global_grid->EnableEditing( true ); m_global_grid->EnableEditing( true );
m_global_grid->EnableGridLines( true ); m_global_grid->EnableGridLines( true );
m_global_grid->EnableDragGridSize( true ); m_global_grid->EnableDragGridSize( true );
...@@ -70,7 +70,7 @@ DIALOG_FP_LIB_TABLE_BASE::DIALOG_FP_LIB_TABLE_BASE( wxWindow* parent, wxWindowID ...@@ -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 ); m_project_grid = new wxGrid( m_project_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid // Grid
m_project_grid->CreateGrid( 1, 4 ); m_project_grid->CreateGrid( 1, 5 );
m_project_grid->EnableEditing( true ); m_project_grid->EnableEditing( true );
m_project_grid->EnableGridLines( true ); m_project_grid->EnableGridLines( true );
m_project_grid->EnableDragGridSize( true ); m_project_grid->EnableDragGridSize( true );
...@@ -199,6 +199,14 @@ DIALOG_FP_LIB_TABLE_BASE::DIALOG_FP_LIB_TABLE_BASE( wxWindow* parent, wxWindowID ...@@ -199,6 +199,14 @@ DIALOG_FP_LIB_TABLE_BASE::DIALOG_FP_LIB_TABLE_BASE( wxWindow* parent, wxWindowID
// Connect Events // Connect Events
m_auinotebook->Connect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( DIALOG_FP_LIB_TABLE_BASE::pageChangedHandler ), NULL, this ); 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_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_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 ); 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() ...@@ -211,6 +219,14 @@ DIALOG_FP_LIB_TABLE_BASE::~DIALOG_FP_LIB_TABLE_BASE()
{ {
// Disconnect Events // Disconnect Events
m_auinotebook->Disconnect( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler( DIALOG_FP_LIB_TABLE_BASE::pageChangedHandler ), NULL, this ); 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_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_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 ); m_move_up_button->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( DIALOG_FP_LIB_TABLE_BASE::moveUpHandler ), NULL, this );
......
...@@ -464,7 +464,7 @@ ...@@ -464,7 +464,7 @@
<property name="col_label_size">30</property> <property name="col_label_size">30</property>
<property name="col_label_values"></property> <property name="col_label_values"></property>
<property name="col_label_vert_alignment">wxALIGN_CENTRE</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="column_sizes"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
...@@ -524,9 +524,9 @@ ...@@ -524,9 +524,9 @@
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnGridCellChange"></event> <event name="OnGridCellChange"></event>
<event name="OnGridCellLeftClick"></event> <event name="OnGridCellLeftClick">onGridCellLeftClick</event>
<event name="OnGridCellLeftDClick"></event> <event name="OnGridCellLeftDClick">onGridCellLeftDClick</event>
<event name="OnGridCellRightClick"></event> <event name="OnGridCellRightClick">onGridCellRightClick</event>
<event name="OnGridCellRightDClick"></event> <event name="OnGridCellRightDClick"></event>
<event name="OnGridCmdCellChange"></event> <event name="OnGridCmdCellChange"></event>
<event name="OnGridCmdCellLeftClick"></event> <event name="OnGridCmdCellLeftClick"></event>
...@@ -543,7 +543,7 @@ ...@@ -543,7 +543,7 @@
<event name="OnGridCmdLabelRightDClick"></event> <event name="OnGridCmdLabelRightDClick"></event>
<event name="OnGridCmdRangeSelect"></event> <event name="OnGridCmdRangeSelect"></event>
<event name="OnGridCmdRowSize"></event> <event name="OnGridCmdRowSize"></event>
<event name="OnGridCmdSelectCell"></event> <event name="OnGridCmdSelectCell">onGridCmdSelectCell</event>
<event name="OnGridColSize"></event> <event name="OnGridColSize"></event>
<event name="OnGridEditorCreated"></event> <event name="OnGridEditorCreated"></event>
<event name="OnGridEditorHidden"></event> <event name="OnGridEditorHidden"></event>
...@@ -693,7 +693,7 @@ ...@@ -693,7 +693,7 @@
<property name="col_label_size">30</property> <property name="col_label_size">30</property>
<property name="col_label_values"></property> <property name="col_label_values"></property>
<property name="col_label_vert_alignment">wxALIGN_CENTRE</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="column_sizes"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
...@@ -753,9 +753,9 @@ ...@@ -753,9 +753,9 @@
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnGridCellChange"></event> <event name="OnGridCellChange"></event>
<event name="OnGridCellLeftClick"></event> <event name="OnGridCellLeftClick">onGridCellLeftClick</event>
<event name="OnGridCellLeftDClick"></event> <event name="OnGridCellLeftDClick">onGridCellLeftDClick</event>
<event name="OnGridCellRightClick"></event> <event name="OnGridCellRightClick">onGridCellRightClick</event>
<event name="OnGridCellRightDClick"></event> <event name="OnGridCellRightDClick"></event>
<event name="OnGridCmdCellChange"></event> <event name="OnGridCmdCellChange"></event>
<event name="OnGridCmdCellLeftClick"></event> <event name="OnGridCmdCellLeftClick"></event>
...@@ -772,7 +772,7 @@ ...@@ -772,7 +772,7 @@
<event name="OnGridCmdLabelRightDClick"></event> <event name="OnGridCmdLabelRightDClick"></event>
<event name="OnGridCmdRangeSelect"></event> <event name="OnGridCmdRangeSelect"></event>
<event name="OnGridCmdRowSize"></event> <event name="OnGridCmdRowSize"></event>
<event name="OnGridCmdSelectCell"></event> <event name="OnGridCmdSelectCell">onGridCmdSelectCell</event>
<event name="OnGridColSize"></event> <event name="OnGridColSize"></event>
<event name="OnGridEditorCreated"></event> <event name="OnGridEditorCreated"></event>
<event name="OnGridEditorHidden"></event> <event name="OnGridEditorHidden"></event>
......
...@@ -61,6 +61,10 @@ class DIALOG_FP_LIB_TABLE_BASE : public DIALOG_SHIM ...@@ -61,6 +61,10 @@ class DIALOG_FP_LIB_TABLE_BASE : public DIALOG_SHIM
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void pageChangedHandler( wxAuiNotebookEvent& event ) { event.Skip(); } 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 appendRowHandler( wxMouseEvent& event ) { event.Skip(); }
virtual void deleteRowHandler( wxMouseEvent& event ) { event.Skip(); } virtual void deleteRowHandler( wxMouseEvent& event ) { event.Skip(); }
virtual void moveUpHandler( wxMouseEvent& event ) { event.Skip(); } virtual void moveUpHandler( wxMouseEvent& event ) { event.Skip(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment