void PSIdraw::GridSpacing (ostream& out) { float xincr, yincr; IdrawComp* comp = (IdrawComp*) GetSubject(); comp->GetGridSpacing(xincr, yincr); out << "Grid " << xincr << " " << yincr << " "; }
void IGridSpacingCmd::Execute () { GridSpacingCmd::Execute(); float xincr, yincr; _dialog->GetValues(xincr, yincr); IdrawComp* idcomp = (IdrawComp*) GetEditor()->GetComponent()->GetRoot(); idcomp->SetGridSpacing(xincr, yincr); }
void OpenCmd::Execute () { Editor* ed = GetEditor(); Component* orig_comp = ed->GetComponent(); ViewCompCmd::Execute(); Component* new_comp = ed->GetComponent(); if (new_comp != orig_comp) { IdrawComp* idcomp = (IdrawComp*) new_comp; Grid* grid = ed->GetViewer()->GetGrid(); float xincr, yincr; idcomp->GetGridSpacing(xincr, yincr); grid->SetSpacing(xincr, yincr); } }