Detect RC Scrolling |
Post Reply |
Author | |
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
Posted: 30 August 2009 at 10:50pm |
Anyone have any ideas on how to tell if the ReportControl is being scrolled? I don't see any Scroll events, and I tried subclassing WM_VSCROLL for the reportcontrol Hwnd without it any success.
If there is no way, any chance of exposing this notification in the ActiveX version? |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
I found funny message in the end of CXTPReportControl::AdjustScrollBars()
#ifdef _XTP_ACTIVEXSendMessage(WM_NCPAINT); #endif Could you try to use this notification?
But sometimes interrupt or change scrollbar behaviour is not most smart way:
e.g. User click on bottom scrollbar arrow - means - move one row down.
If instead of this developer force jump to last visible row (essentially emulate PgDn step) - what's for?
No gain. Just break internal standard logic and behaviour.
If this is desired reaction - hide scrollbar and put Pager button - each click can advance report on exact one page and select last visible row
I am sure everybody understand the fact that ReportControl (same as Windows Explorer) use Paging mechanism of Scrollbar reaction - means that if you move cursor from top row down until last visible row - there is no action on Scrollbar (same for first PgDn). Similar for down to up direction. |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Hi Mark,
Thanks for the reply. I tried subclassing WM_NCPAINT for the ReportControl, but it doesn't fire on scroll, on startup and when the size of the form is expanded (width and/or height). I actually don't want to change the scroll behaviour, I just want to know when the top row has changed (via scrolling only, not when the user changes it with the keyboard) so that I can update information in other controls...it does sound strange, but there is method to my madness (it would just take some time to explain here). I can also think of other benefits to knowing when the user has scrolled: 1) Update other controls based on the top row (or another visible row) 2) Update a custom tooltip while scrolling (VSFlexGrid has a ScrollTips/ScrollTipText property to do this more easily, but it also has BeforeScroll and AfterScroll events). Anyway, I'll keep experimenting to see if I can find a way to get this information. I could always use a timer to watch for changes in the top row I guess, but that's an ugly hack that shouldn't be necessary. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
I am trying to match standard ListView notifications: (from MSDN) - btw - CodeProject MFC Grid also share same or almost same set of notifications
|
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Hi Mark,
Sorry for the delay in getting back to you, I have been really busy. Are these message already being broadcast by the RC, or are you adding them? |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
No - just info for discussion
|
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Okay, for discussion purposes - I personally like having as many events available as possible...too often I find that I'm missing an event that would be useful in unusual circumstances.
I am also a huge fan of having Before* events (with the ability to Cancel the operation) wherever they make sense...not enough controls offer these, but they can be incredibly useful for overriding default behaviours (which is sometimes necessary). They also take some of the load off of you guys since they allow use to implement our own custom and unusual behaviours instead of bugging you to implement them for us ;) It would be very nice if the RC offered Before* events for things like column dragging, column removing, column resizing, column clicking, user-editing cell, etc...I could come up with a more complete list if this is something you are interested in implementing. The purpose of the Before* events is to allow easy control for the developer of default behaviours on a column by column or cell by cell basis depending on dynamic conditions at runtime. I currently use these events to cancel editing, bind columns to minimum and maximum widths, prevent resizing where appropriate, preventing focus changing, etc... with the VSFlexGrid control (which is my current grid of choice for most of my programs at least until the RC can replace all of the main functions I use...it's almost there and I am considering moving to RC exclusively soon). So my 2 cents worth: give me any events that are available, and where appropriate give me Before* versions of those events (with a Cancel flag for overriding default behaviour), and I'll be the happiest developer in the world ;) Specifically regarding scroll events, LVN_BeginScroll and LVN_EndScroll are very nice for hiding/showing dynamic content that is expensive to continually update during a scroll. I don't see an LVN_ScrollChanged message, but that would be nice to have for my purpose of updating other control data based on the current top row (for example) or showing scroll tips. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
This is a good set for CJ Grid control (may be in some future...)
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |