Ejemplo n.º 1
0
Control* ExamineTool::CreatePropsEntry (Selection* s, Editor* ed) {
    Control* ctrl = nil;
    Iterator i;

    if (s->Number() > 1) {
        for (s->First(i); !s->Done(i); s->Next(i)) {
            GraphicComp* comp = s->GetView(i)->GetGraphicComp();
            if (comp->IsA(INTERACTOR_COMP)) {
                if (ctrl == nil) {
                    ctrl = new H_PullrightMenu(
                        new Message("Props...", Center, 2, hfil)
                    );
                }
                Menu* m = (Menu*) ctrl;
                PropsCmd* cmd = new PropsCmd(ed, (InteractorComp*) comp);
                m->Include(
                    new CommandItem(GetName(comp, _shift, false), Center, cmd)
                );
            }
        }
    } else {
	s->First(i);
        GraphicComp* comp = s->GetView(i)->GetGraphicComp();
        if (comp->IsA(INTERACTOR_COMP)) {
            ctrl = new CommandItem(
                "Props...", Center, new PropsCmd(ed, (InteractorComp*) comp)
            );
        }
    }
    return ctrl;
}
Ejemplo n.º 2
0
Control* ExamineTool::CreateInfoEntry (Selection* s, Editor* ed) {
    Control* ctrl = nil;
    Iterator i;

    if (s->Number() > 1) {
        Menu* m = new H_PullrightMenu(new Message("Info...", Center, 2, hfil));
        ctrl = m;

        for (s->First(i); !s->Done(i); s->Next(i)) {
	    GraphicView* view = (GraphicView*) s->GetView(i);
            GraphicComp* comp = view->GetGraphicComp();
            InfoCmd* cmd = new InfoCmd(ed, view);
            m->Include(
                new CommandItem(GetName(comp, _shift, true), Center, cmd)
            );
        }
    } else {
	s->First(i);
	GraphicView* view = (GraphicView*) s->GetView(i);
        ctrl = new CommandItem("Info...", Center, new InfoCmd(ed, view));
    }
    return ctrl;
}