| 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 "../../include/pdfwindow/PDFWindow.h" | 7 #include "../../include/pdfwindow/PDFWindow.h" |
| 8 #include "../../include/pdfwindow/PWL_Wnd.h" | 8 #include "../../include/pdfwindow/PWL_Wnd.h" |
| 9 #include "../../include/pdfwindow/PWL_ListCtrl.h" | 9 #include "../../include/pdfwindow/PWL_ListCtrl.h" |
| 10 #include "../../include/pdfwindow/PWL_IconList.h" | 10 #include "../../include/pdfwindow/PWL_IconList.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 lcp.sTextColor = PWL_DEFAULT_BLACKCOLOR; | 93 lcp.sTextColor = PWL_DEFAULT_BLACKCOLOR; |
| 94 lcp.fFontSize = 12; | 94 lcp.fFontSize = 12; |
| 95 m_pText->Create(lcp); | 95 m_pText->Create(lcp); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void CPWL_IconList_Item::SetData(void* pData) | 98 void CPWL_IconList_Item::SetData(void* pData) |
| 99 { | 99 { |
| 100 m_pData = pData; | 100 m_pData = pData; |
| 101 } | 101 } |
| 102 | 102 |
| 103 void CPWL_IconList_Item::SetIcon(FX_INT32 nIconIndex) | 103 void CPWL_IconList_Item::SetIcon(int32_t nIconIndex) |
| 104 { | 104 { |
| 105 m_nIconIndex = nIconIndex; | 105 m_nIconIndex = nIconIndex; |
| 106 } | 106 } |
| 107 | 107 |
| 108 void CPWL_IconList_Item::SetText(const CFX_WideString& str) | 108 void CPWL_IconList_Item::SetText(const CFX_WideString& str) |
| 109 { | 109 { |
| 110 m_pText->SetText(str.c_str()); | 110 m_pText->SetText(str.c_str()); |
| 111 } | 111 } |
| 112 | 112 |
| 113 CFX_WideString CPWL_IconList_Item::GetText() const | 113 CFX_WideString CPWL_IconList_Item::GetText() const |
| (...skipping 27 matching lines...) Expand all Loading... |
| 141 | 141 |
| 142 void CPWL_IconList_Item::OnDisabled() | 142 void CPWL_IconList_Item::OnDisabled() |
| 143 { | 143 { |
| 144 m_pText->SetTextColor(PWL_DEFAULT_HEAVYGRAYCOLOR); | 144 m_pText->SetTextColor(PWL_DEFAULT_HEAVYGRAYCOLOR); |
| 145 | 145 |
| 146 this->InvalidateRect(); | 146 this->InvalidateRect(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 /* ----------------- CPWL_IconList_Content ----------------- */ | 149 /* ----------------- CPWL_IconList_Content ----------------- */ |
| 150 | 150 |
| 151 CPWL_IconList_Content::CPWL_IconList_Content(FX_INT32 nListCount) : | 151 CPWL_IconList_Content::CPWL_IconList_Content(int32_t nListCount) : |
| 152 m_nSelectIndex(-1), | 152 m_nSelectIndex(-1), |
| 153 m_pNotify(NULL), | 153 m_pNotify(NULL), |
| 154 m_bEnableNotify(TRUE), | 154 m_bEnableNotify(TRUE), |
| 155 m_bMouseDown(FALSE), | 155 m_bMouseDown(FALSE), |
| 156 m_nListCount(nListCount) | 156 m_nListCount(nListCount) |
| 157 { | 157 { |
| 158 } | 158 } |
| 159 | 159 |
| 160 CPWL_IconList_Content::~CPWL_IconList_Content() | 160 CPWL_IconList_Content::~CPWL_IconList_Content() |
| 161 { | 161 { |
| 162 } | 162 } |
| 163 | 163 |
| 164 void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM & cp) | 164 void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM & cp) |
| 165 { | 165 { |
| 166 » for (FX_INT32 i=0; i<m_nListCount; i++) | 166 » for (int32_t i=0; i<m_nListCount; i++) |
| 167 { | 167 { |
| 168 CPWL_IconList_Item* pNewItem = new CPWL_IconList_Item(); | 168 CPWL_IconList_Item* pNewItem = new CPWL_IconList_Item(); |
| 169 | 169 |
| 170 PWL_CREATEPARAM icp = cp; | 170 PWL_CREATEPARAM icp = cp; |
| 171 icp.pParentWnd = this; | 171 icp.pParentWnd = this; |
| 172 icp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_NOREFRESHCLIP; | 172 icp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_NOREFRESHCLIP; |
| 173 pNewItem->Create(icp); | 173 pNewItem->Create(icp); |
| 174 } | 174 } |
| 175 | 175 |
| 176 this->SetItemSpace(PWL_IconList_ITEM_SPACE); | 176 this->SetItemSpace(PWL_IconList_ITEM_SPACE); |
| 177 this->ResetContent(0); | 177 this->ResetContent(0); |
| 178 | 178 |
| 179 if (CPWL_Wnd * pParent = this->GetParentWindow()) | 179 if (CPWL_Wnd * pParent = this->GetParentWindow()) |
| 180 { | 180 { |
| 181 CPDF_Rect rcScroll = this->GetScrollArea(); | 181 CPDF_Rect rcScroll = this->GetScrollArea(); |
| 182 this->GetScrollPos(); | 182 this->GetScrollPos(); |
| 183 | 183 |
| 184 PWL_SCROLL_INFO sInfo; | 184 PWL_SCROLL_INFO sInfo; |
| 185 sInfo.fContentMin = rcScroll.bottom; | 185 sInfo.fContentMin = rcScroll.bottom; |
| 186 sInfo.fContentMax = rcScroll.top; | 186 sInfo.fContentMax = rcScroll.top; |
| 187 sInfo.fPlateWidth = GetClientRect().Height(); | 187 sInfo.fPlateWidth = GetClientRect().Height(); |
| 188 sInfo.fSmallStep = 13.0f; | 188 sInfo.fSmallStep = 13.0f; |
| 189 sInfo.fBigStep = sInfo.fPlateWidth; | 189 sInfo.fBigStep = sInfo.fPlateWidth; |
| 190 | 190 |
| 191 » » pParent->OnNotify(this, PNM_SETSCROLLINFO, SBT_VSCROLL, (FX_INTP
TR)&sInfo); | 191 » » pParent->OnNotify(this, PNM_SETSCROLLINFO, SBT_VSCROLL, (intptr_
t)&sInfo); |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 | 194 |
| 195 FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point, FX_DWORD
nFlag) | 195 FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point, FX_DWORD
nFlag) |
| 196 { | 196 { |
| 197 SetFocus(); | 197 SetFocus(); |
| 198 | 198 |
| 199 SetCapture(); | 199 SetCapture(); |
| 200 m_bMouseDown = TRUE; | 200 m_bMouseDown = TRUE; |
| 201 | 201 |
| 202 » FX_INT32 nItemIndex = FindItemIndex(point); | 202 » int32_t nItemIndex = FindItemIndex(point); |
| 203 SetSelect(nItemIndex); | 203 SetSelect(nItemIndex); |
| 204 ScrollToItem(nItemIndex); | 204 ScrollToItem(nItemIndex); |
| 205 | 205 |
| 206 return TRUE; | 206 return TRUE; |
| 207 } | 207 } |
| 208 | 208 |
| 209 FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point, FX_DWORD nF
lag) | 209 FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point, FX_DWORD nF
lag) |
| 210 { | 210 { |
| 211 m_bMouseDown = FALSE; | 211 m_bMouseDown = FALSE; |
| 212 ReleaseCapture(); | 212 ReleaseCapture(); |
| 213 | 213 |
| 214 return TRUE; | 214 return TRUE; |
| 215 } | 215 } |
| 216 | 216 |
| 217 FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nF
lag) | 217 FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nF
lag) |
| 218 { | 218 { |
| 219 if (m_bMouseDown) | 219 if (m_bMouseDown) |
| 220 { | 220 { |
| 221 » » FX_INT32 nItemIndex = FindItemIndex(point); | 221 » » int32_t nItemIndex = FindItemIndex(point); |
| 222 SetSelect(nItemIndex); | 222 SetSelect(nItemIndex); |
| 223 ScrollToItem(nItemIndex); | 223 ScrollToItem(nItemIndex); |
| 224 } | 224 } |
| 225 | 225 |
| 226 return TRUE; | 226 return TRUE; |
| 227 } | 227 } |
| 228 | 228 |
| 229 FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) | 229 FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) |
| 230 { | 230 { |
| 231 switch (nChar) | 231 switch (nChar) |
| 232 { | 232 { |
| 233 case FWL_VKEY_Up: | 233 case FWL_VKEY_Up: |
| 234 if (m_nSelectIndex > 0) | 234 if (m_nSelectIndex > 0) |
| 235 { | 235 { |
| 236 » » » FX_INT32 nItemIndex = m_nSelectIndex - 1; | 236 » » » int32_t nItemIndex = m_nSelectIndex - 1; |
| 237 SetSelect(nItemIndex); | 237 SetSelect(nItemIndex); |
| 238 ScrollToItem(nItemIndex); | 238 ScrollToItem(nItemIndex); |
| 239 } | 239 } |
| 240 return TRUE; | 240 return TRUE; |
| 241 case FWL_VKEY_Down: | 241 case FWL_VKEY_Down: |
| 242 if (m_nSelectIndex < m_nListCount-1) | 242 if (m_nSelectIndex < m_nListCount-1) |
| 243 { | 243 { |
| 244 » » » FX_INT32 nItemIndex = m_nSelectIndex + 1; | 244 » » » int32_t nItemIndex = m_nSelectIndex + 1; |
| 245 SetSelect(nItemIndex); | 245 SetSelect(nItemIndex); |
| 246 ScrollToItem(nItemIndex); | 246 ScrollToItem(nItemIndex); |
| 247 } | 247 } |
| 248 return TRUE; | 248 return TRUE; |
| 249 } | 249 } |
| 250 | 250 |
| 251 return FALSE; | 251 return FALSE; |
| 252 } | 252 } |
| 253 | 253 |
| 254 FX_INT32 CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point) | 254 int32_t CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point) |
| 255 { | 255 { |
| 256 » FX_INT32 nIndex = 0; | 256 » int32_t nIndex = 0; |
| 257 » for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++) | 257 » for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) |
| 258 { | 258 { |
| 259 if (CPWL_Wnd * pChild = m_aChildren.GetAt(i)) | 259 if (CPWL_Wnd * pChild = m_aChildren.GetAt(i)) |
| 260 { | 260 { |
| 261 CPDF_Rect rcWnd = pChild->ChildToParent(pChild->GetWindo
wRect()); | 261 CPDF_Rect rcWnd = pChild->ChildToParent(pChild->GetWindo
wRect()); |
| 262 | 262 |
| 263 if (point.y < rcWnd.top) | 263 if (point.y < rcWnd.top) |
| 264 { | 264 { |
| 265 nIndex = i; | 265 nIndex = i; |
| 266 } | 266 } |
| 267 } | 267 } |
| 268 } | 268 } |
| 269 | 269 |
| 270 return nIndex; | 270 return nIndex; |
| 271 } | 271 } |
| 272 | 272 |
| 273 void CPWL_IconList_Content::ScrollToItem(FX_INT32 nItemIndex) | 273 void CPWL_IconList_Content::ScrollToItem(int32_t nItemIndex) |
| 274 { | 274 { |
| 275 CPDF_Rect rcClient = GetClientRect(); | 275 CPDF_Rect rcClient = GetClientRect(); |
| 276 | 276 |
| 277 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) | 277 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) |
| 278 { | 278 { |
| 279 CPDF_Rect rcOrigin = pItem->GetWindowRect(); | 279 CPDF_Rect rcOrigin = pItem->GetWindowRect(); |
| 280 CPDF_Rect rcWnd = pItem->ChildToParent(rcOrigin); | 280 CPDF_Rect rcWnd = pItem->ChildToParent(rcOrigin); |
| 281 | 281 |
| 282 if (!(rcWnd.bottom > rcClient.bottom && rcWnd.top < rcClient.top
)) | 282 if (!(rcWnd.bottom > rcClient.bottom && rcWnd.top < rcClient.top
)) |
| 283 { | 283 { |
| 284 CPDF_Point ptScroll = GetScrollPos(); | 284 CPDF_Point ptScroll = GetScrollPos(); |
| 285 | 285 |
| 286 if (rcWnd.top > rcClient.top) | 286 if (rcWnd.top > rcClient.top) |
| 287 { | 287 { |
| 288 ptScroll.y = rcOrigin.top; | 288 ptScroll.y = rcOrigin.top; |
| 289 } | 289 } |
| 290 else if (rcWnd.bottom < rcClient.bottom) | 290 else if (rcWnd.bottom < rcClient.bottom) |
| 291 { | 291 { |
| 292 ptScroll.y = rcOrigin.bottom + rcClient.Height()
; | 292 ptScroll.y = rcOrigin.bottom + rcClient.Height()
; |
| 293 } | 293 } |
| 294 | 294 |
| 295 this->SetScrollPos(ptScroll); | 295 this->SetScrollPos(ptScroll); |
| 296 this->ResetFace(); | 296 this->ResetFace(); |
| 297 this->InvalidateRect(); | 297 this->InvalidateRect(); |
| 298 if (CPWL_Wnd* pParent = this->GetParentWindow()) | 298 if (CPWL_Wnd* pParent = this->GetParentWindow()) |
| 299 { | 299 { |
| 300 » » » » pParent->OnNotify(this, PNM_SETSCROLLPOS, SBT_VS
CROLL, (FX_INTPTR)&ptScroll.y); | 300 » » » » pParent->OnNotify(this, PNM_SETSCROLLPOS, SBT_VS
CROLL, (intptr_t)&ptScroll.y); |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 } | 304 } |
| 305 | 305 |
| 306 void CPWL_IconList_Content::SetSelect(FX_INT32 nIndex) | 306 void CPWL_IconList_Content::SetSelect(int32_t nIndex) |
| 307 { | 307 { |
| 308 if (m_nSelectIndex != nIndex) | 308 if (m_nSelectIndex != nIndex) |
| 309 { | 309 { |
| 310 SelectItem(m_nSelectIndex, FALSE); | 310 SelectItem(m_nSelectIndex, FALSE); |
| 311 SelectItem(nIndex, TRUE); | 311 SelectItem(nIndex, TRUE); |
| 312 m_nSelectIndex = nIndex; | 312 m_nSelectIndex = nIndex; |
| 313 | 313 |
| 314 if (IPWL_IconList_Notify* pNotify = GetNotify()) | 314 if (IPWL_IconList_Notify* pNotify = GetNotify()) |
| 315 pNotify->OnNoteListSelChanged(nIndex); | 315 pNotify->OnNoteListSelChanged(nIndex); |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 | 318 |
| 319 FX_INT32 CPWL_IconList_Content::GetSelect() const | 319 int32_t CPWL_IconList_Content::GetSelect() const |
| 320 { | 320 { |
| 321 return m_nSelectIndex; | 321 return m_nSelectIndex; |
| 322 } | 322 } |
| 323 | 323 |
| 324 IPWL_IconList_Notify* CPWL_IconList_Content::GetNotify() const | 324 IPWL_IconList_Notify* CPWL_IconList_Content::GetNotify() const |
| 325 { | 325 { |
| 326 if (m_bEnableNotify) | 326 if (m_bEnableNotify) |
| 327 return m_pNotify; | 327 return m_pNotify; |
| 328 return NULL; | 328 return NULL; |
| 329 } | 329 } |
| 330 | 330 |
| 331 void CPWL_IconList_Content::SetNotify(IPWL_IconList_Notify* pNotify) | 331 void CPWL_IconList_Content::SetNotify(IPWL_IconList_Notify* pNotify) |
| 332 { | 332 { |
| 333 m_pNotify = pNotify; | 333 m_pNotify = pNotify; |
| 334 } | 334 } |
| 335 | 335 |
| 336 void CPWL_IconList_Content::EnableNotify(FX_BOOL bNotify) | 336 void CPWL_IconList_Content::EnableNotify(FX_BOOL bNotify) |
| 337 { | 337 { |
| 338 m_bEnableNotify = bNotify; | 338 m_bEnableNotify = bNotify; |
| 339 } | 339 } |
| 340 | 340 |
| 341 void CPWL_IconList_Content::SelectItem(FX_INT32 nItemIndex, FX_BOOL bSelect) | 341 void CPWL_IconList_Content::SelectItem(int32_t nItemIndex, FX_BOOL bSelect) |
| 342 { | 342 { |
| 343 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) | 343 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) |
| 344 { | 344 { |
| 345 pItem->SetSelect(bSelect); | 345 pItem->SetSelect(bSelect); |
| 346 pItem->InvalidateRect(); | 346 pItem->InvalidateRect(); |
| 347 } | 347 } |
| 348 } | 348 } |
| 349 | 349 |
| 350 CPWL_IconList_Item* CPWL_IconList_Content::GetListItem(FX_INT32 nItemIndex) cons
t | 350 CPWL_IconList_Item* CPWL_IconList_Content::GetListItem(int32_t nItemIndex) const |
| 351 { | 351 { |
| 352 if (nItemIndex >= 0 && nItemIndex<m_aChildren.GetSize()) | 352 if (nItemIndex >= 0 && nItemIndex<m_aChildren.GetSize()) |
| 353 { | 353 { |
| 354 if (CPWL_Wnd * pChild = m_aChildren.GetAt(nItemIndex)) | 354 if (CPWL_Wnd * pChild = m_aChildren.GetAt(nItemIndex)) |
| 355 { | 355 { |
| 356 if (pChild->GetClassName() == "CPWL_IconList_Item") | 356 if (pChild->GetClassName() == "CPWL_IconList_Item") |
| 357 { | 357 { |
| 358 return (CPWL_IconList_Item*)pChild; | 358 return (CPWL_IconList_Item*)pChild; |
| 359 } | 359 } |
| 360 } | 360 } |
| 361 } | 361 } |
| 362 | 362 |
| 363 return NULL; | 363 return NULL; |
| 364 } | 364 } |
| 365 | 365 |
| 366 void CPWL_IconList_Content::SetListData(FX_INT32 nItemIndex, void* pData) | 366 void CPWL_IconList_Content::SetListData(int32_t nItemIndex, void* pData) |
| 367 { | 367 { |
| 368 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) | 368 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) |
| 369 pItem->SetData(pData); | 369 pItem->SetData(pData); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void CPWL_IconList_Content::SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex
) | 372 void CPWL_IconList_Content::SetListIcon(int32_t nItemIndex, int32_t nIconIndex) |
| 373 { | 373 { |
| 374 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) | 374 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) |
| 375 pItem->SetIcon(nIconIndex); | 375 pItem->SetIcon(nIconIndex); |
| 376 } | 376 } |
| 377 | 377 |
| 378 void CPWL_IconList_Content::SetListString(FX_INT32 nItemIndex, const CFX_WideStr
ing& str) | 378 void CPWL_IconList_Content::SetListString(int32_t nItemIndex, const CFX_WideStri
ng& str) |
| 379 { | 379 { |
| 380 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) | 380 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) |
| 381 pItem->SetText(str); | 381 pItem->SetText(str); |
| 382 } | 382 } |
| 383 | 383 |
| 384 CFX_WideString CPWL_IconList_Content::GetListString(FX_INT32 nItemIndex) const | 384 CFX_WideString CPWL_IconList_Content::GetListString(int32_t nItemIndex) const |
| 385 { | 385 { |
| 386 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) | 386 if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) |
| 387 return pItem->GetText(); | 387 return pItem->GetText(); |
| 388 | 388 |
| 389 return L""; | 389 return L""; |
| 390 } | 390 } |
| 391 | 391 |
| 392 void CPWL_IconList_Content::SetIconFillColor(const CPWL_Color& color) | 392 void CPWL_IconList_Content::SetIconFillColor(const CPWL_Color& color) |
| 393 { | 393 { |
| 394 » for (FX_INT32 i=0,sz=m_aChildren.GetSize(); i<sz; i++) | 394 » for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) |
| 395 { | 395 { |
| 396 if (CPWL_Wnd * pChild = m_aChildren.GetAt(i)) | 396 if (CPWL_Wnd * pChild = m_aChildren.GetAt(i)) |
| 397 { | 397 { |
| 398 if (pChild->GetClassName() == "CPWL_IconList_Item") | 398 if (pChild->GetClassName() == "CPWL_IconList_Item") |
| 399 { | 399 { |
| 400 CPWL_IconList_Item* pItem = (CPWL_IconList_Item*
)pChild; | 400 CPWL_IconList_Item* pItem = (CPWL_IconList_Item*
)pChild; |
| 401 pItem->SetIconFillColor(color); | 401 pItem->SetIconFillColor(color); |
| 402 pItem->InvalidateRect(); | 402 pItem->InvalidateRect(); |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 } | 405 } |
| 406 | 406 |
| 407 } | 407 } |
| 408 | 408 |
| 409 /* -------------------- CPWL_IconList --------------------- */ | 409 /* -------------------- CPWL_IconList --------------------- */ |
| 410 | 410 |
| 411 CPWL_IconList::CPWL_IconList(FX_INT32 nListCount) : | 411 CPWL_IconList::CPWL_IconList(int32_t nListCount) : |
| 412 m_pListContent(NULL), | 412 m_pListContent(NULL), |
| 413 m_nListCount(nListCount) | 413 m_nListCount(nListCount) |
| 414 { | 414 { |
| 415 } | 415 } |
| 416 | 416 |
| 417 CPWL_IconList::~CPWL_IconList() | 417 CPWL_IconList::~CPWL_IconList() |
| 418 { | 418 { |
| 419 } | 419 } |
| 420 | 420 |
| 421 void CPWL_IconList::RePosChildWnd() | 421 void CPWL_IconList::RePosChildWnd() |
| (...skipping 17 matching lines...) Expand all Loading... |
| 439 void CPWL_IconList::OnCreated() | 439 void CPWL_IconList::OnCreated() |
| 440 { | 440 { |
| 441 if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar()) | 441 if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar()) |
| 442 { | 442 { |
| 443 pScrollBar->RemoveFlag(PWS_AUTOTRANSPARENT); | 443 pScrollBar->RemoveFlag(PWS_AUTOTRANSPARENT); |
| 444 pScrollBar->SetTransparency(255); | 444 pScrollBar->SetTransparency(255); |
| 445 pScrollBar->SetNotifyForever(TRUE); | 445 pScrollBar->SetNotifyForever(TRUE); |
| 446 } | 446 } |
| 447 } | 447 } |
| 448 | 448 |
| 449 void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, FX_INTPTR wParam, FX_
INTPTR lParam) | 449 void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
tr_t lParam) |
| 450 { | 450 { |
| 451 CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam); | 451 CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam); |
| 452 | 452 |
| 453 if (wParam == SBT_VSCROLL) | 453 if (wParam == SBT_VSCROLL) |
| 454 { | 454 { |
| 455 switch (msg) | 455 switch (msg) |
| 456 { | 456 { |
| 457 case PNM_SETSCROLLINFO: | 457 case PNM_SETSCROLLINFO: |
| 458 if (PWL_SCROLL_INFO* pInfo = (PWL_SCROLL_INFO*)lParam) | 458 if (PWL_SCROLL_INFO* pInfo = (PWL_SCROLL_INFO*)lParam) |
| 459 { | 459 { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 } | 495 } |
| 496 return; | 496 return; |
| 497 case PNM_SETSCROLLPOS: | 497 case PNM_SETSCROLLPOS: |
| 498 if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar()) | 498 if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar()) |
| 499 pScrollBar->OnNotify(pWnd,PNM_SETSCROLLPOS,wPara
m,lParam); | 499 pScrollBar->OnNotify(pWnd,PNM_SETSCROLLPOS,wPara
m,lParam); |
| 500 return; | 500 return; |
| 501 } | 501 } |
| 502 } | 502 } |
| 503 } | 503 } |
| 504 | 504 |
| 505 void CPWL_IconList::SetSelect(FX_INT32 nIndex) | 505 void CPWL_IconList::SetSelect(int32_t nIndex) |
| 506 { | 506 { |
| 507 m_pListContent->SetSelect(nIndex); | 507 m_pListContent->SetSelect(nIndex); |
| 508 } | 508 } |
| 509 | 509 |
| 510 void CPWL_IconList::SetTopItem(FX_INT32 nIndex) | 510 void CPWL_IconList::SetTopItem(int32_t nIndex) |
| 511 { | 511 { |
| 512 m_pListContent->ScrollToItem(nIndex); | 512 m_pListContent->ScrollToItem(nIndex); |
| 513 } | 513 } |
| 514 | 514 |
| 515 FX_INT32 CPWL_IconList::GetSelect() const | 515 int32_t CPWL_IconList::GetSelect() const |
| 516 { | 516 { |
| 517 return m_pListContent->GetSelect(); | 517 return m_pListContent->GetSelect(); |
| 518 } | 518 } |
| 519 | 519 |
| 520 void CPWL_IconList::SetNotify(IPWL_IconList_Notify* pNotify) | 520 void CPWL_IconList::SetNotify(IPWL_IconList_Notify* pNotify) |
| 521 { | 521 { |
| 522 m_pListContent->SetNotify(pNotify); | 522 m_pListContent->SetNotify(pNotify); |
| 523 } | 523 } |
| 524 | 524 |
| 525 void CPWL_IconList::EnableNotify(FX_BOOL bNotify) | 525 void CPWL_IconList::EnableNotify(FX_BOOL bNotify) |
| 526 { | 526 { |
| 527 m_pListContent->EnableNotify(bNotify); | 527 m_pListContent->EnableNotify(bNotify); |
| 528 } | 528 } |
| 529 | 529 |
| 530 void CPWL_IconList::SetListData(FX_INT32 nItemIndex, void* pData) | 530 void CPWL_IconList::SetListData(int32_t nItemIndex, void* pData) |
| 531 { | 531 { |
| 532 m_pListContent->SetListData(nItemIndex, pData); | 532 m_pListContent->SetListData(nItemIndex, pData); |
| 533 } | 533 } |
| 534 | 534 |
| 535 void CPWL_IconList::SetListIcon(FX_INT32 nItemIndex, FX_INT32 nIconIndex) | 535 void CPWL_IconList::SetListIcon(int32_t nItemIndex, int32_t nIconIndex) |
| 536 { | 536 { |
| 537 m_pListContent->SetListIcon(nItemIndex, nIconIndex); | 537 m_pListContent->SetListIcon(nItemIndex, nIconIndex); |
| 538 } | 538 } |
| 539 | 539 |
| 540 void CPWL_IconList::SetListString(FX_INT32 nItemIndex, const CFX_WideString& str
) | 540 void CPWL_IconList::SetListString(int32_t nItemIndex, const CFX_WideString& str) |
| 541 { | 541 { |
| 542 m_pListContent->SetListString(nItemIndex, str); | 542 m_pListContent->SetListString(nItemIndex, str); |
| 543 } | 543 } |
| 544 | 544 |
| 545 CFX_WideString CPWL_IconList::GetListString(FX_INT32 nItemIndex) const | 545 CFX_WideString CPWL_IconList::GetListString(int32_t nItemIndex) const |
| 546 { | 546 { |
| 547 return m_pListContent->GetListString(nItemIndex); | 547 return m_pListContent->GetListString(nItemIndex); |
| 548 } | 548 } |
| 549 | 549 |
| 550 void CPWL_IconList::SetIconFillColor(const CPWL_Color& color) | 550 void CPWL_IconList::SetIconFillColor(const CPWL_Color& color) |
| 551 { | 551 { |
| 552 m_pListContent->SetIconFillColor(color); | 552 m_pListContent->SetIconFillColor(color); |
| 553 } | 553 } |
| 554 | 554 |
| 555 FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_D
WORD nFlag) | 555 FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_D
WORD nFlag) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 574 if (ptNew.y < rcScroll.bottom) | 574 if (ptNew.y < rcScroll.bottom) |
| 575 ptNew.y = rcScroll.bottom; | 575 ptNew.y = rcScroll.bottom; |
| 576 | 576 |
| 577 if (ptNew.y != ptScroll.y) | 577 if (ptNew.y != ptScroll.y) |
| 578 { | 578 { |
| 579 m_pListContent->SetScrollPos(ptNew); | 579 m_pListContent->SetScrollPos(ptNew); |
| 580 m_pListContent->ResetFace(); | 580 m_pListContent->ResetFace(); |
| 581 m_pListContent->InvalidateRect(NULL); | 581 m_pListContent->InvalidateRect(NULL); |
| 582 | 582 |
| 583 if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar()) | 583 if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar()) |
| 584 » » » » pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT
_VSCROLL, (FX_INTPTR)&ptNew.y); | 584 » » » » pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT
_VSCROLL, (intptr_t)&ptNew.y); |
| 585 | 585 |
| 586 return TRUE; | 586 return TRUE; |
| 587 } | 587 } |
| 588 } | 588 } |
| 589 | 589 |
| 590 return FALSE; | 590 return FALSE; |
| 591 } | 591 } |
| 592 | 592 |
| OLD | NEW |