Example #1
0
void HookSvc::ProcessPointer(const Point& pos)
{
    PaintPointer(pos, true);
    if( IsInPath(cont, DPoint(PhisPos())) )
    {
        pAction->AtPointer();
    }
    cont->begin_new_path();
}
Example #2
0
void PointerCoverSvc::ProcessPointer(const Point& pos)
{
    PaintPointer(pos, true);
    DRect rct;
    cont->get_stroke_extents(rct.lft, rct.top, rct.rgt, rct.btm);

    AddRect(rct);

    cont->begin_new_path();
}
Example #3
0
void CCue::Paint(CPaintDC * dc)
{

    /*
    Get a handle to the parent app
    */
    CFlowZap *fc = ((CFlowZap *)m_Parent);




    /*
    If there are no instructions, return
    */
    if (fc->GetInstructionsSize() == 0)
    {
        return;
    }



    /*
    Find the Boundaries of the spine
    */
    int top = fc->GetInstructionAtIndex(0)->GetCenter() - 1;
    int bot = fc->GetInstructionAtIndex(fc->GetInstructionsSize() - 1)->GetCenter() - 1;


    /*
    Set up the brushes and pens
    */
    CBrush cb(COLORREF(0x000000));
    CBrush *oldBrush = dc->SelectObject(&cb);
    CRect r(12, top, 14, bot);
    dc->FillRect(r, &cb);


    CPen cp(PS_SOLID, 1, COLORREF(0xffffff));
    CPen *oldPen = dc->SelectObject(&cp);
    dc->MoveTo(14, bot);
    dc->LineTo(14, top);





    CInstruction *in;

    for (int i = 0; i < fc->GetInstructionsSize(); i ++)
    {
        in = fc->GetInstructionAtIndex(i);
        int pos = in->GetCenter() - 1;

        CRect r2(8, pos - 1, 18, pos + 1);
        dc->FillRect(r2, &cb);
        dc->MoveTo(9, pos + 1);
        dc->LineTo(12, pos + 1);
        dc->MoveTo(14, pos + 1);
        dc->LineTo(17, pos + 1);
    }




    /*
    Find the location of where to paint the pointer.
    If the ptr is invalid, then reset it to the head of the list
    paint the pointer
    */
    if (ptr != NULL)
    {
        if (ptr->GetSafeHwnd() != NULL)
        {
            m_location = ptr->GetCenter() - 1;
        }
        else
        {
            m_location = fc->GetInstructionAtIndex(0)->GetCenter() - 1;
        }
    }
    else
    {
        m_location = fc->GetInstructionAtIndex(0)->GetCenter() - 1;
    }

    PaintPointer(dc, m_location);

    dc->SelectObject(oldPen);
    dc->SelectObject(oldBrush);

}