summaryrefslogtreecommitdiff
path: root/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-21 06:22:11 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-21 06:22:11 -0700
commitf87058d19a3448face48202c7040ee4d95ba39c1 (patch)
treedca273099a27add24bcfbc6a2ce5e46cf262dbc5 /xfa/fwl/basewidget/fwl_pushbuttonimp.cpp
parentb4e8708ce506be308fefc3eb85a427206ef320d8 (diff)
downloadpdfium-f87058d19a3448face48202c7040ee4d95ba39c1.tar.xz
Convert some FWL defines to enums.
This CL converts FWL_WGTCAPACITY_* defines to the CFWL_WidgetCapacity enum class. The FWL_PART_* defines to the FWL_Part enum class and the FWL_PartState_* defines to an enum. Review URL: https://codereview.chromium.org/1898713003
Diffstat (limited to 'xfa/fwl/basewidget/fwl_pushbuttonimp.cpp')
-rw-r--r--xfa/fwl/basewidget/fwl_pushbuttonimp.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp b/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp
index 89654d0271..92f0ca11d2 100644
--- a/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp
+++ b/xfa/fwl/basewidget/fwl_pushbuttonimp.cpp
@@ -76,7 +76,7 @@ FWL_ERR CFWL_PushButtonImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
rect.Set(0, 0, sz.x, sz.y);
}
FX_FLOAT* fcaption =
- static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_PSB_Margin));
+ static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::Margin));
rect.Inflate(*fcaption, *fcaption);
CFWL_WidgetImp::GetWidgetRect(rect, TRUE);
} else {
@@ -102,7 +102,7 @@ FWL_ERR CFWL_PushButtonImp::Update() {
GetClientRect(m_rtClient);
m_rtCaption = m_rtClient;
FX_FLOAT* fcaption =
- static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_PSB_Margin));
+ static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::Margin));
m_rtCaption.Inflate(-*fcaption, -*fcaption);
return FWL_ERR_Succeeded;
}
@@ -117,11 +117,11 @@ FWL_ERR CFWL_PushButtonImp::DrawWidget(CFX_Graphics* pGraphics,
CFX_DIBitmap* pPicture = NULL;
IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
if (HasBorder()) {
- DrawBorder(pGraphics, FWL_PART_PSB_Border, m_pProperties->m_pThemeProvider,
+ DrawBorder(pGraphics, CFWL_Part::Border, m_pProperties->m_pThemeProvider,
pMatrix);
}
if (HasEdge()) {
- DrawEdge(pGraphics, FWL_PART_PSB_Edge, m_pProperties->m_pThemeProvider,
+ DrawEdge(pGraphics, CFWL_Part::Edge, m_pProperties->m_pThemeProvider,
pMatrix);
}
DrawBkground(pGraphics, m_pProperties->m_pThemeProvider, pMatrix);
@@ -299,7 +299,7 @@ void CFWL_PushButtonImp::DrawBkground(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
CFWL_ThemeBackground param;
param.m_pWidget = m_pInterface;
- param.m_iPart = FWL_PART_PSB_Background;
+ param.m_iPart = CFWL_Part::Background;
param.m_dwStates = GetPartStates();
param.m_pGraphics = pGraphics;
if (pMatrix) {
@@ -323,7 +323,7 @@ void CFWL_PushButtonImp::DrawText(CFX_Graphics* pGraphics,
}
CFWL_ThemeText param;
param.m_pWidget = m_pInterface;
- param.m_iPart = FWL_PART_PSB_Caption;
+ param.m_iPart = CFWL_Part::Caption;
param.m_dwStates = GetPartStates();
param.m_pGraphics = pGraphics;
if (pMatrix) {
@@ -336,18 +336,18 @@ void CFWL_PushButtonImp::DrawText(CFX_Graphics* pGraphics,
pTheme->DrawText(&param);
}
uint32_t CFWL_PushButtonImp::GetPartStates() {
- uint32_t dwStates = FWL_PARTSTATE_PSB_Normal;
+ uint32_t dwStates = CFWL_PartState_Normal;
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) {
- dwStates |= FWL_PARTSTATE_PSB_Focused;
+ dwStates |= CFWL_PartState_Focused;
}
if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) {
- dwStates = FWL_PARTSTATE_PSB_Disabled;
+ dwStates = CFWL_PartState_Disabled;
} else if (m_pProperties->m_dwStates & FWL_STATE_PSB_Pressed) {
- dwStates |= FWL_PARTSTATE_PSB_Pressed;
+ dwStates |= CFWL_PartState_Pressed;
} else if (m_pProperties->m_dwStates & FWL_STATE_PSB_Hovered) {
- dwStates |= FWL_PARTSTATE_PSB_Hovered;
+ dwStates |= CFWL_PartState_Hovered;
} else if (m_pProperties->m_dwStates & FWL_STATE_PSB_Default) {
- dwStates |= FWL_PARTSTATE_PSB_Default;
+ dwStates |= CFWL_PartState_Default;
}
return dwStates;
}