diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-21 06:22:11 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-21 06:22:11 -0700 |
commit | f87058d19a3448face48202c7040ee4d95ba39c1 (patch) | |
tree | dca273099a27add24bcfbc6a2ce5e46cf262dbc5 /xfa/fwl/basewidget | |
parent | b4e8708ce506be308fefc3eb85a427206ef320d8 (diff) | |
download | pdfium-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')
26 files changed, 369 insertions, 454 deletions
diff --git a/xfa/fwl/basewidget/fwl_barcodeimp.cpp b/xfa/fwl/basewidget/fwl_barcodeimp.cpp index 771d7b9833..8238d6af04 100644 --- a/xfa/fwl/basewidget/fwl_barcodeimp.cpp +++ b/xfa/fwl/basewidget/fwl_barcodeimp.cpp @@ -111,20 +111,20 @@ void CFWL_BarcodeImp::GenerateBarcodeImageCache() { CFWL_ThemePart part; part.m_pWidget = m_pInterface; IFWL_ThemeProvider* pTheme = GetAvailableTheme(); - IFX_Font* pFont = - static_cast<IFX_Font*>(pTheme->GetCapacity(&part, FWL_WGTCAPACITY_Font)); + IFX_Font* pFont = static_cast<IFX_Font*>( + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Font)); CFX_Font* pCXFont = pFont ? static_cast<CFX_Font*>(pFont->GetDevFont()) : nullptr; if (pCXFont) { m_pBarcodeEngine->SetFont(pCXFont); } FX_FLOAT* pFontSize = static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_FontSize)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::FontSize)); if (pFontSize) { m_pBarcodeEngine->SetFontSize(*pFontSize); } FX_ARGB* pFontColor = static_cast<FX_ARGB*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_TextColor)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::TextColor)); if (pFontColor) { m_pBarcodeEngine->SetFontColor(*pFontColor); } diff --git a/xfa/fwl/basewidget/fwl_caretimp.cpp b/xfa/fwl/basewidget/fwl_caretimp.cpp index e7ce56777e..959398cbd2 100644 --- a/xfa/fwl/basewidget/fwl_caretimp.cpp +++ b/xfa/fwl/basewidget/fwl_caretimp.cpp @@ -123,8 +123,8 @@ FX_BOOL CFWL_CaretImp::DrawCaretBK(CFX_Graphics* pGraphics, if (!(m_pProperties->m_dwStates & FWL_STATE_CAT_HightLight)) { return FWL_ERR_Succeeded; } - param.m_iPart = FWL_PART_CAT_Background; - param.m_dwStates = FWL_PARTSTATE_CAT_HightLight; + param.m_iPart = CFWL_Part::Background; + param.m_dwStates = CFWL_PartState_HightLight; if (pMatrix) { param.m_matrix.Concat(*pMatrix); } diff --git a/xfa/fwl/basewidget/fwl_checkboximp.cpp b/xfa/fwl/basewidget/fwl_checkboximp.cpp index d2d149ffd4..9ed2f0b8ed 100644 --- a/xfa/fwl/basewidget/fwl_checkboximp.cpp +++ b/xfa/fwl/basewidget/fwl_checkboximp.cpp @@ -118,17 +118,17 @@ FWL_ERR CFWL_CheckBoxImp::DrawWidget(CFX_Graphics* pGraphics, return FWL_ERR_Indefinite; IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (HasBorder()) { - DrawBorder(pGraphics, FWL_PART_CKB_Border, m_pProperties->m_pThemeProvider, + DrawBorder(pGraphics, CFWL_Part::Border, m_pProperties->m_pThemeProvider, pMatrix); } if (HasEdge()) { - DrawEdge(pGraphics, FWL_PART_CKB_Edge, pTheme, pMatrix); + DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); } int32_t dwStates = GetPartStates(); { CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_CKB_Background; + param.m_iPart = CFWL_Part::Background; param.m_dwStates = dwStates; param.m_pGraphics = pGraphics; if (pMatrix) { @@ -139,7 +139,7 @@ FWL_ERR CFWL_CheckBoxImp::DrawWidget(CFX_Graphics* pGraphics, param.m_pData = &m_rtFocus; } pTheme->DrawBackground(¶m); - param.m_iPart = FWL_PART_CKB_CheckBox; + param.m_iPart = CFWL_Part::CheckBox; param.m_rtPart = m_rtBox; pTheme->DrawBackground(¶m); } @@ -153,7 +153,7 @@ FWL_ERR CFWL_CheckBoxImp::DrawWidget(CFX_Graphics* pGraphics, return FWL_ERR_Indefinite; CFWL_ThemeText textParam; textParam.m_pWidget = m_pInterface; - textParam.m_iPart = FWL_PART_CKB_Caption; + textParam.m_iPart = CFWL_Part::Caption; textParam.m_dwStates = dwStates; textParam.m_pGraphics = pGraphics; if (pMatrix) { @@ -280,25 +280,25 @@ void CFWL_CheckBoxImp::Layout() { } } uint32_t CFWL_CheckBoxImp::GetPartStates() { - int32_t dwStates = FWL_PARTSTATE_CKB_UnChecked; + int32_t dwStates = CFWL_PartState_Normal; if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == FWL_STATE_CKB_Neutral) { - dwStates = FWL_PARTSTATE_CKB_Neutral; + dwStates = CFWL_PartState_Neutral; } else if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == FWL_STATE_CKB_Checked) { - dwStates = FWL_PARTSTATE_CKB_Checked; + dwStates = CFWL_PartState_Checked; } if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) { - dwStates |= FWL_PARTSTATE_CKB_Disabled; + dwStates |= CFWL_PartState_Disabled; } else if (m_pProperties->m_dwStates & FWL_STATE_CKB_Hovered) { - dwStates |= FWL_PARTSTATE_CKB_Hovered; + dwStates |= CFWL_PartState_Hovered; } else if (m_pProperties->m_dwStates & FWL_STATE_CKB_Pressed) { - dwStates |= FWL_PARTSTATE_CKB_Pressed; + dwStates |= CFWL_PartState_Pressed; } else { - dwStates |= FWL_PARTSTATE_CKB_Normal; + dwStates |= CFWL_PartState_Normal; } if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) { - dwStates |= FWL_PARTSTATE_CKB_Focused; + dwStates |= CFWL_PartState_Focused; } return dwStates; } diff --git a/xfa/fwl/basewidget/fwl_comboboximp.cpp b/xfa/fwl/basewidget/fwl_comboboximp.cpp index b7d85d3174..b093b6c171 100644 --- a/xfa/fwl/basewidget/fwl_comboboximp.cpp +++ b/xfa/fwl/basewidget/fwl_comboboximp.cpp @@ -472,7 +472,7 @@ CFWL_ComboBoxImp::CFWL_ComboBoxImp(const CFWL_WidgetImpProperties& properties, m_pForm(NULL), m_bLButtonDown(FALSE), m_iCurSel(-1), - m_iBtnState(FWL_PARTSTATE_CMB_Normal), + m_iBtnState(CFWL_PartState_Normal), m_fComboFormHandler(0), m_bNeedShowList(FALSE) { m_rtClient.Reset(); @@ -538,7 +538,7 @@ FWL_ERR CFWL_ComboBoxImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { ReSetTheme(); } FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>( - GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); if (!pFWidth) return FWL_ERR_Indefinite; rect.Inflate(0, 0, *pFWidth, 0); @@ -586,7 +586,7 @@ FWL_ERR CFWL_ComboBoxImp::Update() { part.m_pWidget = m_pInterface; m_fComboFormHandler = *static_cast<FX_FLOAT*>(m_pProperties->m_pThemeProvider->GetCapacity( - &part, FWL_WGTCAPACITY_CMB_ComboFormHandler)); + &part, CFWL_WidgetCapacity::ComboFormHandler)); return FWL_ERR_Succeeded; } uint32_t CFWL_ComboBoxImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { @@ -607,17 +607,17 @@ FWL_ERR CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; FX_BOOL bIsDropDown = IsDropDownStyle(); if (HasBorder()) { - DrawBorder(pGraphics, FWL_PART_CMB_Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); } if (HasEdge()) { - DrawEdge(pGraphics, FWL_PART_CMB_Edge, pTheme, pMatrix); + DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); } if (!bIsDropDown) { CFX_RectF rtTextBk(m_rtClient); rtTextBk.width -= m_rtBtn.width; CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_CMB_Background; + param.m_iPart = CFWL_Part::Background; param.m_pGraphics = pGraphics; if (pMatrix) { param.m_matrix.Concat(*pMatrix); @@ -634,12 +634,12 @@ FWL_ERR CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics, } } if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) { - param.m_dwStates = FWL_PARTSTATE_CMB_Disabled; + param.m_dwStates = CFWL_PartState_Disabled; } else if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) && (m_iCurSel >= 0)) { - param.m_dwStates = FWL_PARTSTATE_CMB_Selected; + param.m_dwStates = CFWL_PartState_Selected; } else { - param.m_dwStates = FWL_PARTSTATE_CMB_Normal; + param.m_dwStates = CFWL_PartState_Normal; } pTheme->DrawBackground(¶m); if (m_iCurSel >= 0) { @@ -653,14 +653,14 @@ FWL_ERR CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics, ->GetItemText(hItem, wsText); CFWL_ThemeText param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_CMB_Caption; + param.m_iPart = CFWL_Part::Caption; param.m_dwStates = m_iBtnState; param.m_pGraphics = pGraphics; param.m_matrix.Concat(*pMatrix); param.m_rtPart = rtTextBk; param.m_dwStates = (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) - ? FWL_PARTSTATE_CMB_Selected - : FWL_PARTSTATE_CMB_Normal; + ? CFWL_PartState_Selected + : CFWL_PartState_Normal; param.m_wsText = wsText; param.m_dwTTOStyles = FDE_TTOSTYLE_SingleLine; param.m_iTTOAlign = FDE_TTOALIGNMENT_CenterLeft; @@ -670,9 +670,9 @@ FWL_ERR CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics, { CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_CMB_DropDownButton; + param.m_iPart = CFWL_Part::DropDownButton; param.m_dwStates = (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) - ? FWL_PARTSTATE_CMB_Disabled + ? CFWL_PartState_Disabled : m_iBtnState; param.m_pGraphics = pGraphics; param.m_matrix.Concat(*pMatrix); @@ -878,8 +878,8 @@ void CFWL_ComboBoxImp::DrawStretchHandler(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground param; param.m_pGraphics = pGraphics; - param.m_iPart = FWL_PART_CMB_StretcgHandler; - param.m_dwStates = FWL_PARTSTATE_CMB_Normal; + param.m_iPart = CFWL_Part::StretchHandler; + param.m_dwStates = CFWL_PartState_Normal; param.m_pWidget = m_pInterface; if (pMatrix) { param.m_matrix.Concat(*pMatrix); @@ -1000,8 +1000,8 @@ void CFWL_ComboBoxImp::Layout() { return DisForm_Layout(); } GetClientRect(m_rtClient); - FX_FLOAT* pFWidth = - static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>( + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); if (!pFWidth) return; FX_FLOAT fBtn = *pFWidth; @@ -1282,7 +1282,7 @@ FWL_ERR CFWL_ComboBoxImp::DisForm_DrawWidget(CFX_Graphics* pGraphics, if (!m_rtBtn.IsEmpty(0.1f)) { CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_CMB_DropDownButton; + param.m_iPart = CFWL_Part::DropDownButton; param.m_dwStates = m_iBtnState; param.m_pGraphics = pGraphics; param.m_rtPart = m_rtBtn; @@ -1320,19 +1320,18 @@ FWL_ERR CFWL_ComboBoxImp::DisForm_GetBBox(CFX_RectF& rect) { void CFWL_ComboBoxImp::DisForm_Layout() { GetClientRect(m_rtClient); m_rtContent = m_rtClient; - FX_FLOAT* pFWidth = - static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>( + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); if (!pFWidth) return; - FX_FLOAT borderWidth = 0; - { borderWidth = FWL_PART_CMB_Border; } + FX_FLOAT borderWidth = 1; FX_FLOAT fBtn = *pFWidth; if (!(GetStylesEx() & FWL_STYLEEXT_CMB_ReadOnly)) { m_rtBtn.Set(m_rtClient.right() - fBtn, m_rtClient.top + borderWidth, fBtn - borderWidth, m_rtClient.height - 2 * borderWidth); } CFX_RectF* pUIMargin = - static_cast<CFX_RectF*>(GetThemeCapacity(FWL_WGTCAPACITY_UIMargin)); + static_cast<CFX_RectF*>(GetThemeCapacity(CFWL_WidgetCapacity::UIMargin)); if (pUIMargin) { m_rtContent.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width, pUIMargin->height); @@ -1481,30 +1480,29 @@ void CFWL_ComboBoxImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) { m_pOwner->MatchEditText(); } m_pOwner->m_bLButtonDown = TRUE; - m_pOwner->m_iBtnState = FWL_PARTSTATE_CMB_Pressed; + m_pOwner->m_iBtnState = CFWL_PartState_Pressed; m_pOwner->Repaint(&m_pOwner->m_rtClient); m_pOwner->ShowDropList(TRUE); - m_pOwner->m_iBtnState = FWL_PARTSTATE_CMB_Normal; + m_pOwner->m_iBtnState = CFWL_PartState_Normal; m_pOwner->Repaint(&m_pOwner->m_rtClient); } } void CFWL_ComboBoxImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) { m_pOwner->m_bLButtonDown = FALSE; if (m_pOwner->m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { - m_pOwner->m_iBtnState = FWL_PARTSTATE_CMB_Hovered; + m_pOwner->m_iBtnState = CFWL_PartState_Hovered; } else { - m_pOwner->m_iBtnState = FWL_PARTSTATE_CMB_Normal; + m_pOwner->m_iBtnState = CFWL_PartState_Normal; } m_pOwner->Repaint(&m_pOwner->m_rtBtn); } void CFWL_ComboBoxImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) { int32_t iOldState = m_pOwner->m_iBtnState; if (m_pOwner->m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { - m_pOwner->m_iBtnState = m_pOwner->m_bLButtonDown - ? FWL_PARTSTATE_CMB_Pressed - : FWL_PARTSTATE_CMB_Hovered; + m_pOwner->m_iBtnState = m_pOwner->m_bLButtonDown ? CFWL_PartState_Pressed + : CFWL_PartState_Hovered; } else { - m_pOwner->m_iBtnState = FWL_PARTSTATE_CMB_Normal; + m_pOwner->m_iBtnState = CFWL_PartState_Normal; } if ((iOldState != m_pOwner->m_iBtnState) && !((m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == @@ -1516,7 +1514,7 @@ void CFWL_ComboBoxImpDelegate::OnMouseLeave(CFWL_MsgMouse* pMsg) { if (!m_pOwner->IsDropListShowed() && !((m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == FWL_WGTSTATE_Disabled)) { - m_pOwner->m_iBtnState = FWL_PARTSTATE_CMB_Normal; + m_pOwner->m_iBtnState = CFWL_PartState_Normal; m_pOwner->Repaint(&m_pOwner->m_rtBtn); } } diff --git a/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp b/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp index d436c47374..21616992b1 100644 --- a/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp +++ b/xfa/fwl/basewidget/fwl_datetimepickerimp.cpp @@ -250,11 +250,11 @@ int32_t CFWL_DateTimeCalendarImpDelegate::OnProcessMessage( } void CFWL_DateTimeCalendarImpDelegate::OnLButtonDownEx(CFWL_MsgMouse* pMsg) { if (m_pOwner->m_rtLBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { - m_pOwner->m_iLBtnPartStates = FWL_PARTSTATE_MCD_Pressed; + m_pOwner->m_iLBtnPartStates = CFWL_PartState_Pressed; m_pOwner->PrevMonth(); m_pOwner->Repaint(&m_pOwner->m_rtClient); } else if (m_pOwner->m_rtRBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { - m_pOwner->m_iRBtnPartStates |= FWL_PARTSTATE_MCD_Pressed; + m_pOwner->m_iRBtnPartStates |= CFWL_PartState_Pressed; m_pOwner->NextMonth(); m_pOwner->Repaint(&m_pOwner->m_rtClient); } else if (m_pOwner->m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) { @@ -499,8 +499,8 @@ FWL_ERR CFWL_DateTimePickerImp::Update() { } m_pEdit->SetThemeProvider(m_pProperties->m_pThemeProvider); GetClientRect(m_rtClient); - FX_FLOAT* pFWidth = - static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>( + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); if (!pFWidth) return FWL_ERR_Indefinite; FX_FLOAT fBtn = *pFWidth; @@ -554,10 +554,10 @@ FWL_ERR CFWL_DateTimePickerImp::DrawWidget(CFX_Graphics* pGraphics, return FWL_ERR_Indefinite; IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (HasBorder()) { - DrawBorder(pGraphics, FWL_PART_DTP_Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); } if (HasEdge()) { - DrawEdge(pGraphics, FWL_PART_DTP_Edge, pTheme, pMatrix); + DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); } if (!m_rtBtn.IsEmpty()) { DrawDropDownButton(pGraphics, pTheme, pMatrix); @@ -692,7 +692,7 @@ void CFWL_DateTimePickerImp::DrawDropDownButton(CFX_Graphics* pGraphics, } else { CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_DTP_DropDownButton; + param.m_iPart = CFWL_Part::DropDownButton; param.m_dwStates = m_iBtnState; param.m_pGraphics = pGraphics; param.m_rtPart = m_rtBtn; @@ -948,8 +948,8 @@ FWL_ERR CFWL_DateTimePickerImp::DisForm_Update() { pData->GetToday(m_pInterface, m_MonthCalendarDP.m_iCurYear, m_MonthCalendarDP.m_iCurMonth, m_MonthCalendarDP.m_iCurDay); } - FX_FLOAT* pWidth = - static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + FX_FLOAT* pWidth = static_cast<FX_FLOAT*>( + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); if (!pWidth) return 0; m_fBtn = *pWidth; @@ -1112,23 +1112,23 @@ void CFWL_DateTimePickerImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) { return; m_pOwner->m_bLBtnDown = FALSE; if (m_pOwner->m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { - m_pOwner->m_iBtnState = FWL_PARTSTATE_DTP_Hovered; + m_pOwner->m_iBtnState = CFWL_PartState_Hovered; } else { - m_pOwner->m_iBtnState = FWL_PARTSTATE_DTP_Normal; + m_pOwner->m_iBtnState = CFWL_PartState_Normal; } m_pOwner->Repaint(&m_pOwner->m_rtBtn); } void CFWL_DateTimePickerImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) { if (m_pOwner->m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { } else { - m_pOwner->m_iBtnState = FWL_PARTSTATE_DTP_Normal; + m_pOwner->m_iBtnState = CFWL_PartState_Normal; } m_pOwner->Repaint(&m_pOwner->m_rtBtn); } void CFWL_DateTimePickerImpDelegate::OnMouseLeave(CFWL_MsgMouse* pMsg) { if (!pMsg) return; - m_pOwner->m_iBtnState = FWL_PARTSTATE_DTP_Normal; + m_pOwner->m_iBtnState = CFWL_PartState_Normal; m_pOwner->Repaint(&m_pOwner->m_rtBtn); } void CFWL_DateTimePickerImpDelegate::DisForm_OnFocusChanged(CFWL_Message* pMsg, diff --git a/xfa/fwl/basewidget/fwl_editimp.cpp b/xfa/fwl/basewidget/fwl_editimp.cpp index 1bc876f691..d25fd09d29 100644 --- a/xfa/fwl/basewidget/fwl_editimp.cpp +++ b/xfa/fwl/basewidget/fwl_editimp.cpp @@ -259,13 +259,13 @@ FWL_ERR CFWL_EditImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_OuterScrollbar) { if (IsShowScrollBar(TRUE)) { FX_FLOAT* pfWidth = static_cast<FX_FLOAT*>( - GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); rect.width += *pfWidth; rect.width += FWL_EDIT_Margin; } if (IsShowScrollBar(FALSE)) { FX_FLOAT* pfWidth = static_cast<FX_FLOAT*>( - GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); rect.height += *pfWidth; rect.height += FWL_EDIT_Margin; } @@ -505,10 +505,10 @@ FWL_ERR CFWL_EditImp::DrawWidget(CFX_Graphics* pGraphics, DrawSpellCheck(pGraphics, pMatrix); } if (HasBorder()) { - DrawBorder(pGraphics, FWL_PART_EDT_Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); } if (HasEdge()) { - DrawEdge(pGraphics, FWL_PART_EDT_Edge, pTheme, pMatrix); + DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); } return FWL_ERR_Succeeded; } @@ -940,14 +940,14 @@ void CFWL_EditImp::DrawTextBk(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_EDT_Background; + param.m_iPart = CFWL_Part::Background; param.m_dwData = FWL_PARTDATA_EDT_Background; param.m_dwStates = m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ReadOnly - ? FWL_PARTSTATE_EDT_ReadOnly - : FWL_PARTSTATE_EDT_Normal; + ? CFWL_PartState_ReadOnly + : CFWL_PartState_Normal; uint32_t dwStates = (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled); if (dwStates) { - param.m_dwStates = FWL_PARTSTATE_EDT_Disable; + param.m_dwStates = CFWL_PartState_Disabled; } param.m_pGraphics = pGraphics; param.m_matrix = *pMatrix; @@ -1032,7 +1032,7 @@ void CFWL_EditImp::DrawContent(CFX_Graphics* pGraphics, param.m_pGraphics = pGraphics; param.m_matrix = *pMatrix; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_EDT_Background; + param.m_iPart = CFWL_Part::Background; param.m_pPath = &path; pTheme->DrawBackground(¶m); } @@ -1065,7 +1065,7 @@ void CFWL_EditImp::DrawContent(CFX_Graphics* pGraphics, param.m_pGraphics = pGraphics; param.m_matrix = *pMatrix; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_EDT_CombTextLine; + param.m_iPart = CFWL_Part::CombTextLine; param.m_pPath = &path; pTheme->DrawBackground(¶m); } @@ -1162,22 +1162,22 @@ void CFWL_EditImp::UpdateEditParams() { params.dwMode |= FDE_TEXTEDITMODE_ReadOnly; } FX_FLOAT* pFontSize = - static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_FontSize)); + static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::FontSize)); if (!pFontSize) return; m_fFontSize = *pFontSize; uint32_t* pFontColor = - static_cast<uint32_t*>(GetThemeCapacity(FWL_WGTCAPACITY_TextColor)); + static_cast<uint32_t*>(GetThemeCapacity(CFWL_WidgetCapacity::TextColor)); if (!pFontColor) return; params.dwFontColor = *pFontColor; FX_FLOAT* pLineHeight = - static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_LineHeight)); + static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::LineHeight)); if (!pLineHeight) return; params.fLineSpace = *pLineHeight; IFX_Font* pFont = - static_cast<IFX_Font*>(GetThemeCapacity(FWL_WGTCAPACITY_Font)); + static_cast<IFX_Font*>(GetThemeCapacity(CFWL_WidgetCapacity::Font)); if (!pFont) return; params.pFont = pFont; @@ -1281,7 +1281,7 @@ void CFWL_EditImp::UpdateVAlignment() { FX_FLOAT fSpaceAbove = 0.0f; FX_FLOAT fSpaceBelow = 0.0f; CFX_SizeF* pSpace = static_cast<CFX_SizeF*>( - GetThemeCapacity(FWL_WGTCAPACITY_SpaceAboveBelow)); + GetThemeCapacity(CFWL_WidgetCapacity::SpaceAboveBelow)); if (pSpace) { fSpaceAbove = pSpace->x; fSpaceBelow = pSpace->y; @@ -1470,14 +1470,14 @@ int32_t CFWL_EditImp::AddDoRecord(const CFX_ByteStringC& bsDoRecord) { void CFWL_EditImp::Layout() { GetClientRect(m_rtClient); m_rtEngine = m_rtClient; - FX_FLOAT* pfWidth = - static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + FX_FLOAT* pfWidth = static_cast<FX_FLOAT*>( + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); if (!pfWidth) return; FX_FLOAT fWidth = *pfWidth; if (!m_pOuter) { - CFX_RectF* pUIMargin = - static_cast<CFX_RectF*>(GetThemeCapacity(FWL_WGTCAPACITY_UIMargin)); + CFX_RectF* pUIMargin = static_cast<CFX_RectF*>( + GetThemeCapacity(CFWL_WidgetCapacity::UIMargin)); if (pUIMargin) { m_rtEngine.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width, pUIMargin->height); @@ -1487,7 +1487,7 @@ void CFWL_EditImp::Layout() { part.m_pWidget = m_pOuter; CFX_RectF* pUIMargin = static_cast<CFX_RectF*>(m_pOuter->GetThemeProvider()->GetCapacity( - &part, FWL_WGTCAPACITY_UIMargin)); + &part, CFWL_WidgetCapacity::UIMargin)); if (pUIMargin) { m_rtEngine.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width, pUIMargin->height); @@ -1547,7 +1547,7 @@ void CFWL_EditImp::LayoutScrollBar() { if (bShowVertScrollbar) { if (!m_pVertScrollBar) { pfWidth = static_cast<FX_FLOAT*>( - GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); FX_FLOAT fWidth = pfWidth ? *pfWidth : 0; InitScrollBar(); CFX_RectF rtVertScr; @@ -1572,7 +1572,7 @@ void CFWL_EditImp::LayoutScrollBar() { if (!m_pHorzScrollBar) { if (!pfWidth) { pfWidth = static_cast<FX_FLOAT*>( - GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); } FX_FLOAT fWidth = pfWidth ? *pfWidth : 0; InitScrollBar(FALSE); diff --git a/xfa/fwl/basewidget/fwl_listboximp.cpp b/xfa/fwl/basewidget/fwl_listboximp.cpp index 24b29d6ac0..2adeb97496 100644 --- a/xfa/fwl/basewidget/fwl_listboximp.cpp +++ b/xfa/fwl/basewidget/fwl_listboximp.cpp @@ -172,10 +172,10 @@ FWL_ERR CFWL_ListBoxImp::DrawWidget(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; pGraphics->SaveGraphState(); if (HasBorder()) { - DrawBorder(pGraphics, FWL_PART_LTB_Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); } if (HasEdge()) { - DrawEdge(pGraphics, FWL_PART_LTB_Edge, pTheme, pMatrix); + DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); } CFX_RectF rtClip(m_rtConent); if (IsShowScrollBar(FALSE)) { @@ -555,7 +555,7 @@ void CFWL_ListBoxImp::DrawBkground(CFX_Graphics* pGraphics, return; CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_LTB_Background; + param.m_iPart = CFWL_Part::Background; param.m_dwStates = 0; param.m_pGraphics = pGraphics; param.m_matrix.Concat(*pMatrix); @@ -564,7 +564,7 @@ void CFWL_ListBoxImp::DrawBkground(CFX_Graphics* pGraphics, param.m_pData = &m_rtStatic; } if (!IsEnabled()) { - param.m_dwStates = FWL_PARTSTATE_LTB_Disabled; + param.m_dwStates = CFWL_PartState_Disabled; } pTheme->DrawBackground(¶m); } @@ -630,15 +630,15 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics* pGraphics, IFWL_ListBoxDP* pData = static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); uint32_t dwItemStyles = pData->GetItemStyles(m_pInterface, hItem); - uint32_t dwPartStates = FWL_PARTSTATE_LTB_Normal; + uint32_t dwPartStates = CFWL_PartState_Normal; if (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) { - dwPartStates = FWL_PARTSTATE_LTB_Disabled; + dwPartStates = CFWL_PartState_Disabled; } else if (dwItemStyles & FWL_ITEMSTATE_LTB_Selected) { - dwPartStates = FWL_PARTSTATE_LTB_Selected; + dwPartStates = CFWL_PartState_Selected; } if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused && dwItemStyles & FWL_ITEMSTATE_LTB_Focused) { - dwPartStates |= FWL_PARTSTATE_LTB_Focused; + dwPartStates |= CFWL_PartState_Focused; } FWL_ListBoxItemData itemData; itemData.pDataProvider = pData; @@ -646,7 +646,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics* pGraphics, { CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_LTB_ListItem; + param.m_iPart = CFWL_Part::ListItem; param.m_dwStates = dwPartStates; param.m_pGraphics = pGraphics; param.m_matrix.Concat(*pMatrix); @@ -655,7 +655,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics* pGraphics, CFX_RectF rtFocus(rtItem); param.m_pData = &rtFocus; if (m_pVertScrollBar && !m_pHorzScrollBar && - (dwPartStates & FWL_PARTSTATE_LTB_Focused)) { + (dwPartStates & CFWL_PartState_Focused)) { param.m_rtPart.left += 1; param.m_rtPart.width -= (m_fScorllBarWidth + 1); rtFocus.Deflate(0.5, 0.5, 1 + m_fScorllBarWidth, 1); @@ -671,7 +671,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics* pGraphics, if (pDib) { CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_LTB_Icon; + param.m_iPart = CFWL_Part::Icon; param.m_pGraphics = pGraphics; param.m_matrix.Concat(*pMatrix); param.m_rtPart = rtDIB; @@ -688,12 +688,12 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics* pGraphics, pData->SetItemCheckRect(m_pInterface, hItem, rtCheck); CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_LTB_Check; + param.m_iPart = CFWL_Part::Check; param.m_pGraphics = pGraphics; if (GetItemChecked(hItem)) { - param.m_dwStates = FWL_PARTSTATE_LTB_Checked; + param.m_dwStates = CFWL_PartState_Checked; } else { - param.m_dwStates = FWL_PARTSTATE_LTB_UnChecked; + param.m_dwStates = CFWL_PartState_Normal; } param.m_matrix.Concat(*pMatrix); param.m_rtPart = rtCheck; @@ -712,7 +712,7 @@ void CFWL_ListBoxImp::DrawItem(CFX_Graphics* pGraphics, } CFWL_ThemeText textParam; textParam.m_pWidget = m_pInterface; - textParam.m_iPart = FWL_PART_LTB_ListItem; + textParam.m_iPart = CFWL_Part::ListItem; textParam.m_dwStates = dwPartStates; textParam.m_pGraphics = pGraphics; textParam.m_matrix.Concat(*pMatrix); @@ -734,8 +734,8 @@ CFX_SizeF CFWL_ListBoxImp::CalcSize(FX_BOOL bAutoSize) { CFX_RectF rtUIMargin; rtUIMargin.Set(0, 0, 0, 0); if (!m_pOuter) { - CFX_RectF* pUIMargin = - static_cast<CFX_RectF*>(GetThemeCapacity(FWL_WGTCAPACITY_UIMargin)); + CFX_RectF* pUIMargin = static_cast<CFX_RectF*>( + GetThemeCapacity(CFWL_WidgetCapacity::UIMargin)); if (pUIMargin) { m_rtConent.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width, pUIMargin->height); @@ -752,7 +752,7 @@ CFX_SizeF CFWL_ListBoxImp::CalcSize(FX_BOOL bAutoSize) { FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, i); CFWL_ThemePart itemPart; itemPart.m_pWidget = m_pInterface; - itemPart.m_iPart = FWL_PART_LTB_ListItem; + itemPart.m_iPart = CFWL_Part::ListItem; itemPart.m_pData = m_pProperties->m_pDataProvider; itemPart.m_dwData = i; CFX_RectF r; @@ -931,15 +931,15 @@ FX_FLOAT CFWL_ListBoxImp::GetMaxTextWidth() { return fRet; } FX_FLOAT CFWL_ListBoxImp::GetScrollWidth() { - FX_FLOAT* pfWidth = - static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + FX_FLOAT* pfWidth = static_cast<FX_FLOAT*>( + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); if (!pfWidth) return 0; return *pfWidth; } FX_FLOAT CFWL_ListBoxImp::GetItemHeigt() { FX_FLOAT* pfFont = - static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_FontSize)); + static_cast<FX_FLOAT*>(GetThemeCapacity(CFWL_WidgetCapacity::FontSize)); if (!pfFont) return 20; return *pfFont + 2 * FWL_LISTBOX_ItemTextMargin; diff --git a/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp b/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp index d55144a805..1965e400b7 100644 --- a/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp +++ b/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp @@ -27,6 +27,98 @@ #define MONTHCAL_HEADER_BTN_VMARGIN 7 #define MONTHCAL_HEADER_BTN_HMARGIN 5 +namespace { + +CFX_WideString* GetCapacityForDay(IFWL_ThemeProvider* pTheme, + CFWL_ThemePart& params, + uint32_t day) { + ASSERT(day < 7); + + if (day == 0) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::Sun)); + } + if (day == 1) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::Mon)); + } + if (day == 2) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::Tue)); + } + if (day == 3) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::Wed)); + } + if (day == 4) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::Thu)); + } + if (day == 5) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::Fri)); + } + + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::Sat)); +} + +CFX_WideString* GetCapacityForMonth(IFWL_ThemeProvider* pTheme, + CFWL_ThemePart& params, + uint32_t month) { + ASSERT(month < 12); + + if (month == 0) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::January)); + } + if (month == 1) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::February)); + } + if (month == 2) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::March)); + } + if (month == 3) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::April)); + } + if (month == 4) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::May)); + } + if (month == 5) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::June)); + } + if (month == 6) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::July)); + } + if (month == 7) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::August)); + } + if (month == 8) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::September)); + } + if (month == 9) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::October)); + } + if (month == 10) { + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::November)); + } + + return static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::December)); +} + +} // namespace + // static IFWL_MonthCalendar* IFWL_MonthCalendar::Create( const CFWL_WidgetImpProperties& properties, @@ -66,8 +158,8 @@ CFWL_MonthCalendarImp::CFWL_MonthCalendarImp( m_iMonth(1), m_iDay(1), m_iHovered(-1), - m_iLBtnPartStates(FWL_PARTSTATE_MCD_Normal), - m_iRBtnPartStates(FWL_PARTSTATE_MCD_Normal) { + m_iLBtnPartStates(CFWL_PartState_Normal), + m_iRBtnPartStates(CFWL_PartState_Normal) { m_rtHead.Reset(); m_rtWeek.Reset(); m_rtLBtn.Reset(); @@ -143,10 +235,10 @@ FWL_ERR CFWL_MonthCalendarImp::DrawWidget(CFX_Graphics* pGraphics, } IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (HasBorder()) { - DrawBorder(pGraphics, FWL_PART_MCD_Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); } if (HasEdge()) { - DrawEdge(pGraphics, FWL_PART_MCD_Edge, pTheme, pMatrix); + DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); } DrawBkground(pGraphics, pTheme, pMatrix); DrawHeadBK(pGraphics, pTheme, pMatrix); @@ -192,9 +284,9 @@ void CFWL_MonthCalendarImp::DrawBkground(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_Background; + params.m_iPart = CFWL_Part::Background; params.m_pGraphics = pGraphics; - params.m_dwStates = FWL_PARTSTATE_MCD_Normal; + params.m_dwStates = CFWL_PartState_Normal; params.m_rtPart = m_rtClient; if (pMatrix) { params.m_matrix.Concat(*pMatrix); @@ -206,9 +298,9 @@ void CFWL_MonthCalendarImp::DrawHeadBK(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_Header; + params.m_iPart = CFWL_Part::Header; params.m_pGraphics = pGraphics; - params.m_dwStates = FWL_PARTSTATE_MCD_Normal; + params.m_dwStates = CFWL_PartState_Normal; params.m_rtPart = m_rtHead; if (pMatrix) { params.m_matrix.Concat(*pMatrix); @@ -220,7 +312,7 @@ void CFWL_MonthCalendarImp::DrawLButton(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_LBtn; + params.m_iPart = CFWL_Part::LBtn; params.m_pGraphics = pGraphics; params.m_dwStates = m_iLBtnPartStates; params.m_rtPart = m_rtLBtn; @@ -234,7 +326,7 @@ void CFWL_MonthCalendarImp::DrawRButton(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_RBtn; + params.m_iPart = CFWL_Part::RBtn; params.m_pGraphics = pGraphics; params.m_dwStates = m_iRBtnPartStates; params.m_rtPart = m_rtRBtn; @@ -248,8 +340,8 @@ void CFWL_MonthCalendarImp::DrawCaption(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeText textParam; textParam.m_pWidget = m_pInterface; - textParam.m_iPart = FWL_PART_MCD_Caption; - textParam.m_dwStates = FWL_PARTSTATE_MCD_Normal; + textParam.m_iPart = CFWL_Part::Caption; + textParam.m_dwStates = CFWL_PartState_Normal; textParam.m_pGraphics = pGraphics; int32_t iYear; int32_t iMonth; @@ -273,9 +365,9 @@ void CFWL_MonthCalendarImp::DrawSeperator(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_HSeparator; + params.m_iPart = CFWL_Part::HSeparator; params.m_pGraphics = pGraphics; - params.m_dwStates = FWL_PARTSTATE_MCD_Normal; + params.m_dwStates = CFWL_PartState_Normal; params.m_rtPart = m_rtHSep; if (pMatrix) { params.m_matrix.Concat(*pMatrix); @@ -287,7 +379,7 @@ void CFWL_MonthCalendarImp::DrawDatesInBK(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_DateInBK; + params.m_iPart = CFWL_Part::DateInBK; params.m_pGraphics = pGraphics; if (pMatrix) { params.m_matrix.Concat(*pMatrix); @@ -296,19 +388,19 @@ void CFWL_MonthCalendarImp::DrawDatesInBK(CFX_Graphics* pGraphics, for (int32_t j = 0; j < iCount; j++) { FWL_DATEINFO* pDataInfo = (FWL_DATEINFO*)m_arrDates.GetAt(j); if (pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Selected) { - params.m_dwStates |= FWL_PARTSTATE_MCD_Selected; + params.m_dwStates |= CFWL_PartState_Selected; if (((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_NoTodayCircle) == 0) && pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Flag) { - params.m_dwStates |= FWL_PARTSTATE_MCD_Flagged; + params.m_dwStates |= CFWL_PartState_Flagged; } if (pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Focused) { - params.m_dwStates |= FWL_PARTSTATE_MCD_Focused; + params.m_dwStates |= CFWL_PartState_Focused; } } else if (j == m_iHovered - 1) { - params.m_dwStates |= FWL_PARTSTATE_MCD_Hovered; + params.m_dwStates |= CFWL_PartState_Hovered; } else if (pDataInfo->dwStates & FWL_ITEMSTATE_MCD_Flag) { - params.m_dwStates = FWL_PARTSTATE_MCD_Flagged; + params.m_dwStates = CFWL_PartState_Flagged; pTheme->DrawBackground(¶ms); } params.m_rtPart = pDataInfo->rect; @@ -321,9 +413,9 @@ void CFWL_MonthCalendarImp::DrawWeek(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeText params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_Week; + params.m_iPart = CFWL_Part::Week; params.m_pGraphics = pGraphics; - params.m_dwStates = FWL_PARTSTATE_MCD_Normal; + params.m_dwStates = CFWL_PartState_Normal; params.m_iTTOAlign = FDE_TTOALIGNMENT_Center; CFX_RectF rtDayOfWeek; if (pMatrix) { @@ -332,10 +424,8 @@ void CFWL_MonthCalendarImp::DrawWeek(CFX_Graphics* pGraphics, for (int32_t i = 0; i < 7; i++) { rtDayOfWeek.Set(m_rtWeek.left + i * (m_szCell.x + MONTHCAL_HMARGIN * 2), m_rtWeek.top, m_szCell.x, m_szCell.y); - CFX_WideString* wsWeekDay = static_cast<CFX_WideString*>( - pTheme->GetCapacity(¶ms, i + FWL_MCCAPACITY_Sun)); params.m_rtPart = rtDayOfWeek; - params.m_wsText = *wsWeekDay; + params.m_wsText = *GetCapacityForDay(pTheme, params, i); params.m_dwTTOStyles = FDE_TTOSTYLE_SingleLine; pTheme->DrawText(¶ms); } @@ -345,9 +435,9 @@ void CFWL_MonthCalendarImp::DrawWeekNumber(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeText params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_WeekNum; + params.m_iPart = CFWL_Part::WeekNum; params.m_pGraphics = pGraphics; - params.m_dwStates = FWL_PARTSTATE_MCD_Normal; + params.m_dwStates = CFWL_PartState_Normal; params.m_iTTOAlign = FDE_TTOALIGNMENT_CenterLeft; CFX_WideString wsWeekNum; params.m_dwTTOStyles = FDE_TTOSTYLE_SingleLine; @@ -377,9 +467,9 @@ void CFWL_MonthCalendarImp::DrawWeekNumberSep(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_WeekNumSep; + params.m_iPart = CFWL_Part::WeekNumSep; params.m_pGraphics = pGraphics; - params.m_dwStates = FWL_PARTSTATE_MCD_Normal; + params.m_dwStates = CFWL_PartState_Normal; params.m_rtPart = m_rtWeekNumSep; if (pMatrix) { params.m_matrix.Concat(*pMatrix); @@ -394,12 +484,12 @@ void CFWL_MonthCalendarImp::DrawToday(CFX_Graphics* pGraphics, } CFWL_ThemeText params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_Today; + params.m_iPart = CFWL_Part::Today; params.m_pGraphics = pGraphics; - params.m_dwStates = FWL_PARTSTATE_MCD_Normal; + params.m_dwStates = CFWL_PartState_Normal; params.m_iTTOAlign = FDE_TTOALIGNMENT_CenterLeft; CFX_WideString* wsDay = static_cast<CFX_WideString*>( - pTheme->GetCapacity(¶ms, FWL_MCCAPACITY_Today)); + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::Today)); CFX_WideString wsText; GetTodayText(m_iYear, m_iMonth, m_iDay, wsText); params.m_wsText = *wsDay + wsText; @@ -417,9 +507,9 @@ void CFWL_MonthCalendarImp::DrawDatesIn(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeText params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_DatesIn; + params.m_iPart = CFWL_Part::DatesIn; params.m_pGraphics = pGraphics; - params.m_dwStates = FWL_PARTSTATE_MCD_Normal; + params.m_dwStates = CFWL_PartState_Normal; params.m_iTTOAlign = FDE_TTOALIGNMENT_Center; if (pMatrix) { params.m_matrix.Concat(*pMatrix); @@ -431,7 +521,7 @@ void CFWL_MonthCalendarImp::DrawDatesIn(CFX_Graphics* pGraphics, params.m_rtPart = pDataInfo->rect; params.m_dwStates = pDataInfo->dwStates; if (j + 1 == m_iHovered) { - params.m_dwStates |= FWL_PARTSTATE_MCD_Hovered; + params.m_dwStates |= CFWL_PartState_Hovered; } params.m_dwTTOStyles = FDE_TTOSTYLE_SingleLine; pTheme->DrawText(¶ms); @@ -442,9 +532,9 @@ void CFWL_MonthCalendarImp::DrawDatesOut(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeText params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_DatesOut; + params.m_iPart = CFWL_Part::DatesOut; params.m_pGraphics = pGraphics; - params.m_dwStates = FWL_PARTSTATE_MCD_Normal; + params.m_dwStates = CFWL_PartState_Normal; params.m_iTTOAlign = FDE_TTOALIGNMENT_Center; if (pMatrix) { params.m_matrix.Concat(*pMatrix); @@ -468,10 +558,10 @@ void CFWL_MonthCalendarImp::DrawDatesInCircle(CFX_Graphics* pGraphics, return; CFWL_ThemeBackground params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_DateInCircle; + params.m_iPart = CFWL_Part::DateInCircle; params.m_pGraphics = pGraphics; params.m_rtPart = pDate->rect; - params.m_dwStates = FWL_PARTSTATE_MCD_Normal; + params.m_dwStates = CFWL_PartState_Normal; if (pMatrix) { params.m_matrix.Concat(*pMatrix); } @@ -488,9 +578,9 @@ void CFWL_MonthCalendarImp::DrawTodayCircle(CFX_Graphics* pGraphics, } CFWL_ThemeBackground params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_MCD_TodayCircle; + params.m_iPart = CFWL_Part::TodayCircle; params.m_pGraphics = pGraphics; - params.m_dwStates = FWL_PARTSTATE_MCD_Normal; + params.m_dwStates = CFWL_PartState_Normal; params.m_rtPart = m_rtTodayFlag; if (pMatrix) { params.m_matrix.Concat(*pMatrix); @@ -510,15 +600,16 @@ CFX_SizeF CFWL_MonthCalendarImp::CalcSize(FX_BOOL bAutoSize) { CFWL_ThemePart params; params.m_pWidget = m_pInterface; IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; - CFX_WideString* wsText = NULL; FX_FLOAT fMaxWeekW = 0.0f; FX_FLOAT fMaxWeekH = 0.0f; - for (uint32_t week = FWL_MCCAPACITY_Sun; week <= FWL_MCCAPACITY_Sat; week++) { - wsText = static_cast<CFX_WideString*>(pTheme->GetCapacity(¶ms, week)); - CFX_SizeF sz = CalcTextSize(*wsText, m_pProperties->m_pThemeProvider); + + for (uint32_t i = 0; i < 7; ++i) { + CFX_SizeF sz = CalcTextSize(*GetCapacityForDay(pTheme, params, i), + m_pProperties->m_pThemeProvider); fMaxWeekW = (fMaxWeekW >= sz.x) ? fMaxWeekW : sz.x; fMaxWeekH = (fMaxWeekH >= sz.y) ? fMaxWeekH : sz.y; } + FX_FLOAT fDayMaxW = 0.0f; FX_FLOAT fDayMaxH = 0.0f; for (int day = 10; day <= 31; day++) { @@ -536,10 +627,10 @@ CFX_SizeF CFWL_MonthCalendarImp::CalcSize(FX_BOOL bAutoSize) { MONTHCAL_HEADER_BTN_HMARGIN * 2; FX_FLOAT fMonthMaxW = 0.0f; FX_FLOAT fMonthMaxH = 0.0f; - for (uint32_t month = FWL_MCCAPACITY_January; - month <= FWL_MCCAPACITY_December; month++) { - wsText = static_cast<CFX_WideString*>(pTheme->GetCapacity(¶ms, month)); - CFX_SizeF sz = CalcTextSize(*wsText, m_pProperties->m_pThemeProvider); + + for (uint32_t i = 0; i < 12; ++i) { + CFX_SizeF sz = CalcTextSize(*GetCapacityForMonth(pTheme, params, i), + m_pProperties->m_pThemeProvider); fMonthMaxW = (fMonthMaxW >= sz.x) ? fMonthMaxW : sz.x; fMonthMaxH = (fMonthMaxH >= sz.y) ? fMonthMaxH : sz.y; } @@ -552,8 +643,8 @@ CFX_SizeF CFWL_MonthCalendarImp::CalcSize(FX_BOOL bAutoSize) { fs.x = std::max(fs.x, fMonthMaxW); CFX_WideString wsToday; GetTodayText(m_iYear, m_iMonth, m_iDay, wsToday); - wsText = static_cast<CFX_WideString*>( - pTheme->GetCapacity(¶ms, FWL_MCCAPACITY_Today)); + CFX_WideString* wsText = static_cast<CFX_WideString*>( + pTheme->GetCapacity(¶ms, CFWL_WidgetCapacity::Today)); m_wsToday = *wsText + wsToday; m_szToday = CalcTextSize(wsToday, m_pProperties->m_pThemeProvider); m_szToday.y = (m_szToday.y >= m_szCell.y) ? m_szToday.y : m_szCell.y; @@ -645,60 +736,60 @@ void CFWL_MonthCalendarImp::GetCapValue() { CFWL_ThemePart part; part.m_pWidget = m_pInterface; m_fHeadWid = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEADER_WIDTH)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HeaderWidth)); m_fHeadHei = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEADER_Height)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HeaderHeight)); m_fHeadBtnWid = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEADER_BTN_WIDTH)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HeaderBtnWidth)); m_fHeadBtnHei = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEADER_BTN_HEIGHT)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HeaderBtnHeight)); m_fHeadBtnHMargin = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEADER_BTN_HMARGIN)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HeaderBtnHMargin)); m_fHeadBtnVMargin = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEADER_BTN_VMARGIN)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HeaderBtnVMargin)); m_fHeadTextWid = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEADER_TEXTWIDHT)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HeaderTextWidth)); m_fHeadTextHei = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEADER_TEXTHEIGHT)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HeaderTextHeight)); m_fHeadTextHMargin = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEADER_TEXT_HMARGIN)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HeaderTextHMargin)); m_fHeadTextVMargin = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEADER_TEXT_VMARGIN)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HeaderTextVMargin)); m_fHSepWid = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HSEP_WIDTH)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HSepWidth)); m_fHSepHei = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HSEP_HEIGHT)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::HSepHeight)); m_fWeekNumWid = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_WEEKNUM_WIDTH)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::WeekNumWidth)); m_fSepDOffset = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_SEP_DOFFSET)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::SepDOffset)); m_fSepX = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_SEP_X)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::SepX)); m_fSepY = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_SEP_Y)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::SepY)); m_fWeekNumHeigh = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_WEEKNUM_HEIGHT)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::WeekNumHeight)); m_fWeekWid = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_WEEK_WIDTH)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::WeekWidth)); m_fWeekHei = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_WEEK_HEIGHT)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::WeekHeight)); m_fDateCellWid = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_DATES_CELL_WIDTH)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::DatesCellWidth)); m_fDateCellHei = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_DATES_CELL_HEIGHT)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::DatesCellHeight)); m_fTodayWid = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_TODAY_WIDHT)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::TodayWidth)); m_fTodayHei = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_TODAY_HEIGHT)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::TodayHeight)); m_fTodayFlagWid = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_TODAY_FLAG_WIDHT)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::TodayFlagWidth)); m_fMCWid = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_WIDTH)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Width)); if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_WeekNumbers) { m_fMCWid += m_fWeekNumWid; } m_fMCHei = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_MC_HEIGHT)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Height)); } int32_t CFWL_MonthCalendarImp::CalWeekNumber(int32_t iYear, int32_t iMonth, @@ -990,11 +1081,11 @@ void CFWL_MonthCalendarImpDelegate::OnFocusChanged(CFWL_Message* pMsg, } void CFWL_MonthCalendarImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) { if (m_pOwner->m_rtLBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { - m_pOwner->m_iLBtnPartStates = FWL_PARTSTATE_MCD_Pressed; + m_pOwner->m_iLBtnPartStates = CFWL_PartState_Pressed; m_pOwner->PrevMonth(); m_pOwner->Repaint(&m_pOwner->m_rtClient); } else if (m_pOwner->m_rtRBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { - m_pOwner->m_iRBtnPartStates |= FWL_PARTSTATE_MCD_Pressed; + m_pOwner->m_iRBtnPartStates |= CFWL_PartState_Pressed; m_pOwner->NextMonth(); m_pOwner->Repaint(&m_pOwner->m_rtClient); } else if (m_pOwner->m_rtToday.Contains(pMsg->m_fx, pMsg->m_fy)) { diff --git a/xfa/fwl/basewidget/fwl_pictureboximp.cpp b/xfa/fwl/basewidget/fwl_pictureboximp.cpp index 2787423d6e..e61dae3b2b 100644 --- a/xfa/fwl/basewidget/fwl_pictureboximp.cpp +++ b/xfa/fwl/basewidget/fwl_pictureboximp.cpp @@ -90,10 +90,10 @@ FWL_ERR CFWL_PictureBoxImp::DrawWidget(CFX_Graphics* pGraphics, return FWL_ERR_Indefinite; IFWL_ThemeProvider* pTheme = GetAvailableTheme(); if (HasBorder()) { - DrawBorder(pGraphics, FWL_PART_PTB_Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); } if (HasEdge()) { - DrawEdge(pGraphics, FWL_PART_PTB_Edge, pTheme, pMatrix); + DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); } DrawBkground(pGraphics, pTheme, pMatrix); return FWL_ERR_Succeeded; 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(¶m); } 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; } diff --git a/xfa/fwl/basewidget/fwl_scrollbarimp.cpp b/xfa/fwl/basewidget/fwl_scrollbarimp.cpp index 23bda25d58..8812076f6b 100644 --- a/xfa/fwl/basewidget/fwl_scrollbarimp.cpp +++ b/xfa/fwl/basewidget/fwl_scrollbarimp.cpp @@ -75,11 +75,11 @@ CFWL_ScrollBarImp::CFWL_ScrollBarImp(const CFWL_WidgetImpProperties& properties, m_fStepSize(0), m_fPos(0), m_fTrackPos(0), - m_iMinButtonState(FWL_PARTSTATE_SCB_Normal), - m_iMaxButtonState(FWL_PARTSTATE_SCB_Normal), - m_iThumbButtonState(FWL_PARTSTATE_SCB_Normal), - m_iMinTrackState(FWL_PARTSTATE_SCB_Normal), - m_iMaxTrackState(FWL_PARTSTATE_SCB_Normal), + m_iMinButtonState(CFWL_PartState_Normal), + m_iMaxButtonState(CFWL_PartState_Normal), + m_iThumbButtonState(CFWL_PartState_Normal), + m_iMinTrackState(CFWL_PartState_Normal), + m_iMaxTrackState(CFWL_PartState_Normal), m_fLastTrackPos(0), m_cpTrackPointX(0), m_cpTrackPointY(0), @@ -122,7 +122,7 @@ FWL_ERR CFWL_ScrollBarImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { if (bAutoSize) { rect.Set(0, 0, 0, 0); FX_FLOAT* pfMinWidth = static_cast<FX_FLOAT*>( - GetThemeCapacity(FWL_WGTCAPACITY_ScrollBarWidth)); + GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth)); if (!pfMinWidth) return FWL_ERR_Indefinite; if (IsVertical()) { @@ -154,10 +154,10 @@ FWL_ERR CFWL_ScrollBarImp::DrawWidget(CFX_Graphics* pGraphics, return FWL_ERR_Indefinite; IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; if (HasBorder()) { - DrawBorder(pGraphics, FWL_PART_SCB_Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); } if (HasEdge()) { - DrawEdge(pGraphics, FWL_PART_SCB_Edge, pTheme, pMatrix); + DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); } DrawTrack(pGraphics, pTheme, TRUE, pMatrix); DrawTrack(pGraphics, pTheme, FALSE, pMatrix); @@ -247,9 +247,9 @@ void CFWL_ScrollBarImp::DrawTrack(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = bLower ? FWL_PART_SCB_LowerTrack : FWL_PART_SCB_UpperTrack; + param.m_iPart = bLower ? CFWL_Part::LowerTrack : CFWL_Part::UpperTrack; param.m_dwStates = (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) - ? FWL_PARTSTATE_SCB_Disabled + ? CFWL_PartState_Disabled : (bLower ? m_iMinTrackState : m_iMaxTrackState); param.m_pGraphics = pGraphics; param.m_matrix.Concat(*pMatrix); @@ -262,9 +262,9 @@ void CFWL_ScrollBarImp::DrawArrowBtn(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = bMinBtn ? FWL_PART_SCB_ForeArrow : FWL_PART_SCB_BackArrow; + param.m_iPart = bMinBtn ? CFWL_Part::ForeArrow : CFWL_Part::BackArrow; param.m_dwStates = (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) - ? FWL_PARTSTATE_SCB_Disabled + ? CFWL_PartState_Disabled : (bMinBtn ? m_iMinButtonState : m_iMaxButtonState); param.m_pGraphics = pGraphics; param.m_matrix.Concat(*pMatrix); @@ -280,9 +280,9 @@ void CFWL_ScrollBarImp::DrawThumb(CFX_Graphics* pGraphics, } CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_SCB_Thumb; + param.m_iPart = CFWL_Part::Thumb; param.m_dwStates = (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) - ? FWL_PARTSTATE_SCB_Disabled + ? CFWL_PartState_Disabled : m_iThumbButtonState; param.m_pGraphics = pGraphics; param.m_matrix.Concat(*pMatrix); @@ -294,7 +294,7 @@ void CFWL_ScrollBarImp::Layout() { CFWL_ThemePart part; part.m_pWidget = m_pInterface; m_fMinThumb = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_CAPACITY_SCB_Size)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::Size)); m_bCustomLayout = pTheme->IsCustomizedLayout(m_pInterface); GetClientRect(m_rtClient); CalcButtonLen(); @@ -320,9 +320,9 @@ void CFWL_ScrollBarImp::CalcMinButtonRect(CFX_RectF& rect) { CFWL_ThemePart pPart; pPart.m_rtPart = m_rtMinBtn; pPart.m_pWidget = m_pInterface; - pPart.m_iPart = FWL_PART_SCB_ForeArrow; + pPart.m_iPart = CFWL_Part::ForeArrow; pPart.m_dwStates = (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) - ? FWL_PARTSTATE_SCB_Disabled + ? CFWL_PartState_Disabled : m_iMinButtonState; pTheme->GetPartRect(&pPart, rect); } else { @@ -338,9 +338,9 @@ void CFWL_ScrollBarImp::CalcMaxButtonRect(CFX_RectF& rect) { CFWL_ThemePart pPart; pPart.m_rtPart = m_rtMaxBtn; pPart.m_pWidget = m_pInterface; - pPart.m_iPart = FWL_PART_SCB_BackArrow; + pPart.m_iPart = CFWL_Part::BackArrow; pPart.m_dwStates = (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) - ? FWL_PARTSTATE_SCB_Disabled + ? CFWL_PartState_Disabled : m_iMaxButtonState; pTheme->GetPartRect(&pPart, rect); } else { @@ -592,19 +592,19 @@ void CFWL_ScrollBarImp::GetTrackRect(CFX_RectF& rect, FX_BOOL bLower) { } } FX_BOOL CFWL_ScrollBarImp::SendEvent() { - if (m_iMinButtonState == FWL_PARTSTATE_SCB_Pressed) { + if (m_iMinButtonState == CFWL_PartState_Pressed) { DoScroll(FWL_SCBCODE_StepBackward, m_fTrackPos); return FALSE; } - if (m_iMaxButtonState == FWL_PARTSTATE_SCB_Pressed) { + if (m_iMaxButtonState == CFWL_PartState_Pressed) { DoScroll(FWL_SCBCODE_StepForward, m_fTrackPos); return FALSE; } - if (m_iMinTrackState == FWL_PARTSTATE_SCB_Pressed) { + if (m_iMinTrackState == CFWL_PartState_Pressed) { DoScroll(FWL_SCBCODE_PageBackward, m_fTrackPos); return m_rtThumb.Contains(m_cpTrackPointX, m_cpTrackPointY); } - if (m_iMaxTrackState == FWL_PARTSTATE_SCB_Pressed) { + if (m_iMaxTrackState == CFWL_PartState_Pressed) { DoScroll(FWL_SCBCODE_PageForward, m_fTrackPos); return m_rtThumb.Contains(m_cpTrackPointX, m_cpTrackPointY); } @@ -748,10 +748,10 @@ void CFWL_ScrollBarImpDelegate::DoMouseDown(int32_t iItem, if (!rtItem.Contains(fx, fy)) { return; } - if (iState == FWL_PARTSTATE_SCB_Pressed) { + if (iState == CFWL_PartState_Pressed) { return; } - iState = FWL_PARTSTATE_SCB_Pressed; + iState = CFWL_PartState_Pressed; m_pOwner->Repaint(&rtItem); } void CFWL_ScrollBarImpDelegate::DoMouseUp(int32_t iItem, @@ -759,8 +759,8 @@ void CFWL_ScrollBarImpDelegate::DoMouseUp(int32_t iItem, int32_t& iState, FX_FLOAT fx, FX_FLOAT fy) { - int32_t iNewState = rtItem.Contains(fx, fy) ? FWL_PARTSTATE_SCB_Hovered - : FWL_PARTSTATE_SCB_Normal; + int32_t iNewState = + rtItem.Contains(fx, fy) ? CFWL_PartState_Hovered : CFWL_PartState_Normal; if (iState == iNewState) { return; } @@ -774,15 +774,15 @@ void CFWL_ScrollBarImpDelegate::DoMouseMove(int32_t iItem, FX_FLOAT fx, FX_FLOAT fy) { if (!m_pOwner->m_bMouseDown) { - int32_t iNewState = rtItem.Contains(fx, fy) ? FWL_PARTSTATE_SCB_Hovered - : FWL_PARTSTATE_SCB_Normal; + int32_t iNewState = rtItem.Contains(fx, fy) ? CFWL_PartState_Hovered + : CFWL_PartState_Normal; if (iState == iNewState) { return; } iState = iNewState; m_pOwner->Repaint(&rtItem); } else if ((2 == iItem) && - (m_pOwner->m_iThumbButtonState == FWL_PARTSTATE_SCB_Pressed)) { + (m_pOwner->m_iThumbButtonState == CFWL_PartState_Pressed)) { FX_FLOAT fPos = m_pOwner->GetTrackPointPos(fx, fy); m_pOwner->m_fTrackPos = fPos; m_pOwner->OnScroll(FWL_SCBCODE_TrackPos, fPos); @@ -791,18 +791,18 @@ void CFWL_ScrollBarImpDelegate::DoMouseMove(int32_t iItem, void CFWL_ScrollBarImpDelegate::DoMouseLeave(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState) { - if (iState == FWL_PARTSTATE_SCB_Normal) { + if (iState == CFWL_PartState_Normal) { return; } - iState = FWL_PARTSTATE_SCB_Normal; + iState = CFWL_PartState_Normal; m_pOwner->Repaint(&rtItem); } void CFWL_ScrollBarImpDelegate::DoMouseHover(int32_t iItem, const CFX_RectF& rtItem, int32_t& iState) { - if (iState == FWL_PARTSTATE_SCB_Hovered) { + if (iState == CFWL_PartState_Hovered) { return; } - iState = FWL_PARTSTATE_SCB_Hovered; + iState = CFWL_PartState_Hovered; m_pOwner->Repaint(&rtItem); } diff --git a/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp b/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp index 9f276b7281..e52529d3c6 100644 --- a/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp +++ b/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp @@ -45,8 +45,8 @@ CFWL_SpinButtonImp::CFWL_SpinButtonImp( const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter) : CFWL_WidgetImp(properties, pOuter), - m_dwUpState(FWL_PARTSTATE_SPB_Normal), - m_dwDnState(FWL_PARTSTATE_SPB_Normal), + m_dwUpState(CFWL_PartState_Normal), + m_dwDnState(CFWL_PartState_Normal), m_iButtonIndex(0), m_bLButtonDwn(FALSE), m_hTimer(NULL) { @@ -112,7 +112,7 @@ uint32_t CFWL_SpinButtonImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { CFX_RectF rtEdge; GetEdgeRect(rtEdge); if (rtEdge.Contains(fx, fy)) { - return FWL_PART_SPB_Edge; + return FWL_WGTHITTEST_Left; } } if (m_rtUpButton.Contains(fx, fy)) { @@ -133,10 +133,10 @@ FWL_ERR CFWL_SpinButtonImp::DrawWidget(CFX_Graphics* pGraphics, } IFWL_ThemeProvider* pTheme = GetAvailableTheme(); if (HasBorder()) { - DrawBorder(pGraphics, FWL_PART_SPB_Border, pTheme, pMatrix); + DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); } if (HasEdge()) { - DrawEdge(pGraphics, FWL_PART_SPB_Edge, pTheme, pMatrix); + DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); } DrawUpButton(pGraphics, pTheme, pMatrix); DrawDownButton(pGraphics, pTheme, pMatrix); @@ -154,31 +154,31 @@ int32_t CFWL_SpinButtonImp::Run(FWL_HTIMER hTimer) { FWL_ERR CFWL_SpinButtonImp::EnableButton(FX_BOOL bEnable, FX_BOOL bUp) { if (bUp) { if (bEnable) { - m_dwUpState = FWL_PARTSTATE_SPB_Normal; + m_dwUpState = CFWL_PartState_Normal; } else { - m_dwUpState = FWL_PARTSTATE_SPB_Disabled; + m_dwUpState = CFWL_PartState_Disabled; } } else { if (bEnable) { - m_dwDnState = FWL_PARTSTATE_SPB_Normal; + m_dwDnState = CFWL_PartState_Normal; } else { - m_dwDnState = FWL_PARTSTATE_SPB_Disabled; + m_dwDnState = CFWL_PartState_Disabled; } } return FWL_ERR_Succeeded; } FX_BOOL CFWL_SpinButtonImp::IsButtonEnable(FX_BOOL bUp) { if (bUp) { - return (m_dwUpState != FWL_PARTSTATE_SPB_Disabled); + return (m_dwUpState != CFWL_PartState_Disabled); } - return (m_dwDnState != FWL_PARTSTATE_SPB_Disabled); + return (m_dwDnState != CFWL_PartState_Disabled); } void CFWL_SpinButtonImp::DrawUpButton(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_SPB_UpButton; + params.m_iPart = CFWL_Part::UpButton; params.m_pGraphics = pGraphics; params.m_dwStates = m_dwUpState + 1; if (pMatrix) { @@ -192,7 +192,7 @@ void CFWL_SpinButtonImp::DrawDownButton(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground params; params.m_pWidget = m_pInterface; - params.m_iPart = FWL_PART_SPB_DownButton; + params.m_iPart = CFWL_Part::DownButton; params.m_pGraphics = pGraphics; params.m_dwStates = m_dwDnState + 1; if (pMatrix) { @@ -285,11 +285,11 @@ void CFWL_SpinButtonImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) { } if (bUpPress) { m_pOwner->m_iButtonIndex = 0; - m_pOwner->m_dwUpState = FWL_PARTSTATE_SPB_Pressed; + m_pOwner->m_dwUpState = CFWL_PartState_Pressed; } if (bDnPress) { m_pOwner->m_iButtonIndex = 1; - m_pOwner->m_dwDnState = FWL_PARTSTATE_SPB_Pressed; + m_pOwner->m_dwDnState = CFWL_PartState_Pressed; } CFWL_EvtSpbClick wmPosChanged; wmPosChanged.m_pSrcTarget = m_pOwner->m_pInterface; @@ -300,7 +300,7 @@ void CFWL_SpinButtonImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) { m_pOwner->m_hTimer = FWL_StartTimer(m_pOwner, FWL_SPIN_Elapse); } void CFWL_SpinButtonImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) { - if (m_pOwner->m_pProperties->m_dwStates & FWL_PARTSTATE_SPB_Disabled) { + if (m_pOwner->m_pProperties->m_dwStates & CFWL_PartState_Disabled) { return; } m_pOwner->m_bLButtonDwn = FALSE; @@ -312,14 +312,14 @@ void CFWL_SpinButtonImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) { } FX_BOOL bRepaint = FALSE; CFX_RectF rtInvalidate; - if (m_pOwner->m_dwUpState == FWL_PARTSTATE_SPB_Pressed && + if (m_pOwner->m_dwUpState == CFWL_PartState_Pressed && m_pOwner->IsButtonEnable(TRUE)) { - m_pOwner->m_dwUpState = FWL_PARTSTATE_SPB_Normal; + m_pOwner->m_dwUpState = CFWL_PartState_Normal; bRepaint = TRUE; rtInvalidate = m_pOwner->m_rtUpButton; - } else if (m_pOwner->m_dwDnState == FWL_PARTSTATE_SPB_Pressed && + } else if (m_pOwner->m_dwDnState == CFWL_PartState_Pressed && m_pOwner->IsButtonEnable(FALSE)) { - m_pOwner->m_dwDnState = FWL_PARTSTATE_SPB_Normal; + m_pOwner->m_dwDnState = CFWL_PartState_Normal; bRepaint = TRUE; rtInvalidate = m_pOwner->m_rtDnButton; } @@ -338,14 +338,14 @@ void CFWL_SpinButtonImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) { rtInvlidate.Reset(); if (m_pOwner->m_rtUpButton.Contains(pMsg->m_fx, pMsg->m_fy)) { if (m_pOwner->IsButtonEnable(TRUE)) { - if (m_pOwner->m_dwUpState == FWL_PARTSTATE_SPB_Hovered) { - m_pOwner->m_dwUpState = FWL_PARTSTATE_SPB_Hovered; + if (m_pOwner->m_dwUpState == CFWL_PartState_Hovered) { + m_pOwner->m_dwUpState = CFWL_PartState_Hovered; bRepaint = TRUE; rtInvlidate = m_pOwner->m_rtUpButton; } - if (m_pOwner->m_dwDnState != FWL_PARTSTATE_SPB_Normal && + if (m_pOwner->m_dwDnState != CFWL_PartState_Normal && m_pOwner->IsButtonEnable(FALSE)) { - m_pOwner->m_dwDnState = FWL_PARTSTATE_SPB_Normal; + m_pOwner->m_dwDnState = CFWL_PartState_Normal; if (bRepaint) { rtInvlidate.Union(m_pOwner->m_rtDnButton); } else { @@ -359,14 +359,14 @@ void CFWL_SpinButtonImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) { } } else if (m_pOwner->m_rtDnButton.Contains(pMsg->m_fx, pMsg->m_fy)) { if (m_pOwner->IsButtonEnable(FALSE)) { - if (m_pOwner->m_dwDnState != FWL_PARTSTATE_SPB_Hovered) { - m_pOwner->m_dwDnState = FWL_PARTSTATE_SPB_Hovered; + if (m_pOwner->m_dwDnState != CFWL_PartState_Hovered) { + m_pOwner->m_dwDnState = CFWL_PartState_Hovered; bRepaint = TRUE; rtInvlidate = m_pOwner->m_rtDnButton; } - if (m_pOwner->m_dwUpState != FWL_PARTSTATE_SPB_Normal && + if (m_pOwner->m_dwUpState != CFWL_PartState_Normal && m_pOwner->IsButtonEnable(TRUE)) { - m_pOwner->m_dwUpState = FWL_PARTSTATE_SPB_Normal; + m_pOwner->m_dwUpState = CFWL_PartState_Normal; if (bRepaint) { rtInvlidate.Union(m_pOwner->m_rtUpButton); } else { @@ -375,15 +375,15 @@ void CFWL_SpinButtonImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) { bRepaint = TRUE; } } - } else if (m_pOwner->m_dwUpState != FWL_PARTSTATE_SPB_Normal || - m_pOwner->m_dwDnState != FWL_PARTSTATE_SPB_Normal) { - if (m_pOwner->m_dwUpState != FWL_PARTSTATE_SPB_Normal) { - m_pOwner->m_dwUpState = FWL_PARTSTATE_SPB_Normal; + } else if (m_pOwner->m_dwUpState != CFWL_PartState_Normal || + m_pOwner->m_dwDnState != CFWL_PartState_Normal) { + if (m_pOwner->m_dwUpState != CFWL_PartState_Normal) { + m_pOwner->m_dwUpState = CFWL_PartState_Normal; bRepaint = TRUE; rtInvlidate = m_pOwner->m_rtUpButton; } - if (m_pOwner->m_dwDnState != FWL_PARTSTATE_SPB_Normal) { - m_pOwner->m_dwDnState = FWL_PARTSTATE_SPB_Normal; + if (m_pOwner->m_dwDnState != CFWL_PartState_Normal) { + m_pOwner->m_dwDnState = CFWL_PartState_Normal; if (bRepaint) { rtInvlidate.Union(m_pOwner->m_rtDnButton); } else { @@ -399,13 +399,13 @@ void CFWL_SpinButtonImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) { void CFWL_SpinButtonImpDelegate::OnMouseLeave(CFWL_MsgMouse* pMsg) { if (!pMsg) return; - if (m_pOwner->m_dwUpState != FWL_PARTSTATE_SPB_Normal && + if (m_pOwner->m_dwUpState != CFWL_PartState_Normal && m_pOwner->IsButtonEnable(TRUE)) { - m_pOwner->m_dwUpState = FWL_PARTSTATE_SPB_Normal; + m_pOwner->m_dwUpState = CFWL_PartState_Normal; } - if (m_pOwner->m_dwDnState != FWL_PARTSTATE_SPB_Normal && + if (m_pOwner->m_dwDnState != CFWL_PartState_Normal && m_pOwner->IsButtonEnable(FALSE)) { - m_pOwner->m_dwDnState = FWL_PARTSTATE_SPB_Normal; + m_pOwner->m_dwDnState = CFWL_PartState_Normal; } m_pOwner->Repaint(&m_pOwner->m_rtClient); } diff --git a/xfa/fwl/basewidget/fwl_tooltipctrlimp.cpp b/xfa/fwl/basewidget/fwl_tooltipctrlimp.cpp index 3f5fccd0e9..36751b637d 100644 --- a/xfa/fwl/basewidget/fwl_tooltipctrlimp.cpp +++ b/xfa/fwl/basewidget/fwl_tooltipctrlimp.cpp @@ -17,6 +17,7 @@ #include "xfa/fwl/core/fwl_widgetimp.h" #include "xfa/fwl/core/ifwl_themeprovider.h" #include "xfa/fwl/core/ifwl_tooltiptarget.h" +#include "xfa/fwl/theme/cfwl_widgettp.h" // static IFWL_ToolTip* IFWL_ToolTip::Create(const CFWL_WidgetImpProperties& properties, @@ -94,8 +95,8 @@ FWL_ERR CFWL_ToolTipImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { if (iLen > 0) { CFX_SizeF sz = CalcTextSize(wsCaption, m_pProperties->m_pThemeProvider); rect.Set(0, 0, sz.x, sz.y); - rect.width += FWL_WGTCAPACITY_CXBorder * 25; - rect.height += FWL_WGTCAPACITY_CYBorder * 8; + rect.width += 25; + rect.height += 16; } CFWL_WidgetImp::GetWidgetRect(rect, TRUE); } else { @@ -124,9 +125,9 @@ FWL_ERR CFWL_ToolTipImp::GetClientRect(CFX_RectF& rect) { CFWL_ThemePart part; part.m_pWidget = m_pInterface; x = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_CXBorder)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::CXBorder)); y = *static_cast<FX_FLOAT*>( - pTheme->GetCapacity(&part, FWL_WGTCAPACITY_CYBorder)); + pTheme->GetCapacity(&part, CFWL_WidgetCapacity::CYBorder)); } rect = m_pProperties->m_rtWidget; rect.Offset(-rect.left, -rect.top); @@ -154,7 +155,7 @@ void CFWL_ToolTipImp::DrawBkground(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { CFWL_ThemeBackground param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_TTP_Background; + param.m_iPart = CFWL_Part::Background; param.m_dwStates = m_pProperties->m_dwStates; param.m_pGraphics = pGraphics; if (pMatrix) { @@ -178,7 +179,7 @@ void CFWL_ToolTipImp::DrawText(CFX_Graphics* pGraphics, } CFWL_ThemeText param; param.m_pWidget = m_pInterface; - param.m_iPart = FWL_PART_TTP_Caption; + param.m_iPart = CFWL_Part::Caption; param.m_dwStates = m_pProperties->m_dwStates; param.m_pGraphics = pGraphics; if (pMatrix) { diff --git a/xfa/fwl/basewidget/ifwl_barcode.h b/xfa/fwl/basewidget/ifwl_barcode.h index 0dbdcb03c1..a506dd8002 100644 --- a/xfa/fwl/basewidget/ifwl_barcode.h +++ b/xfa/fwl/basewidget/ifwl_barcode.h @@ -27,9 +27,6 @@ class CFWL_WidgetImpProperties; #define FWL_BCDATTRIBUTE_VERSION (1L << 10) #define FWL_BCDATTRIBUTE_ECLEVEL (1L << 11) #define FWL_BCDATTRIBUTE_TRUNCATED (1L << 12) -#define FWL_PART_BCD_Border 1 -#define FWL_PART_BCD_Edge 2 -#define FWL_PART_BCD_Background 3 #define FWL_BCUPDATECMD_Data FWL_WGTUPDATECMD_User class IFWL_BarcodeDP : public IFWL_EditDP { diff --git a/xfa/fwl/basewidget/ifwl_caret.h b/xfa/fwl/basewidget/ifwl_caret.h index 229bf12198..08a98c91c4 100644 --- a/xfa/fwl/basewidget/ifwl_caret.h +++ b/xfa/fwl/basewidget/ifwl_caret.h @@ -13,8 +13,6 @@ #define FWL_CLASS_Caret L"FWL_CARET" #define FWL_CLASSHASH_Caret 671181879 #define FWL_STATE_CAT_HightLight 1 -#define FWL_PART_CAT_Background 1 -#define FWL_PARTSTATE_CAT_HightLight 1 class IFWL_Caret : public IFWL_Widget { public: diff --git a/xfa/fwl/basewidget/ifwl_checkbox.h b/xfa/fwl/basewidget/ifwl_checkbox.h index 355121ac1e..f4cfe5f956 100644 --- a/xfa/fwl/basewidget/ifwl_checkbox.h +++ b/xfa/fwl/basewidget/ifwl_checkbox.h @@ -44,21 +44,6 @@ #define FWL_STATE_CKB_Checked (1 << (FWL_WGTSTATE_MAX + 2)) #define FWL_STATE_CKB_Neutral (2 << (FWL_WGTSTATE_MAX + 2)) #define FWL_STATE_CKB_CheckMask (3L << (FWL_WGTSTATE_MAX + 2)) -#define FWL_PART_CKB_Border 1 -#define FWL_PART_CKB_Edge 2 -#define FWL_PART_CKB_Background 3 -#define FWL_PART_CKB_CheckBox 4 -#define FWL_PART_CKB_Caption 5 -#define FWL_PARTSTATE_CKB_Normal (0L << 0) -#define FWL_PARTSTATE_CKB_Pressed (1L << 0) -#define FWL_PARTSTATE_CKB_Hovered (2L << 0) -#define FWL_PARTSTATE_CKB_Disabled (3L << 0) -#define FWL_PARTSTATE_CKB_UnChecked (0L << 2) -#define FWL_PARTSTATE_CKB_Checked (1L << 2) -#define FWL_PARTSTATE_CKB_Neutral (2L << 2) -#define FWL_PARTSTATE_CKB_Focused (1L << 4) -#define FWL_PARTSTATE_CKB_Mask1 (3L << 0) -#define FWL_PARTSTATE_CKB_Mask2 (3L << 2) // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 #define FWL_EVTHASH_CKB_CheckStateChanged 2503252963 diff --git a/xfa/fwl/basewidget/ifwl_combobox.h b/xfa/fwl/basewidget/ifwl_combobox.h index c5a30cf115..826404f9aa 100644 --- a/xfa/fwl/basewidget/ifwl_combobox.h +++ b/xfa/fwl/basewidget/ifwl_combobox.h @@ -38,18 +38,6 @@ class IFWL_ComboBox; #define FWL_STYLEEXT_CMB_ListItemIconText (1L << 12) #define FWL_STYLEEXT_CMB_ListItemAlignMask (3L << 12) #define FWL_STYLEEXT_CMB_ReadOnly (1L << 13) -#define FWL_PART_CMB_Border 1 -#define FWL_PART_CMB_Edge 2 -#define FWL_PART_CMB_Background 3 -#define FWL_PART_CMB_DropDownButton 4 -#define FWL_PART_CMB_Caption 5 -#define FWL_PART_CMB_StretcgHandler 6 -#define FWL_PARTSTATE_CMB_Normal (0L << 0) -#define FWL_PARTSTATE_CMB_Hovered (1L << 0) -#define FWL_PARTSTATE_CMB_Pressed (2L << 0) -#define FWL_PARTSTATE_CMB_Disabled (3L << 0) -#define FWL_PARTSTATE_CMB_Selected (1L << 2) -#define FWL_WGTCAPACITY_CMB_ComboFormHandler (FWL_WGTCAPACITY_MAX + 7) // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 #define FWL_EVTHASH_CMB_PreDropDown 1357646798 #define FWL_EVTHASH_CMB_PostDropDown 3677010285 diff --git a/xfa/fwl/basewidget/ifwl_datetimepicker.h b/xfa/fwl/basewidget/ifwl_datetimepicker.h index f73aa73490..07bc8715c3 100644 --- a/xfa/fwl/basewidget/ifwl_datetimepicker.h +++ b/xfa/fwl/basewidget/ifwl_datetimepicker.h @@ -30,14 +30,6 @@ #define FWL_STYLEEXT_DTP_EditHAlignMask (3L << 4) #define FWL_STYLEEXT_DTP_EditVAlignMask (3L << 6) #define FWL_STYLEEXT_DTP_EditHAlignModeMask (3L << 8) -#define FWL_PART_DTP_Border 1 -#define FWL_PART_DTP_Edge 2 -#define FWL_PART_DTP_Background 3 -#define FWL_PART_DTP_DropDownButton 4 -#define FWL_PARTSTATE_DTP_Normal (0L << 0) -#define FWL_PARTSTATE_DTP_Hovered (1L << 0) -#define FWL_PARTSTATE_DTP_Pressed (2L << 0) -#define FWL_PARTSTATE_DTP_Disabled (3L << 0) // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 #define FWL_EVTHASH_DTP_DropDown 264728733 #define FWL_EVTHASH_DTP_CloseUp 4280973803 diff --git a/xfa/fwl/basewidget/ifwl_edit.h b/xfa/fwl/basewidget/ifwl_edit.h index 90df9d959c..b1de2f91e8 100644 --- a/xfa/fwl/basewidget/ifwl_edit.h +++ b/xfa/fwl/basewidget/ifwl_edit.h @@ -48,15 +48,8 @@ #define FWL_STYLEEXT_EDT_OuterScrollbar (1L << 26) #define FWL_STYLEEXT_EDT_LastLineHeight (1L << 27) #define FWL_STATE_EDT_Editing (1 << FWL_WGTSTATE_MAX) -#define FWL_PART_EDT_Border 1 -#define FWL_PART_EDT_Edge 2 -#define FWL_PART_EDT_Background 3 -#define FWL_PART_EDT_CombTextLine 4 #define FWL_PARTDATA_EDT_Background 0 #define FWL_PARTDATA_EDT_StaticBackground 1 -#define FWL_PARTSTATE_EDT_Normal (0L << 0) -#define FWL_PARTSTATE_EDT_ReadOnly (1L << 0) -#define FWL_PARTSTATE_EDT_Disable (2L << 0) // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 #define FWL_EVTHASH_EDT_TextChanged 1064022132 #define FWL_EVTHASH_EDT_PreSelfAdaption 1001979178 diff --git a/xfa/fwl/basewidget/ifwl_listbox.h b/xfa/fwl/basewidget/ifwl_listbox.h index d73ca0f38d..e80a3289f8 100644 --- a/xfa/fwl/basewidget/ifwl_listbox.h +++ b/xfa/fwl/basewidget/ifwl_listbox.h @@ -30,19 +30,6 @@ #define FWL_ITEMSTATE_LTB_Selected (1L << 0) #define FWL_ITEMSTATE_LTB_Focused (1L << 1) #define FWL_ITEMSTATE_LTB_Checked (1L << 2) -#define FWL_PART_LTB_Border 1 -#define FWL_PART_LTB_Edge 2 -#define FWL_PART_LTB_Background 3 -#define FWL_PART_LTB_ListItem 4 -#define FWL_PART_LTB_Check 5 -#define FWL_PART_LTB_Icon 6 -#define FWL_PARTSTATE_LTB_Normal (0L << 0) -#define FWL_PARTSTATE_LTB_Selected (1L << 0) -#define FWL_PARTSTATE_LTB_Disabled (2L << 0) -#define FWL_PARTSTATE_LTB_Focused (1L << 2) -#define FWL_PARTSTATE_LTB_UnChecked (0L << 3) -#define FWL_PARTSTATE_LTB_Checked (1L << 3) -#define FWL_PARTSTATE_LTB_Mask (3L << 0) #define FWL_WGTHITTEST_LTB_Item FWL_WGTHITTEST_MAX + 1 #define FWL_WGTHITTEST_LTB_HScrollBar FWL_WGTHITTEST_MAX + 2 #define FWL_WGTHITTEST_LTB_VScrollBar FWL_WGTHITTEST_MAX + 3 diff --git a/xfa/fwl/basewidget/ifwl_monthcalendar.h b/xfa/fwl/basewidget/ifwl_monthcalendar.h index 8ac9c36f4d..a635b1cde9 100644 --- a/xfa/fwl/basewidget/ifwl_monthcalendar.h +++ b/xfa/fwl/basewidget/ifwl_monthcalendar.h @@ -18,84 +18,10 @@ #define FWL_STYLEEXT_MCD_NoToday (1L << 1) #define FWL_STYLEEXT_MCD_NoTodayCircle (1L << 2) #define FWL_STYLEEXT_MCD_WeekNumbers (1L << 3) -#define FWL_WGTCAPACITY_MC_HEADER_WIDTH 12 -#define FWL_WGTCAPACITY_MC_HEADER_Height 13 -#define FWL_WGTCAPACITY_MC_HEADER_BTN_WIDTH 14 -#define FWL_WGTCAPACITY_MC_HEADER_BTN_HEIGHT 15 -#define FWL_WGTCAPACITY_MC_HEADER_BTN_HMARGIN 16 -#define FWL_WGTCAPACITY_MC_HEADER_BTN_VMARGIN 17 -#define FWL_WGTCAPACITY_MC_HEADER_TEXTWIDHT 18 -#define FWL_WGTCAPACITY_MC_HEADER_TEXTHEIGHT 19 -#define FWL_WGTCAPACITY_MC_HEADER_TEXT_HMARGIN 20 -#define FWL_WGTCAPACITY_MC_HEADER_TEXT_VMARGIN 21 -#define FWL_WGTCAPACITY_MC_HSEP_WIDTH 22 -#define FWL_WGTCAPACITY_MC_HSEP_HEIGHT 23 -#define FWL_WGTCAPACITY_MC_VSEP_WIDTH 24 -#define FWL_WGTCAPACITY_MC_VSEP_HEIGHT 25 -#define FWL_WGTCAPACITY_MC_WEEKNUM_WIDTH 26 -#define FWL_WGTCAPACITY_MC_SEP_DOFFSET 40 -#define FWL_WGTCAPACITY_MC_SEP_X 27 -#define FWL_WGTCAPACITY_MC_SEP_Y 28 -#define FWL_WGTCAPACITY_MC_WEEKNUM_HEIGHT 29 -#define FWL_WGTCAPACITY_MC_WEEK_WIDTH 30 -#define FWL_WGTCAPACITY_MC_WEEK_HEIGHT 31 -#define FWL_WGTCAPACITY_MC_DATES_CELL_WIDTH 32 -#define FWL_WGTCAPACITY_MC_DATES_CELL_HEIGHT 33 -#define FWL_WGTCAPACITY_MC_TODAY_WIDHT 34 -#define FWL_WGTCAPACITY_MC_TODAY_HEIGHT 35 -#define FWL_WGTCAPACITY_MC_TODAY_FLAG_WIDHT 36 -#define FWL_WGTCAPACITY_MC_WIDTH 37 -#define FWL_WGTCAPACITY_MC_HEIGHT 38 #define FWL_ITEMSTATE_MCD_Nomal (0L << 0) #define FWL_ITEMSTATE_MCD_Flag (1L << 0) #define FWL_ITEMSTATE_MCD_Selected (1L << 1) #define FWL_ITEMSTATE_MCD_Focused (1L << 2) -#define FWL_PART_MCD_Border 1 -#define FWL_PART_MCD_Edge 2 -#define FWL_PART_MCD_Background 3 -#define FWL_PART_MCD_LBtn 4 -#define FWL_PART_MCD_RBtn 5 -#define FWL_PART_MCD_HSeparator 6 -#define FWL_PART_MCD_VSeparator 7 -#define FWL_PART_MCD_TodayCircle 8 -#define FWL_PART_MCD_DateInCircle 9 -#define FWL_PART_MCD_DateInBK 10 -#define FWL_PART_MCD_Caption 9 -#define FWL_PART_MCD_DatesIn 10 -#define FWL_PART_MCD_DatesOut 11 -#define FWL_PART_MCD_Week 12 -#define FWL_PART_MCD_Today 13 -#define FWL_PART_MCD_Header 14 -#define FWL_PART_MCD_WeekNum 15 -#define FWL_PART_MCD_WeekNumSep 16 -#define FWL_PARTSTATE_MCD_Normal (0L << 0) -#define FWL_PARTSTATE_MCD_Pressed (1L << 0) -#define FWL_PARTSTATE_MCD_Hovered (2L << 0) -#define FWL_PARTSTATE_MCD_Selected (3L << 0) -#define FWL_PARTSTATE_MCD_LSelected (1L << 2) -#define FWL_PARTSTATE_MCD_RSelected (2L << 2) -#define FWL_PARTSTATE_MCD_Flagged (1L << 3) -#define FWL_PARTSTATE_MCD_Focused (1L << 4) -#define FWL_MCCAPACITY_Sun FWL_WGTCAPACITY_MAX + 5 -#define FWL_MCCAPACITY_Mon FWL_WGTCAPACITY_MAX + 6 -#define FWL_MCCAPACITY_Tue FWL_WGTCAPACITY_MAX + 7 -#define FWL_MCCAPACITY_Wed FWL_WGTCAPACITY_MAX + 8 -#define FWL_MCCAPACITY_Thu FWL_WGTCAPACITY_MAX + 9 -#define FWL_MCCAPACITY_Fri FWL_WGTCAPACITY_MAX + 10 -#define FWL_MCCAPACITY_Sat FWL_WGTCAPACITY_MAX + 11 -#define FWL_MCCAPACITY_January FWL_WGTCAPACITY_MAX + 12 -#define FWL_MCCAPACITY_February FWL_WGTCAPACITY_MAX + 13 -#define FWL_MCCAPACITY_March FWL_WGTCAPACITY_MAX + 14 -#define FWL_MCCAPACITY_April FWL_WGTCAPACITY_MAX + 15 -#define FWL_MCCAPACITY_May FWL_WGTCAPACITY_MAX + 16 -#define FWL_MCCAPACITY_June FWL_WGTCAPACITY_MAX + 17 -#define FWL_MCCAPACITY_July FWL_WGTCAPACITY_MAX + 18 -#define FWL_MCCAPACITY_August FWL_WGTCAPACITY_MAX + 19 -#define FWL_MCCAPACITY_September FWL_WGTCAPACITY_MAX + 20 -#define FWL_MCCAPACITY_October FWL_WGTCAPACITY_MAX + 21 -#define FWL_MCCAPACITY_November FWL_WGTCAPACITY_MAX + 22 -#define FWL_MCCAPACITY_December FWL_WGTCAPACITY_MAX + 23 -#define FWL_MCCAPACITY_Today FWL_WGTCAPACITY_MAX + 24 #define FWL_EVENT_MCD_DATESELECTED L"FWL_EVENT_MCD_DateSelected" #define FWL_NOTEHASH_MCD_DATASELECTED 1085596932 // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 diff --git a/xfa/fwl/basewidget/ifwl_picturebox.h b/xfa/fwl/basewidget/ifwl_picturebox.h index acc34f78d4..e663f23432 100644 --- a/xfa/fwl/basewidget/ifwl_picturebox.h +++ b/xfa/fwl/basewidget/ifwl_picturebox.h @@ -29,11 +29,6 @@ #define FWL_STYLEEXT_PTB_HAlignMask 3L << 0 #define FWL_STYLEEXT_PTB_VAlignMask 3L << 2 #define FWL_STYLEEXT_PTB_StretchAlignMask 7L << 4 -#define FWL_PART_PTB_Border 1 -#define FWL_PART_PTB_Edge 2 -#define FWL_PART_PTB_Image 3 -#define FWL_PARTSTATE_PTB_Normal (0L << 0) -#define FWL_PARTSTATE_PTB_Disabled (1L << 0) class CFX_DIBitmap; diff --git a/xfa/fwl/basewidget/ifwl_pushbutton.h b/xfa/fwl/basewidget/ifwl_pushbutton.h index 400b0c1b38..32e1e17215 100644 --- a/xfa/fwl/basewidget/ifwl_pushbutton.h +++ b/xfa/fwl/basewidget/ifwl_pushbutton.h @@ -29,18 +29,6 @@ #define FWL_STATE_PSB_Hovered (1 << FWL_WGTSTATE_MAX) #define FWL_STATE_PSB_Pressed (1 << (FWL_WGTSTATE_MAX + 1)) #define FWL_STATE_PSB_Default (1 << (FWL_WGTSTATE_MAX + 2)) -#define FWL_WGTCAPACITY_PSB_Margin (FWL_WGTCAPACITY_MAX + 1) -#define FWL_PART_PSB_Border 1 -#define FWL_PART_PSB_Edge 2 -#define FWL_PART_PSB_Background 3 -#define FWL_PART_PSB_Caption 4 -#define FWL_PARTSTATE_PSB_Normal (0L << 0) -#define FWL_PARTSTATE_PSB_Pressed (1L << 0) -#define FWL_PARTSTATE_PSB_Hovered (2L << 0) -#define FWL_PARTSTATE_PSB_Default (3L << 0) -#define FWL_PARTSTATE_PSB_Disabled (4L << 0) -#define FWL_PARTSTATE_PSB_Focused (1L << 3) -#define FWL_PARTSTATE_PSB_Mask (7L << 0) class CFX_DIBitmap; diff --git a/xfa/fwl/basewidget/ifwl_scrollbar.h b/xfa/fwl/basewidget/ifwl_scrollbar.h index a5b17eab90..2f2994b8f0 100644 --- a/xfa/fwl/basewidget/ifwl_scrollbar.h +++ b/xfa/fwl/basewidget/ifwl_scrollbar.h @@ -18,24 +18,11 @@ #define FWL_CLASSHASH_ScrollBar 2826584844 #define FWL_STYLEEXT_SCB_Horz (0L << 0) #define FWL_STYLEEXT_SCB_Vert (1L << 0) -#define FWL_PART_SCB_Border 1 -#define FWL_PART_SCB_Edge 2 -#define FWL_PART_SCB_Background 3 -#define FWL_PART_SCB_ForeArrow 4 -#define FWL_PART_SCB_BackArrow 5 -#define FWL_PART_SCB_Thumb 6 -#define FWL_PART_SCB_LowerTrack 7 -#define FWL_PART_SCB_UpperTrack 8 -#define FWL_PARTSTATE_SCB_Normal (0L << 0) -#define FWL_PARTSTATE_SCB_Hovered (1L << 0) -#define FWL_PARTSTATE_SCB_Pressed (2L << 0) -#define FWL_PARTSTATE_SCB_Disabled (3L << 0) #define FWL_WGTHITTEST_SCB_ForeArrow FWL_WGTHITTEST_MAX + 1 #define FWL_WGTHITTEST_SCB_BackArrow FWL_WGTHITTEST_MAX + 2 #define FWL_WGTHITTEST_SCB_LowerTrack FWL_WGTHITTEST_MAX + 3 #define FWL_WGTHITTEST_SCB_UpperTrack FWL_WGTHITTEST_MAX + 4 #define FWL_WGTHITTEST_SCB_Thumb FWL_WGTHITTEST_MAX + 5 -#define FWL_CAPACITY_SCB_Size FWL_WGTCAPACITY_MAX enum FWL_SCBCODE { FWL_SCBCODE_None = 1, diff --git a/xfa/fwl/basewidget/ifwl_spinbutton.h b/xfa/fwl/basewidget/ifwl_spinbutton.h index 87f38b4d5f..9a8ff59520 100644 --- a/xfa/fwl/basewidget/ifwl_spinbutton.h +++ b/xfa/fwl/basewidget/ifwl_spinbutton.h @@ -12,14 +12,6 @@ #define FWL_CLASS_SpinButton L"FWL_SPINBUTTON" #define FWL_CLASSHASH_SpinButton 3793043646 #define FWL_STYLEEXE_SPB_Vert (1L << 0) -#define FWL_PART_SPB_Border 1 -#define FWL_PART_SPB_Edge 2 -#define FWL_PART_SPB_UpButton 3 -#define FWL_PART_SPB_DownButton 4 -#define FWL_PARTSTATE_SPB_Normal (0L << 0) -#define FWL_PARTSTATE_SPB_Hovered (1L << 0) -#define FWL_PARTSTATE_SPB_Pressed (2L << 0) -#define FWL_PARTSTATE_SPB_Disabled (3L << 0) #define FWL_WGTHITTEST_SPB_UpButton (FWL_WGTHITTEST_MAX + 1) #define FWL_WGTHITTEST_SPB_DownButton (FWL_WGTHITTEST_MAX + 2) // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 diff --git a/xfa/fwl/basewidget/ifwl_tooltip.h b/xfa/fwl/basewidget/ifwl_tooltip.h index 278544b459..b9a07613a8 100644 --- a/xfa/fwl/basewidget/ifwl_tooltip.h +++ b/xfa/fwl/basewidget/ifwl_tooltip.h @@ -19,9 +19,6 @@ class IFWL_ToolTip; #define FWL_STYLEEXT_TTP_Balloon (1L << 4) #define FWL_STYLEEXT_TTP_Multiline (1L << 5) #define FWL_STYLEEXT_TTP_NoAnchor (1L << 6) -#define FWL_PART_TTP_Border 1 -#define FWL_PART_TTP_Background 2 -#define FWL_PART_TTP_Caption 3 class IFWL_ToolTipDP : public IFWL_DataProvider { public: |