User forums > Using Code::Blocks
Mouse wheel in editor
DrewBoo:
--- Quote from: jens on January 15, 2009, 07:31:44 am ---Another question:
Can you scroll the starthere-page?
--- End quote ---
That page doesn't present any scrollbars to me, even when the window is small enough that scrollbars would make sense. So no...but I'm not sure I ever could.
What I have noticed is that the mouse wheel works in all windows except scintilla -- The actual editor window, the code preview pane in threaded search, the sample code in the Configure Syntax Highlighting dialog...those won't scroll with the mouse wheel unless the mouse cursor is above the scrollbar itself, not the scintilla window.
--- Quote from: jens on January 15, 2009, 07:31:44 am ---Did you try tu do a "make clean"
--- End quote ---
On my second attempt, yes.
--- Quote from: jens on January 15, 2009, 07:31:44 am --- or a "make distclean" before building ?
--- End quote ---
Third attempt.
--- Quote from: jens on January 15, 2009, 07:31:44 am ---And did you run "./bootstrap" with the new sources, because some (many ?) of the "Makefile.am"' are changed ?
--- End quote ---
Fourth. :)
Jenna:
What about this:
--- Quote from: jens on January 15, 2009, 07:31:44 am ---If yes, could you put some debug-statements ("printf"'s for example) inside wxScintillas "OnMouseWheel"-handler, to see if it is reached ?
"src/sdk/wxscintilla/src/wxscintilla.cpp:3835" (OnMouseWheel) and "src/sdk/wxscintilla/src/ScintillaWX.cpp:855" (Do MouseWheel)
--- End quote ---
Starthere-page with scrollbars as attachment.
[attachment deleted by admin]
DrewBoo:
--- Quote from: jens on January 15, 2009, 05:19:14 pm ---could you put some debug-statements
--- End quote ---
I still intend to, Jens...this is my work machine that's showing the problem so my experiment time is limited.
Regarding the Start Here page...your image looks familiar, but with the latest build I see no scrollbars.
Oh, and for good measure, I pulled all the source into a fresh empty directory to do a pure-build-from-scratch. That didn't fix anything.
Jenna:
Did you also try to install C::B to another directory tree (using a different prefix when running ./configure) ?
I know these are many things to try and I'm grateful for your patience, but I'd really like to find (and hopefully fix) the issue.
And I did not find a way to reproduce it.
DrewBoo:
Found it! :D
With a lot of guidance from you, Jens, I have the bug pegged!
Ready?
Code goes in...
--- Code: ---void wxScintilla::OnMouseWheel (wxMouseEvent& evt)
{
// prevent having an event queue with wheel events that cannot be processed
// reasonably fast (see ticket #9057)
printf( "OnMouseWheel\n" );
printf( "Checking %d <= %d\n", m_lastWheelTimestamp, evt.GetTimestamp() );
if ( m_lastWheelTimestamp <= evt.GetTimestamp() )
{
printf( "OnMouseWheel - Processed\n" );
m_lastWheelTimestamp = m_stopWatch.Time();
m_swx->DoMouseWheel(evt.GetWheelRotation(),
evt.GetWheelDelta(),
evt.GetLinesPerAction(),
evt.ControlDown(),
evt.IsPageScroll());
m_lastWheelTimestamp = m_stopWatch.Time() - m_lastWheelTimestamp;
m_lastWheelTimestamp += evt.GetTimestamp();
}
}
--- End code ---
Text comes out...
OnMouseWheel
Checking 0 <= -521831849
OnMouseWheel
Checking 0 <= -521826089
OnMouseWheel
Checking 0 <= -521824121
You can see that the timer is incrementing...it's just negative.
Now here's a quote from http://docs.wxwidgets.org/trunk/classwx_event.html on that function (emphasis mine):
--- Quote ---long wxEvent::GetTimestamp() const
Gets the timestamp for the event.
The timestamp is the time in milliseconds since some fixed moment (not necessarily the standard Unix Epoch, so only differences between the timestamps and not their absolute values usually make sense).
--- End quote ---
So, the bug's in wxScintilla. And sure enough, if I initialize m_lastWheelTimestamp to std::numeric_limits<long>::min() instead of the absolute 0 everything works again.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version