Exemplo n.º 1
0
InfoDialog* EditorView::GetInfoDialog () {
    IBEditor* ibed = (IBEditor*) GetViewer()->GetEditor();
    InfoDialog* info = MonoSceneClassView::GetInfoDialog();
    ButtonState* state = info->GetState();
    EditorComp* edcomp = GetEditorComp();

    MemberNameVar* viewerVar = edcomp->GetViewerVar();
    ButtonStateVar* curCtrlVar = edcomp->GetButtonStateVar();
    MemberNameVar* keymap = edcomp->GetKeyMap();
    MemberNameVar* selection = edcomp->GetSelection();
    IGraphicComps* igrcomps = edcomp->GetIGraphicComps();

    info->Include(new RelatedVarView(
        viewerVar, state, edcomp, "Viewer Name: ")
    );
    info->Include(new SMemberNameVarView(
        keymap, state, edcomp, ibed, "KeyMap")
    );
    info->Include(new SMemberNameVarView(
        selection, state, edcomp, ibed, "Selection")
    );
    info->Include(new SMemberNameVarView(
        igrcomps, state, edcomp, ibed, "GraphicComp")
    );
    info->Include(new CtrlStateVarView(curCtrlVar, state, edcomp, ibed));
    return info;
}
Exemplo n.º 2
0
void Editor::Update () { 
    Viewer* v;

    for (int i = 0; (v = GetViewer(i)) != nil; ++i) {
        v->Update();
    }
}
Exemplo n.º 3
0
boolean ConnectManip::Manipulating (Event& e) {
    GraphicView* views = GetViewer()->GetGraphicView();
    Rubberband* r = GetRubberband();
    float cx, cy;

    if (r == nil) {
        return false;
    }

    if (e.eventType == MotionEvent) {
        _target = views->ConnectorIntersecting(
            e.x-SLOP, e.y-SLOP, e.x+SLOP, e.y+SLOP
        );

        if (_target == nil) {
            r->Track(e.x, e.y);

        } else {
            _target->GetGraphic()->GetCenter(cx, cy);
            r->Track(Math::round(cx), Math::round(cy));
        }

    } else if (e.eventType == UpEvent) {
	r->Erase();
	return false;
    }
    return true;
}
Exemplo n.º 4
0
void DragManip::Constrain (Event& e) {
    if (e.shift) {
        if (_constraint & XFixed) {
            e.x = _origx;
        }
        if (_constraint & YFixed) {
            e.y = _origy; 
        }
        if (_constraint & XYEqual) {
            Coord w = abs(e.x - _origx);
            Coord h = abs(e.y - _origy);
            if (w > h) {
                e.y = _origy + ((e.y > _origy) ? w : -w);
            } else {
                e.x = _origx + ((e.x > _origx) ? h : -h);
            }
        }
        if (_constraint & HorizOrVert) {
            if (abs(e.x - _origx) < abs(e.y - _origy)) {
                e.x = _origx;
            } else {
                e.y = _origy;
            }
        }
    }
    if (_constraint & Gravity) {
        GetViewer()->Constrain(e.x, e.y);
    }
}
Exemplo n.º 5
0
boolean TextManip::HandleKey (Event& e) {
    World* world = GetViewer()->GetWorld();
    char c = e.keystring[0];
    boolean manipulating = true;

    switch (c) {
        case '\007':  world->RingBell(1); break;
        case '\001':  BeginningOfLine(); break;
        case '\005':  EndOfLine(); break;
        case '\006':  ForwardCharacter(1); break;
        case '\002':  BackwardCharacter(1); break;
        case '\016':  ForwardLine(1); break;
        case '\020':  BackwardLine(1); break;
        case '\013':  DeleteLine(); break;
        case '\004':  DeleteCharacter(1); break;
        case '\010':  DeleteCharacter(-1); break;
        case '\177':  DeleteCharacter(-1); break;
        case '\011':  InsertCharacter('\t'); break;
        case '\015':  if (_multiline) InsertCharacter('\n'); break;
        case '\033':  manipulating = false; break;
        default:
            if (!iscntrl(c & 0x7f)) {
                InsertCharacter(c);
            }
            break;
    }
    return manipulating;
}
Exemplo n.º 6
0
void TextManip::Grasp (Event& e) {
    _grasp_e = e;

    Viewer* v = GetViewer();
    Selection* s = v->GetSelection();
    v->Constrain(e.x, e.y);

    _selecting = true;
    if (!_prepositioned) {
        _xpos = e.x;
        _ypos = e.y;
    }

    PlaceTextDisplay(_xpos, _ypos);
    Coord l, b, r, t;
    _display->CaretStyle(BarCaret);
    _display->Bounds(l, b, r, t);
    _display->Redraw(l, b, r, t);

    _selection = new Selection(s);
    s->Clear();

    if (_prepositioned) {
        Select(Locate(e.x, e.y));
    }
}
Exemplo n.º 7
0
InfoDialog* FBrowserView::GetInfoDialog () {
    IBEditor* ibed = (IBEditor*) GetViewer()->GetEditor();
    InfoDialog* info = StrBrowserView::GetInfoDialog();
    ButtonState* state = info->GetState();
    FBrowserComp* fcomp = GetFBrowserComp();
    FBrowserVar* fbVar = fcomp->GetFBrowserVar();

    info->Include(new FBrowserVarView(fbVar, state));
    return info;
}
Exemplo n.º 8
0
Arquivo: rect.cpp Projeto: PNCG/neuron
void RectView::CreateHandles () {
    Coord x[4], y[4];
    Viewer* v = GetViewer();
    
    if (v != nil) {
        GetCorners(x, y);
        _handles = new RubberHandles(nil, nil, x, y, 4, 0, HANDLE_SIZE);
        v->InitRubberband(_handles);
    }
}
Exemplo n.º 9
0
Arquivo: line.cpp Projeto: PNCG/neuron
void LineView::CreateHandles () {
    Coord x[2], y[2];
    Viewer* v = GetViewer();
    
    if (v != nil) {
        GetEndpoints(x[0], y[0], x[1], y[1]);
        _handles = new RubberHandles(nil, nil, x, y, 2, 0, HANDLE_SIZE);
        v->InitRubberband(_handles);
    }
}
Exemplo n.º 10
0
void TextManip::Effect (Event& e) {
    Viewer* v = GetViewer();

    _display->CaretStyle(NoCaret);
    Select(0);
    v->GetSelection()->Merge(_selection);
    v->UnRead(e);
    v->IncurTextDisplayDamage(_display, _painter);
    delete _selection;
}
Exemplo n.º 11
0
InfoDialog* StrBrowserView::GetInfoDialog () {
    IBEditor* ibed = (IBEditor*) GetViewer()->GetEditor();
    InfoDialog* info = ButtonView::GetInfoDialog();
    ButtonState* state = info->GetState();
    StrBrowserComp* scomp = GetStrBrowserComp();
    BooleanStateVar* uniqueSel = scomp->GetUniqueSel();
    info->Include(
	new BooleanStateVarView(uniqueSel, " Unique Selection ")
    );
    return info;
}
Exemplo n.º 12
0
InfoDialog* DialogClassView::GetInfoDialog () {
    IBEditor* ibed = (IBEditor*) GetViewer()->GetEditor();
    InfoDialog* info = MonoSceneClassView::GetInfoDialog();
    ButtonState* state = info->GetState();

    DialogClass* dclass = GetDialogClass();
    ButtonStateVar* bsVar = dclass->GetButtonStateVar();

    info->Include(new ButtonStateVarView(bsVar, state, dclass, ibed));
    return info;
}
Exemplo n.º 13
0
void TextManip::PlaceTextDisplay (Coord xpos, Coord ypos) {
    GetViewer()->InitTextDisplay(_display, _painter);

    Transformer* rel = _painter->GetTransformer();
    if (rel != nil) rel->InvTransform(xpos, ypos);

    int l = xpos;
    int r = l + _display->Width();
    int t = ypos + _lineHt-1;
    int b = t - _display->Height();
    _display->Resize(l, b, r, t);
}
Exemplo n.º 14
0
Viewer* QuickView::GetById(int ID)
{
	return QView && ID==QView->GetId()?GetViewer():nullptr;
}
Exemplo n.º 15
0
Selection* FrameIdrawView::SelectAll() {
    OverlaysView* frame = ((FrameEditor*)GetViewer()->GetEditor())->GetFrame();
    return frame 
      ? frame->SelectAll()
      : OverlaysView::SelectAll();
}
Exemplo n.º 16
0
GraphicView* FrameIdrawView::GetGraphicView (Component* c) {
    OverlaysView* frame = ((FrameEditor*)GetViewer()->GetEditor())->GetFrame();
    return frame 
      ? frame->GetGraphicView(c) 
      : OverlaysView::GetGraphicView(c);
}
Exemplo n.º 17
0
void CViewerDlg::OnOK() 
{
    GetViewerFromControls();
    GetViewer();
	EndDialog(IDOK);
}
Exemplo n.º 18
0
Selection* FrameIdrawView::ViewsContaining(Coord x, Coord y) {
    OverlaysView* frame = ((FrameEditor*)GetViewer()->GetEditor())->GetFrame();
    return frame
      ? frame->ViewsContaining(x, y) 
      : OverlaysView::ViewsContaining(x, y);
}
Exemplo n.º 19
0
Selection* FrameIdrawView::ViewsWithin(Coord x0, Coord y0, Coord x1, Coord y1) {
    OverlaysView* frame = ((FrameEditor*)GetViewer()->GetEditor())->GetFrame();
    return frame
      ? frame->ViewsWithin(x0, y0, x1, y1)
      : OverlaysView::ViewsWithin(x0, y0, x1, y1);
}
Exemplo n.º 20
0
ConnectorView* FrameIdrawView::ConnectorIntersecting(Coord x0, Coord y0, Coord x1, Coord y1) {
    OverlaysView* frame = ((FrameEditor*)GetViewer()->GetEditor())->GetFrame();
    return frame
      ? frame->ConnectorIntersecting(x0, y0, x1, y1)
      : OverlaysView::ConnectorIntersecting(x0, y0, x1, y1);
}