| Index: xfa/fwl/basewidget/fwl_comboboximp.cpp
|
| diff --git a/xfa/fwl/basewidget/fwl_comboboximp.cpp b/xfa/fwl/basewidget/fwl_comboboximp.cpp
|
| index 1aeeb4a83f97aa8791aa938e20b06af78f164626..b8131e279104ab5139291f5b6f0fbd175288e141 100644
|
| --- a/xfa/fwl/basewidget/fwl_comboboximp.cpp
|
| +++ b/xfa/fwl/basewidget/fwl_comboboximp.cpp
|
| @@ -37,22 +37,22 @@ IFWL_ComboBox::IFWL_ComboBox() {}
|
| int32_t IFWL_ComboBox::GetCurSel() {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())->GetCurSel();
|
| }
|
| -FWL_ERR IFWL_ComboBox::SetCurSel(int32_t iSel) {
|
| +FWL_Error IFWL_ComboBox::SetCurSel(int32_t iSel) {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())->SetCurSel(iSel);
|
| }
|
| -FWL_ERR IFWL_ComboBox::SetEditText(const CFX_WideString& wsText) {
|
| +FWL_Error IFWL_ComboBox::SetEditText(const CFX_WideString& wsText) {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())->SetEditText(wsText);
|
| }
|
| int32_t IFWL_ComboBox::GetEditTextLength() const {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())->GetEditTextLength();
|
| }
|
| -FWL_ERR IFWL_ComboBox::GetEditText(CFX_WideString& wsText,
|
| - int32_t nStart,
|
| - int32_t nCount) const {
|
| +FWL_Error IFWL_ComboBox::GetEditText(CFX_WideString& wsText,
|
| + int32_t nStart,
|
| + int32_t nCount) const {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())
|
| ->GetEditText(wsText, nStart, nCount);
|
| }
|
| -FWL_ERR IFWL_ComboBox::SetEditSelRange(int32_t nStart, int32_t nCount) {
|
| +FWL_Error IFWL_ComboBox::SetEditSelRange(int32_t nStart, int32_t nCount) {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())
|
| ->SetEditSelRange(nStart, nCount);
|
| }
|
| @@ -63,10 +63,10 @@ int32_t IFWL_ComboBox::GetEditSelRange(int32_t nIndex, int32_t& nStart) {
|
| int32_t IFWL_ComboBox::GetEditLimit() {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())->GetEditLimit();
|
| }
|
| -FWL_ERR IFWL_ComboBox::SetEditLimit(int32_t nLimit) {
|
| +FWL_Error IFWL_ComboBox::SetEditLimit(int32_t nLimit) {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())->SetEditLimit(nLimit);
|
| }
|
| -FWL_ERR IFWL_ComboBox::EditDoClipboard(int32_t iCmd) {
|
| +FWL_Error IFWL_ComboBox::EditDoClipboard(int32_t iCmd) {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditDoClipboard(iCmd);
|
| }
|
| FX_BOOL IFWL_ComboBox::EditRedo(const CFX_ByteStringC& bsRecord) {
|
| @@ -81,7 +81,7 @@ IFWL_ListBox* IFWL_ComboBox::GetListBoxt() {
|
| FX_BOOL IFWL_ComboBox::AfterFocusShowDropList() {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())->AfterFocusShowDropList();
|
| }
|
| -FX_ERR IFWL_ComboBox::OpenDropDownList(FX_BOOL bActivate) {
|
| +FWL_Error IFWL_ComboBox::OpenDropDownList(FX_BOOL bActivate) {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())->OpenDropDownList(bActivate);
|
| }
|
| FX_BOOL IFWL_ComboBox::EditCanUndo() {
|
| @@ -123,11 +123,11 @@ FX_BOOL IFWL_ComboBox::EditDelete() {
|
| FX_BOOL IFWL_ComboBox::EditDeSelect() {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())->EditDeSelect();
|
| }
|
| -FWL_ERR IFWL_ComboBox::GetBBox(CFX_RectF& rect) {
|
| +FWL_Error IFWL_ComboBox::GetBBox(CFX_RectF& rect) {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())->GetBBox(rect);
|
| }
|
| -FWL_ERR IFWL_ComboBox::EditModifyStylesEx(uint32_t dwStylesExAdded,
|
| - uint32_t dwStylesExRemoved) {
|
| +FWL_Error IFWL_ComboBox::EditModifyStylesEx(uint32_t dwStylesExAdded,
|
| + uint32_t dwStylesExRemoved) {
|
| return static_cast<CFWL_ComboBoxImp*>(GetImpl())
|
| ->EditModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
|
| }
|
| @@ -202,14 +202,14 @@ CFWL_ComboListImp::CFWL_ComboListImp(const CFWL_WidgetImpProperties& properties,
|
| : CFWL_ListBoxImp(properties, pOuter), m_bNotifyOwner(TRUE) {
|
| ASSERT(pOuter != NULL);
|
| }
|
| -FWL_ERR CFWL_ComboListImp::Initialize() {
|
| - if (CFWL_ListBoxImp::Initialize() != FWL_ERR_Succeeded)
|
| - return FWL_ERR_Indefinite;
|
| +FWL_Error CFWL_ComboListImp::Initialize() {
|
| + if (CFWL_ListBoxImp::Initialize() != FWL_Error::Succeeded)
|
| + return FWL_Error::Indefinite;
|
| delete m_pDelegate;
|
| m_pDelegate = new CFWL_ComboListImpDelegate(this);
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| -FWL_ERR CFWL_ComboListImp::Finalize() {
|
| +FWL_Error CFWL_ComboListImp::Finalize() {
|
| delete m_pDelegate;
|
| m_pDelegate = nullptr;
|
| return CFWL_ListBoxImp::Finalize();
|
| @@ -483,27 +483,31 @@ CFWL_ComboBoxImp::CFWL_ComboBoxImp(const CFWL_WidgetImpProperties& properties,
|
| m_rtBtn.Reset();
|
| m_rtHandler.Reset();
|
| }
|
| +
|
| CFWL_ComboBoxImp::~CFWL_ComboBoxImp() {}
|
| -FWL_ERR CFWL_ComboBoxImp::GetClassName(CFX_WideString& wsClass) const {
|
| +
|
| +FWL_Error CFWL_ComboBoxImp::GetClassName(CFX_WideString& wsClass) const {
|
| wsClass = FWL_CLASS_ComboBox;
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| +
|
| uint32_t CFWL_ComboBoxImp::GetClassID() const {
|
| return FWL_CLASSHASH_ComboBox;
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::Initialize() {
|
| - if (m_pWidgetMgr->IsFormDisabled()) {
|
| +
|
| +FWL_Error CFWL_ComboBoxImp::Initialize() {
|
| + if (m_pWidgetMgr->IsFormDisabled())
|
| return DisForm_Initialize();
|
| - }
|
| - if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded)
|
| - return FWL_WGTSTATE_Invisible; // Probably a bug; not a FWL_ERR_ value.
|
| + if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded)
|
| + return FWL_Error::Indefinite;
|
| +
|
| m_pDelegate = new CFWL_ComboBoxImpDelegate(this);
|
| CFWL_WidgetImpProperties prop;
|
| prop.m_pThemeProvider = m_pProperties->m_pThemeProvider;
|
| prop.m_dwStyles |= FWL_WGTSTYLE_Border | FWL_WGTSTYLE_VScroll;
|
| - if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListItemIconText) {
|
| + if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CMB_ListItemIconText)
|
| prop.m_dwStyleExes |= FWL_STYLEEXT_LTB_Icon;
|
| - }
|
| +
|
| prop.m_pDataProvider = m_pProperties->m_pDataProvider;
|
| m_pListBox.reset(IFWL_ListBox::CreateComboList(prop, m_pInterface));
|
| m_pListBox->Initialize();
|
| @@ -513,13 +517,14 @@ FWL_ERR CFWL_ComboBoxImp::Initialize() {
|
| m_pEdit->Initialize();
|
| static_cast<CFWL_EditImp*>(m_pEdit->GetImpl())->SetOuter(m_pInterface);
|
| }
|
| - if (m_pEdit) {
|
| + if (m_pEdit)
|
| m_pEdit->SetParent(m_pInterface);
|
| - }
|
| +
|
| SetStates(m_pProperties->m_dwStates);
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::Finalize() {
|
| +
|
| +FWL_Error CFWL_ComboBoxImp::Finalize() {
|
| if (m_pEdit) {
|
| m_pEdit->Finalize();
|
| }
|
| @@ -528,7 +533,7 @@ FWL_ERR CFWL_ComboBoxImp::Finalize() {
|
| m_pDelegate = nullptr;
|
| return CFWL_WidgetImp::Finalize();
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
|
| +FWL_Error CFWL_ComboBoxImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
|
| if (bAutoSize) {
|
| rect.Reset();
|
| FX_BOOL bIsDropDown = IsDropDownStyle();
|
| @@ -544,16 +549,16 @@ FWL_ERR CFWL_ComboBoxImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
|
| FX_FLOAT* pFWidth = static_cast<FX_FLOAT*>(
|
| GetThemeCapacity(CFWL_WidgetCapacity::ScrollBarWidth));
|
| if (!pFWidth)
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| rect.Inflate(0, 0, *pFWidth, 0);
|
| CFWL_WidgetImp::GetWidgetRect(rect, TRUE);
|
| } else {
|
| rect = m_pProperties->m_rtWidget;
|
| }
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::ModifyStylesEx(uint32_t dwStylesExAdded,
|
| - uint32_t dwStylesExRemoved) {
|
| +FWL_Error CFWL_ComboBoxImp::ModifyStylesEx(uint32_t dwStylesExAdded,
|
| + uint32_t dwStylesExRemoved) {
|
| if (m_pWidgetMgr->IsFormDisabled()) {
|
| return DisForm_ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
|
| }
|
| @@ -570,12 +575,12 @@ FWL_ERR CFWL_ComboBoxImp::ModifyStylesEx(uint32_t dwStylesExAdded,
|
| }
|
| return CFWL_WidgetImp::ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::Update() {
|
| +FWL_Error CFWL_ComboBoxImp::Update() {
|
| if (m_pWidgetMgr->IsFormDisabled()) {
|
| return DisForm_Update();
|
| }
|
| if (IsLocked()) {
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| }
|
| ReSetTheme();
|
| FX_BOOL bDropDown = IsDropDownStyle();
|
| @@ -591,7 +596,7 @@ FWL_ERR CFWL_ComboBoxImp::Update() {
|
| m_fComboFormHandler =
|
| *static_cast<FX_FLOAT*>(m_pProperties->m_pThemeProvider->GetCapacity(
|
| &part, CFWL_WidgetCapacity::ComboFormHandler));
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| uint32_t CFWL_ComboBoxImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
|
| if (m_pWidgetMgr->IsFormDisabled()) {
|
| @@ -599,15 +604,15 @@ uint32_t CFWL_ComboBoxImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
|
| }
|
| return CFWL_WidgetImp::HitTest(fx, fy);
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics,
|
| - const CFX_Matrix* pMatrix) {
|
| +FWL_Error CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics,
|
| + const CFX_Matrix* pMatrix) {
|
| if (m_pWidgetMgr->IsFormDisabled()) {
|
| return DisForm_DrawWidget(pGraphics, pMatrix);
|
| }
|
| if (!pGraphics)
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| if (!m_pProperties->m_pThemeProvider)
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
|
| FX_BOOL bIsDropDown = IsDropDownStyle();
|
| if (HasBorder()) {
|
| @@ -648,7 +653,7 @@ FWL_ERR CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics,
|
| pTheme->DrawBackground(¶m);
|
| if (m_iCurSel >= 0) {
|
| if (!m_pListBox)
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| CFX_WideString wsText;
|
| IFWL_ComboBoxDP* pData =
|
| static_cast<IFWL_ComboBoxDP*>(m_pProperties->m_pDataProvider);
|
| @@ -683,11 +688,12 @@ FWL_ERR CFWL_ComboBoxImp::DrawWidget(CFX_Graphics* pGraphics,
|
| param.m_rtPart = m_rtBtn;
|
| pTheme->DrawBackground(¶m);
|
| }
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
|
| +FWL_Error CFWL_ComboBoxImp::SetThemeProvider(
|
| + IFWL_ThemeProvider* pThemeProvider) {
|
| if (!pThemeProvider)
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| m_pProperties->m_pThemeProvider = pThemeProvider;
|
| if (m_pListBox && pThemeProvider->IsValidWidget(m_pListBox.get())) {
|
| m_pListBox->SetThemeProvider(pThemeProvider);
|
| @@ -695,12 +701,12 @@ FWL_ERR CFWL_ComboBoxImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
|
| if (m_pEdit && pThemeProvider->IsValidWidget(m_pEdit.get())) {
|
| m_pEdit->SetThemeProvider(pThemeProvider);
|
| }
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| int32_t CFWL_ComboBoxImp::GetCurSel() {
|
| return m_iCurSel;
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::SetCurSel(int32_t iSel) {
|
| +FWL_Error CFWL_ComboBoxImp::SetCurSel(int32_t iSel) {
|
| int32_t iCount =
|
| static_cast<CFWL_ComboListImp*>(m_pListBox->GetImpl())->CountItems();
|
| FX_BOOL bClearSel = iSel < 0 || iSel >= iCount;
|
| @@ -720,9 +726,9 @@ FWL_ERR CFWL_ComboBoxImp::SetCurSel(int32_t iSel) {
|
| m_pEdit->Update();
|
| }
|
| m_iCurSel = bClearSel ? -1 : iSel;
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::SetStates(uint32_t dwStates, FX_BOOL bSet) {
|
| +FWL_Error CFWL_ComboBoxImp::SetStates(uint32_t dwStates, FX_BOOL bSet) {
|
| FX_BOOL bIsDropDown = IsDropDownStyle();
|
| if (bIsDropDown && m_pEdit) {
|
| m_pEdit->SetStates(dwStates, bSet);
|
| @@ -732,9 +738,9 @@ FWL_ERR CFWL_ComboBoxImp::SetStates(uint32_t dwStates, FX_BOOL bSet) {
|
| }
|
| return CFWL_WidgetImp::SetStates(dwStates, bSet);
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::SetEditText(const CFX_WideString& wsText) {
|
| +FWL_Error CFWL_ComboBoxImp::SetEditText(const CFX_WideString& wsText) {
|
| if (!m_pEdit)
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| m_pEdit->SetText(wsText);
|
| return m_pEdit->Update();
|
| }
|
| @@ -743,9 +749,9 @@ int32_t CFWL_ComboBoxImp::GetEditTextLength() const {
|
| return -1;
|
| return m_pEdit->GetTextLength();
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::GetEditText(CFX_WideString& wsText,
|
| - int32_t nStart,
|
| - int32_t nCount) const {
|
| +FWL_Error CFWL_ComboBoxImp::GetEditText(CFX_WideString& wsText,
|
| + int32_t nStart,
|
| + int32_t nCount) const {
|
| if (m_pEdit) {
|
| return m_pEdit->GetText(wsText, nStart, nCount);
|
| } else if (m_pListBox) {
|
| @@ -754,14 +760,14 @@ FWL_ERR CFWL_ComboBoxImp::GetEditText(CFX_WideString& wsText,
|
| FWL_HLISTITEM hItem = pData->GetItem(m_pInterface, m_iCurSel);
|
| return m_pListBox->GetItemText(hItem, wsText);
|
| }
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::SetEditSelRange(int32_t nStart, int32_t nCount) {
|
| +FWL_Error CFWL_ComboBoxImp::SetEditSelRange(int32_t nStart, int32_t nCount) {
|
| if (!m_pEdit)
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| static_cast<CFWL_ComboEditImp*>(m_pEdit->GetImpl())->ClearSelected();
|
| m_pEdit->AddSelRange(nStart, nCount);
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| int32_t CFWL_ComboBoxImp::GetEditSelRange(int32_t nIndex, int32_t& nStart) {
|
| if (!m_pEdit)
|
| @@ -773,14 +779,14 @@ int32_t CFWL_ComboBoxImp::GetEditLimit() {
|
| return -1;
|
| return m_pEdit->GetLimit();
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::SetEditLimit(int32_t nLimit) {
|
| +FWL_Error CFWL_ComboBoxImp::SetEditLimit(int32_t nLimit) {
|
| if (!m_pEdit)
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| return m_pEdit->SetLimit(nLimit);
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::EditDoClipboard(int32_t iCmd) {
|
| +FWL_Error CFWL_ComboBoxImp::EditDoClipboard(int32_t iCmd) {
|
| if (!m_pEdit)
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| return m_pEdit->DoClipboard(iCmd);
|
| }
|
| FX_BOOL CFWL_ComboBoxImp::EditRedo(const CFX_ByteStringC& bsRecord) {
|
| @@ -807,9 +813,9 @@ FX_BOOL CFWL_ComboBoxImp::AfterFocusShowDropList() {
|
| m_bNeedShowList = FALSE;
|
| return TRUE;
|
| }
|
| -FX_ERR CFWL_ComboBoxImp::OpenDropDownList(FX_BOOL bActivate) {
|
| +FWL_Error CFWL_ComboBoxImp::OpenDropDownList(FX_BOOL bActivate) {
|
| ShowDropList(bActivate);
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| FX_BOOL CFWL_ComboBoxImp::EditCanUndo() {
|
| return m_pEdit->CanUndo();
|
| @@ -845,15 +851,15 @@ FX_BOOL CFWL_ComboBoxImp::EditPaste(const CFX_WideString& wsPaste) {
|
| return m_pEdit->Paste(wsPaste);
|
| }
|
| FX_BOOL CFWL_ComboBoxImp::EditSelectAll() {
|
| - return m_pEdit->AddSelRange(0) == FWL_ERR_Succeeded;
|
| + return m_pEdit->AddSelRange(0) == FWL_Error::Succeeded;
|
| }
|
| FX_BOOL CFWL_ComboBoxImp::EditDelete() {
|
| - return m_pEdit->ClearText() == FWL_ERR_Succeeded;
|
| + return m_pEdit->ClearText() == FWL_Error::Succeeded;
|
| }
|
| FX_BOOL CFWL_ComboBoxImp::EditDeSelect() {
|
| - return m_pEdit->ClearSelections() == FWL_ERR_Succeeded;
|
| + return m_pEdit->ClearSelections() == FWL_Error::Succeeded;
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::GetBBox(CFX_RectF& rect) {
|
| +FWL_Error CFWL_ComboBoxImp::GetBBox(CFX_RectF& rect) {
|
| if (m_pWidgetMgr->IsFormDisabled()) {
|
| return DisForm_GetBBox(rect);
|
| }
|
| @@ -864,14 +870,14 @@ FWL_ERR CFWL_ComboBoxImp::GetBBox(CFX_RectF& rect) {
|
| rtList.Offset(rect.left, rect.top);
|
| rect.Union(rtList);
|
| }
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::EditModifyStylesEx(uint32_t dwStylesExAdded,
|
| - uint32_t dwStylesExRemoved) {
|
| +FWL_Error CFWL_ComboBoxImp::EditModifyStylesEx(uint32_t dwStylesExAdded,
|
| + uint32_t dwStylesExRemoved) {
|
| if (m_pEdit != NULL) {
|
| return m_pEdit->ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
|
| } else {
|
| - return FWL_ERR_Parameter_Invalid;
|
| + return FWL_Error::ParameterInvalid;
|
| }
|
| }
|
| FX_FLOAT CFWL_ComboBoxImp::GetListHeight() {
|
| @@ -1129,11 +1135,13 @@ void CFWL_ComboBoxImp::ProcessSelChanged(FX_BOOL bLButtonUp) {
|
| Repaint(&m_rtClient);
|
| }
|
| }
|
| +
|
| void CFWL_ComboBoxImp::InitProxyForm() {
|
| if (m_pForm)
|
| return;
|
| if (!m_pListBox)
|
| return;
|
| +
|
| CFWL_WidgetImpProperties propForm;
|
| propForm.m_pOwner = m_pInterface;
|
| propForm.m_dwStyles = FWL_WGTSTYLE_Popup;
|
| @@ -1146,18 +1154,21 @@ void CFWL_ComboBoxImp::InitProxyForm() {
|
| m_pListProxyDelegate = new CFWL_ComboProxyImpDelegate(m_pForm, this);
|
| m_pProxy->SetDelegate(m_pListProxyDelegate);
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::DisForm_Initialize() {
|
| - if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded)
|
| - return FWL_WGTSTATE_Invisible; // Ditto.
|
| +
|
| +FWL_Error CFWL_ComboBoxImp::DisForm_Initialize() {
|
| + if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded)
|
| + return FWL_Error::Indefinite;
|
| +
|
| m_pDelegate = new CFWL_ComboBoxImpDelegate(this);
|
| DisForm_InitComboList();
|
| DisForm_InitComboEdit();
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| +
|
| void CFWL_ComboBoxImp::DisForm_InitComboList() {
|
| - if (m_pListBox) {
|
| + if (m_pListBox)
|
| return;
|
| - }
|
| +
|
| CFWL_WidgetImpProperties prop;
|
| prop.m_pParent = m_pInterface;
|
| prop.m_dwStyles = FWL_WGTSTYLE_Border | FWL_WGTSTYLE_VScroll;
|
| @@ -1227,8 +1238,8 @@ void CFWL_ComboBoxImp::DisForm_ShowDropList(FX_BOOL bActivate) {
|
| FX_BOOL CFWL_ComboBoxImp::DisForm_IsDropListShowed() {
|
| return !(m_pListBox->GetStates() & FWL_WGTSTATE_Invisible);
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::DisForm_ModifyStylesEx(uint32_t dwStylesExAdded,
|
| - uint32_t dwStylesExRemoved) {
|
| +FWL_Error CFWL_ComboBoxImp::DisForm_ModifyStylesEx(uint32_t dwStylesExAdded,
|
| + uint32_t dwStylesExRemoved) {
|
| if (!m_pEdit) {
|
| DisForm_InitComboEdit();
|
| }
|
| @@ -1243,16 +1254,16 @@ FWL_ERR CFWL_ComboBoxImp::DisForm_ModifyStylesEx(uint32_t dwStylesExAdded,
|
| }
|
| return CFWL_WidgetImp::ModifyStylesEx(dwStylesExAdded, dwStylesExRemoved);
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::DisForm_Update() {
|
| +FWL_Error CFWL_ComboBoxImp::DisForm_Update() {
|
| if (m_iLock) {
|
| - return FWL_ERR_Indefinite;
|
| + return FWL_Error::Indefinite;
|
| }
|
| if (m_pEdit) {
|
| ReSetEditAlignment();
|
| }
|
| ReSetTheme();
|
| Layout();
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| uint32_t CFWL_ComboBoxImp::DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) {
|
| CFX_RectF rect;
|
| @@ -1272,8 +1283,8 @@ uint32_t CFWL_ComboBoxImp::DisForm_HitTest(FX_FLOAT fx, FX_FLOAT fy) {
|
| }
|
| return FWL_WGTHITTEST_Unknown;
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::DisForm_DrawWidget(CFX_Graphics* pGraphics,
|
| - const CFX_Matrix* pMatrix) {
|
| +FWL_Error CFWL_ComboBoxImp::DisForm_DrawWidget(CFX_Graphics* pGraphics,
|
| + const CFX_Matrix* pMatrix) {
|
| IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
|
| CFX_Matrix mtOrg;
|
| mtOrg.Set(1, 0, 0, 1, 0, 0);
|
| @@ -1309,9 +1320,9 @@ FWL_ERR CFWL_ComboBoxImp::DisForm_DrawWidget(CFX_Graphics* pGraphics,
|
| mt.Concat(mtOrg);
|
| m_pListBox->DrawWidget(pGraphics, &mt);
|
| }
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| -FWL_ERR CFWL_ComboBoxImp::DisForm_GetBBox(CFX_RectF& rect) {
|
| +FWL_Error CFWL_ComboBoxImp::DisForm_GetBBox(CFX_RectF& rect) {
|
| rect = m_pProperties->m_rtWidget;
|
| if (m_pListBox && DisForm_IsDropListShowed()) {
|
| CFX_RectF rtList;
|
| @@ -1319,7 +1330,7 @@ FWL_ERR CFWL_ComboBoxImp::DisForm_GetBBox(CFX_RectF& rect) {
|
| rtList.Offset(rect.left, rect.top);
|
| rect.Union(rtList);
|
| }
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| void CFWL_ComboBoxImp::DisForm_Layout() {
|
| GetClientRect(m_rtClient);
|
| @@ -1419,7 +1430,7 @@ int32_t CFWL_ComboBoxImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
|
| return iRet;
|
| }
|
|
|
| -FWL_ERR CFWL_ComboBoxImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {
|
| +FWL_Error CFWL_ComboBoxImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {
|
| CFWL_EventType dwFlag = pEvent->GetClassID();
|
| if (dwFlag == CFWL_EventType::DrawItem) {
|
| CFWL_EvtLtbDrawItem* pDrawItemEvent =
|
| @@ -1447,11 +1458,11 @@ FWL_ERR CFWL_ComboBoxImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {
|
| pTemp.nChangeType = pTextChangedEvent->nChangeType;
|
| m_pOwner->DispatchEvent(&pTemp);
|
| }
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
|
|
| -FWL_ERR CFWL_ComboBoxImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
|
| - const CFX_Matrix* pMatrix) {
|
| +FWL_Error CFWL_ComboBoxImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
|
| + const CFX_Matrix* pMatrix) {
|
| return m_pOwner->DrawWidget(pGraphics, pMatrix);
|
| }
|
| void CFWL_ComboBoxImpDelegate::OnFocusChanged(CFWL_Message* pMsg,
|
| @@ -1796,10 +1807,10 @@ int32_t CFWL_ComboProxyImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
|
| return CFWL_WidgetImpDelegate::OnProcessMessage(pMessage);
|
| }
|
|
|
| -FWL_ERR CFWL_ComboProxyImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
|
| - const CFX_Matrix* pMatrix) {
|
| +FWL_Error CFWL_ComboProxyImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
|
| + const CFX_Matrix* pMatrix) {
|
| m_pComboBox->DrawStretchHandler(pGraphics, pMatrix);
|
| - return FWL_ERR_Succeeded;
|
| + return FWL_Error::Succeeded;
|
| }
|
| void CFWL_ComboProxyImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) {
|
| IFWL_App* pApp = m_pForm->GetOwnerApp();
|
|
|