23#include <wx/clipbrd.h> 
   30    m_grid->Disconnect( wxEVT_CHAR_HOOK );
 
 
   35        std::function<
void( wxCommandEvent& )> aAddHandler ) :
 
   38    m_grid->Disconnect( wxEVT_CHAR_HOOK );
 
 
   46                _( 
"Edit options..." ),
 
   47                _( 
"Edit options for this library entry" ) );
 
   49    menu.AppendSeparator();
 
   51    bool            showActivate = 
false;
 
   52    bool            showDeactivate = 
false;
 
   53    bool            showSetVisible = 
false;
 
   54    bool            showUnsetVisible = 
false;
 
   63            showDeactivate = 
true;
 
   68            showUnsetVisible = 
true;
 
   70            showSetVisible = 
true;
 
   72        if( showActivate && showDeactivate && showSetVisible && showUnsetVisible )
 
   87        if( showUnsetVisible )
 
   91    bool showSettings = 
false;
 
   97        if( 
m_sel_row_count == 1 && adapter->SupportsConfigurationDialog( nickname ) )
 
  101                         wxString::Format( 
_( 
"Library settings for %s..." ), nickname ) );
 
  105    if( showActivate || showDeactivate || showSetVisible || showUnsetVisible || showSettings )
 
  106        menu.AppendSeparator();
 
 
  114    int menu_id = 
event.GetId();
 
 
  159    if( ev.GetModifiers() == wxMOD_CONTROL && ev.GetKeyCode() == 
'V' && 
m_grid->IsCellEditControlShown() )
 
  163        if( wxTheClipboard->Open() )
 
  165            if( wxTheClipboard->IsSupported( wxDF_TEXT ) || wxTheClipboard->IsSupported( wxDF_UNICODETEXT ) )
 
  167                wxTextDataObject data;
 
  168                wxTheClipboard->GetData( data );
 
  170                wxString 
text = data.GetText();
 
  172                if( !
text.Contains( 
'\t' ) && 
text.Contains( 
',' ) )
 
  173                    text.Replace( 
',', 
'\t' );
 
  175                if( 
text.Contains( 
'\t' ) || 
text.Contains( 
'\n' ) || 
text.Contains( 
'\r' ) )
 
  177                    m_grid->CancelPendingChanges();
 
  178                    int row = 
m_grid->GetGridCursorRow();
 
  182                    if( 
table && row >= 0 && row < table->GetNumberRows() )
 
  186                        if( !nickname.IsEmpty() )
 
  189                            wxTheClipboard->Close();
 
  197                    m_grid->SetGridCursor( row, 0 );
 
  200                    wxTheClipboard->Close();
 
  206            wxTheClipboard->Close();
 
 
virtual void paste_text(const wxString &cb_text)
 
void getSelectedArea()
Puts the selected area into a sensible rectangle of m_sel_{row,col}_{start,count} above.
 
GRID_TRICKS(WX_GRID *aGrid)
 
virtual void doPopupSelection(wxCommandEvent &event)
 
virtual void showPopupMenu(wxMenu &menu, wxGridEvent &aEvent)
 
WX_GRID * m_grid
I don't own the grid, but he owns me.
 
void onCharHook(wxKeyEvent &event)
 
The interface used by the classes that actually can load IO plugins for the different parts of KiCad ...
 
bool handleDoubleClick(wxGridEvent &aEvent) override
 
LIB_TABLE_GRID_TRICKS(WX_GRID *aGrid)
 
virtual void optionsEditor(int aRow)=0
 
virtual bool supportsVisibilityColumn()
 
void doPopupSelection(wxCommandEvent &event) override
 
void onCharHook(wxKeyEvent &ev)
 
@ LIB_TABLE_GRID_TRICKS_ACTIVATE_SELECTED
 
@ LIB_TABLE_GRID_TRICKS_OPTIONS_EDITOR
 
@ LIB_TABLE_GRID_TRICKS_SET_VISIBLE
 
@ LIB_TABLE_GRID_TRICKS_LIBRARY_SETTINGS
 
@ LIB_TABLE_GRID_TRICKS_DEACTIVATE_SELECTED
 
@ LIB_TABLE_GRID_TRICKS_UNSET_VISIBLE
 
void showPopupMenu(wxMenu &menu, wxGridEvent &aEvent) override
 
This abstract base class mixes any object derived from LIB_TABLE into wxGridTableBase so the result c...
 
void SetValueAsBool(int aRow, int aCol, bool aValue) override
 
wxString GetValue(int aRow, int aCol) override
 
LIBRARY_MANAGER_ADAPTER * Adapter() const
 
LIBRARY_TABLE_ROW & At(size_t aIndex)
 
bool GetValueAsBool(int aRow, int aCol) override
 
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE.
 
virtual void ShowSettingsDialog(wxWindow *aParent) const