Scrolling too fast/too far !
#21
Posted 30 May 2007 - 10:47 PM
Still not sure again where is a problem
Maybe panel somehow add one more scroll-down to the grid (?!). I will look at it more, but not sure anymore.
regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#22
Posted 04 June 2007 - 11:59 AM
now i have the same problem as Gousti, the grid is not client aligned but in in a LMDSimplePanel. Putting the grid outside of the panel solved the problem. So i tried to build a little demo with this panel - but in the demo app everything works fine, no matter if grid is in the panel or outside, aligned or not ...
The problem exists, but what is the reason?
I only have seen that in the grid with the scroll-problem the wheel works like Ctrl+Wheel - no matter if grid has 2 or 20 rows, it scrolls always 10 rows - and pressing Ctrl+Wheel goes directly to the end of the grid (it has 48 rows) .
So maybe the problem is not the rowcount, it is that normal scroll will be handled as page-scroll and page-scroll as scroll-to-end ??
bye,
user22
#23
Posted 04 June 2007 - 12:18 PM
This is what I have thinked, maybe panel have own MouseWheel handling too and this double scrolling.
I will still work on it.
regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#24
Posted 04 June 2007 - 12:30 PM
i am not sure if it has to do with the panel, because i was not able to make a demo app with this problem, no matter if i putted grid on a panel, aligned or not, it always worked as expected. But i my main app i have this problem and if i put the grid outside of the panel it works okay .... No idea why grid in a panel is working in one app but not in another
bye,
Helmut
#25
Posted 18 June 2007 - 11:49 AM
Still not sure again where is a problem
Maybe panel somehow add one more scroll-down to the grid (?!). I will look at it more, but not sure anymore.
regards
Hello Boki,
Do you confirm that you saw the same behaviour in the demo I sent you (a while ago !) ?
Any idea yet of what's causing that behaviour ? Could it be related to the incorrect drawing of scrollbars button size ? (The button size is constant, it should adjust to the page value)
Gousti.
#26
Posted 18 June 2007 - 12:07 PM
Yes I saw it, but then I was think that it must be like that due to Windows configuration. I will try to do something again with your demo, but I am not sure that something may be done. Resizing grid for 2px down (size of panel border) work fine (?!)
regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#27
Posted 18 June 2007 - 12:15 PM
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#28
Posted 20 June 2007 - 11:31 AM
I don't understand this last message but I will try to resize my grids to see if I get the same result. The problem is that in my main application, my grids are anchored to resize according to the form size...
#29
Posted 20 June 2007 - 06:14 PM
It is really strange, I have put that ClientHeight is exact, but this still happen.
regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#30
Posted 22 June 2007 - 02:45 PM
Yes I saw it, but then I was think that it must be like that due to Windows configuration. I will try to do something again with your demo, but I am not sure that something may be done. Resizing grid for 2px down (size of panel border) work fine (?!)
regards
I tried resizing my grids (+/- 1 to several pixels) but still get the problem. What do you mean by 2px corresponding to the panel border ? My grids are client-aligned in the panel so they can't be resized alone, the panel must be resized as well !? Maybe your grid won't return their correct height when borderstyle is set to none or when they are client-aligned, which would then cause problems with functions using that value ?
#31
Posted 22 June 2007 - 03:09 PM
I have resize Panel for 2px (1px top, 1px bottom) to get same heigh as grid outside Panel, but same things happen. I like to note that every other kind of scrolling work fine (?!)
regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#32
Posted 23 June 2007 - 02:48 PM
Maybe I have find a solution, I will write here durring today.
regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#33
Posted 23 June 2007 - 03:26 PM
I have resize Panel for 2px (1px top, 1px bottom) to get same heigh as grid outside Panel, but same things happen. I like to note that every other kind of scrolling work fine (?!)
regards
Other kind of scrolling: do you mean clicking on the middle button, using arrow keys, ... ? Or do you mean that other components dropped on a panel scroll just fine ?
Maybe I have find a solution, I will write here durring today.
regards
I'm eagerly waiting for it :-D
#34
Posted 23 June 2007 - 03:39 PM
Every new Parent add new wheel rolls into acumulator and this cause a problem. I think that I am near to solve it.
regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#35
Posted 23 June 2007 - 05:27 PM
Please read bellow, here is how mouse wheel work in components:
1) When you roll mouse wheel down once, OnMouseWheelDown event will trigger with Handled parameter. Default value for this parameter is False (as I have investigate in Controls.pas from Delphi VCL source).
2) Because by default, this parameter is False (hardcoded in Controls.pas), mouse wheel will not work on Grid automatically. You need to set this Handled parameter to True manualy inside event.
3) I have thinking about adding a property named HandleMouseWheel (Boolean), or similar to set Handled to True by default, and save users with adding Handled := True inside event manually.
With following code all work fine, except that you need to add Handled := True in OnMouseWheelDown/Up events:
begin
Result := inherited DoMouseWheelDown(Shift, MousePos);
if Result and not(gtEdit in GridState) then
begin
case (VertScrollBar.Max > 0) and not VertScrollBar.IsLast of
True: if ssCtrl in Shift then VertScrollBar.PageDown else VertScrollBar.Next;
else if (GridStyle = gsReport) and (HorzScrollBar.Max > 0)
then if ssCtrl in Shift then HorzScrollBar.PageDown else HorzScrollBar.Next;
end;
end;
end;
function TNxCustomGrid.DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean;
begin
Result := inherited DoMouseWheelUp(Shift, MousePos);
if Result and not(gtEdit in GridState) then
begin
case VertScrollBar.Max > 0 of
True: if ssCtrl in Shift then VertScrollBar.PageUp else VertScrollBar.Prior;
else if (GridStyle = gsReport) and (HorzScrollBar.Max > 0)
then if ssCtrl in Shift then HorzScrollBar.PageUp else HorzScrollBar.Prior;
end;
end;
end;
Please tell me what you think.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#36
Posted 23 June 2007 - 06:25 PM
Indeed, adding a property to handle it would probably be better: I have several Grids on my form, for now I have attached one OnWheelMouseDown procedure to all grids OnWheelMouseDown/OnWheelMouseUp events... Luckily I'm not using those events for anything else.
But it seems (not sure, I didn't recompile with previous code) that I was able to move my mouse over one grid and use the wheel on it without having to set the focus on it first, while now I need to click in a grid to give it the focus to be able to scroll it using the wheel !? But *really* this is only a minor glitch compared to the resolution of the incorrect scrolling problem. Thanks ;-)
Gousti.
#37
Posted 23 June 2007 - 06:46 PM
I will now think about this property, and how to name it. Also, I will read system value for whell step.
It was probably already focused
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users