//------------------------------------------------------------------------ bool CTextButton::getFocusPath (CGraphicsPath& outPath) { CRect r (getViewSize ()); CCoord focusWidth = getFrame ()->getFocusWidth (); r.inset (-focusWidth, -focusWidth); outPath.addRoundRect (r, roundRadius); outPath.closeSubpath (); r = getViewSize (); r.inset (frameWidth / 2., frameWidth / 2.); outPath.addRoundRect (r, roundRadius); return true; }
void draw (CDrawContext* context) { CGraphicsPath* path = context->createGraphicsPath (); if (path) { CRect r (getViewSize ()); r.inset (5, 5); path->beginSubpath (CPoint (r.left + r.getWidth () / 2, r.top)); path->addLine (CPoint (r.left, r.bottom)); path->addLine (CPoint (r.right, r.bottom)); path->closeSubpath (); setupLineStyle (context); context->drawGraphicsPath (path, CDrawContext::kPathStroked); path->forget (); } setDirty (false); }