OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007-2009 Torch Mobile Inc. | 3 * Copyright (C) 2007-2009 Torch Mobile Inc. |
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 } | 524 } |
525 | 525 |
526 bool PopupMenuWin::scrollToRevealSelection() | 526 bool PopupMenuWin::scrollToRevealSelection() |
527 { | 527 { |
528 if (!m_scrollbar) | 528 if (!m_scrollbar) |
529 return false; | 529 return false; |
530 | 530 |
531 int index = focusedIndex(); | 531 int index = focusedIndex(); |
532 | 532 |
533 if (index < m_scrollOffset) { | 533 if (index < m_scrollOffset) { |
534 m_scrollbar->setValue(index); | 534 m_scrollbar->setValue(index, Scrollbar::NotFromScrollAnimator); |
535 return true; | 535 return true; |
536 } | 536 } |
537 | 537 |
538 if (index >= m_scrollOffset + visibleItems()) { | 538 if (index >= m_scrollOffset + visibleItems()) { |
539 m_scrollbar->setValue(index - visibleItems() + 1); | 539 m_scrollbar->setValue(index - visibleItems() + 1, Scrollbar::NotFromScro
llAnimator); |
540 return true; | 540 return true; |
541 } | 541 } |
542 | 542 |
543 return false; | 543 return false; |
544 } | 544 } |
545 | 545 |
546 void PopupMenuWin::updateFromElement() | 546 void PopupMenuWin::updateFromElement() |
547 { | 547 { |
548 if (!m_popup) | 548 if (!m_popup) |
549 return; | 549 return; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 HDC localDC = hdc ? hdc : ::GetDC(m_popup); | 659 HDC localDC = hdc ? hdc : ::GetDC(m_popup); |
660 | 660 |
661 ::BitBlt(localDC, damageRect.x(), damageRect.y(), damageRect.width(), damage
Rect.height(), m_DC, damageRect.x(), damageRect.y(), SRCCOPY); | 661 ::BitBlt(localDC, damageRect.x(), damageRect.y(), damageRect.width(), damage
Rect.height(), m_DC, damageRect.x(), damageRect.y(), SRCCOPY); |
662 | 662 |
663 if (!hdc) | 663 if (!hdc) |
664 ::ReleaseDC(m_popup, localDC); | 664 ::ReleaseDC(m_popup, localDC); |
665 } | 665 } |
666 | 666 |
667 int PopupMenuWin::scrollSize(ScrollbarOrientation orientation) const | 667 int PopupMenuWin::scrollSize(ScrollbarOrientation orientation) const |
668 { | 668 { |
669 return ((orientation == VerticallScrollbar) && m_scrollbar) ? (m_scrollbar->
totalSize() - m_scrollbar->visibleSize()) : 0; | 669 return ((orientation == VerticalScrollbar) && m_scrollbar) ? (m_scrollbar->t
otalSize() - m_scrollbar->visibleSize()) : 0; |
670 } | 670 } |
671 | 671 |
672 void PopupMenuWin::setScrollOffsetFromAnimation(const IntPoint& offset) | 672 void PopupMenuWin::setScrollOffsetFromAnimation(const IntPoint& offset) |
673 { | 673 { |
674 if (m_scrollbar) | 674 if (m_scrollbar) |
675 m_scrollbar->setValue(offset.y(), Scrollbar::FromScrollAnimator); | 675 m_scrollbar->setValue(offset.y(), Scrollbar::FromScrollAnimator); |
676 } | 676 } |
677 | 677 |
678 void PopupMenuWin::valueChanged(Scrollbar* scrollBar) | 678 void PopupMenuWin::valueChanged(Scrollbar* scrollBar) |
679 { | 679 { |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 break; | 1008 break; |
1009 #endif | 1009 #endif |
1010 default: | 1010 default: |
1011 lResult = DefWindowProc(hWnd, message, wParam, lParam); | 1011 lResult = DefWindowProc(hWnd, message, wParam, lParam); |
1012 } | 1012 } |
1013 | 1013 |
1014 return lResult; | 1014 return lResult; |
1015 } | 1015 } |
1016 | 1016 |
1017 } | 1017 } |
OLD | NEW |