Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(587)

Unified Diff: xfa/fwl/core/cfwl_combobox.cpp

Issue 2533623002: Cleanup default FWL params part I (Closed)
Patch Set: Rebase to master Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/cfwl_combobox.h ('k') | xfa/fwl/core/cfwl_comboboxproxy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/cfwl_combobox.cpp
diff --git a/xfa/fwl/core/cfwl_combobox.cpp b/xfa/fwl/core/cfwl_combobox.cpp
index c8486c39c4ee366ac9f5a68796b954da476a883d..70f863504db7696681e34dedf2af93690a98ac18 100644
--- a/xfa/fwl/core/cfwl_combobox.cpp
+++ b/xfa/fwl/core/cfwl_combobox.cpp
@@ -124,7 +124,7 @@ void CFWL_ComboBox::ModifyStylesEx(uint32_t dwStylesExAdded,
m_pEdit->SetOuter(this);
m_pEdit->SetParent(this);
} else if (bRemoveDropDown && m_pEdit) {
- m_pEdit->SetStates(FWL_WGTSTATE_Invisible, true);
+ m_pEdit->SetStates(FWL_WGTSTATE_Invisible);
}
CFWL_Widget::ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
}
@@ -276,12 +276,20 @@ void CFWL_ComboBox::SetCurSel(int32_t iSel) {
m_iCurSel = bClearSel ? -1 : iSel;
}
-void CFWL_ComboBox::SetStates(uint32_t dwStates, bool bSet) {
+void CFWL_ComboBox::SetStates(uint32_t dwStates) {
if (IsDropDownStyle() && m_pEdit)
- m_pEdit->SetStates(dwStates, bSet);
+ m_pEdit->SetStates(dwStates);
if (m_pListBox)
- m_pListBox->SetStates(dwStates, bSet);
- CFWL_Widget::SetStates(dwStates, bSet);
+ m_pListBox->SetStates(dwStates);
+ CFWL_Widget::SetStates(dwStates);
+}
+
+void CFWL_ComboBox::RemoveStates(uint32_t dwStates) {
+ if (IsDropDownStyle() && m_pEdit)
+ m_pEdit->RemoveStates(dwStates);
+ if (m_pListBox)
+ m_pListBox->RemoveStates(dwStates);
+ CFWL_Widget::RemoveStates(dwStates);
}
void CFWL_ComboBox::SetEditText(const CFX_WideString& wsText) {
@@ -319,7 +327,7 @@ void CFWL_ComboBox::GetBBox(CFX_RectF& rect) const {
return;
CFX_RectF rtList;
- m_pListBox->GetWidgetRect(rtList);
+ m_pListBox->GetWidgetRect(rtList, false);
rtList.Offset(rect.left, rect.top);
rect.Union(rtList);
}
@@ -635,14 +643,16 @@ void CFWL_ComboBox::DisForm_ShowDropList(bool bActivate) {
SetFocus(true);
}
- m_pListBox->SetStates(FWL_WGTSTATE_Invisible, !bActivate);
if (bActivate) {
+ m_pListBox->RemoveStates(FWL_WGTSTATE_Invisible);
CFWL_Event postEvent(CFWL_Event::Type::PostDropDown, this);
DispatchEvent(&postEvent);
+ } else {
+ m_pListBox->SetStates(FWL_WGTSTATE_Invisible);
}
CFX_RectF rect;
- m_pListBox->GetWidgetRect(rect);
+ m_pListBox->GetWidgetRect(rect, false);
rect.Inflate(2, 2);
Repaint(&rect);
}
@@ -683,7 +693,7 @@ FWL_WidgetHit CFWL_ComboBox::DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) {
if (m_rtBtn.Contains(fx, fy))
return FWL_WidgetHit::Client;
if (DisForm_IsDropListVisible()) {
- m_pListBox->GetWidgetRect(rect);
+ m_pListBox->GetWidgetRect(rect, false);
if (rect.Contains(fx, fy))
return FWL_WidgetHit::Client;
}
@@ -713,7 +723,7 @@ void CFWL_ComboBox::DisForm_DrawWidget(CFX_Graphics* pGraphics,
if (m_pEdit) {
CFX_RectF rtEdit;
- m_pEdit->GetWidgetRect(rtEdit);
+ m_pEdit->GetWidgetRect(rtEdit, false);
CFX_Matrix mt;
mt.Set(1, 0, 0, 1, rtEdit.left, rtEdit.top);
mt.Concat(mtOrg);
@@ -721,7 +731,7 @@ void CFWL_ComboBox::DisForm_DrawWidget(CFX_Graphics* pGraphics,
}
if (m_pListBox && DisForm_IsDropListVisible()) {
CFX_RectF rtList;
- m_pListBox->GetWidgetRect(rtList);
+ m_pListBox->GetWidgetRect(rtList, false);
CFX_Matrix mt;
mt.Set(1, 0, 0, 1, rtList.left, rtList.top);
mt.Concat(mtOrg);
@@ -735,7 +745,7 @@ void CFWL_ComboBox::DisForm_GetBBox(CFX_RectF& rect) const {
return;
CFX_RectF rtList;
- m_pListBox->GetWidgetRect(rtList);
+ m_pListBox->GetWidgetRect(rtList, false);
rtList.Offset(rect.left, rect.top);
rect.Union(rtList);
}
« no previous file with comments | « xfa/fwl/core/cfwl_combobox.h ('k') | xfa/fwl/core/cfwl_comboboxproxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698