summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_combobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl/cfwl_combobox.cpp')
-rw-r--r--xfa/fwl/cfwl_combobox.cpp34
1 files changed, 12 insertions, 22 deletions
diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp
index c07e0cf246..03d2921e65 100644
--- a/xfa/fwl/cfwl_combobox.cpp
+++ b/xfa/fwl/cfwl_combobox.cpp
@@ -35,8 +35,7 @@ CFWL_ComboBox::CFWL_ComboBox(const CFWL_App* app)
m_pComboBoxProxy(nullptr),
m_bLButtonDown(false),
m_iCurSel(-1),
- m_iBtnState(CFWL_PartState_Normal),
- m_fComboFormHandler(0) {
+ m_iBtnState(CFWL_PartState_Normal) {
m_rtClient.Reset();
m_rtBtn.Reset();
m_rtHandler.Reset();
@@ -117,11 +116,6 @@ void CFWL_ComboBox::Update() {
m_pProperties->m_pThemeProvider = GetAvailableTheme();
Layout();
- CFWL_ThemePart part;
- part.m_pWidget = this;
- m_fComboFormHandler =
- *static_cast<FX_FLOAT*>(m_pProperties->m_pThemeProvider->GetCapacity(
- &part, CFWL_WidgetCapacity::ComboFormHandler));
}
FWL_WidgetHit CFWL_ComboBox::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
@@ -349,7 +343,6 @@ void CFWL_ComboBox::ShowDropList(bool bActivate) {
CFWL_Event ev(CFWL_Event::Type::PreDropDown, this);
DispatchEvent(&ev);
- m_fItemHeight = m_pListBox->GetItemHeight();
m_pListBox->SetFocus(true);
m_pComboBoxProxy->DoModal();
m_pListBox->SetFocus(false);
@@ -380,12 +373,11 @@ void CFWL_ComboBox::Layout() {
return DisForm_Layout();
m_rtClient = GetClientRect();
- FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>(
- GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth));
- if (!pFWidth)
+ IFWL_ThemeProvider* theme = GetAvailableTheme();
+ if (!theme)
return;
- FX_FLOAT fBtn = *pFWidth;
+ FX_FLOAT fBtn = theme->GetScrollBarWidth();
m_rtBtn.Set(m_rtClient.right() - fBtn, m_rtClient.top, fBtn,
m_rtClient.height);
if (!IsDropDownStyle() || !m_pEdit)
@@ -680,24 +672,22 @@ CFX_RectF CFWL_ComboBox::DisForm_GetBBox() const {
void CFWL_ComboBox::DisForm_Layout() {
m_rtClient = GetClientRect();
m_rtContent = m_rtClient;
- FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>(
- GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth));
- if (!pFWidth)
+ IFWL_ThemeProvider* theme = GetAvailableTheme();
+ if (!theme)
return;
FX_FLOAT borderWidth = 1;
- FX_FLOAT fBtn = *pFWidth;
+ FX_FLOAT fBtn = theme->GetScrollBarWidth();
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(CFWL_WidgetCapacity::UIMargin));
- if (pUIMargin) {
- m_rtContent.Deflate(pUIMargin->left, pUIMargin->top, pUIMargin->width,
- pUIMargin->height);
- }
+ CFWL_ThemePart part;
+ part.m_pWidget = this;
+ CFX_RectF pUIMargin = theme->GetUIMargin(&part);
+ m_rtContent.Deflate(pUIMargin.left, pUIMargin.top, pUIMargin.width,
+ pUIMargin.height);
if (!IsDropDownStyle() || !m_pEdit)
return;