| 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_Button.h" | 9 #include "../../include/pdfwindow/PWL_Button.h" |
| 10 #include "../../include/pdfwindow/PWL_EditCtrl.h" | 10 #include "../../include/pdfwindow/PWL_EditCtrl.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 { | 53 { |
| 54 if (IsValid()) | 54 if (IsValid()) |
| 55 { | 55 { |
| 56 ASSERT(m_pText != NULL); | 56 ASSERT(m_pText != NULL); |
| 57 | 57 |
| 58 CPDF_Rect rcClient = GetClientRect(); | 58 CPDF_Rect rcClient = GetClientRect(); |
| 59 | 59 |
| 60 if (rcClient.Width() > 15.0f) | 60 if (rcClient.Width() > 15.0f) |
| 61 { | 61 { |
| 62 rcClient.right -= 15.0f; | 62 rcClient.right -= 15.0f; |
| 63 » » » m_pText->Move(rcClient, TRUE, FALSE); | 63 » » » m_pText->Move(rcClient, true, false); |
| 64 » » » m_pText->SetVisible(TRUE); | 64 » » » m_pText->SetVisible(true); |
| 65 } | 65 } |
| 66 else | 66 else |
| 67 { | 67 { |
| 68 » » » m_pText->Move(CPDF_Rect(0,0,0,0), TRUE, FALSE); | 68 » » » m_pText->Move(CPDF_Rect(0,0,0,0), true, false); |
| 69 » » » m_pText->SetVisible(FALSE); | 69 » » » m_pText->SetVisible(false); |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 void CPWL_Note_Options::CreateChildWnd(const PWL_CREATEPARAM & cp) | 74 void CPWL_Note_Options::CreateChildWnd(const PWL_CREATEPARAM & cp) |
| 75 { | 75 { |
| 76 m_pText = new CPWL_Label; | 76 m_pText = new CPWL_Label; |
| 77 PWL_CREATEPARAM tcp = cp; | 77 PWL_CREATEPARAM tcp = cp; |
| 78 tcp.pParentWnd = this; | 78 tcp.pParentWnd = this; |
| 79 tcp.dwFlags = PWS_CHILD | PWS_VISIBLE; | 79 tcp.dwFlags = PWS_CHILD | PWS_VISIBLE; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 { | 115 { |
| 116 ASSERT(m_pText != NULL); | 116 ASSERT(m_pText != NULL); |
| 117 | 117 |
| 118 CPDF_Rect rcText = m_pText->GetContentRect(); | 118 CPDF_Rect rcText = m_pText->GetContentRect(); |
| 119 rcText.right += 15.0f; | 119 rcText.right += 15.0f; |
| 120 return rcText; | 120 return rcText; |
| 121 } | 121 } |
| 122 | 122 |
| 123 /* ------------------------------- CPWL_Note_Edit ------------------------------
*/ | 123 /* ------------------------------- CPWL_Note_Edit ------------------------------
*/ |
| 124 | 124 |
| 125 CPWL_Note_Edit::CPWL_Note_Edit() : m_bEnableNotify(TRUE), | 125 CPWL_Note_Edit::CPWL_Note_Edit() : m_bEnableNotify(true), |
| 126 m_fOldItemHeight(0.0f), | 126 m_fOldItemHeight(0.0f), |
| 127 » m_bSizeChanged(FALSE), | 127 » m_bSizeChanged(false), |
| 128 m_fOldMin(0.0f), | 128 m_fOldMin(0.0f), |
| 129 m_fOldMax(0.0f) | 129 m_fOldMax(0.0f) |
| 130 { | 130 { |
| 131 } | 131 } |
| 132 | 132 |
| 133 CPWL_Note_Edit::~CPWL_Note_Edit() | 133 CPWL_Note_Edit::~CPWL_Note_Edit() |
| 134 { | 134 { |
| 135 } | 135 } |
| 136 | 136 |
| 137 void CPWL_Note_Edit::RePosChildWnd() | 137 void CPWL_Note_Edit::RePosChildWnd() |
| 138 { | 138 { |
| 139 » m_bEnableNotify = FALSE; | 139 » m_bEnableNotify = false; |
| 140 CPWL_Edit::RePosChildWnd(); | 140 CPWL_Edit::RePosChildWnd(); |
| 141 » m_bEnableNotify = TRUE; | 141 » m_bEnableNotify = true; |
| 142 | 142 |
| 143 m_fOldItemHeight = GetContentRect().Height(); | 143 m_fOldItemHeight = GetContentRect().Height(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void CPWL_Note_Edit::SetText(const FX_WCHAR* csText) | 146 void CPWL_Note_Edit::SetText(const FX_WCHAR* csText) |
| 147 { | 147 { |
| 148 » m_bEnableNotify = FALSE; | 148 » m_bEnableNotify = false; |
| 149 CPWL_Edit::SetText(csText); | 149 CPWL_Edit::SetText(csText); |
| 150 » m_bEnableNotify = TRUE; | 150 » m_bEnableNotify = true; |
| 151 m_fOldItemHeight = GetContentRect().Height(); | 151 m_fOldItemHeight = GetContentRect().Height(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void CPWL_Note_Edit::OnSetFocus() | 154 void CPWL_Note_Edit::OnSetFocus() |
| 155 { | 155 { |
| 156 » m_bEnableNotify = FALSE; | 156 » m_bEnableNotify = false; |
| 157 CPWL_Edit::OnSetFocus(); | 157 CPWL_Edit::OnSetFocus(); |
| 158 » m_bEnableNotify = TRUE; | 158 » m_bEnableNotify = true; |
| 159 | 159 |
| 160 » EnableSpellCheck(TRUE); | 160 » EnableSpellCheck(true); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void CPWL_Note_Edit::OnKillFocus() | 163 void CPWL_Note_Edit::OnKillFocus() |
| 164 { | 164 { |
| 165 » EnableSpellCheck(FALSE); | 165 » EnableSpellCheck(false); |
| 166 | 166 |
| 167 if (CPWL_Wnd* pParent = GetParentWindow()) | 167 if (CPWL_Wnd* pParent = GetParentWindow()) |
| 168 { | 168 { |
| 169 if (CPWL_Wnd* pGrand = pParent->GetParentWindow()) | 169 if (CPWL_Wnd* pGrand = pParent->GetParentWindow()) |
| 170 { | 170 { |
| 171 ASSERT(pGrand->GetClassName() == "CPWL_NoteItem"); | 171 ASSERT(pGrand->GetClassName() == "CPWL_NoteItem"); |
| 172 | 172 |
| 173 CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pGrand; | 173 CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pGrand; |
| 174 | 174 |
| 175 pNoteItem->OnContentsValidate(); | 175 pNoteItem->OnContentsValidate(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 186 if (wParam == SBT_VSCROLL) | 186 if (wParam == SBT_VSCROLL) |
| 187 { | 187 { |
| 188 switch (msg) | 188 switch (msg) |
| 189 { | 189 { |
| 190 case PNM_SETSCROLLINFO: | 190 case PNM_SETSCROLLINFO: |
| 191 if (PWL_SCROLL_INFO* pInfo = (PWL_SCROLL_INFO*)l
Param) | 191 if (PWL_SCROLL_INFO* pInfo = (PWL_SCROLL_INFO*)l
Param) |
| 192 { | 192 { |
| 193 if (!IsFloatEqual(pInfo->fContentMax, m_
fOldMax) || | 193 if (!IsFloatEqual(pInfo->fContentMax, m_
fOldMax) || |
| 194 !IsFloatEqual(pInfo->fContentMin
, m_fOldMin)) | 194 !IsFloatEqual(pInfo->fContentMin
, m_fOldMin)) |
| 195 { | 195 { |
| 196 » » » » » » m_bSizeChanged = TRUE; | 196 » » » » » » m_bSizeChanged = true; |
| 197 if (CPWL_Wnd * pParent = GetPare
ntWindow()) | 197 if (CPWL_Wnd * pParent = GetPare
ntWindow()) |
| 198 { | 198 { |
| 199 pParent->OnNotify(this,
PNM_NOTEEDITCHANGED, 0, 0); | 199 pParent->OnNotify(this,
PNM_NOTEEDITCHANGED, 0, 0); |
| 200 } | 200 } |
| 201 | 201 |
| 202 m_fOldMax = pInfo->fContentMax; | 202 m_fOldMax = pInfo->fContentMax; |
| 203 m_fOldMin = pInfo->fContentMin; | 203 m_fOldMin = pInfo->fContentMin; |
| 204 return; | 204 return; |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 CPWL_Edit::OnNotify(pWnd, msg, wParam, lParam); | 211 CPWL_Edit::OnNotify(pWnd, msg, wParam, lParam); |
| 212 | 212 |
| 213 if (m_bEnableNotify) | 213 if (m_bEnableNotify) |
| 214 { | 214 { |
| 215 switch (msg) | 215 switch (msg) |
| 216 { | 216 { |
| 217 case PNM_SETCARETINFO: | 217 case PNM_SETCARETINFO: |
| 218 if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam) | 218 if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam) |
| 219 { | 219 { |
| 220 PWL_CARET_INFO newInfo = *pInfo; | 220 PWL_CARET_INFO newInfo = *pInfo; |
| 221 » » » » newInfo.bVisible = TRUE; | 221 » » » » newInfo.bVisible = true; |
| 222 newInfo.ptHead = ChildToParent(pInfo->ptHead); | 222 newInfo.ptHead = ChildToParent(pInfo->ptHead); |
| 223 newInfo.ptFoot = ChildToParent(pInfo->ptFoot); | 223 newInfo.ptFoot = ChildToParent(pInfo->ptFoot); |
| 224 | 224 |
| 225 if (CPWL_Wnd * pParent = GetParentWindow()) | 225 if (CPWL_Wnd * pParent = GetParentWindow()) |
| 226 { | 226 { |
| 227 pParent->OnNotify(this, PNM_SETCARETINFO
, (intptr_t)&newInfo, 0); | 227 pParent->OnNotify(this, PNM_SETCARETINFO
, (intptr_t)&newInfo, 0); |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 break; | 230 break; |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 FX_FLOAT CPWL_Note_Edit::GetItemHeight(FX_FLOAT fLimitWidth) | 235 FX_FLOAT CPWL_Note_Edit::GetItemHeight(FX_FLOAT fLimitWidth) |
| 236 { | 236 { |
| 237 if (fLimitWidth > 0) | 237 if (fLimitWidth > 0) |
| 238 { | 238 { |
| 239 if (!m_bSizeChanged) | 239 if (!m_bSizeChanged) |
| 240 return m_fOldItemHeight; | 240 return m_fOldItemHeight; |
| 241 | 241 |
| 242 » » m_bSizeChanged = FALSE; | 242 » » m_bSizeChanged = false; |
| 243 | 243 |
| 244 » » EnableNotify(FALSE); | 244 » » EnableNotify(false); |
| 245 » » EnableRefresh(FALSE); | 245 » » EnableRefresh(false); |
| 246 » » m_pEdit->EnableNotify(FALSE); | 246 » » m_pEdit->EnableNotify(false); |
| 247 | 247 |
| 248 » » Move(CPDF_Rect(0,0,fLimitWidth,0), TRUE, FALSE); | 248 » » Move(CPDF_Rect(0,0,fLimitWidth,0), true, false); |
| 249 FX_FLOAT fRet = GetContentRect().Height(); | 249 FX_FLOAT fRet = GetContentRect().Height(); |
| 250 | 250 |
| 251 » » m_pEdit->EnableNotify(TRUE); | 251 » » m_pEdit->EnableNotify(true); |
| 252 » » EnableNotify(TRUE); | 252 » » EnableNotify(true); |
| 253 » » EnableRefresh(TRUE); | 253 » » EnableRefresh(true); |
| 254 | 254 |
| 255 return fRet; | 255 return fRet; |
| 256 } | 256 } |
| 257 | 257 |
| 258 return 0; | 258 return 0; |
| 259 } | 259 } |
| 260 | 260 |
| 261 FX_FLOAT CPWL_Note_Edit::GetItemLeftMargin() | 261 FX_FLOAT CPWL_Note_Edit::GetItemLeftMargin() |
| 262 { | 262 { |
| 263 return POPUP_ITEM_TEXT_INDENT; | 263 return POPUP_ITEM_TEXT_INDENT; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 } | 342 } |
| 343 | 343 |
| 344 void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix*
pUser2Device) | 344 void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix*
pUser2Device) |
| 345 { | 345 { |
| 346 CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nType, GetClientR
ect(), | 346 CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nType, GetClientR
ect(), |
| 347 GetBackgroundColor(), PWL_DEFAULT_BLACKCOLOR, GetTransparency())
; | 347 GetBackgroundColor(), PWL_DEFAULT_BLACKCOLOR, GetTransparency())
; |
| 348 } | 348 } |
| 349 | 349 |
| 350 /* --------------------------------- CPWL_Note_CloseBox ------------------------
---------- */ | 350 /* --------------------------------- CPWL_Note_CloseBox ------------------------
---------- */ |
| 351 | 351 |
| 352 CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(FALSE) | 352 CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(false) |
| 353 { | 353 { |
| 354 } | 354 } |
| 355 | 355 |
| 356 CPWL_Note_CloseBox::~CPWL_Note_CloseBox() | 356 CPWL_Note_CloseBox::~CPWL_Note_CloseBox() |
| 357 { | 357 { |
| 358 } | 358 } |
| 359 | 359 |
| 360 void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matr
ix* pUser2Device) | 360 void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matr
ix* pUser2Device) |
| 361 { | 361 { |
| 362 CPWL_Button::DrawThisAppearance(pDevice, pUser2Device); | 362 CPWL_Button::DrawThisAppearance(pDevice, pUser2Device); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 380 pathCross.SetPointCount(4); | 380 pathCross.SetPointCount(4); |
| 381 pathCross.SetPoint(0, rcClient.left, rcClient.bottom, FXPT_MOVETO); | 381 pathCross.SetPoint(0, rcClient.left, rcClient.bottom, FXPT_MOVETO); |
| 382 pathCross.SetPoint(1, rcClient.right, rcClient.top, FXPT_LINETO); | 382 pathCross.SetPoint(1, rcClient.right, rcClient.top, FXPT_LINETO); |
| 383 pathCross.SetPoint(2, rcClient.left, rcClient.top, FXPT_MOVETO); | 383 pathCross.SetPoint(2, rcClient.left, rcClient.top, FXPT_MOVETO); |
| 384 pathCross.SetPoint(3, rcClient.right, rcClient.bottom, FXPT_LINETO); | 384 pathCross.SetPoint(3, rcClient.right, rcClient.bottom, FXPT_LINETO); |
| 385 | 385 |
| 386 pDevice->DrawPath(&pathCross, pUser2Device, &gsd, | 386 pDevice->DrawPath(&pathCross, pUser2Device, &gsd, |
| 387 0, CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency
()), FXFILL_ALTERNATE); | 387 0, CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency
()), FXFILL_ALTERNATE); |
| 388 } | 388 } |
| 389 | 389 |
| 390 FX_BOOL CPWL_Note_CloseBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFl
ag) | 390 bool CPWL_Note_CloseBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag) |
| 391 { | 391 { |
| 392 SetBorderStyle(PBS_INSET); | 392 SetBorderStyle(PBS_INSET); |
| 393 InvalidateRect(NULL); | 393 InvalidateRect(NULL); |
| 394 | 394 |
| 395 » m_bMouseDown = TRUE; | 395 » m_bMouseDown = true; |
| 396 | 396 |
| 397 return CPWL_Button::OnLButtonDown(point,nFlag); | 397 return CPWL_Button::OnLButtonDown(point,nFlag); |
| 398 } | 398 } |
| 399 | 399 |
| 400 FX_BOOL»CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag
) | 400 bool» CPWL_Note_CloseBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag
) |
| 401 { | 401 { |
| 402 » m_bMouseDown = FALSE; | 402 » m_bMouseDown = false; |
| 403 | 403 |
| 404 SetBorderStyle(PBS_BEVELED); | 404 SetBorderStyle(PBS_BEVELED); |
| 405 InvalidateRect(NULL); | 405 InvalidateRect(NULL); |
| 406 | 406 |
| 407 return CPWL_Button::OnLButtonUp(point,nFlag); | 407 return CPWL_Button::OnLButtonUp(point,nFlag); |
| 408 } | 408 } |
| 409 | 409 |
| 410 /* ------------------------------ CPWL_Note_Contents ---------------------------
---- */ | 410 /* ------------------------------ CPWL_Note_Contents ---------------------------
---- */ |
| 411 | 411 |
| 412 CPWL_Note_Contents::CPWL_Note_Contents() : m_pEdit(NULL) | 412 CPWL_Note_Contents::CPWL_Note_Contents() : m_pEdit(NULL) |
| 413 { | 413 { |
| 414 } | 414 } |
| 415 | 415 |
| 416 CPWL_Note_Contents::~CPWL_Note_Contents() | 416 CPWL_Note_Contents::~CPWL_Note_Contents() |
| 417 { | 417 { |
| 418 } | 418 } |
| 419 | 419 |
| 420 CFX_ByteString CPWL_Note_Contents::GetClassName() const | 420 CFX_ByteString CPWL_Note_Contents::GetClassName() const |
| 421 { | 421 { |
| 422 return "CPWL_Note_Contents"; | 422 return "CPWL_Note_Contents"; |
| 423 } | 423 } |
| 424 | 424 |
| 425 void CPWL_Note_Contents::CreateChildWnd(const PWL_CREATEPARAM & cp) | 425 void CPWL_Note_Contents::CreateChildWnd(const PWL_CREATEPARAM & cp) |
| 426 { | 426 { |
| 427 m_pEdit = new CPWL_Note_Edit; | 427 m_pEdit = new CPWL_Note_Edit; |
| 428 PWL_CREATEPARAM ecp = cp; | 428 PWL_CREATEPARAM ecp = cp; |
| 429 ecp.pParentWnd = this; | 429 ecp.pParentWnd = this; |
| 430 ecp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_MULTILINE | PES_AUTORETURN |
PES_TEXTOVERFLOW | PES_UNDO | PES_SPELLCHECK; | 430 ecp.dwFlags = PWS_VISIBLE | PWS_CHILD | PES_MULTILINE | PES_AUTORETURN |
PES_TEXTOVERFLOW | PES_UNDO | PES_SPELLCHECK; |
| 431 | 431 |
| 432 » m_pEdit->EnableNotify(FALSE); | 432 » m_pEdit->EnableNotify(false); |
| 433 m_pEdit->Create(ecp); | 433 m_pEdit->Create(ecp); |
| 434 » m_pEdit->EnableNotify(TRUE); | 434 » m_pEdit->EnableNotify(true); |
| 435 } | 435 } |
| 436 | 436 |
| 437 void CPWL_Note_Contents::SetText(const CFX_WideString& sText) | 437 void CPWL_Note_Contents::SetText(const CFX_WideString& sText) |
| 438 { | 438 { |
| 439 if (m_pEdit) | 439 if (m_pEdit) |
| 440 { | 440 { |
| 441 » » m_pEdit->EnableNotify(FALSE); | 441 » » m_pEdit->EnableNotify(false); |
| 442 m_pEdit->SetText(sText.c_str()); | 442 m_pEdit->SetText(sText.c_str()); |
| 443 » » m_pEdit->EnableNotify(TRUE); | 443 » » m_pEdit->EnableNotify(true); |
| 444 OnNotify(m_pEdit, PNM_NOTEEDITCHANGED, 0, 0); | 444 OnNotify(m_pEdit, PNM_NOTEEDITCHANGED, 0, 0); |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 | 447 |
| 448 CFX_WideString CPWL_Note_Contents::GetText() const | 448 CFX_WideString CPWL_Note_Contents::GetText() const |
| 449 { | 449 { |
| 450 if (m_pEdit) | 450 if (m_pEdit) |
| 451 return m_pEdit->GetText(); | 451 return m_pEdit->GetText(); |
| 452 | 452 |
| 453 return L""; | 453 return L""; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 544 |
| 545 void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
intptr_t lParam) | 545 void CPWL_Note_Contents::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam,
intptr_t lParam) |
| 546 { | 546 { |
| 547 switch (msg) | 547 switch (msg) |
| 548 { | 548 { |
| 549 case PNM_NOTEEDITCHANGED: | 549 case PNM_NOTEEDITCHANGED: |
| 550 { | 550 { |
| 551 int32_t nIndex = GetItemIndex(pWnd); | 551 int32_t nIndex = GetItemIndex(pWnd); |
| 552 if (nIndex < 0) nIndex = 0; | 552 if (nIndex < 0) nIndex = 0; |
| 553 | 553 |
| 554 » » » m_pEdit->EnableNotify(FALSE); | 554 » » » m_pEdit->EnableNotify(false); |
| 555 ResetContent(nIndex); | 555 ResetContent(nIndex); |
| 556 » » » m_pEdit->EnableNotify(TRUE); | 556 » » » m_pEdit->EnableNotify(true); |
| 557 | 557 |
| 558 for (int32_t i=nIndex+1, sz=m_aChildren.GetSize(); i<sz;
i++) | 558 for (int32_t i=nIndex+1, sz=m_aChildren.GetSize(); i<sz;
i++) |
| 559 { | 559 { |
| 560 if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) | 560 if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) |
| 561 pChild->OnNotify(this, PNM_NOTERESET, 0,
0); | 561 pChild->OnNotify(this, PNM_NOTERESET, 0,
0); |
| 562 } | 562 } |
| 563 | 563 |
| 564 if (CPWL_Wnd * pParent = GetParentWindow()) | 564 if (CPWL_Wnd * pParent = GetParentWindow()) |
| 565 { | 565 { |
| 566 pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0,
0); | 566 pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0,
0); |
| 567 } | 567 } |
| 568 } | 568 } |
| 569 return; | 569 return; |
| 570 case PNM_SCROLLWINDOW: | 570 case PNM_SCROLLWINDOW: |
| 571 SetScrollPos(CPDF_Point(0.0f, *(FX_FLOAT*)lParam)); | 571 SetScrollPos(CPDF_Point(0.0f, *(FX_FLOAT*)lParam)); |
| 572 ResetFace(); | 572 ResetFace(); |
| 573 InvalidateRect(NULL); | 573 InvalidateRect(NULL); |
| 574 return; | 574 return; |
| 575 case PNM_SETCARETINFO: | 575 case PNM_SETCARETINFO: |
| 576 if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam) | 576 if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam) |
| 577 { | 577 { |
| 578 PWL_CARET_INFO newInfo = *pInfo; | 578 PWL_CARET_INFO newInfo = *pInfo; |
| 579 » » » newInfo.bVisible = TRUE; | 579 » » » newInfo.bVisible = true; |
| 580 newInfo.ptHead = ChildToParent(pInfo->ptHead); | 580 newInfo.ptHead = ChildToParent(pInfo->ptHead); |
| 581 newInfo.ptFoot = ChildToParent(pInfo->ptFoot); | 581 newInfo.ptFoot = ChildToParent(pInfo->ptFoot); |
| 582 | 582 |
| 583 if (CPWL_Wnd * pParent = GetParentWindow()) | 583 if (CPWL_Wnd * pParent = GetParentWindow()) |
| 584 { | 584 { |
| 585 pParent->OnNotify(this, PNM_SETCARETINFO, (intpt
r_t)&newInfo, 0); | 585 pParent->OnNotify(this, PNM_SETCARETINFO, (intpt
r_t)&newInfo, 0); |
| 586 } | 586 } |
| 587 } | 587 } |
| 588 return; | 588 return; |
| 589 case PNM_NOTERESET: | 589 case PNM_NOTERESET: |
| 590 { | 590 { |
| 591 » » » m_pEdit->EnableNotify(FALSE); | 591 » » » m_pEdit->EnableNotify(false); |
| 592 ResetContent(0); | 592 ResetContent(0); |
| 593 » » » m_pEdit->EnableNotify(TRUE); | 593 » » » m_pEdit->EnableNotify(true); |
| 594 | 594 |
| 595 for (int32_t i=1, sz=m_aChildren.GetSize(); i<sz; i++) | 595 for (int32_t i=1, sz=m_aChildren.GetSize(); i<sz; i++) |
| 596 { | 596 { |
| 597 if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) | 597 if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) |
| 598 pChild->OnNotify(this, PNM_NOTERESET, 0,
0); | 598 pChild->OnNotify(this, PNM_NOTERESET, 0,
0); |
| 599 } | 599 } |
| 600 | 600 |
| 601 » » » m_pEdit->EnableNotify(FALSE); | 601 » » » m_pEdit->EnableNotify(false); |
| 602 ResetContent(0); | 602 ResetContent(0); |
| 603 » » » m_pEdit->EnableNotify(TRUE); | 603 » » » m_pEdit->EnableNotify(true); |
| 604 } | 604 } |
| 605 return; | 605 return; |
| 606 } | 606 } |
| 607 | 607 |
| 608 CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam); | 608 CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam); |
| 609 } | 609 } |
| 610 | 610 |
| 611 FX_BOOL»CPWL_Note_Contents::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFl
ag) | 611 bool» CPWL_Note_Contents::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFl
ag) |
| 612 { | 612 { |
| 613 » if (CPWL_Wnd::OnLButtonDown(point,nFlag)) return TRUE; | 613 » if (CPWL_Wnd::OnLButtonDown(point,nFlag)) return true; |
| 614 | 614 |
| 615 if (!m_pEdit->IsFocused()) | 615 if (!m_pEdit->IsFocused()) |
| 616 { | 616 { |
| 617 m_pEdit->SetFocus(); | 617 m_pEdit->SetFocus(); |
| 618 } | 618 } |
| 619 | 619 |
| 620 » return TRUE; | 620 » return true; |
| 621 } | 621 } |
| 622 | 622 |
| 623 void CPWL_Note_Contents::SetEditFocus(FX_BOOL bLast) | 623 void CPWL_Note_Contents::SetEditFocus(bool bLast) |
| 624 { | 624 { |
| 625 if (!m_pEdit->IsFocused()) | 625 if (!m_pEdit->IsFocused()) |
| 626 { | 626 { |
| 627 m_pEdit->SetFocus(); | 627 m_pEdit->SetFocus(); |
| 628 m_pEdit->SetCaret(bLast ? m_pEdit->GetTotalWords() : 0); | 628 m_pEdit->SetCaret(bLast ? m_pEdit->GetTotalWords() : 0); |
| 629 } | 629 } |
| 630 } | 630 } |
| 631 | 631 |
| 632 CPWL_Edit* CPWL_Note_Contents::GetEdit() const | 632 CPWL_Edit* CPWL_Note_Contents::GetEdit() const |
| 633 { | 633 { |
| 634 return m_pEdit; | 634 return m_pEdit; |
| 635 } | 635 } |
| 636 | 636 |
| 637 void CPWL_Note_Contents::EnableModify(FX_BOOL bEnabled) | 637 void CPWL_Note_Contents::EnableModify(bool bEnabled) |
| 638 { | 638 { |
| 639 if (!bEnabled) | 639 if (!bEnabled) |
| 640 m_pEdit->AddFlag(PWS_READONLY); | 640 m_pEdit->AddFlag(PWS_READONLY); |
| 641 else | 641 else |
| 642 m_pEdit->RemoveFlag(PWS_READONLY); | 642 m_pEdit->RemoveFlag(PWS_READONLY); |
| 643 | 643 |
| 644 for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) | 644 for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) |
| 645 { | 645 { |
| 646 if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) | 646 if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) |
| 647 { | 647 { |
| 648 if (pChild->GetClassName() == "CPWL_NoteItem") | 648 if (pChild->GetClassName() == "CPWL_NoteItem") |
| 649 { | 649 { |
| 650 CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChil
d; | 650 CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChil
d; |
| 651 pNoteItem->EnableModify(bEnabled); | 651 pNoteItem->EnableModify(bEnabled); |
| 652 } | 652 } |
| 653 } | 653 } |
| 654 } | 654 } |
| 655 } | 655 } |
| 656 | 656 |
| 657 void CPWL_Note_Contents::EnableRead(FX_BOOL bEnabled) | 657 void CPWL_Note_Contents::EnableRead(bool bEnabled) |
| 658 { | 658 { |
| 659 if (!bEnabled) | 659 if (!bEnabled) |
| 660 m_pEdit->AddFlag(PES_NOREAD); | 660 m_pEdit->AddFlag(PES_NOREAD); |
| 661 else | 661 else |
| 662 m_pEdit->RemoveFlag(PES_NOREAD); | 662 m_pEdit->RemoveFlag(PES_NOREAD); |
| 663 | 663 |
| 664 for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) | 664 for (int32_t i=0,sz=m_aChildren.GetSize(); i<sz; i++) |
| 665 { | 665 { |
| 666 if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) | 666 if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) |
| 667 { | 667 { |
| 668 if (pChild->GetClassName() == "CPWL_NoteItem") | 668 if (pChild->GetClassName() == "CPWL_NoteItem") |
| 669 { | 669 { |
| 670 CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChil
d; | 670 CPWL_NoteItem* pNoteItem = (CPWL_NoteItem*)pChil
d; |
| 671 pNoteItem->EnableRead(bEnabled); | 671 pNoteItem->EnableRead(bEnabled); |
| 672 } | 672 } |
| 673 } | 673 } |
| 674 } | 674 } |
| 675 } | 675 } |
| 676 | 676 |
| 677 /* ---------------------------------- CPWL_NoteItem ----------------------------
------ */ | 677 /* ---------------------------------- CPWL_NoteItem ----------------------------
------ */ |
| 678 | 678 |
| 679 CPWL_NoteItem::CPWL_NoteItem() : | 679 CPWL_NoteItem::CPWL_NoteItem() : |
| 680 m_pSubject(NULL), | 680 m_pSubject(NULL), |
| 681 m_pDateTime(NULL), | 681 m_pDateTime(NULL), |
| 682 m_pContents(NULL), | 682 m_pContents(NULL), |
| 683 m_pPrivateData(NULL), | 683 m_pPrivateData(NULL), |
| 684 m_sAuthor(L""), | 684 m_sAuthor(L""), |
| 685 m_fOldItemHeight(0.0f), | 685 m_fOldItemHeight(0.0f), |
| 686 » m_bSizeChanged(FALSE), | 686 » m_bSizeChanged(false), |
| 687 » m_bAllowModify(TRUE) | 687 » m_bAllowModify(true) |
| 688 { | 688 { |
| 689 } | 689 } |
| 690 | 690 |
| 691 CPWL_NoteItem::~CPWL_NoteItem() | 691 CPWL_NoteItem::~CPWL_NoteItem() |
| 692 { | 692 { |
| 693 } | 693 } |
| 694 | 694 |
| 695 CFX_ByteString CPWL_NoteItem::GetClassName() const | 695 CFX_ByteString CPWL_NoteItem::GetClassName() const |
| 696 { | 696 { |
| 697 return "CPWL_NoteItem"; | 697 return "CPWL_NoteItem"; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 ASSERT(m_pContents != NULL); | 741 ASSERT(m_pContents != NULL); |
| 742 | 742 |
| 743 CPDF_Rect rcClient = GetClientRect(); | 743 CPDF_Rect rcClient = GetClientRect(); |
| 744 | 744 |
| 745 CPDF_Rect rcSubject = rcClient; | 745 CPDF_Rect rcSubject = rcClient; |
| 746 rcSubject.left += POPUP_ITEM_TEXT_INDENT; | 746 rcSubject.left += POPUP_ITEM_TEXT_INDENT; |
| 747 rcSubject.top = rcClient.top; | 747 rcSubject.top = rcClient.top; |
| 748 rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetConten
tRect().Width() + 1.0f, rcClient.right); | 748 rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetConten
tRect().Width() + 1.0f, rcClient.right); |
| 749 rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().
Height(); | 749 rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().
Height(); |
| 750 rcSubject.Normalize(); | 750 rcSubject.Normalize(); |
| 751 » » m_pSubject->Move(rcSubject, TRUE, FALSE); | 751 » » m_pSubject->Move(rcSubject, true, false); |
| 752 m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubj
ect)); | 752 m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubj
ect)); |
| 753 | 753 |
| 754 CPDF_Rect rcDate = rcClient; | 754 CPDF_Rect rcDate = rcClient; |
| 755 rcDate.right -= POPUP_ITEM_TEXT_INDENT; | 755 rcDate.right -= POPUP_ITEM_TEXT_INDENT; |
| 756 rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect
().Width() - 1.0f, rcSubject.right); | 756 rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect
().Width() - 1.0f, rcSubject.right); |
| 757 rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Heigh
t(); | 757 rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Heigh
t(); |
| 758 rcDate.Normalize(); | 758 rcDate.Normalize(); |
| 759 » » m_pDateTime->Move(rcDate, TRUE, FALSE); | 759 » » m_pDateTime->Move(rcDate, true, false); |
| 760 m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDat
e)); | 760 m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDat
e)); |
| 761 | 761 |
| 762 CPDF_Rect rcContents = rcClient; | 762 CPDF_Rect rcContents = rcClient; |
| 763 rcContents.left += 1.0f; | 763 rcContents.left += 1.0f; |
| 764 rcContents.right -= 1.0f; | 764 rcContents.right -= 1.0f; |
| 765 rcContents.top = rcDate.bottom - POPUP_ITEM_HEAD_BOTTOM; | 765 rcContents.top = rcDate.bottom - POPUP_ITEM_HEAD_BOTTOM; |
| 766 rcContents.bottom += POPUP_ITEM_BOTTOMWIDTH; | 766 rcContents.bottom += POPUP_ITEM_BOTTOMWIDTH; |
| 767 rcContents.Normalize(); | 767 rcContents.Normalize(); |
| 768 » » m_pContents->Move(rcContents, TRUE, FALSE); | 768 » » m_pContents->Move(rcContents, true, false); |
| 769 m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcCon
tents)); | 769 m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcCon
tents)); |
| 770 } | 770 } |
| 771 | 771 |
| 772 SetClipRect(CPWL_Utils::InflateRect(GetWindowRect(),1.0f)); | 772 SetClipRect(CPWL_Utils::InflateRect(GetWindowRect(),1.0f)); |
| 773 } | 773 } |
| 774 | 774 |
| 775 void CPWL_NoteItem::SetPrivateData(void* pData) | 775 void CPWL_NoteItem::SetPrivateData(void* pData) |
| 776 { | 776 { |
| 777 m_pPrivateData = pData; | 777 m_pPrivateData = pData; |
| 778 } | 778 } |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 return NULL; | 1031 return NULL; |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 FX_FLOAT CPWL_NoteItem::GetItemHeight(FX_FLOAT fLimitWidth) | 1034 FX_FLOAT CPWL_NoteItem::GetItemHeight(FX_FLOAT fLimitWidth) |
| 1035 { | 1035 { |
| 1036 if (fLimitWidth > 0) | 1036 if (fLimitWidth > 0) |
| 1037 { | 1037 { |
| 1038 if (!m_bSizeChanged) | 1038 if (!m_bSizeChanged) |
| 1039 return m_fOldItemHeight; | 1039 return m_fOldItemHeight; |
| 1040 | 1040 |
| 1041 » » m_bSizeChanged = FALSE; | 1041 » » m_bSizeChanged = false; |
| 1042 | 1042 |
| 1043 ASSERT(m_pSubject != NULL); | 1043 ASSERT(m_pSubject != NULL); |
| 1044 ASSERT(m_pDateTime != NULL); | 1044 ASSERT(m_pDateTime != NULL); |
| 1045 ASSERT(m_pContents != NULL); | 1045 ASSERT(m_pContents != NULL); |
| 1046 | 1046 |
| 1047 FX_FLOAT fRet = m_pDateTime->GetContentRect().Height(); | 1047 FX_FLOAT fRet = m_pDateTime->GetContentRect().Height(); |
| 1048 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); | 1048 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); |
| 1049 if (fLimitWidth > fBorderWidth * 2) | 1049 if (fLimitWidth > fBorderWidth * 2) |
| 1050 fRet += m_pContents->GetContentsHeight(fLimitWidth - fBo
rderWidth * 2); | 1050 fRet += m_pContents->GetContentsHeight(fLimitWidth - fBo
rderWidth * 2); |
| 1051 fRet += POPUP_ITEM_HEAD_BOTTOM + POPUP_ITEM_BOTTOMWIDTH + fBorde
rWidth * 2; | 1051 fRet += POPUP_ITEM_HEAD_BOTTOM + POPUP_ITEM_BOTTOMWIDTH + fBorde
rWidth * 2; |
| 1052 | 1052 |
| 1053 return m_fOldItemHeight = fRet; | 1053 return m_fOldItemHeight = fRet; |
| 1054 } | 1054 } |
| 1055 | 1055 |
| 1056 return 0; | 1056 return 0; |
| 1057 } | 1057 } |
| 1058 | 1058 |
| 1059 FX_FLOAT CPWL_NoteItem::GetItemLeftMargin() | 1059 FX_FLOAT CPWL_NoteItem::GetItemLeftMargin() |
| 1060 { | 1060 { |
| 1061 return POPUP_ITEM_SIDEMARGIN; | 1061 return POPUP_ITEM_SIDEMARGIN; |
| 1062 } | 1062 } |
| 1063 | 1063 |
| 1064 FX_FLOAT CPWL_NoteItem::GetItemRightMargin() | 1064 FX_FLOAT CPWL_NoteItem::GetItemRightMargin() |
| 1065 { | 1065 { |
| 1066 return POPUP_ITEM_SIDEMARGIN; | 1066 return POPUP_ITEM_SIDEMARGIN; |
| 1067 } | 1067 } |
| 1068 | 1068 |
| 1069 FX_BOOL»CPWL_NoteItem::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) | 1069 bool» CPWL_NoteItem::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) |
| 1070 { | 1070 { |
| 1071 if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point))) | 1071 if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point))) |
| 1072 { | 1072 { |
| 1073 » » SetNoteFocus(FALSE); | 1073 » » SetNoteFocus(false); |
| 1074 } | 1074 } |
| 1075 | 1075 |
| 1076 CPWL_Wnd::OnLButtonDown(point,nFlag); | 1076 CPWL_Wnd::OnLButtonDown(point,nFlag); |
| 1077 | 1077 |
| 1078 » return TRUE; | 1078 » return true; |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 FX_BOOL»CPWL_NoteItem::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) | 1081 bool» CPWL_NoteItem::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) |
| 1082 { | 1082 { |
| 1083 if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point))) | 1083 if (!m_pContents->WndHitTest(m_pContents->ParentToChild(point))) |
| 1084 { | 1084 { |
| 1085 » » SetNoteFocus(FALSE); | 1085 » » SetNoteFocus(false); |
| 1086 PopupNoteItemMenu(point); | 1086 PopupNoteItemMenu(point); |
| 1087 | 1087 |
| 1088 » » return TRUE; | 1088 » » return true; |
| 1089 } | 1089 } |
| 1090 | 1090 |
| 1091 return CPWL_Wnd::OnRButtonUp(point,nFlag); | 1091 return CPWL_Wnd::OnRButtonUp(point,nFlag); |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
tr_t lParam) | 1094 void CPWL_NoteItem::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp
tr_t lParam) |
| 1095 { | 1095 { |
| 1096 switch (msg) | 1096 switch (msg) |
| 1097 { | 1097 { |
| 1098 case PNM_NOTEEDITCHANGED: | 1098 case PNM_NOTEEDITCHANGED: |
| 1099 » » m_bSizeChanged = TRUE; | 1099 » » m_bSizeChanged = true; |
| 1100 | 1100 |
| 1101 if (CPWL_Wnd* pParent = GetParentWindow()) | 1101 if (CPWL_Wnd* pParent = GetParentWindow()) |
| 1102 { | 1102 { |
| 1103 pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0); | 1103 pParent->OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0); |
| 1104 } | 1104 } |
| 1105 return; | 1105 return; |
| 1106 case PNM_SETCARETINFO: | 1106 case PNM_SETCARETINFO: |
| 1107 if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam) | 1107 if (PWL_CARET_INFO * pInfo = (PWL_CARET_INFO*)wParam) |
| 1108 { | 1108 { |
| 1109 PWL_CARET_INFO newInfo = *pInfo; | 1109 PWL_CARET_INFO newInfo = *pInfo; |
| 1110 » » » newInfo.bVisible = TRUE; | 1110 » » » newInfo.bVisible = true; |
| 1111 newInfo.ptHead = ChildToParent(pInfo->ptHead); | 1111 newInfo.ptHead = ChildToParent(pInfo->ptHead); |
| 1112 newInfo.ptFoot = ChildToParent(pInfo->ptFoot); | 1112 newInfo.ptFoot = ChildToParent(pInfo->ptFoot); |
| 1113 | 1113 |
| 1114 if (CPWL_Wnd * pParent = GetParentWindow()) | 1114 if (CPWL_Wnd * pParent = GetParentWindow()) |
| 1115 { | 1115 { |
| 1116 pParent->OnNotify(this, PNM_SETCARETINFO, (intpt
r_t)&newInfo, 0); | 1116 pParent->OnNotify(this, PNM_SETCARETINFO, (intpt
r_t)&newInfo, 0); |
| 1117 } | 1117 } |
| 1118 } | 1118 } |
| 1119 return; | 1119 return; |
| 1120 case PNM_NOTERESET: | 1120 case PNM_NOTERESET: |
| 1121 » » m_bSizeChanged = TRUE; | 1121 » » m_bSizeChanged = true; |
| 1122 m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); | 1122 m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); |
| 1123 | 1123 |
| 1124 return; | 1124 return; |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam); | 1127 CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam); |
| 1128 } | 1128 } |
| 1129 | 1129 |
| 1130 void CPWL_NoteItem::PopupNoteItemMenu(const CPDF_Point& point) | 1130 void CPWL_NoteItem::PopupNoteItemMenu(const CPDF_Point& point) |
| 1131 { | 1131 { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 } | 1171 } |
| 1172 | 1172 |
| 1173 void CPWL_NoteItem::OnContentsValidate() | 1173 void CPWL_NoteItem::OnContentsValidate() |
| 1174 { | 1174 { |
| 1175 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) | 1175 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) |
| 1176 { | 1176 { |
| 1177 pNotify->OnSetContents(this); | 1177 pNotify->OnSetContents(this); |
| 1178 } | 1178 } |
| 1179 } | 1179 } |
| 1180 | 1180 |
| 1181 void CPWL_NoteItem::SetNoteFocus(FX_BOOL bLast) | 1181 void CPWL_NoteItem::SetNoteFocus(bool bLast) |
| 1182 { | 1182 { |
| 1183 m_pContents->SetEditFocus(bLast); | 1183 m_pContents->SetEditFocus(bLast); |
| 1184 } | 1184 } |
| 1185 | 1185 |
| 1186 void CPWL_NoteItem::EnableModify(FX_BOOL bEnabled) | 1186 void CPWL_NoteItem::EnableModify(bool bEnabled) |
| 1187 { | 1187 { |
| 1188 m_pContents->EnableModify(bEnabled); | 1188 m_pContents->EnableModify(bEnabled); |
| 1189 m_bAllowModify = bEnabled; | 1189 m_bAllowModify = bEnabled; |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 void CPWL_NoteItem::EnableRead(FX_BOOL bEnabled) | 1192 void CPWL_NoteItem::EnableRead(bool bEnabled) |
| 1193 { | 1193 { |
| 1194 m_pContents->EnableRead(bEnabled); | 1194 m_pContents->EnableRead(bEnabled); |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 /* ---------------------------------- CPWL_Note --------------------------------
-- */ | 1197 /* ---------------------------------- CPWL_Note --------------------------------
-- */ |
| 1198 | 1198 |
| 1199 CPWL_Note::CPWL_Note(IPopup_Note* pPopupNote, IPWL_NoteNotify* pNoteNotify, IPWL
_NoteHandler* pNoteHandler) : | 1199 CPWL_Note::CPWL_Note(IPopup_Note* pPopupNote, IPWL_NoteNotify* pNoteNotify, IPWL
_NoteHandler* pNoteHandler) : |
| 1200 m_pAuthor(NULL), | 1200 m_pAuthor(NULL), |
| 1201 m_pIcon(NULL), | 1201 m_pIcon(NULL), |
| 1202 m_pCloseBox(NULL), | 1202 m_pCloseBox(NULL), |
| 1203 m_pLBBox(NULL), | 1203 m_pLBBox(NULL), |
| 1204 m_pRBBox(NULL), | 1204 m_pRBBox(NULL), |
| 1205 m_pContentsBar(NULL), | 1205 m_pContentsBar(NULL), |
| 1206 m_pOptions(NULL), | 1206 m_pOptions(NULL), |
| 1207 m_pNoteNotify(pNoteNotify), | 1207 m_pNoteNotify(pNoteNotify), |
| 1208 » m_bResizing(FALSE), | 1208 » m_bResizing(false), |
| 1209 m_rcCaption(0,0,0,0), | 1209 m_rcCaption(0,0,0,0), |
| 1210 » m_bEnalbleNotify(TRUE), | 1210 » m_bEnalbleNotify(true), |
| 1211 m_pPopupNote(pPopupNote) | 1211 m_pPopupNote(pPopupNote) |
| 1212 { | 1212 { |
| 1213 } | 1213 } |
| 1214 | 1214 |
| 1215 CPWL_Note::~CPWL_Note() | 1215 CPWL_Note::~CPWL_Note() |
| 1216 { | 1216 { |
| 1217 } | 1217 } |
| 1218 | 1218 |
| 1219 IPWL_NoteItem* CPWL_Note::Reply() | 1219 IPWL_NoteItem* CPWL_Note::Reply() |
| 1220 { | 1220 { |
| 1221 return CreateNoteItem(); | 1221 return CreateNoteItem(); |
| 1222 } | 1222 } |
| 1223 | 1223 |
| 1224 void CPWL_Note::EnableNotify(FX_BOOL bEnabled) | 1224 void CPWL_Note::EnableNotify(bool bEnabled) |
| 1225 { | 1225 { |
| 1226 m_bEnalbleNotify = bEnabled; | 1226 m_bEnalbleNotify = bEnabled; |
| 1227 } | 1227 } |
| 1228 | 1228 |
| 1229 void CPWL_Note::RePosChildWnd() | 1229 void CPWL_Note::RePosChildWnd() |
| 1230 { | 1230 { |
| 1231 RePosNoteChildren(); | 1231 RePosNoteChildren(); |
| 1232 m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); | 1232 m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); |
| 1233 ResetScrollBar(); | 1233 ResetScrollBar(); |
| 1234 m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); | 1234 m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); |
| 1235 OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0); | 1235 OnNotify(this, PNM_NOTEEDITCHANGED, 0, 0); |
| 1236 if (const CPWL_Wnd* pWnd = GetFocused()) | 1236 if (const CPWL_Wnd* pWnd = GetFocused()) |
| 1237 { | 1237 { |
| 1238 if (pWnd->GetClassName() == "CPWL_Edit") | 1238 if (pWnd->GetClassName() == "CPWL_Edit") |
| 1239 { | 1239 { |
| 1240 CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; | 1240 CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; |
| 1241 pEdit->SetCaret(pEdit->GetCaret()); | 1241 pEdit->SetCaret(pEdit->GetCaret()); |
| 1242 } | 1242 } |
| 1243 } | 1243 } |
| 1244 } | 1244 } |
| 1245 | 1245 |
| 1246 FX_BOOL CPWL_Note::ResetScrollBar() | 1246 bool CPWL_Note::ResetScrollBar() |
| 1247 { | 1247 { |
| 1248 » FX_BOOL bScrollChanged = FALSE; | 1248 » bool bScrollChanged = false; |
| 1249 | 1249 |
| 1250 if (ScrollBarShouldVisible()) | 1250 if (ScrollBarShouldVisible()) |
| 1251 { | 1251 { |
| 1252 if (!m_pContentsBar->IsVisible()) | 1252 if (!m_pContentsBar->IsVisible()) |
| 1253 { | 1253 { |
| 1254 » » » m_pContentsBar->SetVisible(TRUE); | 1254 » » » m_pContentsBar->SetVisible(true); |
| 1255 if (m_pContentsBar->IsVisible()) | 1255 if (m_pContentsBar->IsVisible()) |
| 1256 { | 1256 { |
| 1257 m_pContentsBar->InvalidateRect(NULL); | 1257 m_pContentsBar->InvalidateRect(NULL); |
| 1258 » » » » bScrollChanged = TRUE; | 1258 » » » » bScrollChanged = true; |
| 1259 } | 1259 } |
| 1260 } | 1260 } |
| 1261 } | 1261 } |
| 1262 else | 1262 else |
| 1263 { | 1263 { |
| 1264 if (m_pContentsBar->IsVisible()) | 1264 if (m_pContentsBar->IsVisible()) |
| 1265 { | 1265 { |
| 1266 » » » m_pContentsBar->SetVisible(FALSE); | 1266 » » » m_pContentsBar->SetVisible(false); |
| 1267 m_pContentsBar->InvalidateRect(NULL); | 1267 m_pContentsBar->InvalidateRect(NULL); |
| 1268 | 1268 |
| 1269 » » » bScrollChanged = TRUE; | 1269 » » » bScrollChanged = true; |
| 1270 } | 1270 } |
| 1271 } | 1271 } |
| 1272 | 1272 |
| 1273 if (bScrollChanged) | 1273 if (bScrollChanged) |
| 1274 { | 1274 { |
| 1275 CPDF_Rect rcNote = GetClientRect(); | 1275 CPDF_Rect rcNote = GetClientRect(); |
| 1276 CPDF_Rect rcContents = m_pContents->GetWindowRect(); | 1276 CPDF_Rect rcContents = m_pContents->GetWindowRect(); |
| 1277 rcContents.right = rcNote.right - 3.0f; | 1277 rcContents.right = rcNote.right - 3.0f; |
| 1278 if (m_pContentsBar->IsVisible()) | 1278 if (m_pContentsBar->IsVisible()) |
| 1279 rcContents.right -= PWL_SCROLLBAR_WIDTH; | 1279 rcContents.right -= PWL_SCROLLBAR_WIDTH; |
| 1280 » » m_pContents->Move(rcContents, TRUE, TRUE); | 1280 » » m_pContents->Move(rcContents, true, true); |
| 1281 m_pContents->SetScrollPos(CPDF_Point(0.0f,0.0f)); | 1281 m_pContents->SetScrollPos(CPDF_Point(0.0f,0.0f)); |
| 1282 m_pContents->InvalidateRect(NULL); | 1282 m_pContents->InvalidateRect(NULL); |
| 1283 } | 1283 } |
| 1284 | 1284 |
| 1285 return bScrollChanged; | 1285 return bScrollChanged; |
| 1286 } | 1286 } |
| 1287 | 1287 |
| 1288 FX_BOOL CPWL_Note::ScrollBarShouldVisible() | 1288 bool CPWL_Note::ScrollBarShouldVisible() |
| 1289 { | 1289 { |
| 1290 CPDF_Rect rcContentsFact = m_pContents->GetScrollArea(); | 1290 CPDF_Rect rcContentsFact = m_pContents->GetScrollArea(); |
| 1291 CPDF_Rect rcContentsClient = m_pContents->GetClientRect(); | 1291 CPDF_Rect rcContentsClient = m_pContents->GetClientRect(); |
| 1292 | 1292 |
| 1293 return rcContentsFact.Height() > rcContentsClient.Height(); | 1293 return rcContentsFact.Height() > rcContentsClient.Height(); |
| 1294 } | 1294 } |
| 1295 | 1295 |
| 1296 void CPWL_Note::SetOptionsText(const CFX_WideString& sText) | 1296 void CPWL_Note::SetOptionsText(const CFX_WideString& sText) |
| 1297 { | 1297 { |
| 1298 if (m_pOptions) | 1298 if (m_pOptions) |
| 1299 m_pOptions->SetText(sText); | 1299 m_pOptions->SetText(sText); |
| 1300 | 1300 |
| 1301 RePosNoteChildren(); | 1301 RePosNoteChildren(); |
| 1302 } | 1302 } |
| 1303 | 1303 |
| 1304 void CPWL_Note::RePosNoteChildren() | 1304 void CPWL_Note::RePosNoteChildren() |
| 1305 { | 1305 { |
| 1306 if (m_bResizing) return; | 1306 if (m_bResizing) return; |
| 1307 | 1307 |
| 1308 » m_bResizing = TRUE; | 1308 » m_bResizing = true; |
| 1309 | 1309 |
| 1310 if (IsValid()) | 1310 if (IsValid()) |
| 1311 { | 1311 { |
| 1312 ASSERT(m_pSubject != NULL); | 1312 ASSERT(m_pSubject != NULL); |
| 1313 ASSERT(m_pDateTime != NULL); | 1313 ASSERT(m_pDateTime != NULL); |
| 1314 ASSERT(m_pContents != NULL); | 1314 ASSERT(m_pContents != NULL); |
| 1315 ASSERT(m_pAuthor != NULL); | 1315 ASSERT(m_pAuthor != NULL); |
| 1316 ASSERT(m_pCloseBox != NULL); | 1316 ASSERT(m_pCloseBox != NULL); |
| 1317 ASSERT(m_pIcon != NULL); | 1317 ASSERT(m_pIcon != NULL); |
| 1318 ASSERT(m_pLBBox != NULL); | 1318 ASSERT(m_pLBBox != NULL); |
| 1319 ASSERT(m_pRBBox != NULL); | 1319 ASSERT(m_pRBBox != NULL); |
| 1320 ASSERT(m_pContentsBar != NULL); | 1320 ASSERT(m_pContentsBar != NULL); |
| 1321 ASSERT(m_pOptions != NULL); | 1321 ASSERT(m_pOptions != NULL); |
| 1322 | 1322 |
| 1323 CPDF_Rect rcClient = GetClientRect(); | 1323 CPDF_Rect rcClient = GetClientRect(); |
| 1324 | 1324 |
| 1325 CPDF_Rect rcIcon = rcClient; | 1325 CPDF_Rect rcIcon = rcClient; |
| 1326 rcIcon.top -= 2.0f; | 1326 rcIcon.top -= 2.0f; |
| 1327 rcIcon.right = rcIcon.left + 14.0f; | 1327 rcIcon.right = rcIcon.left + 14.0f; |
| 1328 rcIcon.bottom = rcIcon.top - 14.0f; | 1328 rcIcon.bottom = rcIcon.top - 14.0f; |
| 1329 rcIcon.Normalize(); | 1329 rcIcon.Normalize(); |
| 1330 » » m_pIcon->Move(rcIcon, TRUE, FALSE); | 1330 » » m_pIcon->Move(rcIcon, true, false); |
| 1331 m_pIcon->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcIcon)); | 1331 m_pIcon->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcIcon)); |
| 1332 | 1332 |
| 1333 CPDF_Rect rcCloseBox = rcClient; | 1333 CPDF_Rect rcCloseBox = rcClient; |
| 1334 rcCloseBox.right -= 1.0f; | 1334 rcCloseBox.right -= 1.0f; |
| 1335 rcCloseBox.top -= 1.0f; | 1335 rcCloseBox.top -= 1.0f; |
| 1336 rcCloseBox.left = rcCloseBox.right - 14.0f; | 1336 rcCloseBox.left = rcCloseBox.right - 14.0f; |
| 1337 rcCloseBox.bottom = rcCloseBox.top - 14.0f; | 1337 rcCloseBox.bottom = rcCloseBox.top - 14.0f; |
| 1338 rcCloseBox.Normalize(); | 1338 rcCloseBox.Normalize(); |
| 1339 » » m_pCloseBox->Move(rcCloseBox, TRUE, FALSE); | 1339 » » m_pCloseBox->Move(rcCloseBox, true, false); |
| 1340 m_pCloseBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcClo
seBox)); | 1340 m_pCloseBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcClo
seBox)); |
| 1341 | 1341 |
| 1342 CPDF_Rect rcDate = rcClient; | 1342 CPDF_Rect rcDate = rcClient; |
| 1343 rcDate.right = rcCloseBox.left - POPUP_ITEM_TEXT_INDENT; | 1343 rcDate.right = rcCloseBox.left - POPUP_ITEM_TEXT_INDENT; |
| 1344 rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect
().Width() - 1.0f, rcIcon.right + 1.0f); | 1344 rcDate.left = PWL_MAX(rcDate.right - m_pDateTime->GetContentRect
().Width() - 1.0f, rcIcon.right + 1.0f); |
| 1345 rcDate.top = rcClient.top - 2.0f; | 1345 rcDate.top = rcClient.top - 2.0f; |
| 1346 rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Heigh
t(); | 1346 rcDate.bottom = rcDate.top - m_pDateTime->GetContentRect().Heigh
t(); |
| 1347 rcDate.Normalize(); | 1347 rcDate.Normalize(); |
| 1348 » » m_pDateTime->Move(rcDate, TRUE, FALSE); | 1348 » » m_pDateTime->Move(rcDate, true, false); |
| 1349 m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDat
e)); | 1349 m_pDateTime->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcDat
e)); |
| 1350 | 1350 |
| 1351 CPDF_Rect rcSubject = rcClient; | 1351 CPDF_Rect rcSubject = rcClient; |
| 1352 rcSubject.top = rcClient.top - 2.0f; | 1352 rcSubject.top = rcClient.top - 2.0f; |
| 1353 rcSubject.left = rcIcon.right + POPUP_ITEM_TEXT_INDENT; | 1353 rcSubject.left = rcIcon.right + POPUP_ITEM_TEXT_INDENT; |
| 1354 rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetConten
tRect().Width() + 1.0f, rcDate.left - 1.0f); | 1354 rcSubject.right = PWL_MIN(rcSubject.left + m_pSubject->GetConten
tRect().Width() + 1.0f, rcDate.left - 1.0f); |
| 1355 rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().
Height(); | 1355 rcSubject.bottom = rcSubject.top - m_pSubject->GetContentRect().
Height(); |
| 1356 rcSubject.Normalize(); | 1356 rcSubject.Normalize(); |
| 1357 » » m_pSubject->Move(rcSubject, TRUE, FALSE); | 1357 » » m_pSubject->Move(rcSubject, true, false); |
| 1358 m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubj
ect)); | 1358 m_pSubject->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcSubj
ect)); |
| 1359 | 1359 |
| 1360 CPDF_Rect rcOptions = rcClient; | 1360 CPDF_Rect rcOptions = rcClient; |
| 1361 rcOptions.left = PWL_MAX(rcOptions.right - m_pOptions->GetConten
tRect().Width(), rcIcon.right + 1.0f); | 1361 rcOptions.left = PWL_MAX(rcOptions.right - m_pOptions->GetConten
tRect().Width(), rcIcon.right + 1.0f); |
| 1362 rcOptions.top = rcSubject.bottom - 4.0f; | 1362 rcOptions.top = rcSubject.bottom - 4.0f; |
| 1363 rcOptions.bottom = rcOptions.top - m_pOptions->GetContentRect().
Height(); | 1363 rcOptions.bottom = rcOptions.top - m_pOptions->GetContentRect().
Height(); |
| 1364 rcOptions.Normalize(); | 1364 rcOptions.Normalize(); |
| 1365 » » m_pOptions->Move(rcOptions, TRUE, FALSE); | 1365 » » m_pOptions->Move(rcOptions, true, false); |
| 1366 m_pOptions->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcOpti
ons)); | 1366 m_pOptions->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcOpti
ons)); |
| 1367 | 1367 |
| 1368 CPDF_Rect rcAuthor = rcClient; | 1368 CPDF_Rect rcAuthor = rcClient; |
| 1369 rcAuthor.top = rcSubject.bottom - 4.0f; | 1369 rcAuthor.top = rcSubject.bottom - 4.0f; |
| 1370 rcAuthor.left = rcSubject.left; | 1370 rcAuthor.left = rcSubject.left; |
| 1371 rcAuthor.right = PWL_MIN(rcSubject.left + m_pAuthor->GetContentR
ect().Width() + 1.0f, rcOptions.left - 1.0f); | 1371 rcAuthor.right = PWL_MIN(rcSubject.left + m_pAuthor->GetContentR
ect().Width() + 1.0f, rcOptions.left - 1.0f); |
| 1372 rcAuthor.bottom = rcAuthor.top - m_pAuthor->GetContentRect().Hei
ght(); | 1372 rcAuthor.bottom = rcAuthor.top - m_pAuthor->GetContentRect().Hei
ght(); |
| 1373 rcAuthor.Normalize(); | 1373 rcAuthor.Normalize(); |
| 1374 » » m_pAuthor->Move(rcAuthor, TRUE, FALSE); | 1374 » » m_pAuthor->Move(rcAuthor, true, false); |
| 1375 m_pAuthor->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcAutho
r)); | 1375 m_pAuthor->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcAutho
r)); |
| 1376 | 1376 |
| 1377 CPDF_Rect rcLBBox = rcClient; | 1377 CPDF_Rect rcLBBox = rcClient; |
| 1378 rcLBBox.top = rcLBBox.bottom + 7.0f; | 1378 rcLBBox.top = rcLBBox.bottom + 7.0f; |
| 1379 rcLBBox.right = rcLBBox.left + 7.0f; | 1379 rcLBBox.right = rcLBBox.left + 7.0f; |
| 1380 rcLBBox.Normalize(); | 1380 rcLBBox.Normalize(); |
| 1381 » » m_pLBBox->Move(rcLBBox, TRUE, FALSE); | 1381 » » m_pLBBox->Move(rcLBBox, true, false); |
| 1382 m_pLBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcLBBox)
); | 1382 m_pLBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcLBBox)
); |
| 1383 | 1383 |
| 1384 CPDF_Rect rcRBBox = rcClient; | 1384 CPDF_Rect rcRBBox = rcClient; |
| 1385 rcRBBox.top = rcRBBox.bottom + 7.0f; | 1385 rcRBBox.top = rcRBBox.bottom + 7.0f; |
| 1386 rcRBBox.left = rcRBBox.right - 7.0f; | 1386 rcRBBox.left = rcRBBox.right - 7.0f; |
| 1387 rcRBBox.Normalize(); | 1387 rcRBBox.Normalize(); |
| 1388 » » m_pRBBox->Move(rcRBBox, TRUE, FALSE); | 1388 » » m_pRBBox->Move(rcRBBox, true, false); |
| 1389 m_pRBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcRBBox)
); | 1389 m_pRBBox->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcRBBox)
); |
| 1390 | 1390 |
| 1391 CPDF_Rect rcContents = rcClient; | 1391 CPDF_Rect rcContents = rcClient; |
| 1392 rcContents.top = rcAuthor.bottom - POPUP_ITEM_HEAD_BOTTOM; | 1392 rcContents.top = rcAuthor.bottom - POPUP_ITEM_HEAD_BOTTOM; |
| 1393 rcContents.left += 3.0f; | 1393 rcContents.left += 3.0f; |
| 1394 rcContents.right -= 3.0f; | 1394 rcContents.right -= 3.0f; |
| 1395 if (m_pContentsBar->IsVisible()) | 1395 if (m_pContentsBar->IsVisible()) |
| 1396 rcContents.right -= PWL_SCROLLBAR_WIDTH; | 1396 rcContents.right -= PWL_SCROLLBAR_WIDTH; |
| 1397 rcContents.bottom += 14.0f; | 1397 rcContents.bottom += 14.0f; |
| 1398 rcContents.Normalize(); | 1398 rcContents.Normalize(); |
| 1399 » » m_pContents->Move(rcContents, FALSE, FALSE); | 1399 » » m_pContents->Move(rcContents, false, false); |
| 1400 m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcCon
tents)); | 1400 m_pContents->SetVisible(CPWL_Utils::ContainsRect(rcClient, rcCon
tents)); |
| 1401 | 1401 |
| 1402 CPDF_Rect rcContentsBar = rcContents; | 1402 CPDF_Rect rcContentsBar = rcContents; |
| 1403 rcContentsBar.right = rcClient.right - 3.0f; | 1403 rcContentsBar.right = rcClient.right - 3.0f; |
| 1404 rcContentsBar.left = rcContentsBar.right - PWL_SCROLLBAR_WIDTH; | 1404 rcContentsBar.left = rcContentsBar.right - PWL_SCROLLBAR_WIDTH; |
| 1405 rcContentsBar.Normalize(); | 1405 rcContentsBar.Normalize(); |
| 1406 » » m_pContentsBar->Move(rcContentsBar, TRUE, FALSE); | 1406 » » m_pContentsBar->Move(rcContentsBar, true, false); |
| 1407 | 1407 |
| 1408 m_rcCaption = rcClient; | 1408 m_rcCaption = rcClient; |
| 1409 m_rcCaption.bottom = rcContents.top; | 1409 m_rcCaption.bottom = rcContents.top; |
| 1410 } | 1410 } |
| 1411 | 1411 |
| 1412 » m_bResizing = FALSE; | 1412 » m_bResizing = false; |
| 1413 } | 1413 } |
| 1414 | 1414 |
| 1415 //0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close /
5-options | 1415 //0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close /
5-options |
| 1416 int32_t CPWL_Note::NoteHitTest(const CPDF_Point& point) const | 1416 int32_t CPWL_Note::NoteHitTest(const CPDF_Point& point) const |
| 1417 { | 1417 { |
| 1418 ASSERT(m_pSubject != NULL); | 1418 ASSERT(m_pSubject != NULL); |
| 1419 ASSERT(m_pDateTime != NULL); | 1419 ASSERT(m_pDateTime != NULL); |
| 1420 ASSERT(m_pContents != NULL); | 1420 ASSERT(m_pContents != NULL); |
| 1421 ASSERT(m_pAuthor != NULL); | 1421 ASSERT(m_pAuthor != NULL); |
| 1422 ASSERT(m_pIcon != NULL); | 1422 ASSERT(m_pIcon != NULL); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1500 rcp.eCursorType = FXCT_NWSE; | 1500 rcp.eCursorType = FXCT_NWSE; |
| 1501 rcp.sTextColor = sTextColor; | 1501 rcp.sTextColor = sTextColor; |
| 1502 m_pRBBox->Create(rcp); | 1502 m_pRBBox->Create(rcp); |
| 1503 | 1503 |
| 1504 m_pContentsBar = new CPWL_ScrollBar(SBT_VSCROLL); | 1504 m_pContentsBar = new CPWL_ScrollBar(SBT_VSCROLL); |
| 1505 PWL_CREATEPARAM scp = cp; | 1505 PWL_CREATEPARAM scp = cp; |
| 1506 scp.pParentWnd = this; | 1506 scp.pParentWnd = this; |
| 1507 scp.sBackgroundColor = CPWL_Color(COLORTYPE_RGB, 240/255.0f, 240/255.0f,
240/255.0f); | 1507 scp.sBackgroundColor = CPWL_Color(COLORTYPE_RGB, 240/255.0f, 240/255.0f,
240/255.0f); |
| 1508 scp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_BACKGROUND; | 1508 scp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_BACKGROUND; |
| 1509 m_pContentsBar->Create(scp); | 1509 m_pContentsBar->Create(scp); |
| 1510 » m_pContentsBar->SetNotifyForever(TRUE); | 1510 » m_pContentsBar->SetNotifyForever(true); |
| 1511 } | 1511 } |
| 1512 | 1512 |
| 1513 void CPWL_Note::SetSubjectName(const CFX_WideString& sName) | 1513 void CPWL_Note::SetSubjectName(const CFX_WideString& sName) |
| 1514 { | 1514 { |
| 1515 CPWL_NoteItem::SetSubjectName(sName); | 1515 CPWL_NoteItem::SetSubjectName(sName); |
| 1516 RePosChildWnd(); | 1516 RePosChildWnd(); |
| 1517 } | 1517 } |
| 1518 | 1518 |
| 1519 void CPWL_Note::SetAuthorName(const CFX_WideString& sName) | 1519 void CPWL_Note::SetAuthorName(const CFX_WideString& sName) |
| 1520 { | 1520 { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1531 } | 1531 } |
| 1532 | 1532 |
| 1533 CFX_WideString CPWL_Note::GetAuthorName() const | 1533 CFX_WideString CPWL_Note::GetAuthorName() const |
| 1534 { | 1534 { |
| 1535 if (m_pAuthor) | 1535 if (m_pAuthor) |
| 1536 return m_pAuthor->GetText(); | 1536 return m_pAuthor->GetText(); |
| 1537 | 1537 |
| 1538 return L""; | 1538 return L""; |
| 1539 } | 1539 } |
| 1540 | 1540 |
| 1541 FX_BOOL CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD
nFlag) | 1541 bool CPWL_Note::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nF
lag) |
| 1542 { | 1542 { |
| 1543 CPDF_Point ptScroll = m_pContents->GetScrollPos(); | 1543 CPDF_Point ptScroll = m_pContents->GetScrollPos(); |
| 1544 CPDF_Rect rcScroll = m_pContents->GetScrollArea(); | 1544 CPDF_Rect rcScroll = m_pContents->GetScrollArea(); |
| 1545 CPDF_Rect rcContents = m_pContents->GetClientRect(); | 1545 CPDF_Rect rcContents = m_pContents->GetClientRect(); |
| 1546 | 1546 |
| 1547 if (rcScroll.top - rcScroll.bottom > rcContents.Height()) | 1547 if (rcScroll.top - rcScroll.bottom > rcContents.Height()) |
| 1548 { | 1548 { |
| 1549 CPDF_Point ptNew = ptScroll; | 1549 CPDF_Point ptNew = ptScroll; |
| 1550 | 1550 |
| 1551 if (zDelta > 0) | 1551 if (zDelta > 0) |
| 1552 ptNew.y += 30; | 1552 ptNew.y += 30; |
| 1553 else | 1553 else |
| 1554 ptNew.y -= 30; | 1554 ptNew.y -= 30; |
| 1555 | 1555 |
| 1556 if (ptNew.y > rcScroll.top) | 1556 if (ptNew.y > rcScroll.top) |
| 1557 ptNew.y = rcScroll.top; | 1557 ptNew.y = rcScroll.top; |
| 1558 if (ptNew.y < rcScroll.bottom + rcContents.Height()) | 1558 if (ptNew.y < rcScroll.bottom + rcContents.Height()) |
| 1559 ptNew.y = rcScroll.bottom + rcContents.Height(); | 1559 ptNew.y = rcScroll.bottom + rcContents.Height(); |
| 1560 if (ptNew.y < rcScroll.bottom) | 1560 if (ptNew.y < rcScroll.bottom) |
| 1561 ptNew.y = rcScroll.bottom; | 1561 ptNew.y = rcScroll.bottom; |
| 1562 | 1562 |
| 1563 if (ptNew.y != ptScroll.y) | 1563 if (ptNew.y != ptScroll.y) |
| 1564 { | 1564 { |
| 1565 m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); | 1565 m_pContents->OnNotify(this, PNM_NOTERESET, 0, 0); |
| 1566 m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROL
L, (intptr_t)&ptNew.y); | 1566 m_pContents->OnNotify(this, PNM_SCROLLWINDOW, SBT_VSCROL
L, (intptr_t)&ptNew.y); |
| 1567 m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSC
ROLL, (intptr_t)&ptNew.y); | 1567 m_pContentsBar->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSC
ROLL, (intptr_t)&ptNew.y); |
| 1568 | 1568 |
| 1569 » » » return TRUE; | 1569 » » » return true; |
| 1570 } | 1570 } |
| 1571 } | 1571 } |
| 1572 | 1572 |
| 1573 » return FALSE; | 1573 » return false; |
| 1574 } | 1574 } |
| 1575 | 1575 |
| 1576 void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t
lParam) | 1576 void CPWL_Note::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t
lParam) |
| 1577 { | 1577 { |
| 1578 switch (msg) | 1578 switch (msg) |
| 1579 { | 1579 { |
| 1580 case PNM_NOTEEDITCHANGED: | 1580 case PNM_NOTEEDITCHANGED: |
| 1581 { | 1581 { |
| 1582 CPDF_Rect rcScroll = m_pContents->GetScrollArea(); | 1582 CPDF_Rect rcScroll = m_pContents->GetScrollArea(); |
| 1583 | 1583 |
| 1584 | 1584 |
| 1585 PWL_SCROLL_INFO sInfo; | 1585 PWL_SCROLL_INFO sInfo; |
| 1586 sInfo.fContentMin = rcScroll.bottom; | 1586 sInfo.fContentMin = rcScroll.bottom; |
| 1587 sInfo.fContentMax = rcScroll.top; | 1587 sInfo.fContentMax = rcScroll.top; |
| 1588 sInfo.fPlateWidth = m_pContents->GetClientRect().Height(
); | 1588 sInfo.fPlateWidth = m_pContents->GetClientRect().Height(
); |
| 1589 sInfo.fSmallStep = 13.0f; | 1589 sInfo.fSmallStep = 13.0f; |
| 1590 sInfo.fBigStep = sInfo.fPlateWidth; | 1590 sInfo.fBigStep = sInfo.fPlateWidth; |
| 1591 | 1591 |
| 1592 if (FXSYS_memcmp(&m_OldScrollInfo, &sInfo, sizeof(PWL_SC
ROLL_INFO)) != 0) | 1592 if (FXSYS_memcmp(&m_OldScrollInfo, &sInfo, sizeof(PWL_SC
ROLL_INFO)) != 0) |
| 1593 { | 1593 { |
| 1594 » » » » FX_BOOL bScrollChanged = FALSE; | 1594 » » » » bool bScrollChanged = false; |
| 1595 | 1595 |
| 1596 if (lParam < 3) //·ÀÖ¹ËÀÑ»· mantis:15759 | 1596 if (lParam < 3) //·ÀÖ¹ËÀÑ»· mantis:15759 |
| 1597 { | 1597 { |
| 1598 bScrollChanged = ResetScrollBar(); | 1598 bScrollChanged = ResetScrollBar(); |
| 1599 if (bScrollChanged) | 1599 if (bScrollChanged) |
| 1600 { | 1600 { |
| 1601 lParam++; | 1601 lParam++; |
| 1602 m_pContents->OnNotify(this, PNM_
NOTERESET, 0, 0); | 1602 m_pContents->OnNotify(this, PNM_
NOTERESET, 0, 0); |
| 1603 OnNotify(this, PNM_NOTEEDITCHANG
ED, 0, lParam); | 1603 OnNotify(this, PNM_NOTEEDITCHANG
ED, 0, lParam); |
| 1604 } | 1604 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1697 if (m_pAuthor) | 1697 if (m_pAuthor) |
| 1698 m_pAuthor->SetTextColor(sTextColor); | 1698 m_pAuthor->SetTextColor(sTextColor); |
| 1699 if (m_pOptions) | 1699 if (m_pOptions) |
| 1700 m_pOptions->SetTextColor(sTextColor); | 1700 m_pOptions->SetTextColor(sTextColor); |
| 1701 if (m_pLBBox) | 1701 if (m_pLBBox) |
| 1702 m_pLBBox->SetTextColor(sTextColor); | 1702 m_pLBBox->SetTextColor(sTextColor); |
| 1703 if (m_pRBBox) | 1703 if (m_pRBBox) |
| 1704 m_pRBBox->SetTextColor(sTextColor); | 1704 m_pRBBox->SetTextColor(sTextColor); |
| 1705 } | 1705 } |
| 1706 | 1706 |
| 1707 FX_BOOL»CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) | 1707 bool» CPWL_Note::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) |
| 1708 { | 1708 { |
| 1709 if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point))) | 1709 if (m_pOptions->WndHitTest(m_pOptions->ParentToChild(point))) |
| 1710 { | 1710 { |
| 1711 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) | 1711 if (IPWL_NoteNotify* pNotify = GetNoteNotify()) |
| 1712 { | 1712 { |
| 1713 int32_t x, y; | 1713 int32_t x, y; |
| 1714 PWLtoWnd(point, x, y); | 1714 PWLtoWnd(point, x, y); |
| 1715 if (IFX_SystemHandler* pSH = GetSystemHandler()) | 1715 if (IFX_SystemHandler* pSH = GetSystemHandler()) |
| 1716 pSH->ClientToScreen(GetAttachedHWnd(), x, y); | 1716 pSH->ClientToScreen(GetAttachedHWnd(), x, y); |
| 1717 KillFocus(); | 1717 KillFocus(); |
| 1718 pNotify->OnPopupMenu(x, y); | 1718 pNotify->OnPopupMenu(x, y); |
| 1719 | 1719 |
| 1720 » » » return TRUE; | 1720 » » » return true; |
| 1721 } | 1721 } |
| 1722 } | 1722 } |
| 1723 | 1723 |
| 1724 return CPWL_Wnd::OnLButtonDown(point,nFlag); | 1724 return CPWL_Wnd::OnLButtonDown(point,nFlag); |
| 1725 } | 1725 } |
| 1726 | 1726 |
| 1727 FX_BOOL»CPWL_Note::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) | 1727 bool» CPWL_Note::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) |
| 1728 { | 1728 { |
| 1729 return CPWL_Wnd::OnRButtonUp(point,nFlag); | 1729 return CPWL_Wnd::OnRButtonUp(point,nFlag); |
| 1730 } | 1730 } |
| 1731 | 1731 |
| 1732 const CPWL_Note* CPWL_Note::GetNote() const | 1732 const CPWL_Note* CPWL_Note::GetNote() const |
| 1733 { | 1733 { |
| 1734 return this; | 1734 return this; |
| 1735 } | 1735 } |
| 1736 | 1736 |
| 1737 IPWL_NoteNotify* CPWL_Note::GetNoteNotify() const | 1737 IPWL_NoteNotify* CPWL_Note::GetNoteNotify() const |
| 1738 { | 1738 { |
| 1739 if (m_bEnalbleNotify) | 1739 if (m_bEnalbleNotify) |
| 1740 return m_pNoteNotify; | 1740 return m_pNoteNotify; |
| 1741 | 1741 |
| 1742 return NULL; | 1742 return NULL; |
| 1743 } | 1743 } |
| 1744 | 1744 |
| 1745 void CPWL_Note::SetIconType(int32_t nType) | 1745 void CPWL_Note::SetIconType(int32_t nType) |
| 1746 { | 1746 { |
| 1747 if (m_pIcon) | 1747 if (m_pIcon) |
| 1748 m_pIcon->SetIconType(nType); | 1748 m_pIcon->SetIconType(nType); |
| 1749 } | 1749 } |
| 1750 | 1750 |
| 1751 void CPWL_Note::EnableModify(FX_BOOL bEnabled) | 1751 void CPWL_Note::EnableModify(bool bEnabled) |
| 1752 { | 1752 { |
| 1753 m_pContents->EnableModify(bEnabled); | 1753 m_pContents->EnableModify(bEnabled); |
| 1754 } | 1754 } |
| 1755 | 1755 |
| 1756 void CPWL_Note::EnableRead(FX_BOOL bEnabled) | 1756 void CPWL_Note::EnableRead(bool bEnabled) |
| 1757 { | 1757 { |
| 1758 m_pContents->EnableRead(bEnabled); | 1758 m_pContents->EnableRead(bEnabled); |
| 1759 } | 1759 } |
| 1760 | 1760 |
| 1761 CFX_WideString CPWL_Note::GetReplyString() const | 1761 CFX_WideString CPWL_Note::GetReplyString() const |
| 1762 { | 1762 { |
| 1763 return m_sReplyString; | 1763 return m_sReplyString; |
| 1764 } | 1764 } |
| 1765 | 1765 |
| 1766 void CPWL_Note::SetReplyString(const CFX_WideString& string) | 1766 void CPWL_Note::SetReplyString(const CFX_WideString& string) |
| 1767 { | 1767 { |
| 1768 m_sReplyString = string; | 1768 m_sReplyString = string; |
| 1769 } | 1769 } |
| 1770 | 1770 |
| OLD | NEW |