41 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
45 grid->CreateGrid( 1, 7 );
46 grid->EnableGridLines(
true );
47 grid->SetMargins( 0, 0 );
48 grid->SetSelectionMode( wxGrid::wxGridSelectRows );
51 grid->SetColSize( 0, 30 );
52 grid->SetColSize( 1, 48 );
53 grid->SetColSize( 2, 48 );
54 grid->SetColSize( 3, 240 );
55 grid->SetColSize( 4, 100 );
56 grid->SetColSize( 5, 80 );
57 grid->SetColSize( 6, 240 );
58 grid->SetColLabelSize( 22 );
59 grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
62 grid->EnableDragRowSize(
false );
63 grid->SetRowLabelSize( 0 );
64 grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
67 grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTER );
76 sizer->Add(
grid, 1, wxALL|wxEXPAND, 5 );
78 panel->SetSizer( sizer );
85 aNotebook->AddPage( panel, aTitle,
false );
100 int row = aEvent.GetRow();
101 int col = aEvent.GetCol();
106 wxString editValue =
grid->GetCellValue( row, col );
108 if( wxGridCellEditor* cellEditor =
grid->GetCellEditor( row, col ) )
110 if( cellEditor->IsCreated() && cellEditor->GetWindow()->IsShown() )
111 editValue = cellEditor->GetValue();
113 cellEditor->DecRef();
116 grid->GetTable()->SetValue( row, col, editValue );
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.