Jump to content


Photo

Scrolling too fast/too far !


  • Please log in to reply
36 replies to this topic

#21 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 30 May 2007 - 10:47 PM

Hello Gousti,

Still not sure again where is a problem sad.gif

Maybe panel somehow add one more scroll-down to the grid (?!). I will look at it more, but not sure anymore.

regards
boki@bergsoft.net | LinkedIn Profile
--
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 user22

user22
  • Members
  • 192 posts
  • Gender:Male
  • Location:Linz / Austria

Posted 04 June 2007 - 11:59 AM

Hi Boki,

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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 04 June 2007 - 12:18 PM

Hello,

This is what I have thinked, maybe panel have own MouseWheel handling too and this double scrolling.

I will still work on it.

regards
boki@bergsoft.net | LinkedIn Profile
--
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 user22

user22
  • Members
  • 192 posts
  • Gender:Male
  • Location:Linz / Austria

Posted 04 June 2007 - 12:30 PM

Hi Boki,

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 sad.gif

bye,
Helmut

#25 GoustiFruit

GoustiFruit
  • Members
  • 82 posts

Posted 18 June 2007 - 11:49 AM

QUOTE (Boki (Berg) @ May 30 2007, 11:47 PM) <{POST_SNAPBACK}>
Hello Gousti,

Still not sure again where is a problem sad.gif

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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 18 June 2007 - 12:07 PM

Hello Gousti,

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
boki@bergsoft.net | LinkedIn Profile
--
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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 18 June 2007 - 12:15 PM

PS. Now I thinking, maybe when scrolling for less rows is a bug smile.gif It actually need to scroll for 3 rows (no less)
boki@bergsoft.net | LinkedIn Profile
--
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 GoustiFruit

GoustiFruit
  • Members
  • 82 posts

Posted 20 June 2007 - 11:31 AM

QUOTE (Boki (Berg) @ Jun 18 2007, 01:15 PM) <{POST_SNAPBACK}>
PS. Now I thinking, maybe when scrolling for less rows is a bug smile.gif It actually need to scroll for 3 rows (no less)


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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 20 June 2007 - 06:14 PM

Hello Gousti,

It is really strange, I have put that ClientHeight is exact, but this still happen.

regards
boki@bergsoft.net | LinkedIn Profile
--
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 GoustiFruit

GoustiFruit
  • Members
  • 82 posts

Posted 22 June 2007 - 02:45 PM

QUOTE (Boki (Berg) @ Jun 18 2007, 01:07 PM) <{POST_SNAPBACK}>
Hello Gousti,

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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 22 June 2007 - 03:09 PM

Hello Gousti,

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
boki@bergsoft.net | LinkedIn Profile
--
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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 23 June 2007 - 02:48 PM

Hello,

Maybe I have find a solution, I will write here durring today.

regards
boki@bergsoft.net | LinkedIn Profile
--
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 GoustiFruit

GoustiFruit
  • Members
  • 82 posts

Posted 23 June 2007 - 03:26 PM

QUOTE (Boki (Berg) @ Jun 22 2007, 04:09 PM) <{POST_SNAPBACK}>
Hello Gousti,

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 ?

QUOTE (Boki (Berg) @ Jun 23 2007, 03:48 PM) <{POST_SNAPBACK}>
Hello,

Maybe I have find a solution, I will write here durring today.

regards


I'm eagerly waiting for it :-D

#34 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 23 June 2007 - 03:39 PM

Hello,

Every new Parent add new wheel rolls into acumulator and this cause a problem. I think that I am near to solve it.

regards
boki@bergsoft.net | LinkedIn Profile
--
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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 23 June 2007 - 05:27 PM

Hello Gousty,

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:

CODE
function TNxCustomGrid.DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean;
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.
boki@bergsoft.net | LinkedIn Profile
--
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 GoustiFruit

GoustiFruit
  • Members
  • 82 posts

Posted 23 June 2007 - 06:25 PM

It seems to work as expected now :-)

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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 23 June 2007 - 06:46 PM

Hello Gousti,

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 smile.gif

Best regards
boki@bergsoft.net | LinkedIn Profile
--
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