Page 35 of 35 FirstFirst ... 2532333435
Results 1,361 to 1,389 of 1389

Thread: VBFlexGrid Control (Replacement of the MSFlexGrid control)

  1. #1361

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Nouyana View Post
    IMO yes, it would be more convenient to customize the grid. ClientHeight and ClientWidth.
    Seems to be difficult due to the dynamic appearance of the scrollbars. So will not be included..

  2. #1362
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,495

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi Krool,

    When selecting a large number of grid-rows with the mouse, VBFlexGrid can only scroll through many pages at a very slow speed to select hundreds or thousands of grid-rows, which takes a lot of time. Is it possible to make VBFlexGrid able to scroll quickly when selecting a large number of grid-rows?

  3. #1363

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by SearchingDataOnly View Post
    Hi Krool,

    When selecting a large number of grid-rows with the mouse, VBFlexGrid can only scroll through many pages at a very slow speed to select hundreds or thousands of grid-rows, which takes a lot of time. Is it possible to make VBFlexGrid able to scroll quickly when selecting a large number of grid-rows?
    Do you have a FlexDataSource where the viewport data is fetched on demand?
    Maybe that's the reason of "slow" scrolling on a large list ..

  4. #1364
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,495

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Do you have a FlexDataSource where the viewport data is fetched on demand?
    Maybe that's the reason of "slow" scrolling on a large list ..
    No, I'm not using FlexDataSource. Attached is the test code (click the button "Load Large Data")
    Attached Files Attached Files

  5. #1365

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by SearchingDataOnly View Post
    No, I'm not using FlexDataSource. Attached is the test code (click the button "Load Large Data")
    I can't repro. I tested in the IDE and scrolling is normal.

  6. #1366
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,495

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    I can't repro. I tested in the IDE and scrolling is normal.
    Yes, VBFlexGrid's scrolling is normal. I mean the VBFlexGrid should scroll a little faster, especially when the grid has a lot of rows, and the scrolling speed should be more than 3 times what it is now.

  7. #1367

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by SearchingDataOnly View Post
    Yes, VBFlexGrid's scrolling is normal. I mean the VBFlexGrid should scroll a little faster, especially when the grid has a lot of rows, and the scrolling speed should be more than 3 times what it is now.
    How?
    One scroll should scroll "1 page", that's it.

  8. #1368
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,495

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I don't know if anyone understands what I mean. If anyone understands what I mean, hopefully he could explain it to Krool.

  9. #1369
    Lively Member
    Join Date
    May 2022
    Posts
    93

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Can you record a video of your screen? Maybe then....

  10. #1370
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,058

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by SearchingDataOnly View Post
    I don't know if anyone understands what I mean. If anyone understands what I mean, hopefully he could explain it to Krool.
    Do you want non linear scrolling?
    The longer you keep the arrow button or page down button pressed the bigger the step?

  11. #1371
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,495

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Thank you, Calcu and Arnoutdv.

    I'll rephrase my problem.

    When we need to select a lot of grid rows with the mouse, we do it like this:

    (1) Click on the first row you want to select

    (2) Hold down the mouse and drag down, and the grid rows will start to scroll

    (3) Soon, the mouse moves to the bottom of the grid component and moves outside the grid.

    (4) When the mouse has moved outside the grid the grid should continue to scroll, and the scrolling speed should be more than three times the normal scrolling speed (i.e., the speed of the mouse inside the grid).

    (5) When all the grid rows to be selected have been included, the mouse should move up to the grid, and the scrolling speed of the grid will return to the normal state (i.e., slow down). At this point, the mouse can select exactly the hundreds or thousands of rows that need to be selected.

    My requirement is that when the mouse has moved outside of the grid, the grid should scroll at more than three times the normal scrolling speed (i.e., the speed of the mouse inside the grid).
    Last edited by SearchingDataOnly; May 26th, 2024 at 01:20 AM.

  12. #1372

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by SearchingDataOnly View Post
    Thank you, Calcu and Arnoutdv.

    I'll rephrase my problem.

    When we need to select a lot of grid rows with the mouse, we do it like this:

    (1) Click on the first row you want to select

    (2) Hold down the mouse and drag down, and the grid rows will start to scroll

    (3) Soon, the mouse moves to the bottom of the grid component and moves outside the grid.

    (4) When the mouse has moved outside the grid the grid should continue to scroll, and the scrolling speed should be more than three times the normal scrolling speed (i.e., the speed of the mouse inside the grid).

    (5) When all the grid rows to be selected have been included, the mouse should move up to the grid, and the scrolling speed of the grid will return to the normal state (i.e., slow down). At this point, the mouse can select exactly the hundreds or thousands of rows that need to be selected.

    My requirement is that when the mouse has moved outside of the grid, the grid should scroll at more than three times the normal scrolling speed (i.e., the speed of the mouse inside the grid).
    So like in the reader mode? (AllowReaderMode = True and click or hold down middle mouse button)
    There the scroll is faster/slower depedent on the "distance" to the anchor..

  13. #1373
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,495

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    So like in the reader mode? (AllowReaderMode = True and click or hold down middle mouse button)
    There the scroll is faster/slower depedent on the "distance" to the anchor..
    It doesn't seem to have anything to do with reader mode. You can try selecting 5,000 rows from 30,000 grid rows with your mouse and see how much time it takes.

  14. #1374

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by SearchingDataOnly View Post
    It doesn't seem to have anything to do with reader mode. You can try selecting 5,000 rows from 30,000 grid rows with your mouse and see how much time it takes.
    OMG. We really can't understand. I said LIKE mechanism of reader mode.

  15. #1375
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    44

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    @SearchingDataOnly: I've tried it in a grid with about 4.500 Rows. Selected row 1 and moved down outside the control, still button pressed. Now moved the mouse erratic fast outside the control, e.g. to the left and right, and so the selection in the grid sped up. Is this like what you want to have? In my opinion the selection speeds up with the movement of the mouse, and it is fast.
    Greetings

  16. #1376
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,495

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Seniorchef View Post
    @SearchingDataOnly: I've tried it in a grid with about 4.500 Rows. Selected row 1 and moved down outside the control, still button pressed. Now moved the mouse erratic fast outside the control, e.g. to the left and right, and so the selection in the grid sped up. Is this like what you want to have? In my opinion the selection speeds up with the movement of the mouse, and it is fast.
    Greetings
    Yes, you understand exactly what I mean. Thank you, Seniorchef.

    Have you ever tried to select 5,000 grid rows out of 50,000?

  17. #1377
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    263

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I personally am not a big fan of doing such a select using "auto scrolling", and especially not when the scroll starts accelerating, as it's usually hard to stop at the right moment. I would select the first row, use the slider in the scrollbar to quickly go to the end of the selection, press <Shift> and then click the last row that has to be selected.

  18. #1378

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Erwin69 View Post
    I personally am not a big fan of doing such a select using "auto scrolling", and especially not when the scroll starts accelerating, as it's usually hard to stop at the right moment. I would select the first row, use the slider in the scrollbar to quickly go to the end of the selection, press <Shift> and then click the last row that has to be selected.
    The ScrollTip functionality can help here to get quick preview of where the scroll would jump.

  19. #1379
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    44

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    @SearchingDataOnly: I tested it on a 84,000 rows grid in the IDE (I had to change my code to display the number of selected rows) and it took me 5 seconds to mark about 5,000 rows - in my opinion it's fast (and my PC is really outdated :-)). But as Erwin69 mentioned, it's almost impossible to stop on a certain row. So I'd prefer another method to select that much rows, e.g. via keyboard (ctrl + pagedown, slower) or via code (if possible). So in the first place, what's the goal?
    Greetings

  20. #1380
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,303

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    ...I said LIKE mechanism of reader mode.
    Yep, the greater the (Pixel-)-distance in y-Direction from a "Fix-Point" -
    the higher the "Rows-per-Tick"-speed in the ScrollTimer-Event (which you probably already have anyways).

    The only difference is, that there's now two "Fix-points" you measure Pixel-distances from:
    - in Scroll-down-mode, the Pixel-Diff is measured as Delta to the BottomLine of the Ctl
    - in Scroll-up-mode, to the Top-Line of the Ctl respectively

    For the cwVList-Widget, I think I have 3 speed-levels (related to the Pixel-Delta):
    - 1-15 = "normal speed"
    - 16-30 = "higher speed"
    - > 30 = "highest speed"

    Olaf

  21. #1381

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Thanks Schmidt. Before in getting into the acceleration topic there is one more fundamental thing to solve first.

    Currently the scroll is reacting upon WM_MOUSEMOVE. (SetCapture)
    That's fine and keep like that BUT:

    For my non-OLE DragRow/DragCol methods which enter a modal message loop I have timers which ticks when mouse is idle, so it's a combination of WM_MOUSE and SetTimer/KillTimer. Any WM_MOUSEMOVE will reset the timer to not have "double" thing.

    Question is now I guess I should add this to the normal scrolling also? Certainly vsFlexGrid seem to do it.

  22. #1382
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,303

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    For my non-OLE DragRow/DragCol methods which enter a modal message loop -
    I have timers which ticks when mouse is idle, so it's a combination of WM_MOUSE and SetTimer/KillTimer.
    Any WM_MOUSEMOVE will reset the timer to not have "double" thing.
    This should be separable with relative ease, via proper bool-Flags -
    which depend on, whether MouseY is inside the Control or not (whilst the Mousekey is down).

    If outside the Control, then only the timer is responsible, if inside the Control, then only Mouse_Move...

    Olaf

  23. #1383

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Schmidt View Post
    This should be separable with relative ease, via proper bool-Flags -
    which depend on, whether MouseY is inside the Control or not (whilst the Mousekey is down).

    If outside the Control, then only the timer is responsible, if inside the Control, then only Mouse_Move...

    Olaf
    I based the logic upon https://devblogs.microsoft.com/oldne...5-00/?p=104757

  24. #1384

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    To note is that for "down" scrolling there is an acceleration the farther the mouse is. This is due to the fact that the selection will extend to the current mouse row/col.
    For "up" scrolling it is currently just 1 line. So, there a small function could calculate the amount of lines to be scrolled based on the distance. Like it's already for the "down" scroll.

    Then that's solved, the acceleration part for "up" is missing. Then a timer could help to scroll when mouse is idle and outside the scroll-able area ..

  25. #1385

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Improvement in the "capture mouse move" scroll.
    The "down" and "right" scroll build up acceleration due to MouseRow/MouseCol.
    However, the "up" and "left" scroll was too simple and just did a single line scroll.
    Now the number of lines are calculated based on the distance and edge of fixed rows/cols.
    So, all directions behave and feel now the same for the user.

    @SearchingDataOnly, now I understand what you mean. I couldn't repro because I just did a "down" scroll on "capture mouse move" scroll.
    It speeds up now also on "up" and "left" scroll. Plus the more you wiggle the mouse the more often a "mouse move" occurs.

    IMO I think we can save the overhead here to integrate a timer here on a "capture mouse move" scroll when the mouse is idle for a moment?
    This also has a benefit for the user to "pause" the scroll and continue when moved again.
    For the "non-OLE drag row/col" the timer was useful because it scrolls when near the edge of the scroll-able area, so the user can pause any moment by moving the mouse to the scroll-able area and continue when moving against the edge again.
    Last edited by Krool; May 30th, 2024 at 11:29 AM.

  26. #1386
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,495

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    @Krool, @Olaf, @Seniorchef,

    A good scrolling algorithm/pattern is essential for modern spreads/grids.

    VSCode's scrolling algorithm is excellent. I'm going to use VSCode as an example to illustrate what some good scrolling algorithms look like.

    1. Open the source code of VBFlexGrid.ctl with VSCode.

    2. Select a row with the mouse and drag the mouse down to select more rows.

    3. When the mouse reaches the horizontal scroll bar at the bottom of the code window, the page starts scrolling.

    4. Even if the mouse is stationary/resting on the horizontal scroll bar at the bottom of the code window, the page scrolling is still going on

    5. Continue to move the mouse down, and when the mouse leaves the horizontal scroll bar at the bottom of the code window, the scrolling starts to accelerate

    6. When the mouse leaves the code window, even if the mouse is stationary, the page scrolling is still frantic.

    7. The longer you hold down the mouse, the faster the scrolling speed seems to increase.

    8. When you have selected enough rows, move the mouse back to the code window, at this point, the scrolling stops, and then you can use the mouse to select the grid rows exactly.

    VSCode is a perfect example of what a good scrolling pattern looks like.
    Last edited by SearchingDataOnly; Jun 1st, 2024 at 01:09 AM.

  27. #1387

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    @SearchingDataOnly, did you test the new update ?

    As further information.. the MS(H)FlexGrid is also lame/lazy (1 liner scroll only) on the "up" and "left" "capture mouse move" scroll.
    So the VBFlexGrid is in this regard now better as to take the distance and calculate actual number of lines to scroll, like in the "down" and "right" scroll which is done naturally due to MouseRow/Col.

  28. #1388
    Frenzied Member
    Join Date
    Aug 2020
    Posts
    1,495

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    @SearchingDataOnly, did you test the new update ?
    Yes, I tested it yesterday. It seems to be a little faster, but it's not noticeable. The reason for this is that when I move the mouse outside of the grid, I need to keep moving the mouse left and right to keep scrolling. As soon as the mouse stops moving, the scrolling of the grid stops. It is recommended that the scrolling of the grid should continue even if the mouse is stationary.


    Quote Originally Posted by Krool View Post
    As further information.. the MS(H)FlexGrid is also lame/lazy (1 liner scroll only) on the "up" and "left" "capture mouse move" scroll.
    So the VBFlexGrid is in this regard now better as to take the distance and calculate actual number of lines to scroll, like in the "down" and "right" scroll which is done naturally due to MouseRow/Col.
    VBFlexGrid is getting better and better. Five years ago, the performance of VBFlexGrid was only a few tens of times that of Farpoint-Spread. Now, the performance of VBFlexGrid has surpassed that of Farpoint-Spread

  29. #1389

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,449

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Support of the VP_FORMATRANGE message. (like MS(H)FlexGrid and vsFlexGrid)

    See the demo VB6 Simple EMF-based FlexPrint-Reporting (incl. Print-Preview) by Olaf of how it can be used.

    Info: I couldn't figure out what rcPage is actually needed for and it is ignored for now .. it uses only rc where the actual drawing appears. (FORMATRANGE)
    Also I couldn't figure out the actual difference (in code) for hdc and hdcTarget. So only hdc is taken into account.
    Last edited by Krool; Yesterday at 02:23 AM.

Page 35 of 35 FirstFirst ... 2532333435

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width