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

Side by Side Diff: fpdfsdk/src/pdfwindow/PWL_IconList.cpp

Issue 1252613002: FX_BOOL considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Manual edits. Created 5 years, 5 months 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/pdfwindow/PWL_Icon.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Label.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "../../include/pdfwindow/PWL_Utils.h" 11 #include "../../include/pdfwindow/PWL_Utils.h"
12 #include "../../include/pdfwindow/PWL_ScrollBar.h" 12 #include "../../include/pdfwindow/PWL_ScrollBar.h"
13 #include "../../include/pdfwindow/PWL_Label.h" 13 #include "../../include/pdfwindow/PWL_Label.h"
14 14
15 #define PWL_IconList_ITEM_ICON_LEFTMARGIN 10.0f 15 #define PWL_IconList_ITEM_ICON_LEFTMARGIN 10.0f
16 #define PWL_IconList_ITEM_WIDTH 20.0f 16 #define PWL_IconList_ITEM_WIDTH 20.0f
17 #define PWL_IconList_ITEM_HEIGHT 20.0f 17 #define PWL_IconList_ITEM_HEIGHT 20.0f
18 #define PWL_IconList_ITEM_SPACE 4.0f 18 #define PWL_IconList_ITEM_SPACE 4.0f
19 19
20 /* ------------------ CPWL_IconList_Item ------------------- */ 20 /* ------------------ CPWL_IconList_Item ------------------- */
21 21
22 CPWL_IconList_Item::CPWL_IconList_Item() : 22 CPWL_IconList_Item::CPWL_IconList_Item() :
23 m_nIconIndex(-1), 23 m_nIconIndex(-1),
24 m_pData(NULL), 24 m_pData(NULL),
25 » m_bSelected(FALSE), 25 » m_bSelected(false),
26 m_pText(NULL) 26 m_pText(NULL)
27 { 27 {
28 } 28 }
29 29
30 CPWL_IconList_Item::~CPWL_IconList_Item() 30 CPWL_IconList_Item::~CPWL_IconList_Item()
31 { 31 {
32 } 32 }
33 33
34 CFX_ByteString CPWL_IconList_Item::GetClassName() const 34 CFX_ByteString CPWL_IconList_Item::GetClassName() const
35 { 35 {
(...skipping 24 matching lines...) Expand all
60 } 60 }
61 61
62 CPDF_Rect rcIcon = rcClient; 62 CPDF_Rect rcIcon = rcClient;
63 rcIcon.left += PWL_IconList_ITEM_ICON_LEFTMARGIN; 63 rcIcon.left += PWL_IconList_ITEM_ICON_LEFTMARGIN;
64 rcIcon.right = rcIcon.left + PWL_IconList_ITEM_WIDTH; 64 rcIcon.right = rcIcon.left + PWL_IconList_ITEM_WIDTH;
65 65
66 CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nIconIndex, rcIco n, 66 CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nIconIndex, rcIco n,
67 m_crIcon, m_pText->GetTextColor(), GetTransparency()); 67 m_crIcon, m_pText->GetTextColor(), GetTransparency());
68 } 68 }
69 69
70 void CPWL_IconList_Item::SetSelect(FX_BOOL bSelected) 70 void CPWL_IconList_Item::SetSelect(bool bSelected)
71 { 71 {
72 m_bSelected = bSelected; 72 m_bSelected = bSelected;
73 73
74 if (bSelected) 74 if (bSelected)
75 m_pText->SetTextColor(PWL_DEFAULT_WHITECOLOR); 75 m_pText->SetTextColor(PWL_DEFAULT_WHITECOLOR);
76 else 76 else
77 m_pText->SetTextColor(PWL_DEFAULT_BLACKCOLOR); 77 m_pText->SetTextColor(PWL_DEFAULT_BLACKCOLOR);
78 78
79 } 79 }
80 80
81 FX_BOOL»CPWL_IconList_Item::IsSelected() const 81 bool» CPWL_IconList_Item::IsSelected() const
82 { 82 {
83 return m_bSelected; 83 return m_bSelected;
84 } 84 }
85 85
86 void CPWL_IconList_Item::CreateChildWnd(const PWL_CREATEPARAM & cp) 86 void CPWL_IconList_Item::CreateChildWnd(const PWL_CREATEPARAM & cp)
87 { 87 {
88 m_pText = new CPWL_Label; 88 m_pText = new CPWL_Label;
89 89
90 PWL_CREATEPARAM lcp = cp; 90 PWL_CREATEPARAM lcp = cp;
91 lcp.pParentWnd = this; 91 lcp.pParentWnd = this;
(...skipping 22 matching lines...) Expand all
114 { 114 {
115 return m_pText->GetText(); 115 return m_pText->GetText();
116 } 116 }
117 117
118 void CPWL_IconList_Item::RePosChildWnd() 118 void CPWL_IconList_Item::RePosChildWnd()
119 { 119 {
120 CPDF_Rect rcClient = GetClientRect(); 120 CPDF_Rect rcClient = GetClientRect();
121 121
122 rcClient.left += (PWL_IconList_ITEM_ICON_LEFTMARGIN + PWL_IconList_ITEM_ WIDTH + PWL_IconList_ITEM_ICON_LEFTMARGIN); 122 rcClient.left += (PWL_IconList_ITEM_ICON_LEFTMARGIN + PWL_IconList_ITEM_ WIDTH + PWL_IconList_ITEM_ICON_LEFTMARGIN);
123 123
124 » m_pText->Move(rcClient, TRUE, FALSE); 124 » m_pText->Move(rcClient, true, false);
125 } 125 }
126 126
127 void CPWL_IconList_Item::SetIconFillColor(const CPWL_Color& color) 127 void CPWL_IconList_Item::SetIconFillColor(const CPWL_Color& color)
128 { 128 {
129 m_crIcon = color; 129 m_crIcon = color;
130 } 130 }
131 131
132 void CPWL_IconList_Item::OnEnabled() 132 void CPWL_IconList_Item::OnEnabled()
133 { 133 {
134 if (m_bSelected) 134 if (m_bSelected)
135 m_pText->SetTextColor(PWL_DEFAULT_WHITECOLOR); 135 m_pText->SetTextColor(PWL_DEFAULT_WHITECOLOR);
136 else 136 else
137 m_pText->SetTextColor(PWL_DEFAULT_BLACKCOLOR); 137 m_pText->SetTextColor(PWL_DEFAULT_BLACKCOLOR);
138 138
139 InvalidateRect(); 139 InvalidateRect();
140 } 140 }
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 InvalidateRect(); 146 InvalidateRect();
147 } 147 }
148 148
149 /* ----------------- CPWL_IconList_Content ----------------- */ 149 /* ----------------- CPWL_IconList_Content ----------------- */
150 150
151 CPWL_IconList_Content::CPWL_IconList_Content(int32_t 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 {
(...skipping 19 matching lines...) Expand all
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, (intptr_ t)&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 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 int32_t 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 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 bool CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag )
218 { 218 {
219 if (m_bMouseDown) 219 if (m_bMouseDown)
220 { 220 {
221 int32_t 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 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 int32_t 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 int32_t 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 int32_t CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point) 254 int32_t CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point)
255 { 255 {
256 int32_t nIndex = 0; 256 int32_t nIndex = 0;
257 for (int32_t 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());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 pParent->OnNotify(this, PNM_SETSCROLLPOS, SBT_VS CROLL, (intptr_t)&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(int32_t 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 int32_t 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(bool bNotify)
337 { 337 {
338 m_bEnableNotify = bNotify; 338 m_bEnableNotify = bNotify;
339 } 339 }
340 340
341 void CPWL_IconList_Content::SelectItem(int32_t nItemIndex, FX_BOOL bSelect) 341 void CPWL_IconList_Content::SelectItem(int32_t nItemIndex, 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(int32_t nItemIndex) const 350 CPWL_IconList_Item* CPWL_IconList_Content::GetListItem(int32_t nItemIndex) const
351 { 351 {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()
422 { 422 {
423 CPWL_Wnd::RePosChildWnd(); 423 CPWL_Wnd::RePosChildWnd();
424 424
425 if (m_pListContent) 425 if (m_pListContent)
426 » » m_pListContent->Move(GetClientRect(), TRUE, FALSE); 426 » » m_pListContent->Move(GetClientRect(), true, false);
427 } 427 }
428 428
429 void CPWL_IconList::CreateChildWnd(const PWL_CREATEPARAM & cp) 429 void CPWL_IconList::CreateChildWnd(const PWL_CREATEPARAM & cp)
430 { 430 {
431 m_pListContent = new CPWL_IconList_Content(m_nListCount); 431 m_pListContent = new CPWL_IconList_Content(m_nListCount);
432 432
433 PWL_CREATEPARAM ccp = cp; 433 PWL_CREATEPARAM ccp = cp;
434 ccp.pParentWnd = this; 434 ccp.pParentWnd = this;
435 ccp.dwFlags = PWS_CHILD | PWS_VISIBLE; 435 ccp.dwFlags = PWS_CHILD | PWS_VISIBLE;
436 m_pListContent->Create(ccp); 436 m_pListContent->Create(ccp);
437 } 437 }
438 438
439 void CPWL_IconList::OnCreated() 439 void CPWL_IconList::OnCreated()
440 { 440 {
441 if (CPWL_ScrollBar* pScrollBar = GetVScrollBar()) 441 if (CPWL_ScrollBar* pScrollBar = 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, intptr_t wParam, intp tr_t 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 {
460 if (CPWL_ScrollBar* pScrollBar = GetVScrollBar() ) 460 if (CPWL_ScrollBar* pScrollBar = GetVScrollBar() )
461 { 461 {
462 if (pInfo->fContentMax - pInfo->fContent Min > pInfo->fPlateWidth) 462 if (pInfo->fContentMax - pInfo->fContent Min > pInfo->fPlateWidth)
463 { 463 {
464 if (!pScrollBar->IsVisible()) 464 if (!pScrollBar->IsVisible())
465 { 465 {
466 » » » » » » » pScrollBar->SetVisible(T RUE); 466 » » » » » » » pScrollBar->SetVisible(t rue);
467 RePosChildWnd(); 467 RePosChildWnd();
468 } 468 }
469 else 469 else
470 { 470 {
471 } 471 }
472 } 472 }
473 else 473 else
474 { 474 {
475 if (pScrollBar->IsVisible()) 475 if (pScrollBar->IsVisible())
476 { 476 {
477 » » » » » » » pScrollBar->SetVisible(F ALSE); 477 » » » » » » » pScrollBar->SetVisible(f alse);
478 RePosChildWnd(); 478 RePosChildWnd();
479 } 479 }
480 480
481 if (m_pListContent) 481 if (m_pListContent)
482 m_pListContent->SetScrol lPos(CPDF_Point(0.0f,0.0f)); 482 m_pListContent->SetScrol lPos(CPDF_Point(0.0f,0.0f));
483 } 483 }
484 484
485 pScrollBar->OnNotify(pWnd,PNM_SETSCROLLI NFO,wParam,lParam); 485 pScrollBar->OnNotify(pWnd,PNM_SETSCROLLI NFO,wParam,lParam);
486 } 486 }
487 } 487 }
(...skipping 27 matching lines...) Expand all
515 int32_t 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(bool bNotify)
526 { 526 {
527 m_pListContent->EnableNotify(bNotify); 527 m_pListContent->EnableNotify(bNotify);
528 } 528 }
529 529
530 void CPWL_IconList::SetListData(int32_t 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(int32_t nItemIndex, int32_t 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(int32_t 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(int32_t 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 bool» CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_D WORD nFlag)
556 { 556 {
557 CPDF_Point ptScroll = m_pListContent->GetScrollPos(); 557 CPDF_Point ptScroll = m_pListContent->GetScrollPos();
558 CPDF_Rect rcScroll = m_pListContent->GetScrollArea(); 558 CPDF_Rect rcScroll = m_pListContent->GetScrollArea();
559 CPDF_Rect rcContents = m_pListContent->GetClientRect(); 559 CPDF_Rect rcContents = m_pListContent->GetClientRect();
560 560
561 if (rcScroll.top - rcScroll.bottom > rcContents.Height()) 561 if (rcScroll.top - rcScroll.bottom > rcContents.Height())
562 { 562 {
563 CPDF_Point ptNew = ptScroll; 563 CPDF_Point ptNew = ptScroll;
564 564
565 if (zDelta > 0) 565 if (zDelta > 0)
(...skipping 10 matching lines...) Expand all
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 = GetVScrollBar()) 583 if (CPWL_ScrollBar* pScrollBar = GetVScrollBar())
584 pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT _VSCROLL, (intptr_t)&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
OLDNEW
« no previous file with comments | « fpdfsdk/src/pdfwindow/PWL_Icon.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Label.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698