20#include "../../kernel/core/datamanagement/container.hpp"
22#define ID_TABLEEDIT_OK 10101
23#define ID_TABLEEDIT_CANCEL 10102
47TablePanel::
TablePanel(wxFrame* parent, wxWindowID
id, wxStatusBar* statusbar,
bool readOnly) : wxPanel(parent,
id, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC | wxTAB_TRAVERSAL)
52 vsizer =
new wxBoxSizer(wxVERTICAL);
53 hsizer =
new wxBoxSizer(wxHORIZONTAL);
54 m_commentField =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200, -1),
55 wxTE_MULTILINE | wxTE_BESTWRAP | wxTE_RICH | wxBORDER_STATIC | (readOnly ? wxTE_READONLY : 0));
56 m_sourceField =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
57 wxTE_READONLY | wxBORDER_THEME);
58 m_lastSaveText =
new wxStaticText(
this, wxID_ANY,
_guilang.
get(
"GUI_TABLEPANEL_LASTSAVE"));
60 grid =
new TableViewer(
this, wxID_ANY, statusbar,
this, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS | wxBORDER_STATIC);
61 grid->SetTableReadOnly(readOnly);
63 vsizer->Add(
new wxStaticText(
this, wxID_ANY,
_guilang.
get(
"GUI_TABLEPANEL_DESCRIPTION")), 0, wxALIGN_LEFT | wxBOTTOM, 5);
64 vsizer->Add(m_commentField, 1, wxALIGN_CENTER_HORIZONTAL | wxEXPAND | wxBOTTOM, 5);
65 vsizer->Add(
new wxStaticText(
this, wxID_ANY,
_guilang.
get(
"GUI_TABLEPANEL_SOURCE")), 0, wxALIGN_LEFT | wxBOTTOM, 5);
66 vsizer->Add(m_sourceField, 0, wxALIGN_CENTER_HORIZONTAL | wxEXPAND | wxBOTTOM, 5);
67 vsizer->Add(m_lastSaveText, 0, wxALIGN_LEFT, 0);
69 hsizer->Add(vsizer, 0, wxEXPAND | wxALL, 5);
70 hsizer->Add(grid, 1, wxALIGN_CENTER_HORIZONTAL | wxEXPAND | wxALL, 5);
116 wxMenuBar* menuBar =
static_cast<wxFrame*
>(m_parent)->GetMenuBar();
120 menuBar =
new wxMenuBar();
121 static_cast<wxFrame*
>(m_parent)->SetMenuBar(menuBar);
136 return static_cast<wxFrame*
>(m_parent);
175 wxBoxSizer* buttonsizer =
new wxBoxSizer(wxHORIZONTAL);
180 buttonsizer->Add(button_ok, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
181 buttonsizer->Add(button_cancel, 1, wxALIGN_CENTER_VERTICAL | wxLEFT , 5);
183 vsizer->Prepend(buttonsizer, 0, wxALIGN_LEFT | wxEXPAND | wxBOTTOM, 5);
std::string get(const std::string &sMessage, const std::vector< std::string > &vTokens) const
This member function returns the language string for the passed language identifier and replaces all ...
void passEditedTable(NumeRe::Table _table)
Passes a table (as a container) to the kernel.
A table panel with editing functionalities. Creates APPLY and CANCEL buttons and provides their event...
void OnButtonOk(wxCommandEvent &event)
Event handler for the OK button.
void OnButtonCancel(wxCommandEvent &event)
Event handler for the CANCEL button.
void OnClose(wxCloseEvent &event)
Event handler for the CLOSE event.
TableEditPanel(wxFrame *parent, wxWindowID id, wxStatusBar *statusbar)
Constructor for the table edit panel, which creates also the buttons at the top of the window.
Generic table panel, which also contains all meta UI elements.
void OnClose(wxCloseEvent &event)
Event handler for the CLOSE event.
void update(const NumeRe::TableMetaData &meta)
Update the panel with the passed table meta data.
wxTextCtrl * m_sourceField
std::string getComment() const
Returns the comment listed in the documentation field.
wxFrame * getFrame()
Returns a pointer to the parent frame.
wxTextCtrl * m_commentField
NumeReTerminal * m_terminal
wxMenuBar * getMenuBar()
Returns a pointer to the menu bar of the parent frame. If no menu bar exists, a new one is created.
wxStaticText * m_lastSaveText
This class is an adaption of the wxGrid class to present the tabular data in NumeRe's memory and enab...
NumeRe::Table GetData()
This member function returns the internal NumeRe::Table from the data provider object.
void finalize()
Ensure that the editors are all closed.
std::string toString(int)
Converts an integer to a string without the Settings bloat.
#define ID_TABLEEDIT_CANCEL