Scrolling with middle mouse button - not working.

General TRichView support forum. Please post your questions here
Post Reply
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

Scrolling with middle mouse button - not working.

Post 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.
Smike
Posts: 24
Joined: Fri Sep 08, 2006 12:21 pm
Location: Ukraine, Kiev

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Last edited by Sergey Tkachenko on Sun Jan 20, 2008 10:04 am, edited 1 time in total.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Smike, what is imouse?
TRichView uses standard window scrollbars, but I think it does not matter in this case.
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

Post 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.
Smike
Posts: 24
Joined: Fri Sep 08, 2006 12:21 pm
Location: Ukraine, Kiev

Post 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 ;)
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

Post by Marsianin »

Thanks Smike, it's working now :)
Only one thing left...standard cursor for this looks little bit ugly :?
Smike
Posts: 24
Joined: Fri Sep 08, 2006 12:21 pm
Location: Ukraine, Kiev

Post 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)
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Smike
Posts: 24
Joined: Fri Sep 08, 2006 12:21 pm
Location: Ukraine, Kiev

Post 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.
Post Reply