MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / moveCols

Method moveCols

src/csvapplication.cpp:2419–2438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2417
2418
2419void CsvApplication::moveCols(bool right) {
2420 int row_top, row_bottom, col_top, col_bottom;
2421 int winIndex = app.getTopWindow();
2422 windows[winIndex].grid->get_selection(row_top, col_top, row_bottom, col_bottom);
2423 if( (right && col_bottom < windows[winIndex].table->getNumberCols() - 1 && col_top >= 0) ||
2424 (!right && col_bottom < windows[winIndex].table->getNumberCols() && col_top > 0 ) ) {
2425 showImWorkingWindow("Moving column(s) ...");
2426 windows[winIndex].addUndoStateTable("Move column(s)");
2427 windows[winIndex].setChanged(true);
2428 windows[winIndex].setUsed(true);
2429 windows[winIndex].table->moveCols(col_top, col_bottom, right);
2430 if( right )
2431 windows[winIndex].grid->moveSelection(0,1);
2432 else
2433 windows[winIndex].grid->moveSelection(0,-1);
2434 hideImWorkingWindow();
2435 windows[winIndex].grid->redraw();
2436 Fl::check();
2437 }
2438}
2439
2440
2441void CsvApplication::addCol(bool before) {

Callers

nothing calls this directly

Calls 7

checkFunction · 0.85
getTopWindowMethod · 0.80
getNumberColsMethod · 0.80
addUndoStateTableMethod · 0.80
setChangedMethod · 0.80
setUsedMethod · 0.80
moveSelectionMethod · 0.80

Tested by

no test coverage detected