Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Detect RC Scrolling
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Detect RC Scrolling

 Post Reply Post Reply
Author
Message
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Topic: Detect RC Scrolling
    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

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2009 at 5:18pm
I found funny message in the end of CXTPReportControl::AdjustScrollBars()

#ifdef _XTP_ACTIVEX

SendMessage(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.
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2009 at 9:33pm
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

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2009 at 10:34pm
I am trying to match standard ListView notifications: (from MSDN) - btw - CodeProject MFC Grid also share same or almost same set of notifications
 
LVN_BEGINDRAG

Notifies a list-view control's parent window that a drag-and-drop operation involving the left mouse button is being initiated. This notification message is sent in the form of a WM_NOTIFY message.

LVN_BEGINLABELEDIT

Notifies a list-view control's parent window about the start of label editing for an item. This notification message is sent in the form of a WM_NOTIFY message.

LVN_BEGINRDRAG

Notifies a list-view control's parent window that a drag-and-drop operation involving the right mouse button is being initiated. This notification message is sent in the form of a WM_NOTIFY message.

LVN_BEGINSCROLL

Notifies a list-view control's parent window when a scrolling operation starts.

LVN_COLUMNCLICK

Notifies a list-view control's parent window that a column was clicked. This notification message is sent in the form of a WM_NOTIFY message.

LVN_COLUMNDROPDOWN

Sent by a list-view control when the list-view's drop-down button is pressed. This notification message is sent in the form of a WM_NOTIFY message.

LVN_COLUMNOVERFLOWCLICK

Sent by a list-view control when its overflow button is clicked. This notification message is sent in the form of a WM_NOTIFY message.

LVN_DELETEALLITEMS

Notifies a list-view control's parent window that all items in the control are about to be deleted. This notification message is sent in the form of a WM_NOTIFY message.

LVN_DELETEITEM

Notifies a list-view control's parent window that an item is about to be deleted. This notification message is sent in the form of a WM_NOTIFY message.

LVN_ENDLABELEDIT

Notifies a list-view control's parent window about the end of label editing for an item. This notification message is sent in the form of a WM_NOTIFY message.

LVN_ENDSCROLL

Notifies a list-view control's parent window when a scrolling operation ends.

LVN_GETDISPINFO

Sent by a list-view control to its parent window. It is a request for the parent window to provide information needed to display or sort a list-view item. This notification message is sent in the form of a WM_NOTIFY message.

LVN_GETEMPTYMARKUP

Sent by list-view control to its parent window when the control has no items. This notification message is sent in the form of a WM_NOTIFY message. The LVN_GETEMPTYMARKUP notification message is a request for the parent window to provide markup text.

LVN_GETINFOTIP

Sent by a large icon view list-view control that has the LVS_EX_INFOTIP extended style. This notification is sent when the list-view control is requesting additional text information to be displayed in a ToolTip. It is sent in the form of a WM_NOTIFY message.

LVN_HOTTRACK

Sent by a list-view control when the user moves the mouse over an item. This notification is only sent by list-view controls that have the LVS_EX_TRACKSELECT extended list-view style. It is sent in the form of a WM_NOTIFY message.

LVN_INCREMENTALSEARCH

Notifies a list-view control's parent window that an incremental search has started. This notification message is sent in the form of a WM_NOTIFY message.

LVN_INSERTITEM

Notifies a list-view control's parent window that a new item was inserted. This notification message is sent in the form of a WM_NOTIFY message.

LVN_ITEMACTIVATE

Sent by a list-view control when the user activates an item. This notification is sent in the form of a WM_NOTIFY message.

LVN_ITEMCHANGED

Notifies a list-view control's parent window that an item has changed. This notification message is sent in the form of a WM_NOTIFY message.

LVN_ITEMCHANGING

Notifies a list-view control's parent window that an item is changing. This notification message is sent in the form of a WM_NOTIFY message.

LVN_KEYDOWN

Notifies a list-view control's parent window that a key has been pressed. This notification message is sent in the form of a WM_NOTIFY message.

LVN_LINKCLICK

Notifies a list-view control's parent window that a link has been clicked on. This notification is sent in the form of a WM_NOTIFY message.

LVN_MARQUEEBEGIN

Notifies a list-view control's parent window that a bounding box (marquee) selection has begun. This notification message is sent in the form of a WM_NOTIFY message.

LVN_ODCACHEHINT

Sent by a virtual list-view control when the contents of its display area have changed. For example, a list-view control sends this notification when the user scrolls the control's display. The LVN_ODCACHEHINT notification message is sent in the form of a WM_NOTIFY message.

LVN_ODFINDITEM

Sent by a virtual list-view control when it needs the owner to find a particular callback item. For example, the control will send this notification when it receives shortcut keyboard input or when it receives an LVM_FINDITEM message.

LVN_ODSTATECHANGED

Sent by a list-view control when the state of an item or range of items has changed. This notification is sent in the form of a WM_NOTIFY message.

LVN_SETDISPINFO

Notifies a list-view control's parent window that it must update the information it maintains for an item. This notification message is sent in the form of a WM_NOTIFY message.

NM_CLICK (list view)

Sent by a list-view control when the user clicks an item with the left mouse button. This notification message is sent in the form of a WM_NOTIFY message.

NM_CUSTOMDRAW (list view)

Sent by a list-view control to notify its parent windows about drawing operations. This notification is sent in the form of a WM_NOTIFY message.

NM_DBLCLK (list view)

Sent by a list-view control when the user double-clicks an item with the left mouse button. This notification message is sent in the form of a WM_NOTIFY message.

NM_HOVER (list view)

Sent by a list-view control when the mouse hovers over an item. This notification message is sent in the form of a WM_NOTIFY message.

NM_KILLFOCUS (list view)

Notifies a list-view control's parent window that the control has lost the input focus. NM_KILLFOCUS (list view) is sent in the form of a WM_NOTIFY message.

NM_RCLICK (list view)

Sent by a list-view control when the user clicks an item with the right mouse button. This notification message is sent in the form of a WM_NOTIFY message.

NM_RDBLCLK (list view)

Sent by a list-view control when the user double-clicks an item with the right mouse button. This notification message is sent in the form of a WM_NOTIFY message.

NM_RELEASEDCAPTURE (list view)

Notifies a list-view control's parent window that the control is releasing mouse capture. This notification is sent in the form of a WM_NOTIFY message.

NM_RETURN (list view)

Notifies a list-view control's parent window that the control has the input focus and that the user has pressed the ENTER key. NM_RETURN is sent in the form of a WM_NOTIFY message.

NM_SETFOCUS (list view)

Notifies a list-view control's parent window that the control has received the input focus. NM_SETFOCUS (list view) is sent in the form of a WM_NOTIFY message.

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2009 at 12:39pm
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

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2009 at 12:42pm
No - just info for discussion
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2009 at 1:03pm
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

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 03 September 2009 at 1:15pm
This is a good set for CJ Grid control (may be in some future...)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.