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 "fpdfsdk/include/pdfwindow/PDFWindow.h" | 7 #include "fpdfsdk/include/pdfwindow/PWL_Note.h" |
| 8 |
8 #include "fpdfsdk/include/pdfwindow/PWL_Button.h" | 9 #include "fpdfsdk/include/pdfwindow/PWL_Button.h" |
9 #include "fpdfsdk/include/pdfwindow/PWL_Caret.h" | 10 #include "fpdfsdk/include/pdfwindow/PWL_Caret.h" |
10 #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" | 11 #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" |
11 #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" | |
12 #include "fpdfsdk/include/pdfwindow/PWL_EditCtrl.h" | 12 #include "fpdfsdk/include/pdfwindow/PWL_EditCtrl.h" |
13 #include "fpdfsdk/include/pdfwindow/PWL_Label.h" | 13 #include "fpdfsdk/include/pdfwindow/PWL_Label.h" |
14 #include "fpdfsdk/include/pdfwindow/PWL_ListCtrl.h" | 14 #include "fpdfsdk/include/pdfwindow/PWL_ListCtrl.h" |
15 #include "fpdfsdk/include/pdfwindow/PWL_Note.h" | |
16 #include "fpdfsdk/include/pdfwindow/PWL_ScrollBar.h" | |
17 #include "fpdfsdk/include/pdfwindow/PWL_ScrollBar.h" | 15 #include "fpdfsdk/include/pdfwindow/PWL_ScrollBar.h" |
18 #include "fpdfsdk/include/pdfwindow/PWL_Utils.h" | 16 #include "fpdfsdk/include/pdfwindow/PWL_Utils.h" |
19 #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" | 17 #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" |
20 | 18 |
21 #define POPUP_ITEM_HEAD_BOTTOM 3.0f | 19 #define POPUP_ITEM_HEAD_BOTTOM 3.0f |
22 #define POPUP_ITEM_BOTTOMWIDTH 1.0f | 20 #define POPUP_ITEM_BOTTOMWIDTH 1.0f |
23 #define POPUP_ITEM_SIDEMARGIN 3.0f | 21 #define POPUP_ITEM_SIDEMARGIN 3.0f |
24 #define POPUP_ITEM_SPACE 4.0f | 22 #define POPUP_ITEM_SPACE 4.0f |
25 #define POPUP_ITEM_TEXT_INDENT 2.0f | 23 #define POPUP_ITEM_TEXT_INDENT 2.0f |
26 #define POPUP_ITEM_BORDERCOLOR \ | 24 #define POPUP_ITEM_BORDERCOLOR \ |
27 CPWL_Color(COLORTYPE_RGB, 80 / 255.0f, 80 / 255.0f, 80 / 255.0f) | 25 CPWL_Color(COLORTYPE_RGB, 80 / 255.0f, 80 / 255.0f, 80 / 255.0f) |
28 | 26 |
29 #define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001) | 27 #define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001) |
30 #define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb))) | 28 #define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb))) |
31 #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) | 29 #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) |
32 #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb)) | 30 #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb)) |
33 | 31 |
34 /* ------------------------------- CPWL_Note_Options | |
35 * ------------------------------- */ | |
36 | |
37 CPWL_Note_Options::CPWL_Note_Options() : m_pText(NULL) {} | 32 CPWL_Note_Options::CPWL_Note_Options() : m_pText(NULL) {} |
38 | 33 |
39 CPWL_Note_Options::~CPWL_Note_Options() {} | 34 CPWL_Note_Options::~CPWL_Note_Options() {} |
40 | 35 |
41 void CPWL_Note_Options::SetTextColor(const CPWL_Color& color) { | 36 void CPWL_Note_Options::SetTextColor(const CPWL_Color& color) { |
42 CPWL_Wnd::SetTextColor(color); | 37 CPWL_Wnd::SetTextColor(color); |
43 | 38 |
44 if (m_pText) | 39 if (m_pText) |
45 m_pText->SetTextColor(color); | 40 m_pText->SetTextColor(color); |
46 } | 41 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), 0, | 94 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), 0, |
100 FXFILL_ALTERNATE); | 95 FXFILL_ALTERNATE); |
101 } | 96 } |
102 | 97 |
103 CPDF_Rect CPWL_Note_Options::GetContentRect() const { | 98 CPDF_Rect CPWL_Note_Options::GetContentRect() const { |
104 CPDF_Rect rcText = m_pText->GetContentRect(); | 99 CPDF_Rect rcText = m_pText->GetContentRect(); |
105 rcText.right += 15.0f; | 100 rcText.right += 15.0f; |
106 return rcText; | 101 return rcText; |
107 } | 102 } |
108 | 103 |
109 /* ------------------------------- CPWL_Note_Edit ------------------------------ | |
110 */ | |
111 | |
112 CPWL_Note_Edit::CPWL_Note_Edit() | 104 CPWL_Note_Edit::CPWL_Note_Edit() |
113 : m_bEnableNotify(TRUE), | 105 : m_bEnableNotify(TRUE), |
114 m_fOldItemHeight(0.0f), | 106 m_fOldItemHeight(0.0f), |
115 m_bSizeChanged(FALSE), | 107 m_bSizeChanged(FALSE), |
116 m_fOldMin(0.0f), | 108 m_fOldMin(0.0f), |
117 m_fOldMax(0.0f) {} | 109 m_fOldMax(0.0f) {} |
118 | 110 |
119 CPWL_Note_Edit::~CPWL_Note_Edit() {} | 111 CPWL_Note_Edit::~CPWL_Note_Edit() {} |
120 | 112 |
121 void CPWL_Note_Edit::RePosChildWnd() { | 113 void CPWL_Note_Edit::RePosChildWnd() { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 219 } |
228 | 220 |
229 FX_FLOAT CPWL_Note_Edit::GetItemLeftMargin() { | 221 FX_FLOAT CPWL_Note_Edit::GetItemLeftMargin() { |
230 return POPUP_ITEM_TEXT_INDENT; | 222 return POPUP_ITEM_TEXT_INDENT; |
231 } | 223 } |
232 | 224 |
233 FX_FLOAT CPWL_Note_Edit::GetItemRightMargin() { | 225 FX_FLOAT CPWL_Note_Edit::GetItemRightMargin() { |
234 return POPUP_ITEM_TEXT_INDENT; | 226 return POPUP_ITEM_TEXT_INDENT; |
235 } | 227 } |
236 | 228 |
237 /* -------------------------------- CPWL_Note_LBBox | |
238 * --------------------------------*/ | |
239 | |
240 CPWL_Note_LBBox::CPWL_Note_LBBox() {} | 229 CPWL_Note_LBBox::CPWL_Note_LBBox() {} |
241 | 230 |
242 CPWL_Note_LBBox::~CPWL_Note_LBBox() {} | 231 CPWL_Note_LBBox::~CPWL_Note_LBBox() {} |
243 | 232 |
244 void CPWL_Note_LBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, | 233 void CPWL_Note_LBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, |
245 CFX_Matrix* pUser2Device) { | 234 CFX_Matrix* pUser2Device) { |
246 CPDF_Rect rcClient = GetClientRect(); | 235 CPDF_Rect rcClient = GetClientRect(); |
247 | 236 |
248 CFX_GraphStateData gsd; | 237 CFX_GraphStateData gsd; |
249 gsd.m_LineWidth = 1.0f; | 238 gsd.m_LineWidth = 1.0f; |
250 | 239 |
251 CFX_PathData pathCross; | 240 CFX_PathData pathCross; |
252 | 241 |
253 pathCross.SetPointCount(4); | 242 pathCross.SetPointCount(4); |
254 pathCross.SetPoint(0, rcClient.left, rcClient.top, FXPT_MOVETO); | 243 pathCross.SetPoint(0, rcClient.left, rcClient.top, FXPT_MOVETO); |
255 pathCross.SetPoint(1, rcClient.right, rcClient.bottom, FXPT_LINETO); | 244 pathCross.SetPoint(1, rcClient.right, rcClient.bottom, FXPT_LINETO); |
256 pathCross.SetPoint(2, rcClient.left, | 245 pathCross.SetPoint(2, rcClient.left, |
257 rcClient.bottom + rcClient.Height() * 0.5f, FXPT_MOVETO); | 246 rcClient.bottom + rcClient.Height() * 0.5f, FXPT_MOVETO); |
258 pathCross.SetPoint(3, rcClient.left + rcClient.Width() * 0.5f, | 247 pathCross.SetPoint(3, rcClient.left + rcClient.Width() * 0.5f, |
259 rcClient.bottom, FXPT_LINETO); | 248 rcClient.bottom, FXPT_LINETO); |
260 | 249 |
261 pDevice->DrawPath( | 250 pDevice->DrawPath( |
262 &pathCross, pUser2Device, &gsd, 0, | 251 &pathCross, pUser2Device, &gsd, 0, |
263 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), | 252 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), |
264 FXFILL_ALTERNATE); | 253 FXFILL_ALTERNATE); |
265 } | 254 } |
266 | 255 |
267 /* -------------------------------- CPWL_Note_RBBox | |
268 * --------------------------------*/ | |
269 | |
270 CPWL_Note_RBBox::CPWL_Note_RBBox() {} | 256 CPWL_Note_RBBox::CPWL_Note_RBBox() {} |
271 | 257 |
272 CPWL_Note_RBBox::~CPWL_Note_RBBox() {} | 258 CPWL_Note_RBBox::~CPWL_Note_RBBox() {} |
273 | 259 |
274 void CPWL_Note_RBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, | 260 void CPWL_Note_RBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, |
275 CFX_Matrix* pUser2Device) { | 261 CFX_Matrix* pUser2Device) { |
276 CPDF_Rect rcClient = GetClientRect(); | 262 CPDF_Rect rcClient = GetClientRect(); |
277 | 263 |
278 CFX_GraphStateData gsd; | 264 CFX_GraphStateData gsd; |
279 gsd.m_LineWidth = 1.0f; | 265 gsd.m_LineWidth = 1.0f; |
280 | 266 |
281 CFX_PathData pathCross; | 267 CFX_PathData pathCross; |
282 | 268 |
283 pathCross.SetPointCount(4); | 269 pathCross.SetPointCount(4); |
284 pathCross.SetPoint(0, rcClient.right, rcClient.top, FXPT_MOVETO); | 270 pathCross.SetPoint(0, rcClient.right, rcClient.top, FXPT_MOVETO); |
285 pathCross.SetPoint(1, rcClient.left, rcClient.bottom, FXPT_LINETO); | 271 pathCross.SetPoint(1, rcClient.left, rcClient.bottom, FXPT_LINETO); |
286 pathCross.SetPoint(2, rcClient.right, | 272 pathCross.SetPoint(2, rcClient.right, |
287 rcClient.bottom + rcClient.Height() * 0.5f, FXPT_MOVETO); | 273 rcClient.bottom + rcClient.Height() * 0.5f, FXPT_MOVETO); |
288 pathCross.SetPoint(3, rcClient.left + rcClient.Width() * 0.5f, | 274 pathCross.SetPoint(3, rcClient.left + rcClient.Width() * 0.5f, |
289 rcClient.bottom, FXPT_LINETO); | 275 rcClient.bottom, FXPT_LINETO); |
290 | 276 |
291 pDevice->DrawPath( | 277 pDevice->DrawPath( |
292 &pathCross, pUser2Device, &gsd, 0, | 278 &pathCross, pUser2Device, &gsd, 0, |
293 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), | 279 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), |
294 FXFILL_ALTERNATE); | 280 FXFILL_ALTERNATE); |
295 } | 281 } |
296 | 282 |
297 /* --------------------------------- CPWL_Note_Icon | |
298 * ---------------------------------- */ | |
299 | |
300 CPWL_Note_Icon::CPWL_Note_Icon() : m_nType(0) {} | 283 CPWL_Note_Icon::CPWL_Note_Icon() : m_nType(0) {} |
301 | 284 |
302 CPWL_Note_Icon::~CPWL_Note_Icon() {} | 285 CPWL_Note_Icon::~CPWL_Note_Icon() {} |
303 | 286 |
304 void CPWL_Note_Icon::SetIconType(int32_t nType) { | 287 void CPWL_Note_Icon::SetIconType(int32_t nType) { |
305 m_nType = nType; | 288 m_nType = nType; |
306 } | 289 } |
307 | 290 |
308 void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice, | 291 void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice, |
309 CFX_Matrix* pUser2Device) { | 292 CFX_Matrix* pUser2Device) { |
310 CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nType, GetClientRect(), | 293 CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nType, GetClientRect(), |
311 GetBackgroundColor(), PWL_DEFAULT_BLACKCOLOR, | 294 GetBackgroundColor(), PWL_DEFAULT_BLACKCOLOR, |
312 GetTransparency()); | 295 GetTransparency()); |
313 } | 296 } |
314 | 297 |
315 /* --------------------------------- CPWL_Note_CloseBox | |
316 * ---------------------------------- */ | |
317 | |
318 CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(FALSE) {} | 298 CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(FALSE) {} |
319 | 299 |
320 CPWL_Note_CloseBox::~CPWL_Note_CloseBox() {} | 300 CPWL_Note_CloseBox::~CPWL_Note_CloseBox() {} |
321 | 301 |
322 void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, | 302 void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, |
323 CFX_Matrix* pUser2Device) { | 303 CFX_Matrix* pUser2Device) { |
324 CPWL_Button::DrawThisAppearance(pDevice, pUser2Device); | 304 CPWL_Button::DrawThisAppearance(pDevice, pUser2Device); |
325 | 305 |
326 CPDF_Rect rcClient = GetClientRect(); | 306 CPDF_Rect rcClient = GetClientRect(); |
327 rcClient = CPWL_Utils::DeflateRect(rcClient, 2.0f); | 307 rcClient = CPWL_Utils::DeflateRect(rcClient, 2.0f); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 FX_BOOL CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point& point, | 343 FX_BOOL CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point& point, |
364 FX_DWORD nFlag) { | 344 FX_DWORD nFlag) { |
365 m_bMouseDown = FALSE; | 345 m_bMouseDown = FALSE; |
366 | 346 |
367 SetBorderStyle(PBS_BEVELED); | 347 SetBorderStyle(PBS_BEVELED); |
368 InvalidateRect(NULL); | 348 InvalidateRect(NULL); |
369 | 349 |
370 return CPWL_Button::OnLButtonUp(point, nFlag); | 350 return CPWL_Button::OnLButtonUp(point, nFlag); |
371 } | 351 } |
372 | 352 |
373 /* ------------------------------ CPWL_Note_Contents | |
374 * ------------------------------- */ | |
375 | |
376 CPWL_Note_Contents::CPWL_Note_Contents() : m_pEdit(NULL) {} | 353 CPWL_Note_Contents::CPWL_Note_Contents() : m_pEdit(NULL) {} |
377 | 354 |
378 CPWL_Note_Contents::~CPWL_Note_Contents() {} | 355 CPWL_Note_Contents::~CPWL_Note_Contents() {} |
379 | 356 |
380 CFX_ByteString CPWL_Note_Contents::GetClassName() const { | 357 CFX_ByteString CPWL_Note_Contents::GetClassName() const { |
381 return "CPWL_Note_Contents"; | 358 return "CPWL_Note_Contents"; |
382 } | 359 } |
383 | 360 |
384 void CPWL_Note_Contents::CreateChildWnd(const PWL_CREATEPARAM& cp) { | 361 void CPWL_Note_Contents::CreateChildWnd(const PWL_CREATEPARAM& cp) { |
385 m_pEdit = new CPWL_Note_Edit; | 362 m_pEdit = new CPWL_Note_Edit; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 return pNoteItem; | 409 return pNoteItem; |
433 } | 410 } |
434 | 411 |
435 int32_t CPWL_Note_Contents::CountSubItems() const { | 412 int32_t CPWL_Note_Contents::CountSubItems() const { |
436 return m_aChildren.GetSize() - 1; | 413 return m_aChildren.GetSize() - 1; |
437 } | 414 } |
438 | 415 |
439 IPWL_NoteItem* CPWL_Note_Contents::GetSubItems(int32_t index) const { | 416 IPWL_NoteItem* CPWL_Note_Contents::GetSubItems(int32_t index) const { |
440 int32_t nIndex = index + 1; | 417 int32_t nIndex = index + 1; |
441 | 418 |
442 if (nIndex > 0 && nIndex < m_aChildren.GetSize()) | 419 if (nIndex > 0 && nIndex < m_aChildren.GetSize()) { |
443 if (CPWL_Wnd* pChild = m_aChildren.GetAt(nIndex)) { | 420 if (CPWL_Wnd* pChild = m_aChildren.GetAt(nIndex)) { |
444 ASSERT(pChild->GetClassName() == "CPWL_NoteItem"); | 421 ASSERT(pChild->GetClassName() == "CPWL_NoteItem"); |
445 CPWL_NoteItem* pItem = (CPWL_NoteItem*)pChild; | 422 CPWL_NoteItem* pItem = (CPWL_NoteItem*)pChild; |
446 return pItem; | 423 return pItem; |
447 } | 424 } |
| 425 } |
448 return NULL; | 426 return NULL; |
449 } | 427 } |
450 | 428 |
451 void CPWL_Note_Contents::DeleteSubItem(IPWL_NoteItem* pNoteItem) { | 429 void CPWL_Note_Contents::DeleteSubItem(IPWL_NoteItem* pNoteItem) { |
452 int32_t nIndex = GetItemIndex((CPWL_NoteItem*)pNoteItem); | 430 int32_t nIndex = GetItemIndex((CPWL_NoteItem*)pNoteItem); |
453 | 431 |
454 if (nIndex > 0) { | 432 if (nIndex > 0) { |
455 if (CPWL_NoteItem* pPWLNoteItem = (CPWL_NoteItem*)pNoteItem) { | 433 if (CPWL_NoteItem* pPWLNoteItem = (CPWL_NoteItem*)pNoteItem) { |
456 pPWLNoteItem->KillFocus(); | 434 pPWLNoteItem->KillFocus(); |
457 pPWLNoteItem->Destroy(); | 435 pPWLNoteItem->Destroy(); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 for (int32_t i = 0, sz = m_aChildren.GetSize(); i < sz; i++) { | 572 for (int32_t i = 0, sz = m_aChildren.GetSize(); i < sz; i++) { |
595 if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { | 573 if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) { |
596 if (pChild->GetClassName() == "CPWL_NoteItem") { | 574 if (pChild->GetClassName() == "CPWL_NoteItem") { |
597 CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChild; | 575 CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChild; |
598 pNoteItem->EnableRead(bEnabled); | 576 pNoteItem->EnableRead(bEnabled); |
599 } | 577 } |
600 } | 578 } |
601 } | 579 } |
602 } | 580 } |
603 | 581 |
604 /* ---------------------------------- CPWL_NoteItem | |
605 * ---------------------------------- */ | |
606 | |
607 CPWL_NoteItem::CPWL_NoteItem() | 582 CPWL_NoteItem::CPWL_NoteItem() |
608 : m_pSubject(NULL), | 583 : m_pSubject(NULL), |
609 m_pDateTime(NULL), | 584 m_pDateTime(NULL), |
610 m_pContents(NULL), | 585 m_pContents(NULL), |
611 m_pPrivateData(NULL), | 586 m_pPrivateData(NULL), |
612 m_sAuthor(L""), | 587 m_sAuthor(L""), |
613 m_fOldItemHeight(0.0f), | 588 m_fOldItemHeight(0.0f), |
614 m_bSizeChanged(FALSE), | 589 m_bSizeChanged(FALSE), |
615 m_bAllowModify(TRUE) {} | 590 m_bAllowModify(TRUE) {} |
616 | 591 |
(...skipping 21 matching lines...) Expand all Loading... |
638 m_pDateTime = new CPWL_Label; | 613 m_pDateTime = new CPWL_Label; |
639 PWL_CREATEPARAM dcp = cp; | 614 PWL_CREATEPARAM dcp = cp; |
640 dcp.pParentWnd = this; | 615 dcp.pParentWnd = this; |
641 dcp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_RIGHT | PES_TOP; | 616 dcp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_RIGHT | PES_TOP; |
642 dcp.sTextColor = sTextColor; | 617 dcp.sTextColor = sTextColor; |
643 m_pDateTime->Create(dcp); | 618 m_pDateTime->Create(dcp); |
644 | 619 |
645 m_pContents = new CPWL_Note_Contents; | 620 m_pContents = new CPWL_Note_Contents; |
646 PWL_CREATEPARAM ccp = cp; | 621 PWL_CREATEPARAM ccp = cp; |
647 ccp.pParentWnd = this; | 622 ccp.pParentWnd = this; |
648 // ccp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR; | |
649 ccp.sBackgroundColor = | 623 ccp.sBackgroundColor = |
650 CPWL_Color(COLORTYPE_RGB, 240 / 255.0f, 240 / 255.0f, 240 / 255.0f); | 624 CPWL_Color(COLORTYPE_RGB, 240 / 255.0f, 240 / 255.0f, 240 / 255.0f); |
651 ccp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BACKGROUND; | 625 ccp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BACKGROUND; |
652 m_pContents->Create(ccp); | 626 m_pContents->Create(ccp); |
653 m_pContents->SetItemSpace(POPUP_ITEM_SPACE); | 627 m_pContents->SetItemSpace(POPUP_ITEM_SPACE); |
654 m_pContents->SetTopSpace(POPUP_ITEM_SPACE); | 628 m_pContents->SetTopSpace(POPUP_ITEM_SPACE); |
655 m_pContents->SetBottomSpace(POPUP_ITEM_SPACE); | 629 m_pContents->SetBottomSpace(POPUP_ITEM_SPACE); |
656 } | 630 } |
657 | 631 |
658 void CPWL_NoteItem::RePosChildWnd() { | 632 void CPWL_NoteItem::RePosChildWnd() { |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 | 1011 |
1038 void CPWL_NoteItem::EnableModify(FX_BOOL bEnabled) { | 1012 void CPWL_NoteItem::EnableModify(FX_BOOL bEnabled) { |
1039 m_pContents->EnableModify(bEnabled); | 1013 m_pContents->EnableModify(bEnabled); |
1040 m_bAllowModify = bEnabled; | 1014 m_bAllowModify = bEnabled; |
1041 } | 1015 } |
1042 | 1016 |
1043 void CPWL_NoteItem::EnableRead(FX_BOOL bEnabled) { | 1017 void CPWL_NoteItem::EnableRead(FX_BOOL bEnabled) { |
1044 m_pContents->EnableRead(bEnabled); | 1018 m_pContents->EnableRead(bEnabled); |
1045 } | 1019 } |
1046 | 1020 |
1047 /* ---------------------------------- CPWL_Note | |
1048 * ---------------------------------- */ | |
1049 | |
1050 CPWL_Note::CPWL_Note(IPopup_Note* pPopupNote, | 1021 CPWL_Note::CPWL_Note(IPopup_Note* pPopupNote, |
1051 IPWL_NoteNotify* pNoteNotify, | 1022 IPWL_NoteNotify* pNoteNotify, |
1052 IPWL_NoteHandler* pNoteHandler) | 1023 IPWL_NoteHandler* pNoteHandler) |
1053 : m_pAuthor(NULL), | 1024 : m_pAuthor(NULL), |
1054 m_pIcon(NULL), | 1025 m_pIcon(NULL), |
1055 m_pCloseBox(NULL), | 1026 m_pCloseBox(NULL), |
1056 m_pLBBox(NULL), | 1027 m_pLBBox(NULL), |
1057 m_pRBBox(NULL), | 1028 m_pRBBox(NULL), |
1058 m_pContentsBar(NULL), | 1029 m_pContentsBar(NULL), |
1059 m_pOptions(NULL), | 1030 m_pOptions(NULL), |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1373 sInfo.fContentMin = rcScroll.bottom; | 1344 sInfo.fContentMin = rcScroll.bottom; |
1374 sInfo.fContentMax = rcScroll.top; | 1345 sInfo.fContentMax = rcScroll.top; |
1375 sInfo.fPlateWidth = m_pContents->GetClientRect().Height(); | 1346 sInfo.fPlateWidth = m_pContents->GetClientRect().Height(); |
1376 sInfo.fSmallStep = 13.0f; | 1347 sInfo.fSmallStep = 13.0f; |
1377 sInfo.fBigStep = sInfo.fPlateWidth; | 1348 sInfo.fBigStep = sInfo.fPlateWidth; |
1378 | 1349 |
1379 if (FXSYS_memcmp(&m_OldScrollInfo, &sInfo, sizeof(PWL_SCROLL_INFO)) != | 1350 if (FXSYS_memcmp(&m_OldScrollInfo, &sInfo, sizeof(PWL_SCROLL_INFO)) != |
1380 0) { | 1351 0) { |
1381 FX_BOOL bScrollChanged = FALSE; | 1352 FX_BOOL bScrollChanged = FALSE; |
1382 | 1353 |
1383 if (lParam < 3) //·ÀÖ¹ËÀÑ»· mantis:15759 | 1354 if (lParam < 3) { |
1384 { | |
1385 bScrollChanged = ResetScrollBar(); | 1355 bScrollChanged = ResetScrollBar(); |
1386 if (bScrollChanged) { | 1356 if (bScrollChanged) { |
1387 lParam++; | 1357 lParam++; |
1388 m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); | 1358 m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); |
1389 OnNotify(this, PNM_NOTEEDITCHANGED, 0, lParam); | 1359 OnNotify(this, PNM_NOTEEDITCHANGED, 0, lParam); |
1390 } | 1360 } |
1391 } | 1361 } |
1392 | 1362 |
1393 if (!bScrollChanged) { | 1363 if (!bScrollChanged) { |
1394 if (m_pContentsBar->IsVisible()) { | 1364 if (m_pContentsBar->IsVisible()) { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 m_pContents->EnableRead(bEnabled); | 1500 m_pContents->EnableRead(bEnabled); |
1531 } | 1501 } |
1532 | 1502 |
1533 CFX_WideString CPWL_Note::GetReplyString() const { | 1503 CFX_WideString CPWL_Note::GetReplyString() const { |
1534 return m_sReplyString; | 1504 return m_sReplyString; |
1535 } | 1505 } |
1536 | 1506 |
1537 void CPWL_Note::SetReplyString(const CFX_WideString& string) { | 1507 void CPWL_Note::SetReplyString(const CFX_WideString& string) { |
1538 m_sReplyString = string; | 1508 m_sReplyString = string; |
1539 } | 1509 } |
OLD | NEW |