Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi ScrollBox ohne Wheel funktion ? (https://www.delphipraxis.net/10484-scrollbox-ohne-wheel-funktion.html)

Tau 19. Okt 2003 17:59


ScrollBox ohne Wheel funktion ?
 
Hallo Leute

kann mir einer sagen wieso meine ScrollBox oder Form die Standard
Wheel Funktionen nicht unterstützt. Ich arbeite mit D6 unter XP.

XP hat einen Standard Treiber für die Wheel Unterstützung.

Mit Grüssen
Tau

CalganX 19. Okt 2003 19:14

Re: ScrollBox ohne Wheel funktion ?
 
Hi Tau,
funktioniert dein Wheel denn unter Windows normal? Des Weiteren stelle ich mir die Frage bei welchen Komponenten dieses Phänomen auftritt. Nur bei einer Scrollbox, oder auch bei Listview, Listbox und co?

Chris

APP 19. Okt 2003 19:22

Re: ScrollBox ohne Wheel funktion ?
 
Hallo Tau,

vielleicht hilft Dir, was Peter Below in einer NG (borland.public.delphi.vcl.components.using)
geschrieben hat:


Zitat:

...
No, nothing at all special, i only set the images Autosize property to true to
make it adjust to the image size. This may in fact be a mouse driver problem.
Most wheel mouse drivers have a compatibility option that makes them send
normal scroll messages (not WM_MOUSEWHEEL messages) to a control if it has the
WS_VSCROLL style when the user operates the wheel. This works even with
controls that are not "wheel-aware".

Ah, yes. My mouse driver has a checkbox to activate MS Intellimouse
compatibility, if i check that the scrolling no longer works, so the mouse is
working in a somewhat smarter mode normally. The main problem seems to be that
the scrollbox does not take focus when clicked on, and the MS Intellimouse
driver will only send WM_MOUSEWHEEL messages to the control with focus.
So the
messages go to the form. The default handling in the VCL will only forward
them to the control with focus either, so no joy here as well.

You can use the forms OnMouseWheel event to fix this behaviour:

procedure TForm1.FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
Var
msg: Cardinal;
code: Cardinal;
i, n: Integer;
begin
If WindowFromPoint( mousepos ) = scrollbox1.Handle Then Begin
Handled := true;
If ssShift In Shift Then
msg := WM_HSCROLL
Else
msg := WM_VSCROLL;

If WheelDelta < 0 Then
code := SB_LINEUP
Else
code := SB_LINEDOWN;

n:= Mouse.WheelScrollLines;
For i:= 1 to n Do
scrollbox1.Perform( msg, code, 0 );
scrollbox1.Perform( msg, SB_ENDSCROLL, 0 );
End;
end;

Tau 20. Okt 2003 00:10

Re: ScrollBox ohne Wheel funktion ?
 
Hallo APP

DANKE für deine Hilfe

Es funktioniert :dancer2:

mfg
Tau


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:29 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz