MCPcopy Create free account
hub / github.com/NatLabRockies/SAM / OnCommand

Method OnCommand

src/widgets.cpp:5203–5225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5201 }
5202
5203 void OnCommand(wxCommandEvent &evt)
5204 {
5205 if (evt.GetId() == IDDD_CHANGENUMROWS)
5206 {
5207 wxString result = wxGetTextFromUser("Enter number of data rows", "Edit Table",
5208 wxString::Format("%d", Grid->GetNumberRows()), this );
5209 if (result.IsEmpty()) return;
5210
5211 long l=0;
5212 if ( result.ToLong(&l) && l > 0 )
5213 {
5214 Grid->ResizeGrid( l, Grid->GetNumberCols() );
5215 }
5216 else
5217 wxMessageBox("Invalid number of rows or non-numeric entry.");
5218 }
5219 else if (evt.GetId() == IDDD_COPY)
5220 Grid->Copy(true);
5221 else if (evt.GetId() == IDDD_PASTE)
5222 Grid->Paste( wxExtGridCtrl::PASTE_ALL );
5223 else if (evt.GetId() == wxID_HELP)
5224 SamApp::ShowHelp("edit_data_table_column");
5225 }
5226
5227 DECLARE_EVENT_TABLE();
5228};

Callers

nothing calls this directly

Calls 5

GetIdMethod · 0.80
ResizeGridMethod · 0.80
GetNumberRowsMethod · 0.45
GetNumberColsMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected