void Viewer::Update () { Selection* s = GetSelection(); GraphicView* view = GetGraphicView(); Component* viewComp = view->GetGraphicComp(); Component* edComp = _editor->GetComponent(); if (viewComp != edComp) { ComponentView* newView = edComp->Create(ViewCategory()); if (newView->IsA(GRAPHIC_VIEW)) { edComp->Attach(newView); newView->Update(); SetGraphicView((GraphicView*) newView); } else { delete newView; } } else { s->Hide(this); _viewerView->Update(); GraphicBlock::UpdatePerspective(); _damage->Repair(); s->Show(this); } }
OverlayView* OverlayComp::FindView (Viewer* viewer) { if (!_views) return nil; for (UList* u = _views->First(); u != _views->End(); u = u->Next()) { ComponentView* compview = View(u); if (compview->IsA(OVERLAY_VIEW) && ((OverlayView*)compview)->GetViewer() == viewer) return (OverlayView*)compview; } return nil; }
void OverlayComp::Interpret(Command* cmd) { Editor* ed = cmd->GetEditor(); if (cmd->IsA(UNHIDE_VIEWS_CMD) || cmd->IsA(SENSITIZE_VIEWS_CMD)) { for (UList* u = _views->First(); u != _views->End(); u = u->Next()) { ComponentView* compview = View(u); if (compview->IsA(OVERLAY_VIEW)) { ((OverlayView*)compview)->Sensitize(); if (cmd->IsA(UNHIDE_VIEWS_CMD)) ((OverlayView*)compview)->Show(); } } Notify(); } else { GraphicComp::Interpret(cmd); } }