| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fwl/lightwidget/cfwl_listbox.h" | 7 #include "xfa/fwl/lightwidget/cfwl_listbox.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "third_party/base/stl_util.h" | 11 #include "third_party/base/stl_util.h" |
| 12 | 12 |
| 13 CFWL_ListBox* CFWL_ListBox::Create() { | 13 CFWL_ListBox* CFWL_ListBox::Create() { |
| 14 return new CFWL_ListBox; | 14 return new CFWL_ListBox; |
| 15 } | 15 } |
| 16 | 16 |
| 17 FWL_ERR CFWL_ListBox::Initialize(const CFWL_WidgetProperties* pProperties) { | 17 FWL_Error CFWL_ListBox::Initialize(const CFWL_WidgetProperties* pProperties) { |
| 18 if (m_pIface) | 18 if (m_pIface) |
| 19 return FWL_ERR_Indefinite; | 19 return FWL_Error::Indefinite; |
| 20 if (pProperties) { | 20 if (pProperties) { |
| 21 *m_pProperties = *pProperties; | 21 *m_pProperties = *pProperties; |
| 22 } | 22 } |
| 23 std::unique_ptr<IFWL_ListBox> pListBox(IFWL_ListBox::Create( | 23 std::unique_ptr<IFWL_ListBox> pListBox(IFWL_ListBox::Create( |
| 24 m_pProperties->MakeWidgetImpProperties(&m_ListBoxDP), nullptr)); | 24 m_pProperties->MakeWidgetImpProperties(&m_ListBoxDP), nullptr)); |
| 25 FWL_ERR ret = pListBox->Initialize(); | 25 FWL_Error ret = pListBox->Initialize(); |
| 26 if (ret != FWL_ERR_Succeeded) { | 26 if (ret != FWL_Error::Succeeded) { |
| 27 return ret; | 27 return ret; |
| 28 } | 28 } |
| 29 m_pIface = pListBox.release(); | 29 m_pIface = pListBox.release(); |
| 30 CFWL_Widget::Initialize(); | 30 CFWL_Widget::Initialize(); |
| 31 return FWL_ERR_Succeeded; | 31 return FWL_Error::Succeeded; |
| 32 } | 32 } |
| 33 | 33 |
| 34 FWL_ERR CFWL_ListBox::AddDIBitmap(CFX_DIBitmap* pDIB, FWL_HLISTITEM hItem) { | 34 FWL_Error CFWL_ListBox::AddDIBitmap(CFX_DIBitmap* pDIB, FWL_HLISTITEM hItem) { |
| 35 reinterpret_cast<CFWL_ListItem*>(hItem)->m_pDIB = pDIB; | 35 reinterpret_cast<CFWL_ListItem*>(hItem)->m_pDIB = pDIB; |
| 36 return FWL_ERR_Succeeded; | 36 return FWL_Error::Succeeded; |
| 37 } | 37 } |
| 38 | 38 |
| 39 FWL_HLISTITEM CFWL_ListBox::AddString(const CFX_WideStringC& wsAdd, | 39 FWL_HLISTITEM CFWL_ListBox::AddString(const CFX_WideStringC& wsAdd, |
| 40 FX_BOOL bSelect) { | 40 FX_BOOL bSelect) { |
| 41 std::unique_ptr<CFWL_ListItem> pItem(new CFWL_ListItem); | 41 std::unique_ptr<CFWL_ListItem> pItem(new CFWL_ListItem); |
| 42 pItem->m_dwStates = 0; | 42 pItem->m_dwStates = 0; |
| 43 pItem->m_wsText = wsAdd; | 43 pItem->m_wsText = wsAdd; |
| 44 pItem->m_dwStates = bSelect ? FWL_ITEMSTATE_LTB_Selected : 0; | 44 pItem->m_dwStates = bSelect ? FWL_ITEMSTATE_LTB_Selected : 0; |
| 45 m_ListBoxDP.m_ItemArray.push_back(std::move(pItem)); | 45 m_ListBoxDP.m_ItemArray.push_back(std::move(pItem)); |
| 46 return (FWL_HLISTITEM)m_ListBoxDP.m_ItemArray.back().get(); | 46 return (FWL_HLISTITEM)m_ListBoxDP.m_ItemArray.back().get(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 return NULL; | 84 return NULL; |
| 85 return static_cast<IFWL_ListBox*>(m_pIface)->GetSelItem(nIndexSel); | 85 return static_cast<IFWL_ListBox*>(m_pIface)->GetSelItem(nIndexSel); |
| 86 } | 86 } |
| 87 | 87 |
| 88 int32_t CFWL_ListBox::GetSelIndex(int32_t nIndex) { | 88 int32_t CFWL_ListBox::GetSelIndex(int32_t nIndex) { |
| 89 if (!m_pIface) | 89 if (!m_pIface) |
| 90 return 0; | 90 return 0; |
| 91 return static_cast<IFWL_ListBox*>(m_pIface)->GetSelIndex(nIndex); | 91 return static_cast<IFWL_ListBox*>(m_pIface)->GetSelIndex(nIndex); |
| 92 } | 92 } |
| 93 | 93 |
| 94 FWL_ERR CFWL_ListBox::SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect) { | 94 FWL_Error CFWL_ListBox::SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect) { |
| 95 if (!m_pIface) | 95 if (!m_pIface) |
| 96 return FWL_ERR_Indefinite; | 96 return FWL_Error::Indefinite; |
| 97 return static_cast<IFWL_ListBox*>(m_pIface)->SetSelItem(hItem, bSelect); | 97 return static_cast<IFWL_ListBox*>(m_pIface)->SetSelItem(hItem, bSelect); |
| 98 } | 98 } |
| 99 | 99 |
| 100 FWL_ERR CFWL_ListBox::GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText) { | 100 FWL_Error CFWL_ListBox::GetItemText(FWL_HLISTITEM hItem, |
| 101 CFX_WideString& wsText) { |
| 101 if (!m_pIface) | 102 if (!m_pIface) |
| 102 return FWL_ERR_Indefinite; | 103 return FWL_Error::Indefinite; |
| 103 return static_cast<IFWL_ListBox*>(m_pIface)->GetItemText(hItem, wsText); | 104 return static_cast<IFWL_ListBox*>(m_pIface)->GetItemText(hItem, wsText); |
| 104 } | 105 } |
| 105 | 106 |
| 106 FWL_ERR CFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert) { | 107 FWL_Error CFWL_ListBox::GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert) { |
| 107 if (!m_pIface) | 108 if (!m_pIface) |
| 108 return FWL_ERR_Indefinite; | 109 return FWL_Error::Indefinite; |
| 109 return static_cast<IFWL_ListBox*>(m_pIface)->GetScrollPos(fPos, bVert); | 110 return static_cast<IFWL_ListBox*>(m_pIface)->GetScrollPos(fPos, bVert); |
| 110 } | 111 } |
| 111 | 112 |
| 112 FWL_ERR CFWL_ListBox::SetItemHeight(FX_FLOAT fItemHeight) { | 113 FWL_Error CFWL_ListBox::SetItemHeight(FX_FLOAT fItemHeight) { |
| 113 m_ListBoxDP.m_fItemHeight = fItemHeight; | 114 m_ListBoxDP.m_fItemHeight = fItemHeight; |
| 114 return FWL_ERR_Succeeded; | 115 return FWL_Error::Succeeded; |
| 115 } | 116 } |
| 116 | 117 |
| 117 FWL_HLISTITEM CFWL_ListBox::GetFocusItem() { | 118 FWL_HLISTITEM CFWL_ListBox::GetFocusItem() { |
| 118 for (const auto& hItem : m_ListBoxDP.m_ItemArray) { | 119 for (const auto& hItem : m_ListBoxDP.m_ItemArray) { |
| 119 if (hItem->m_dwStates & FWL_ITEMSTATE_LTB_Focused) | 120 if (hItem->m_dwStates & FWL_ITEMSTATE_LTB_Focused) |
| 120 return (FWL_HLISTITEM)hItem.get(); | 121 return (FWL_HLISTITEM)hItem.get(); |
| 121 } | 122 } |
| 122 return nullptr; | 123 return nullptr; |
| 123 } | 124 } |
| 124 | 125 |
| 125 FWL_ERR CFWL_ListBox::SetFocusItem(FWL_HLISTITEM hItem) { | 126 FWL_Error CFWL_ListBox::SetFocusItem(FWL_HLISTITEM hItem) { |
| 126 int32_t nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), hItem); | 127 int32_t nIndex = m_ListBoxDP.GetItemIndex(GetWidget(), hItem); |
| 127 m_ListBoxDP.m_ItemArray[nIndex]->m_dwStates |= FWL_ITEMSTATE_LTB_Focused; | 128 m_ListBoxDP.m_ItemArray[nIndex]->m_dwStates |= FWL_ITEMSTATE_LTB_Focused; |
| 128 return FWL_ERR_Succeeded; | 129 return FWL_Error::Succeeded; |
| 129 } | 130 } |
| 130 | 131 |
| 131 FWL_ERR* CFWL_ListBox::Sort(IFWL_ListBoxCompare* pCom) { | 132 FWL_Error CFWL_ListBox::Sort(IFWL_ListBoxCompare* pCom) { |
| 132 return static_cast<IFWL_ListBox*>(m_pIface)->Sort(pCom); | 133 return static_cast<IFWL_ListBox*>(m_pIface)->Sort(pCom); |
| 133 } | 134 } |
| 134 | 135 |
| 135 int32_t CFWL_ListBox::CountItems() { | 136 int32_t CFWL_ListBox::CountItems() { |
| 136 return pdfium::CollectionSize<int32_t>(m_ListBoxDP.m_ItemArray); | 137 return pdfium::CollectionSize<int32_t>(m_ListBoxDP.m_ItemArray); |
| 137 } | 138 } |
| 138 | 139 |
| 139 FWL_HLISTITEM CFWL_ListBox::GetItem(int32_t nIndex) { | 140 FWL_HLISTITEM CFWL_ListBox::GetItem(int32_t nIndex) { |
| 140 if (nIndex < 0 || nIndex >= CountItems()) | 141 if (nIndex < 0 || nIndex >= CountItems()) |
| 141 return nullptr; | 142 return nullptr; |
| 142 | 143 |
| 143 return (FWL_HLISTITEM)m_ListBoxDP.m_ItemArray[nIndex].get(); | 144 return (FWL_HLISTITEM)m_ListBoxDP.m_ItemArray[nIndex].get(); |
| 144 } | 145 } |
| 145 | 146 |
| 146 FWL_ERR CFWL_ListBox::SetItemString(FWL_HLISTITEM hItem, | 147 FWL_Error CFWL_ListBox::SetItemString(FWL_HLISTITEM hItem, |
| 147 const CFX_WideStringC& wsText) { | 148 const CFX_WideStringC& wsText) { |
| 148 if (!hItem) | 149 if (!hItem) |
| 149 return FWL_ERR_Indefinite; | 150 return FWL_Error::Indefinite; |
| 150 reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText = wsText; | 151 reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText = wsText; |
| 151 return FWL_ERR_Succeeded; | 152 return FWL_Error::Succeeded; |
| 152 } | 153 } |
| 153 | 154 |
| 154 FWL_ERR CFWL_ListBox::GetItemString(FWL_HLISTITEM hItem, | 155 FWL_Error CFWL_ListBox::GetItemString(FWL_HLISTITEM hItem, |
| 155 CFX_WideString& wsText) { | 156 CFX_WideString& wsText) { |
| 156 if (!hItem) | 157 if (!hItem) |
| 157 return FWL_ERR_Indefinite; | 158 return FWL_Error::Indefinite; |
| 158 wsText = reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText; | 159 wsText = reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText; |
| 159 return FWL_ERR_Succeeded; | 160 return FWL_Error::Succeeded; |
| 160 } | 161 } |
| 161 | 162 |
| 162 FWL_ERR CFWL_ListBox::SetItemData(FWL_HLISTITEM hItem, void* pData) { | 163 FWL_Error CFWL_ListBox::SetItemData(FWL_HLISTITEM hItem, void* pData) { |
| 163 if (!hItem) | 164 if (!hItem) |
| 164 return FWL_ERR_Indefinite; | 165 return FWL_Error::Indefinite; |
| 165 reinterpret_cast<CFWL_ListItem*>(hItem)->m_pData = pData; | 166 reinterpret_cast<CFWL_ListItem*>(hItem)->m_pData = pData; |
| 166 return FWL_ERR_Succeeded; | 167 return FWL_Error::Succeeded; |
| 167 } | 168 } |
| 168 | 169 |
| 169 void* CFWL_ListBox::GetItemData(FWL_HLISTITEM hItem) { | 170 void* CFWL_ListBox::GetItemData(FWL_HLISTITEM hItem) { |
| 170 if (!hItem) | 171 if (!hItem) |
| 171 return NULL; | 172 return NULL; |
| 172 return reinterpret_cast<CFWL_ListItem*>(hItem)->m_pData; | 173 return reinterpret_cast<CFWL_ListItem*>(hItem)->m_pData; |
| 173 } | 174 } |
| 174 | 175 |
| 175 FWL_HLISTITEM CFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) { | 176 FWL_HLISTITEM CFWL_ListBox::GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy) { |
| 176 CFX_RectF rtClient; | 177 CFX_RectF rtClient; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 205 } | 206 } |
| 206 | 207 |
| 207 CFWL_ListBox::CFWL_ListBox() {} | 208 CFWL_ListBox::CFWL_ListBox() {} |
| 208 | 209 |
| 209 CFWL_ListBox::~CFWL_ListBox() {} | 210 CFWL_ListBox::~CFWL_ListBox() {} |
| 210 | 211 |
| 211 CFWL_ListBox::CFWL_ListBoxDP::CFWL_ListBoxDP() {} | 212 CFWL_ListBox::CFWL_ListBoxDP::CFWL_ListBoxDP() {} |
| 212 | 213 |
| 213 CFWL_ListBox::CFWL_ListBoxDP::~CFWL_ListBoxDP() {} | 214 CFWL_ListBox::CFWL_ListBoxDP::~CFWL_ListBoxDP() {} |
| 214 | 215 |
| 215 FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::GetCaption(IFWL_Widget* pWidget, | 216 FWL_Error CFWL_ListBox::CFWL_ListBoxDP::GetCaption(IFWL_Widget* pWidget, |
| 216 CFX_WideString& wsCaption) { | 217 CFX_WideString& wsCaption) { |
| 217 wsCaption = m_wsData; | 218 wsCaption = m_wsData; |
| 218 return FWL_ERR_Succeeded; | 219 return FWL_Error::Succeeded; |
| 219 } | 220 } |
| 220 | 221 |
| 221 int32_t CFWL_ListBox::CFWL_ListBoxDP::CountItems(IFWL_Widget* pWidget) { | 222 int32_t CFWL_ListBox::CFWL_ListBoxDP::CountItems(IFWL_Widget* pWidget) { |
| 222 return pdfium::CollectionSize<int32_t>(m_ItemArray); | 223 return pdfium::CollectionSize<int32_t>(m_ItemArray); |
| 223 } | 224 } |
| 224 | 225 |
| 225 FWL_HLISTITEM CFWL_ListBox::CFWL_ListBoxDP::GetItem(IFWL_Widget* pWidget, | 226 FWL_HLISTITEM CFWL_ListBox::CFWL_ListBoxDP::GetItem(IFWL_Widget* pWidget, |
| 226 int32_t nIndex) { | 227 int32_t nIndex) { |
| 227 if (nIndex < 0 || nIndex >= CountItems(pWidget)) | 228 if (nIndex < 0 || nIndex >= CountItems(pWidget)) |
| 228 return nullptr; | 229 return nullptr; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 249 return TRUE; | 250 return TRUE; |
| 250 } | 251 } |
| 251 | 252 |
| 252 uint32_t CFWL_ListBox::CFWL_ListBoxDP::GetItemStyles(IFWL_Widget* pWidget, | 253 uint32_t CFWL_ListBox::CFWL_ListBoxDP::GetItemStyles(IFWL_Widget* pWidget, |
| 253 FWL_HLISTITEM hItem) { | 254 FWL_HLISTITEM hItem) { |
| 254 if (!hItem) | 255 if (!hItem) |
| 255 return -1; | 256 return -1; |
| 256 return reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwStates; | 257 return reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwStates; |
| 257 } | 258 } |
| 258 | 259 |
| 259 FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::GetItemText(IFWL_Widget* pWidget, | 260 FWL_Error CFWL_ListBox::CFWL_ListBoxDP::GetItemText(IFWL_Widget* pWidget, |
| 260 FWL_HLISTITEM hItem, | 261 FWL_HLISTITEM hItem, |
| 261 CFX_WideString& wsText) { | 262 CFX_WideString& wsText) { |
| 262 if (!hItem) | 263 if (!hItem) |
| 263 return FWL_ERR_Indefinite; | 264 return FWL_Error::Indefinite; |
| 264 wsText = reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText; | 265 wsText = reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText; |
| 265 return FWL_ERR_Succeeded; | 266 return FWL_Error::Succeeded; |
| 266 } | 267 } |
| 267 | 268 |
| 268 FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::GetItemRect(IFWL_Widget* pWidget, | 269 FWL_Error CFWL_ListBox::CFWL_ListBoxDP::GetItemRect(IFWL_Widget* pWidget, |
| 269 FWL_HLISTITEM hItem, | 270 FWL_HLISTITEM hItem, |
| 270 CFX_RectF& rtItem) { | 271 CFX_RectF& rtItem) { |
| 271 if (!hItem) | 272 if (!hItem) |
| 272 return FWL_ERR_Indefinite; | 273 return FWL_Error::Indefinite; |
| 273 CFWL_ListItem* pItem = reinterpret_cast<CFWL_ListItem*>(hItem); | 274 CFWL_ListItem* pItem = reinterpret_cast<CFWL_ListItem*>(hItem); |
| 274 rtItem = pItem->m_rtItem; | 275 rtItem = pItem->m_rtItem; |
| 275 return FWL_ERR_Succeeded; | 276 return FWL_Error::Succeeded; |
| 276 } | 277 } |
| 277 | 278 |
| 278 void* CFWL_ListBox::CFWL_ListBoxDP::GetItemData(IFWL_Widget* pWidget, | 279 void* CFWL_ListBox::CFWL_ListBoxDP::GetItemData(IFWL_Widget* pWidget, |
| 279 FWL_HLISTITEM hItem) { | 280 FWL_HLISTITEM hItem) { |
| 280 if (!hItem) | 281 if (!hItem) |
| 281 return NULL; | 282 return NULL; |
| 282 CFWL_ListItem* pItem = reinterpret_cast<CFWL_ListItem*>(hItem); | 283 CFWL_ListItem* pItem = reinterpret_cast<CFWL_ListItem*>(hItem); |
| 283 return pItem->m_pData; | 284 return pItem->m_pData; |
| 284 } | 285 } |
| 285 | 286 |
| 286 FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::SetItemStyles(IFWL_Widget* pWidget, | 287 FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemStyles(IFWL_Widget* pWidget, |
| 287 FWL_HLISTITEM hItem, | 288 FWL_HLISTITEM hItem, |
| 288 uint32_t dwStyle) { | 289 uint32_t dwStyle) { |
| 289 if (!hItem) | 290 if (!hItem) |
| 290 return FWL_ERR_Indefinite; | 291 return FWL_Error::Indefinite; |
| 291 reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwStates = dwStyle; | 292 reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwStates = dwStyle; |
| 292 return FWL_ERR_Succeeded; | 293 return FWL_Error::Succeeded; |
| 293 } | 294 } |
| 294 | 295 |
| 295 FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::SetItemText(IFWL_Widget* pWidget, | 296 FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemText(IFWL_Widget* pWidget, |
| 296 FWL_HLISTITEM hItem, | 297 FWL_HLISTITEM hItem, |
| 297 const FX_WCHAR* pszText) { | 298 const FX_WCHAR* pszText) { |
| 298 if (!hItem) | 299 if (!hItem) |
| 299 return FWL_ERR_Indefinite; | 300 return FWL_Error::Indefinite; |
| 300 reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText = pszText; | 301 reinterpret_cast<CFWL_ListItem*>(hItem)->m_wsText = pszText; |
| 301 return FWL_ERR_Succeeded; | 302 return FWL_Error::Succeeded; |
| 302 } | 303 } |
| 303 | 304 |
| 304 FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::SetItemRect(IFWL_Widget* pWidget, | 305 FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemRect(IFWL_Widget* pWidget, |
| 305 FWL_HLISTITEM hItem, | 306 FWL_HLISTITEM hItem, |
| 306 const CFX_RectF& rtItem) { | 307 const CFX_RectF& rtItem) { |
| 307 if (!hItem) | 308 if (!hItem) |
| 308 return FWL_ERR_Indefinite; | 309 return FWL_Error::Indefinite; |
| 309 reinterpret_cast<CFWL_ListItem*>(hItem)->m_rtItem = rtItem; | 310 reinterpret_cast<CFWL_ListItem*>(hItem)->m_rtItem = rtItem; |
| 310 return FWL_ERR_Succeeded; | 311 return FWL_Error::Succeeded; |
| 311 } | 312 } |
| 312 | 313 |
| 313 FX_FLOAT CFWL_ListBox::CFWL_ListBoxDP::GetItemHeight(IFWL_Widget* pWidget) { | 314 FX_FLOAT CFWL_ListBox::CFWL_ListBoxDP::GetItemHeight(IFWL_Widget* pWidget) { |
| 314 return m_fItemHeight; | 315 return m_fItemHeight; |
| 315 } | 316 } |
| 316 | 317 |
| 317 CFX_DIBitmap* CFWL_ListBox::CFWL_ListBoxDP::GetItemIcon(IFWL_Widget* pWidget, | 318 CFX_DIBitmap* CFWL_ListBox::CFWL_ListBoxDP::GetItemIcon(IFWL_Widget* pWidget, |
| 318 FWL_HLISTITEM hItem) { | 319 FWL_HLISTITEM hItem) { |
| 319 return reinterpret_cast<CFWL_ListItem*>(hItem)->m_pDIB; | 320 return reinterpret_cast<CFWL_ListItem*>(hItem)->m_pDIB; |
| 320 } | 321 } |
| 321 | 322 |
| 322 FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::GetItemCheckRect(IFWL_Widget* pWidget, | 323 FWL_Error CFWL_ListBox::CFWL_ListBoxDP::GetItemCheckRect(IFWL_Widget* pWidget, |
| 323 FWL_HLISTITEM hItem, | 324 FWL_HLISTITEM hItem, |
| 324 CFX_RectF& rtCheck) { | 325 CFX_RectF& rtCheck) { |
| 325 rtCheck = reinterpret_cast<CFWL_ListItem*>(hItem)->m_rtCheckBox; | 326 rtCheck = reinterpret_cast<CFWL_ListItem*>(hItem)->m_rtCheckBox; |
| 326 return FWL_ERR_Succeeded; | 327 return FWL_Error::Succeeded; |
| 327 } | 328 } |
| 328 | 329 |
| 329 FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::SetItemCheckRect( | 330 FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemCheckRect( |
| 330 IFWL_Widget* pWidget, | 331 IFWL_Widget* pWidget, |
| 331 FWL_HLISTITEM hItem, | 332 FWL_HLISTITEM hItem, |
| 332 const CFX_RectF& rtCheck) { | 333 const CFX_RectF& rtCheck) { |
| 333 reinterpret_cast<CFWL_ListItem*>(hItem)->m_rtCheckBox = rtCheck; | 334 reinterpret_cast<CFWL_ListItem*>(hItem)->m_rtCheckBox = rtCheck; |
| 334 return FWL_ERR_Succeeded; | 335 return FWL_Error::Succeeded; |
| 335 } | 336 } |
| 336 | 337 |
| 337 uint32_t CFWL_ListBox::CFWL_ListBoxDP::GetItemCheckState(IFWL_Widget* pWidget, | 338 uint32_t CFWL_ListBox::CFWL_ListBoxDP::GetItemCheckState(IFWL_Widget* pWidget, |
| 338 FWL_HLISTITEM hItem) { | 339 FWL_HLISTITEM hItem) { |
| 339 return reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwCheckState; | 340 return reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwCheckState; |
| 340 } | 341 } |
| 341 | 342 |
| 342 FWL_ERR CFWL_ListBox::CFWL_ListBoxDP::SetItemCheckState(IFWL_Widget* pWidget, | 343 FWL_Error CFWL_ListBox::CFWL_ListBoxDP::SetItemCheckState( |
| 343 FWL_HLISTITEM hItem, | 344 IFWL_Widget* pWidget, |
| 344 uint32_t dwCheckState) { | 345 FWL_HLISTITEM hItem, |
| 346 uint32_t dwCheckState) { |
| 345 reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwCheckState = dwCheckState; | 347 reinterpret_cast<CFWL_ListItem*>(hItem)->m_dwCheckState = dwCheckState; |
| 346 return FWL_ERR_Succeeded; | 348 return FWL_Error::Succeeded; |
| 347 } | 349 } |
| OLD | NEW |