本文整理汇总了C++中CFX_Path::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_Path::Clear方法的具体用法?C++ CFX_Path::Clear怎么用?C++ CFX_Path::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_Path
的用法示例。
在下文中一共展示了CFX_Path::Clear方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitCaption
void CFWL_FormTP::InitCaption(FX_BOOL bActive) {
if (bActive) {
CFX_FxgeDevice dev;
CFX_Graphics gs;
CFX_Path path;
path.Create();
if (m_pActiveBitmap) {
delete m_pActiveBitmap;
m_pActiveBitmap = NULL;
}
m_pActiveBitmap = new CFX_DIBitmap;
m_pActiveBitmap->Create(1, FWLTHEME_CAPACITY_CYCaption, FXDIB_Argb);
dev.Attach(m_pActiveBitmap);
gs.Create(&dev);
path.AddRectangle(0, 0, 1, 5);
DrawAxialShading(&gs, 0, 0, 0, 5, m_pThemeData->clrHeadBK[0][0],
m_pThemeData->clrHeadBK[0][1], &path);
path.Clear();
path.AddRectangle(0, 5, 1, 15);
DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[0][1],
m_pThemeData->clrHeadBK[0][2], &path);
path.Clear();
path.AddRectangle(0, 20, 1, FWLTHEME_CAPACITY_CYCaption - 19);
DrawAxialShading(&gs, 0, 20, 0, FWLTHEME_CAPACITY_CYCaption,
m_pThemeData->clrHeadBK[0][2],
m_pThemeData->clrHeadBK[0][3], &path);
} else {
CFX_FxgeDevice dev;
CFX_Graphics gs;
CFX_Path path;
path.Create();
if (m_pDeactivebitmap) {
delete m_pDeactivebitmap;
m_pDeactivebitmap = NULL;
}
m_pDeactivebitmap = new CFX_DIBitmap;
m_pDeactivebitmap->Create(1, FWLTHEME_CAPACITY_CYCaption, FXDIB_Argb);
dev.Attach(m_pDeactivebitmap);
gs.Create(&dev);
path.AddRectangle(0, 0, 1, 5);
DrawAxialShading(&gs, 0, 0, 0, 5, m_pThemeData->clrHeadBK[1][0],
m_pThemeData->clrHeadBK[1][1], &path);
path.Clear();
path.AddRectangle(0, 5, 1, 15);
DrawAxialShading(&gs, 0, 5, 0, 20, m_pThemeData->clrHeadBK[1][1],
m_pThemeData->clrHeadBK[1][2], &path);
path.Clear();
path.AddRectangle(0, 20, 1, FWLTHEME_CAPACITY_CYCaption - 19);
DrawAxialShading(&gs, 0, 20, 0, FWLTHEME_CAPACITY_CYCaption,
m_pThemeData->clrHeadBK[1][2],
m_pThemeData->clrHeadBK[1][3], &path);
}
}
示例2: DrawMinMaxBoxCommon
void CFWL_FormTP::DrawMinMaxBoxCommon(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FWLTHEME_STATE eState,
CFX_Matrix* pMatrix,
int32_t iActive) {
pGraphics->SaveGraphState();
FX_FLOAT fRight = pRect->right();
FX_FLOAT fBottom = pRect->bottom();
FX_FLOAT fWidth = pRect->width;
FX_FLOAT fHeight = pRect->height;
CFX_RectF rt(*pRect);
pGraphics->SetLineWidth(1.0f);
CFX_Path path;
path.Create();
path.AddRectangle(rt.left + 1, rt.top, fWidth - 2, 1);
path.AddRectangle(rt.left, rt.top + 1, 1, fHeight - 2);
path.AddRectangle(fRight - 1, rt.top + 1, 1, fHeight - 2);
path.AddRectangle(rt.left + 1, fBottom - 1, fWidth - 2, 1);
CFX_Color crFill;
crFill = m_pThemeData->clrBtnEdgeOut[iActive];
pGraphics->SetFillColor(&crFill);
pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
path.Clear();
path.AddRectangle(rt.left + 1, rt.top + 1, 1, 1);
path.AddRectangle(fRight - 2, rt.top + 1, 1, 1);
path.AddRectangle(rt.left + 1, fBottom - 2, 1, 1);
path.AddRectangle(fRight - 2, fBottom - 2, 1, 1);
crFill = m_pThemeData->clrBtnCornerLight[iActive][eState - 1];
pGraphics->SetFillColor(&crFill);
pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
path.Clear();
path.AddRectangle(rt.left + 2, rt.top + 1, fWidth - 4, 1);
path.AddRectangle(rt.left + 1, rt.top + 2, 1, fHeight - 4);
crFill = m_pThemeData->clrNormalBtEdgeLight[iActive][eState - 1];
pGraphics->SetFillColor(&crFill);
pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
path.Clear();
path.AddRectangle(fRight - 2, rt.top + 2, 1, fHeight - 4);
path.AddRectangle(rt.left + 2, fBottom - 2, fWidth - 4, 1);
crFill = m_pThemeData->clrNormalBtEdgeDark[iActive][eState - 1];
pGraphics->SetFillColor(&crFill);
pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
pGraphics->RestoreGraphState();
path.Clear();
path.AddRectangle(pRect->left + 2, pRect->top + 2, fWidth - 4, fHeight - 4);
DrawAxialShading(pGraphics, pRect->left + 2, pRect->top + 2, fRight - 2,
fBottom - 2,
m_pThemeData->clrNormalBtBKStart[iActive][eState - 1],
m_pThemeData->clrNormalBtBKEnd[iActive][eState - 1], &path,
FXFILL_WINDING, pMatrix);
}
示例3: DrawFormBorder
void CFWL_FormTP::DrawFormBorder(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FWLTHEME_STATE eState,
CFX_Matrix* pMatrix,
int32_t iActive) {
CFX_RectF rt;
rt.Set(pRect->left, pRect->top, 1, pRect->height);
FX_FLOAT fBottom, fRight;
fBottom = pRect->bottom();
fRight = pRect->right();
CFX_Path path;
path.Create();
CFX_Color clrLine;
path.Clear();
path.MoveTo(pRect->left, pRect->top);
path.LineTo(pRect->left, fBottom - 1);
path.LineTo(fRight - 1, fBottom - 1);
path.LineTo(fRight - 1, pRect->top);
clrLine = m_pThemeData->clrFormBorder[iActive][2];
pGraphics->SetStrokeColor(&clrLine);
pGraphics->StrokePath(&path, pMatrix);
path.Clear();
path.MoveTo(pRect->left + 1, pRect->top);
path.LineTo(pRect->left + 1, fBottom - 2);
path.LineTo(fRight - 2, fBottom - 2);
path.LineTo(fRight - 2, pRect->top);
clrLine = m_pThemeData->clrFormBorder[iActive][1];
pGraphics->SetStrokeColor(&clrLine);
pGraphics->StrokePath(&path, pMatrix);
path.Clear();
path.MoveTo(pRect->left + 2, pRect->top);
path.LineTo(pRect->left + 2, fBottom - 3);
path.LineTo(fRight - 3, fBottom - 3);
path.LineTo(fRight - 3, pRect->top);
clrLine = m_pThemeData->clrFormBorder[iActive][0];
pGraphics->SetStrokeColor(&clrLine);
pGraphics->StrokePath(&path, pMatrix);
path.Clear();
path.MoveTo(pRect->left + 3, pRect->top);
path.LineTo(pRect->left + 3, fBottom - 4);
path.LineTo(fRight - 4, fBottom - 4);
path.LineTo(fRight - 4, pRect->top);
clrLine = m_pThemeData->clrFormBorder[iActive][4];
pGraphics->SetStrokeColor(&clrLine);
pGraphics->StrokePath(&path, pMatrix);
m_rtDisLBorder.Set(pRect->left, pRect->top + 29, 4, pRect->height - 29);
m_rtDisRBorder.Set(pRect->right() - 4, pRect->top + 29, 4,
pRect->height - 29);
m_rtDisBBorder.Set(pRect->left, pRect->bottom() - 4, pRect->width, 4);
m_rtDisCaption.Set(pRect->left, pRect->top, pRect->width, 29);
}
示例4: DrawTrack
void CFWL_ScrollBarTP::DrawTrack(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FX_BOOL bVert,
FWLTHEME_STATE eState,
FX_BOOL bLowerTrack,
CFX_Matrix* pMatrix) {
if (eState < FWLTHEME_STATE_Normal || eState > FWLTHEME_STATE_Disabale) {
return;
}
pGraphics->SaveGraphState();
CFX_Color colorLine(ArgbEncode(255, 238, 237, 229));
CFX_Path path;
path.Create();
FX_FLOAT fRight = pRect->right();
FX_FLOAT fBottom = pRect->bottom();
if (bVert) {
path.AddRectangle(pRect->left, pRect->top, 1, pRect->height);
path.AddRectangle(fRight - 1, pRect->top, 1, pRect->height);
} else {
path.AddRectangle(pRect->left, pRect->top, pRect->width, 1);
path.AddRectangle(pRect->left, fBottom - 1, pRect->width, 1);
}
pGraphics->SetFillColor(&colorLine);
pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
path.Clear();
path.AddRectangle(pRect->left + 1, pRect->top, pRect->width - 2,
pRect->height);
FX_FLOAT x1 = bVert ? pRect->left + 1 : pRect->left;
FX_FLOAT y1 = bVert ? pRect->top : pRect->top + 1;
FX_FLOAT x2 = bVert ? fRight - 1 : pRect->left;
FX_FLOAT y2 = bVert ? pRect->top : fBottom - 1;
pGraphics->RestoreGraphState();
DrawAxialShading(pGraphics, x1, y1, x2, y2, m_pThemeData->clrTrackBKStart,
m_pThemeData->clrTrackBKEnd, &path, FXFILL_WINDING, pMatrix);
}
示例5: DrawEdge
void CFWL_WidgetTP::DrawEdge(CFX_Graphics* pGraphics,
FX_DWORD dwStyles,
const CFX_RectF* pRect,
CFX_Matrix* pMatrix) {
if (!pGraphics)
return;
if (!pRect)
return;
pGraphics->SaveGraphState();
CFX_Color crStroke(FWL_GetThemeColor(m_dwThemeID) == 0
? ArgbEncode(255, 127, 157, 185)
: FWLTHEME_COLOR_Green_BKSelected);
pGraphics->SetStrokeColor(&crStroke);
CFX_Path path;
path.Create();
path.AddRectangle(pRect->left, pRect->top, pRect->width - 1,
pRect->height - 1);
pGraphics->StrokePath(&path, pMatrix);
path.Clear();
crStroke = ArgbEncode(255, 255, 255, 255);
pGraphics->SetStrokeColor(&crStroke);
path.AddRectangle(pRect->left + 1, pRect->top + 1, pRect->width - 3,
pRect->height - 3);
pGraphics->StrokePath(&path, pMatrix);
pGraphics->RestoreGraphState();
}
示例6: rtInner
void CFWL_WidgetTP::Draw3DCircle(CFX_Graphics* pGraphics,
FWLTHEME_EDGE eType,
FX_FLOAT fWidth,
const CFX_RectF* pRect,
FX_ARGB cr1,
FX_ARGB cr2,
FX_ARGB cr3,
FX_ARGB cr4,
CFX_Matrix* pMatrix) {
if (!pGraphics)
return;
if (!pRect)
return;
pGraphics->SaveGraphState();
CFX_Path path;
path.Create();
path.AddArc(pRect->left, pRect->top, pRect->width, pRect->height,
FWLTHEME_PI * 3 / 4, FWLTHEME_PI);
CFX_Color crFill1(eType == FWLTHEME_EDGE_Raised ? cr4 : cr1);
pGraphics->SetStrokeColor(&crFill1);
pGraphics->StrokePath(&path, pMatrix);
CFX_RectF rtInner(*pRect);
rtInner.Deflate(pRect->width / 4, pRect->height / 4);
path.Clear();
path.AddArc(rtInner.left, rtInner.top, rtInner.width, rtInner.height,
FWLTHEME_PI * 3 / 4, FWLTHEME_PI);
CFX_Color crFill2(eType == FWLTHEME_EDGE_Raised ? cr3 : cr2);
pGraphics->SetStrokeColor(&crFill2);
pGraphics->StrokePath(&path, pMatrix);
path.Clear();
path.AddArc(pRect->left, pRect->top, pRect->width, pRect->height,
FWLTHEME_PI * 7 / 4, FWLTHEME_PI);
CFX_Color crFill3(eType == FWLTHEME_EDGE_Raised ? cr1 : cr3);
pGraphics->SetStrokeColor(&crFill3);
pGraphics->StrokePath(&path, pMatrix);
path.AddArc(rtInner.left, rtInner.top, rtInner.width, rtInner.height,
FWLTHEME_PI * 7 / 4, FWLTHEME_PI);
CFX_Color crFill4(eType == FWLTHEME_EDGE_Raised ? cr2 : cr4);
pGraphics->SetStrokeColor(&crFill4);
pGraphics->StrokePath(&path, pMatrix);
pGraphics->RestoreGraphState();
}
示例7: DrawMaximizeBox
void CFWL_FormTP::DrawMaximizeBox(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FWLTHEME_STATE eState,
FX_BOOL bMax,
CFX_Matrix* pMatrix,
int32_t iActive) {
DrawMinMaxBoxCommon(pGraphics, pRect, eState, pMatrix);
FX_FLOAT fWidth = pRect->width;
FX_FLOAT fHeight = pRect->height;
if (bMax) {
CFX_Path path;
path.Create();
path.AddLine(pRect->left + 7, pRect->top + 6, pRect->left + 14,
pRect->top + 6);
path.AddLine(pRect->left + 4, pRect->top + 9, pRect->left + 11,
pRect->top + 9);
pGraphics->SaveGraphState();
pGraphics->SetLineWidth(2);
CFX_Color crStroke(0xFFFFFFFF);
pGraphics->SetStrokeColor(&crStroke);
pGraphics->StrokePath(&path, pMatrix);
pGraphics->SetLineWidth(1);
path.Clear();
path.AddLine(pRect->left + 4, pRect->top + 10, pRect->left + 4,
pRect->top + 14);
path.AddLine(pRect->left + 10, pRect->top + 10, pRect->left + 10,
pRect->top + 14);
path.AddLine(pRect->left + 13, pRect->top + 7, pRect->left + 13,
pRect->top + 11);
path.AddLine(pRect->left + 4, pRect->top + 14, pRect->left + 10,
pRect->top + 14);
path.AddLine(pRect->left + 12, pRect->top + 11, pRect->left + 12,
pRect->top + 11);
pGraphics->StrokePath(&path, pMatrix);
pGraphics->RestoreGraphState();
} else {
CFX_RectF rtMax(*pRect);
rtMax.Inflate(-5, -5);
CFX_Path path;
path.Create();
path.AddRectangle(pRect->left + 5, pRect->top + 5, fWidth - 10,
fHeight - 10);
path.AddRectangle(pRect->left + 6, pRect->top + 8, fWidth - 12,
fHeight - 14);
pGraphics->SaveGraphState();
CFX_Color crFill(0xFFFFFFFF);
pGraphics->SetFillColor(&crFill);
pGraphics->FillPath(&path, FXFILL_ALTERNATE, pMatrix);
pGraphics->RestoreGraphState();
}
}
示例8: DrawPaw
void CFWL_ScrollBarTP::DrawPaw(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FX_BOOL bVert,
FWLTHEME_STATE eState,
CFX_Matrix* pMatrix) {
CFX_Path path;
path.Create();
if (bVert) {
FX_FLOAT fPawLen = kPawLength;
if (pRect->width / 2 <= fPawLen) {
fPawLen = (pRect->width - 6) / 2;
}
FX_FLOAT fX = pRect->left + pRect->width / 4;
FX_FLOAT fY = pRect->top + pRect->height / 2;
path.MoveTo(fX, fY - 4);
path.LineTo(fX + fPawLen, fY - 4);
path.MoveTo(fX, fY - 2);
path.LineTo(fX + fPawLen, fY - 2);
path.MoveTo(fX, fY);
path.LineTo(fX + fPawLen, fY);
path.MoveTo(fX, fY + 2);
path.LineTo(fX + fPawLen, fY + 2);
CFX_Color clrLight(m_pThemeData->clrPawColorLight[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrLight);
pGraphics->StrokePath(&path);
fX++;
path.Clear();
path.MoveTo(fX, fY - 3);
path.LineTo(fX + fPawLen, fY - 3);
path.MoveTo(fX, fY - 1);
path.LineTo(fX + fPawLen, fY - 1);
path.MoveTo(fX, fY + 1);
path.LineTo(fX + fPawLen, fY + 1);
path.MoveTo(fX, fY + 3);
path.LineTo(fX + fPawLen, fY + 3);
CFX_Color clrDark(m_pThemeData->clrPawColorDark[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrDark);
pGraphics->StrokePath(&path, pMatrix);
} else {
FX_FLOAT fPawLen = kPawLength;
if (pRect->height / 2 <= fPawLen) {
fPawLen = (pRect->height - 6) / 2;
}
FX_FLOAT fX = pRect->left + pRect->width / 2;
FX_FLOAT fY = pRect->top + pRect->height / 4;
path.MoveTo(fX - 4, fY);
path.LineTo(fX - 4, fY + fPawLen);
path.MoveTo(fX - 2, fY);
path.LineTo(fX - 2, fY + fPawLen);
path.MoveTo(fX, fY);
path.LineTo(fX, fY + fPawLen);
path.MoveTo(fX + 2, fY);
path.LineTo(fX + 2, fY + fPawLen);
CFX_Color clrLight(m_pThemeData->clrPawColorLight[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrLight);
pGraphics->StrokePath(&path, pMatrix);
fY++;
path.Clear();
path.MoveTo(fX - 3, fY);
path.LineTo(fX - 3, fY + fPawLen);
path.MoveTo(fX - 1, fY);
path.LineTo(fX - 1, fY + fPawLen);
path.MoveTo(fX + 1, fY);
path.LineTo(fX + 1, fY + fPawLen);
path.MoveTo(fX + 3, fY);
path.LineTo(fX + 3, fY + fPawLen);
CFX_Color clrDark(m_pThemeData->clrPawColorDark[eState - 1]);
pGraphics->SetLineWidth(1);
pGraphics->SetStrokeColor(&clrDark);
pGraphics->StrokePath(&path, pMatrix);
}
}
示例9: cr
void CFWL_WidgetTP::Draw3DRect(CFX_Graphics* pGraphics,
FWLTHEME_EDGE eType,
FX_FLOAT fWidth,
const CFX_RectF* pRect,
FX_ARGB cr1,
FX_ARGB cr2,
FX_ARGB cr3,
FX_ARGB cr4,
CFX_Matrix* pMatrix) {
if (!pGraphics)
return;
if (!pRect)
return;
pGraphics->SaveGraphState();
if (eType == FWLTHEME_EDGE_Flat) {
CFX_Path path;
path.Create();
path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height);
path.AddRectangle(pRect->left + 1, pRect->top + 1, pRect->width - 2,
pRect->height - 2);
CFX_Color cr(ArgbEncode(255, 100, 100, 100));
pGraphics->SetFillColor(&cr);
pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
path.Clear();
path.AddRectangle(pRect->left + 1, pRect->top + 1, pRect->width - 2,
pRect->height - 2);
path.AddRectangle(pRect->left + 2, pRect->top + 2, pRect->width - 4,
pRect->height - 4);
cr.Set(0xFFFFFFFF);
pGraphics->SetFillColor(&cr);
pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
} else {
FX_FLOAT fLeft = pRect->left;
FX_FLOAT fRight = pRect->right();
FX_FLOAT fTop = pRect->top;
FX_FLOAT fBottom = pRect->bottom();
FX_FLOAT fHalfWidth = fWidth / 2.0f;
CFX_Color crLT(eType == FWLTHEME_EDGE_Raised ? cr4 : cr1);
pGraphics->SetFillColor(&crLT);
CFX_Path pathLT;
pathLT.Create();
pathLT.MoveTo(fLeft, fBottom - fHalfWidth);
pathLT.LineTo(fLeft, fTop);
pathLT.LineTo(fRight - fHalfWidth, fTop);
pathLT.LineTo(fRight - fHalfWidth, fTop + fHalfWidth);
pathLT.LineTo(fLeft + fHalfWidth, fTop + fHalfWidth);
pathLT.LineTo(fLeft + fHalfWidth, fBottom - fHalfWidth);
pathLT.LineTo(fLeft, fBottom - fHalfWidth);
pGraphics->FillPath(&pathLT, FXFILL_WINDING, pMatrix);
crLT = CFX_Color(eType == FWLTHEME_EDGE_Raised ? cr3 : cr2);
pGraphics->SetFillColor(&crLT);
pathLT.Clear();
pathLT.MoveTo(fLeft + fHalfWidth, fBottom - fWidth);
pathLT.LineTo(fLeft + fHalfWidth, fTop + fHalfWidth);
pathLT.LineTo(fRight - fWidth, fTop + fHalfWidth);
pathLT.LineTo(fRight - fWidth, fTop + fWidth);
pathLT.LineTo(fLeft + fWidth, fTop + fWidth);
pathLT.LineTo(fLeft + fWidth, fBottom - fWidth);
pathLT.LineTo(fLeft + fHalfWidth, fBottom - fWidth);
pGraphics->FillPath(&pathLT, FXFILL_WINDING, pMatrix);
CFX_Color crRB(eType == FWLTHEME_EDGE_Raised ? cr1 : cr3);
pGraphics->SetFillColor(&crRB);
CFX_Path pathRB;
pathRB.Create();
pathRB.MoveTo(fRight - fHalfWidth, fTop + fHalfWidth);
pathRB.LineTo(fRight - fHalfWidth, fBottom - fHalfWidth);
pathRB.LineTo(fLeft + fHalfWidth, fBottom - fHalfWidth);
pathRB.LineTo(fLeft + fHalfWidth, fBottom - fWidth);
pathRB.LineTo(fRight - fWidth, fBottom - fWidth);
pathRB.LineTo(fRight - fWidth, fTop + fHalfWidth);
pathRB.LineTo(fRight - fHalfWidth, fTop + fHalfWidth);
pGraphics->FillPath(&pathRB, FXFILL_WINDING, pMatrix);
crRB = CFX_Color(eType == FWLTHEME_EDGE_Raised ? cr2 : cr4);
pGraphics->SetFillColor(&crRB);
pathRB.Clear();
pathRB.MoveTo(fRight, fTop);
pathRB.LineTo(fRight, fBottom);
pathRB.LineTo(fLeft, fBottom);
pathRB.LineTo(fLeft, fBottom - fHalfWidth);
pathRB.LineTo(fRight - fHalfWidth, fBottom - fHalfWidth);
pathRB.LineTo(fRight - fHalfWidth, fTop);
pathRB.LineTo(fRight, fTop);
pGraphics->FillPath(&pathRB, FXFILL_WINDING, pMatrix);
}
pGraphics->RestoreGraphState();
}
示例10: DrawBackground
FX_BOOL CFWL_PushButtonTP::DrawBackground(CFWL_ThemeBackground* pParams) {
switch (pParams->m_iPart) {
case CFWL_Part::Border: {
DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix);
break;
}
case CFWL_Part::Edge: {
DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(),
&pParams->m_rtPart, &pParams->m_matrix);
break;
}
case CFWL_Part::Background: {
CFX_RectF& rect = pParams->m_rtPart;
FX_FLOAT fRight = rect.right();
FX_FLOAT fBottom = rect.bottom();
CFX_Path strokePath;
strokePath.Create();
strokePath.MoveTo(rect.left + PUSHBUTTON_SIZE_Corner, rect.top);
strokePath.LineTo(fRight - PUSHBUTTON_SIZE_Corner, rect.top);
strokePath.LineTo(fRight, rect.top + PUSHBUTTON_SIZE_Corner);
strokePath.LineTo(fRight, fBottom - PUSHBUTTON_SIZE_Corner);
strokePath.LineTo(fRight - PUSHBUTTON_SIZE_Corner, fBottom);
strokePath.LineTo(rect.left + PUSHBUTTON_SIZE_Corner, fBottom);
strokePath.LineTo(rect.left, fBottom - PUSHBUTTON_SIZE_Corner);
strokePath.LineTo(rect.left, rect.top + PUSHBUTTON_SIZE_Corner);
strokePath.LineTo(rect.left + PUSHBUTTON_SIZE_Corner, rect.top);
CFX_Path fillPath;
fillPath.Create();
fillPath.AddSubpath(&strokePath);
CFX_Graphics* pGraphics = pParams->m_pGraphics;
pGraphics->SaveGraphState();
CFX_RectF rtInner(rect);
rtInner.Deflate(PUSHBUTTON_SIZE_Corner + 1, PUSHBUTTON_SIZE_Corner + 1,
PUSHBUTTON_SIZE_Corner, PUSHBUTTON_SIZE_Corner);
fillPath.AddRectangle(rtInner.left, rtInner.top, rtInner.width,
rtInner.height);
int32_t iColor = GetColorID(pParams->m_dwStates);
DrawAxialShading(pGraphics, rect.left + PUSHBUTTON_SIZE_Corner, rect.top,
rect.left + PUSHBUTTON_SIZE_Corner, rect.bottom(),
m_pThemeData->clrStart[iColor],
m_pThemeData->clrEnd[iColor], &fillPath,
FXFILL_ALTERNATE, &pParams->m_matrix);
CFX_Color crStroke(m_pThemeData->clrBorder[iColor]);
pGraphics->SetStrokeColor(&crStroke);
pGraphics->StrokePath(&strokePath, &pParams->m_matrix);
fillPath.Clear();
fillPath.AddRectangle(rtInner.left, rtInner.top, rtInner.width,
rtInner.height);
CFX_Color crFill(m_pThemeData->clrFill[iColor]);
pGraphics->SetFillColor(&crFill);
pGraphics->FillPath(&fillPath, FXFILL_WINDING, &pParams->m_matrix);
if (pParams->m_dwStates & CFWL_PartState_Focused) {
rtInner.Inflate(1, 1, 0, 0);
DrawFocus(pGraphics, &rtInner, &pParams->m_matrix);
}
pGraphics->RestoreGraphState();
break;
}
default: {}
}
return TRUE;
}