20#ifndef DIALOG_GENERATED_TABLE_PROPERTIES_H
21#define DIALOG_GENERATED_TABLE_PROPERTIES_H
54 using wxPanel::wxPanel;
62 std::function<std::optional<GENERATED_TABLE_FORMAT>()>
m_GetFormat;
92 void onMoveUp( wxCommandEvent& aEvent )
override;
93 void onMoveDown( wxCommandEvent& aEvent )
override;
100 void setColumns(
const std::vector<GENERATED_TABLE_COLUMN>& aColumns );
102 std::vector<GENERATED_TABLE_COLUMN>
shownColumns()
const;
104 std::optional<GENERATED_TABLE_FORMAT>
getFormat();
DIALOG_GENERATED_TABLE_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Table Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void setColumns(const std::vector< GENERATED_TABLE_COLUMN > &aColumns)
Show aColumns checked and in order, then every other schema column unchecked so turning one back on d...
bool harvestColumnGrid()
Read the grid back into m_rows.
void onMoveUp(wxCommandEvent &aEvent) override
void onResetColumns(wxCommandEvent &aEvent) override
PCB_GENERATED_TABLE * m_table
DIALOG_GENERATED_TABLE_PROPERTIES(PCB_BASE_EDIT_FRAME *aFrame, PCB_GENERATED_TABLE *aTable, GENERATED_TABLE_OPTIONS_FACTORY aOptions)
aOptions may be empty. When given, the panel is created on the dialog and put below the column grid
void setFormat(const GENERATED_TABLE_FORMAT &aFormat)
void fillColumnGrid()
Fill the column grid from m_rows.
GENERATED_TABLE_OPTIONS_PANEL * m_options
std::vector< GENERATED_TABLE_COLUMN > shownColumns() const
UNIT_BINDER m_separatorsWidth
void onMoveDown(wxCommandEvent &aEvent) override
void onBorderChecked(wxCommandEvent &aEvent) override
std::optional< GENERATED_TABLE_FORMAT > getFormat()
PCB_BASE_EDIT_FRAME * m_frame
bool TransferDataToWindow() override
bool TransferDataFromWindow() override
std::vector< COLUMN_ROW > m_rows
Every known column, checked ones first in table order.
void onColumnGridSize(wxSizeEvent &aEvent)
void moveColumn(int aDelta)
void fitColumnGrid()
Share the grid's width out across its columns so none of it goes unused.
UNIT_BINDER m_borderWidth
Settings only one kind of generated table has, shown below the shared column grid.
virtual bool TransferFromWindow(PCB_GENERATED_TABLE &aTable, GENERATED_TABLE_REFRESH &aRefresh)=0
Applies to the table. Board state goes into aRefresh so Cancel leaves the board alone.
std::function< std::optional< GENERATED_TABLE_FORMAT >()> m_GetFormat
The dialog's columns, units and precision as edited so far, or nothing when a grid edit is invalid.
virtual void TransferToWindow(const PCB_GENERATED_TABLE &aTable)=0
std::function< void(const GENERATED_TABLE_FORMAT &)> m_SetFormat
Hands the dialog a new column set, units and precision, e.g. from an imported template.
One pass of rebuilding tables.
Common, abstract interface for edit frames.
A table whose cell text is derived from the board and rebuilt whenever it goes stale.
std::function< GENERATED_TABLE_OPTIONS_PANEL *(wxWindow *aParent)> GENERATED_TABLE_OPTIONS_FACTORY
The options panel must be created with its real parent, since a wxPanel cannot be reparented reliably...
GENERATED_TABLE_COLUMN m_Column
A column as a generated table actually carries it: what a row's cell in that column holds and how it ...