Author: af
Date: Wed May 8 07:21:37 2013
New Revision: 1480173
URL: http://svn.apache.org/r1480173
Log:
122254: Process mouse wheel events over sidebar scroll bar.
Modified:
openoffice/trunk/main/sfx2/source/sidebar/Deck.cxx
openoffice/trunk/main/sfx2/source/sidebar/Deck.hxx
Modified: openoffice/trunk/main/sfx2/source/sidebar/Deck.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/Deck.cxx?rev=1480173&r1=1480172&r2=1480173&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/sidebar/Deck.cxx (original)
+++ openoffice/trunk/main/sfx2/source/sidebar/Deck.cxx Wed May 8 07:21:37 2013
@@ -220,6 +220,56 @@ void Deck::DataChanged (const DataChange
+long Deck::Notify (NotifyEvent& rEvent)
+{
+ if (rEvent.GetType() != EVENT_COMMAND)
+ return sal_False;
+
+ CommandEvent* pCommandEvent =
reinterpret_cast<CommandEvent*>(rEvent.GetData());
+ if (pCommandEvent == NULL)
+ return sal_False;
+
+ switch (pCommandEvent->GetCommand())
+ {
+ case COMMAND_WHEEL:
+ {
+ if ( ! mpVerticalScrollBar
+ || ! mpVerticalScrollBar->IsVisible())
+ return sal_False;
+
+ // Ignore all wheel commands from outside the vertical
+ // scroll bar. Otherwise after a scroll we might land on
+ // a spin field and subsequent wheel events would change
+ // the value of that control.
+ if (rEvent.GetWindow() != mpVerticalScrollBar.get())
+ return sal_True;
+
+ // Get the wheel data and check that it describes a valid
+ // vertical scroll.
+ const CommandWheelData* pData = pCommandEvent->GetWheelData();
+ if (pData==NULL
+ || pData->GetModifier()
+ || pData->GetMode() != COMMAND_WHEEL_SCROLL
+ || pData->IsHorz())
+ return sal_False;
+
+ // Execute the actual scroll action.
+ long nDelta = pData->GetDelta();
+ mpVerticalScrollBar->DoScroll(
+ mpVerticalScrollBar->GetThumbPos() - nDelta);
+ return sal_True;
+ }
+
+ default:
+ break;
+ }
+
+ return sal_False;
+}
+
+
+
+
void Deck::SetPanels (const SharedPanelContainer& rPanels)
{
maPanels = rPanels;
@@ -276,7 +326,6 @@ void Deck::ShowPanel (const Panel& rPane
if (rPanel.GetTitleBar() != NULL && rPanel.GetTitleBar()->IsVisible())
nPanelTop = rPanel.GetTitleBar()->GetPosPixel().Y();
-
// Determine what the new thumb position should be like.
// When the whole panel does not fit then make its top visible
// and it off at the bottom.
@@ -419,4 +468,5 @@ void Deck::ScrollContainerWindow::SetSep
maSeparators = rSeparators;
}
+
} } // end of namespace sfx2::sidebar
Modified: openoffice/trunk/main/sfx2/source/sidebar/Deck.hxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/Deck.hxx?rev=1480173&r1=1480172&r2=1480173&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/sidebar/Deck.hxx (original)
+++ openoffice/trunk/main/sfx2/source/sidebar/Deck.hxx Wed May 8 07:21:37 2013
@@ -73,6 +73,7 @@ public:
virtual void Paint (const Rectangle& rUpdateArea);
virtual void DataChanged (const DataChangedEvent& rEvent);
+ virtual long Notify (NotifyEvent& rEvent);
void PrintWindowTree (void);
void PrintWindowTree (const ::std::vector<Panel*>& rPanels);