2010-08-28 18:02:24 +00:00
|
|
|
#ifndef __hotkeys_grid_table__
|
|
|
|
#define __hotkeys_grid_table__
|
|
|
|
|
|
|
|
#include <wx/intl.h>
|
|
|
|
|
|
|
|
#include <wx/string.h>
|
|
|
|
#include <wx/grid.h>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <utility>
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
|
|
|
#include <appl_wxstruct.h>
|
|
|
|
#include <common.h>
|
|
|
|
#include <hotkeys_basic.h>
|
2010-08-28 18:02:24 +00:00
|
|
|
|
2013-09-21 17:09:08 +00:00
|
|
|
class HOTKEY_EDITOR_GRID_TABLE : public wxGridTableBase
|
2010-08-28 18:02:24 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2011-09-29 16:49:40 +00:00
|
|
|
typedef std::pair< wxString, EDA_HOTKEY* > hotkey_spec;
|
2010-08-28 18:02:24 +00:00
|
|
|
typedef std::vector< hotkey_spec > hotkey_spec_vector;
|
|
|
|
|
2013-09-21 17:09:08 +00:00
|
|
|
HOTKEY_EDITOR_GRID_TABLE( struct EDA_HOTKEY_CONFIG* origin );
|
|
|
|
virtual ~HOTKEY_EDITOR_GRID_TABLE();
|
2010-08-28 18:02:24 +00:00
|
|
|
hotkey_spec_vector& getHotkeys();
|
|
|
|
|
2011-01-23 12:32:33 +00:00
|
|
|
private:
|
2010-08-28 18:02:24 +00:00
|
|
|
virtual int GetNumberRows();
|
|
|
|
virtual int GetNumberCols();
|
|
|
|
virtual bool IsEmptyCell( int row, int col );
|
|
|
|
virtual wxString GetValue( int row, int col );
|
|
|
|
virtual void SetValue( int row, int col, const wxString& value );
|
|
|
|
virtual wxString GetTypeName( int row, int col );
|
|
|
|
virtual bool CanGetValueAs( int row, int col, const wxString& typeName );
|
|
|
|
virtual bool CanSetValueAs( int row, int col, const wxString& typeName );
|
|
|
|
virtual long GetValueAsLong( int row, int col );
|
|
|
|
virtual double GetValueAsDouble( int row, int col );
|
|
|
|
virtual bool GetValueAsBool( int row, int col );
|
|
|
|
virtual void SetValueAsLong( int row, int col, long value );
|
|
|
|
virtual void SetValueAsDouble( int row, int col, double value );
|
|
|
|
virtual void SetValueAsBool( int row, int col, bool value );
|
|
|
|
virtual void* GetValueAsCustom( int row, int col );
|
|
|
|
virtual void SetValueAsCustom( int row, int col, void* value );
|
|
|
|
virtual wxString GetColLabelValue( int col );
|
|
|
|
|
2011-01-23 12:32:33 +00:00
|
|
|
public:
|
2013-09-21 17:09:08 +00:00
|
|
|
virtual bool IsHeader( int row );
|
2010-08-28 18:02:24 +00:00
|
|
|
virtual void SetKeyCode( int row, long key );
|
2011-09-29 16:49:40 +00:00
|
|
|
virtual void RestoreFrom( struct EDA_HOTKEY_CONFIG* origin );
|
2010-08-28 18:02:24 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
std::vector< hotkey_spec > m_hotkeys;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|