- Add wxWindow::BeginRepositioningChildren() and EndRepositioningChildren().
- Fix wxStyledTextCtrl::SetInsertionPointEnd() (troelsk).
- Add wxFileDialog::GetCurrentlySelectedFilename() (Carl Godkin).
+- Add wxMouseEvent::GetColumnsPerAction() (toiffel).
wxGTK:
wxMouseWheelAxis GetWheelAxis() const { return m_wheelAxis; }
// Returns the configured number of lines (or whatever) to be scrolled per
- // wheel action. Defaults to one.
+ // wheel action. Defaults to three.
int GetLinesPerAction() const { return m_linesPerAction; }
+ // Returns the configured number of columns (or whatever) to be scrolled per
+ // wheel action. Defaults to three.
+ int GetColumnsPerAction() const { return m_columnsPerAction; }
+
// Is the system set to do page scrolling?
bool IsPageScroll() const { return ((unsigned int)m_linesPerAction == UINT_MAX); }
int m_wheelRotation;
int m_wheelDelta;
int m_linesPerAction;
+ int m_columnsPerAction;
protected:
void Assign(const wxMouseEvent& evt);
#ifndef SPI_GETWHEELSCROLLLINES
#define SPI_GETWHEELSCROLLLINES 104
#endif
+ #ifndef SPI_GETWHEELSCROLLCHARS
+ #define SPI_GETWHEELSCROLLCHARS 108
+ #endif
#endif // wxUSE_MOUSEWHEEL
// Needed by window.cpp
/**
Returns the configured number of lines (or whatever) to be scrolled per
- wheel action. Defaults to three.
+ wheel action.
+
+ Default value under most platforms is three.
+
+ @see GetColumnsPerAction()
*/
int GetLinesPerAction() const;
+ /**
+ Returns the configured number of columns (or whatever) to be scrolled per
+ wheel action.
+
+ Default value under most platforms is three.
+
+ @see GetLinesPerAction()
+
+ @since 2.9.5
+ */
+ int GetColumnsPerAction() const;
+
/**
Returns the logical mouse position in pixels (i.e.\ translated according to the
translation set for the DC, which usually indicates that the window has been
m_wheelRotation = 0;
m_wheelDelta = 0;
m_linesPerAction = 0;
+ m_columnsPerAction = 0;
}
void wxMouseEvent::Assign(const wxMouseEvent& event)
m_wheelRotation = event.m_wheelRotation;
m_wheelDelta = event.m_wheelDelta;
m_linesPerAction = event.m_linesPerAction;
+ m_columnsPerAction = event.m_columnsPerAction;
m_wheelAxis = event.m_wheelAxis;
}
// FIXME: Get these values from GTK or GDK
event.m_linesPerAction = 3;
+ event.m_columnsPerAction = 3;
event.m_wheelDelta = 120;
// Determine the scroll direction.
if (event.GetEventType() == wxEVT_MOUSEWHEEL)
{
event.m_linesPerAction = 3;
+ event.m_columnsPerAction = 3;
event.m_wheelDelta = 120;
if (((GdkEventButton*)gdk_event)->button == 4)
event.m_wheelRotation = 120;
}
}
+ static int s_columnsPerRotation = -1;
+ if ( s_columnsPerRotation == -1 )
+ {
+ if ( !::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0,
+ &s_columnsPerRotation, 0))
+ {
+ // this setting is not supported on Windows 2000/XP, so use the value of 1
+ // http://msdn.microsoft.com/en-us/library/ms997498.aspx
+ s_columnsPerRotation = 1;
+ }
+ }
+
event.m_linesPerAction = s_linesPerRotation;
+ event.m_columnsPerAction = s_columnsPerRotation;
return HandleWindowEvent(event);
#else // !wxUSE_MOUSEWHEEL
wxevent.m_wheelRotation = delta;
wxevent.m_wheelDelta = 1;
wxevent.m_linesPerAction = 1;
+ wxevent.m_columnsPerAction = 1;
if ( axis == kEventMouseWheelAxisX )
wxevent.m_wheelAxis = wxMOUSE_WHEEL_HORIZONTAL;
}
wxevent.m_wheelDelta = 10;
wxevent.m_linesPerAction = 1;
+ wxevent.m_columnsPerAction = 1;
if ( fabs(deltaX) > fabs(deltaY) )
{
button = xevent->xbutton.button;
wxevent.m_linesPerAction = 3;
+ wxevent.m_columnsPerAction = 3;
wxevent.m_wheelDelta = WHEEL_DELTA;
// Button 4 means mousewheel up, 5 means down