- Fix wxStyledTextCtrl::SetInsertionPointEnd() (troelsk).
- Add wxFileDialog::GetCurrentlySelectedFilename() (Carl Godkin).
- Add wxMouseEvent::GetColumnsPerAction() (toiffel).
+- Add support for horizontal mouse wheel scrolling in wxSTC (toiffel).
- Improve wrapping of cell contents in wxGrid (nmset).
wxGTK:
focusEvent = false;
wMain = win;
stc = win;
- wheelRotation = 0;
+ wheelVRotation = 0;
+ wheelHRotation = 0;
Initialise();
#ifdef __WXMSW__
sysCaretBitmap = 0;
ScrollTo(topLineNew);
}
-void ScintillaWX::DoMouseWheel(int rotation, int delta,
- int linesPerAction, int ctrlDown,
- bool isPageScroll ) {
+void ScintillaWX::DoMouseWheel(wxMouseWheelAxis axis, int rotation, int delta,
+ int linesPerAction, int columnsPerAction,
+ bool ctrlDown, bool isPageScroll) {
int topLineNew = topLine;
int lines;
-
- if (ctrlDown) { // Zoom the fonts if Ctrl key down
+ int xPos = xOffset;
+ int pixels;
+
+ if (axis == wxMOUSE_WHEEL_HORIZONTAL) {
+ wheelHRotation += rotation * (columnsPerAction * vs.spaceWidth);
+ pixels = wheelHRotation / delta;
+ wheelHRotation -= pixels * delta;
+ if (pixels != 0) {
+ xPos += pixels;
+ PRectangle rcText = GetTextRectangle();
+ if (xPos > scrollWidth - rcText.Width()) {
+ xPos = scrollWidth - rcText.Width();
+ }
+ HorizontalScrollTo(xPos);
+ }
+ }
+ else if (ctrlDown) { // Zoom the fonts if Ctrl key down
if (rotation > 0) {
KeyCommand(SCI_ZOOMIN);
}
else { // otherwise just scroll the window
if ( !delta )
delta = 120;
- wheelRotation += rotation;
- lines = wheelRotation / delta;
- wheelRotation -= lines * delta;
+ wheelVRotation += rotation;
+ lines = wheelVRotation / delta;
+ wheelVRotation -= lines * delta;
if (lines != 0) {
if (isPageScroll)
lines = lines * LinesOnScreen(); // lines is either +1 or -1
void DoLeftButtonUp(Point pt, unsigned int curTime, bool ctrl);
void DoLeftButtonMove(Point pt);
void DoMiddleButtonUp(Point pt);
- void DoMouseWheel(int rotation, int delta, int linesPerAction, int ctrlDown, bool isPageScroll);
+ void DoMouseWheel(wxMouseWheelAxis axis, int rotation, int delta,
+ int linesPerAction, int columnsPerAction,
+ bool ctrlDown, bool isPageScroll);
void DoAddChar(int key);
int DoKeyDown(const wxKeyEvent& event, bool* consumed);
void DoTick() { Tick(); }
wxDragResult dragResult;
#endif
- int wheelRotation;
+ int wheelVRotation;
+ int wheelHRotation;
// For use in creating a system caret
bool HasCaretSizeChanged();
void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt)
{
- m_swx->DoMouseWheel(evt.GetWheelRotation(),
+ m_swx->DoMouseWheel(evt.GetWheelAxis(),
+ evt.GetWheelRotation(),
evt.GetWheelDelta(),
evt.GetLinesPerAction(),
+ evt.GetColumnsPerAction(),
evt.ControlDown(),
evt.IsPageScroll());
}
void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt)
{
- m_swx->DoMouseWheel(evt.GetWheelRotation(),
+ m_swx->DoMouseWheel(evt.GetWheelAxis(),
+ evt.GetWheelRotation(),
evt.GetWheelDelta(),
evt.GetLinesPerAction(),
+ evt.GetColumnsPerAction(),
evt.ControlDown(),
evt.IsPageScroll());
}