Page 1 of 1

Scrolling with middle mouse button - not working.

Posted: Sun Jan 20, 2008 7:38 am
by Marsianin
Just found that the scroll with middle mouse button (when pressing wheel) doesn't works.

There are a lot of mouse drivers that have this feature when pressing and releasing mouse wheel like a button inside a text control makes mouse cursor round with up/down pointers and after that moving mouse up/down scrolls the text. This doesn't works with TRichView.

Posted: Sun Jan 20, 2008 9:31 am
by Smike
Oh, and Delphi 2007 imouse doesn't work too with last version. But with previous versions (1.9.24, as I remember) it worked correctly.

How are scrollbars added to control?

Posted: Sun Jan 20, 2008 10:03 am
by Sergey Tkachenko
Marsianin, I believe this type of scrolling (pressing middle button and moving mouse) is implemented not by drivers but by applications.
On my computer, only few applications implement this feature:
- IE
- OE (only in editor, not in lists)
- MS Office
- CodeGear RAD Studio.
And in all these applications this gadget looks slightly different.
No, TRichView does not implement this feature yet.

Posted: Sun Jan 20, 2008 10:04 am
by Sergey Tkachenko
Smike, what is imouse?
TRichView uses standard window scrollbars, but I think it does not matter in this case.

Posted: Sun Jan 20, 2008 9:26 pm
by Marsianin
Hm, tested on some applications I have installed here. Not all supports this middle click scrolling and different apps have different mouse cursor for that.
So I think, you're right, Sergey.

Posted: Mon Jan 21, 2008 10:02 pm
by Smike
Sergey Tkachenko wrote:Smike, what is imouse?
TRichView uses standard window scrollbars, but I think it does not matter in this case.
Imouse (imouse.pas unit) is a standard implementation of scrolling with middle button (called also "mouse panning"). It's also used in RAD Studio. Imouse functionality relays on standard window scrollbars and sends WM_HSCROLL/WM_VSCROLL to the window to make it scroll. It works on every window, that have a scrollbar (e.g. TListView, TTreeView, even TForm/TFrame if AutoScroll is True and at least one scrollbar is visible).

Oh, I've forgotten one thing. Control must have csPannable in ControlStyle, but RichView hasn't by default. So, after adding

Code: Select all

  RichViewEdit1.ControlStyle := RichViewEdit1.ControlStyle + [csPannable];
to code, I've got expected result, mouse panning :)

So, there are no hitches with it, all works right ;)

Posted: Tue Jan 22, 2008 1:29 am
by Marsianin
Thanks Smike, it's working now :)
Only one thing left...standard cursor for this looks little bit ugly :?

Posted: Tue Jan 22, 2008 7:11 pm
by Smike
Marsianin wrote:Thanks Smike, it's working now :)
Only one thing left...standard cursor for this looks little bit ugly :?
Yes, I agree. Try out my modification :)
http://smike.drkb.ru/components/mousepan.zip
Description of modifications:
http://smike.drkb.ru/components/mousepan.htm
(Currently only in Russian)

Posted: Thu Jan 24, 2008 4:57 pm
by Sergey Tkachenko
Wow, I didn't know about this unit. It will be supported by default in the next update.

A special processing is required for inplace editors (to scroll the root editor instead of them), I've made it.

Posted: Thu Jan 24, 2008 5:29 pm
by Sergey Tkachenko
The question is: should I include IMouse in uses of RVScroll.
From one side, without including this unit mouse panning does not work.
From the other side, including (as I understand) makes it impossible to use third party modifications.

Posted: Thu Jan 24, 2008 7:13 pm
by Smike
To my mind, adding csPannable to ControlStyle is quite enough. If programmer wants application to support panning, he must include imouse unit or other panning implementation.