//----------------------------------------------------------------------------- bool CSegmentButton::getFocusPath (CGraphicsPath& outPath) { CRect r (getViewSize ()); r.inset (getFrameWidth () / 2., getFrameWidth () / 2.); outPath.addRoundRect (r, getRoundRadius ()); CCoord focusWidth = getFrame ()->getFocusWidth (); r.extend (focusWidth, focusWidth); outPath.addRoundRect (r, getRoundRadius ()); return true; }
//------------------------------------------------------------------------ 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; }
//----------------------------------------------------------------------------- CGraphicsPath* CDrawContext::createRoundRectGraphicsPath (const CRect& size, CCoord radius) { CGraphicsPath* path = createGraphicsPath (); if (path) { path->addRoundRect (size, radius); } return path; }