void GridSpacingCmd::Execute () { float xincr, yincr; Editor* ed = GetEditor(); if (_dialog == nil) { _dialog = new GridDialog(); } ed->InsertDialog(_dialog); bool accepted = _dialog->Accept(); ed->RemoveDialog(_dialog); if (accepted) { _dialog->GetValues(xincr, yincr); if (xincr != 0.0 && yincr != 0.0) { Viewer* viewer; for (int i = 0; (viewer = ed->GetViewer(i)) != nil; ++i) { viewer->GetGrid()->SetSpacing(xincr, yincr); viewer->Draw(); } } } }
void GridCmd::Execute () { Viewer* viewer; for (int i = 0; (viewer = GetEditor()->GetViewer(i)) != nil; ++i) { Grid* grid = viewer->GetGrid(); if (grid != nil) grid->Visibility(!grid->IsVisible()); viewer->Draw(); } }