Print Page | Close Window

HitTest and HeaderRows

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=9395
Printed Date: 10 November 2024 at 6:03am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HitTest and HeaderRows
Posted By: mlatona
Subject: HitTest and HeaderRows
Date Posted: 23 January 2008 at 8:53am
Hi,
 
the HitTest function don`t works with header rows. If I click in a header row, the HitTest function return "Nothing" for the item, column, row object.
 
Regards
Marco



Replies:
Posted By: Rafael
Date Posted: 24 January 2008 at 12:01pm
Are you clicking on a column header?  You can catch that event with ReportControl_ColumnClick(column)


Posted By: mlatona
Date Posted: 24 January 2008 at 12:12pm
No, I click on a header row. This is a row from the HeaderRows collection.
The report control have HeaderRows, normal Rows and FooterRows collections.
 
The HitTest works only with normal Rows.


Posted By: Rafael
Date Posted: 24 January 2008 at 2:17pm
I cought the mouse down event and ran the hit test on the header and it matches the hit test code xtpHitTestUnknown or 0.
 
Not entirely helpful, but I didn't get 'Nothing'
 
Do you need the code I used?


Posted By: mlatona
Date Posted: 25 January 2008 at 3:57am
No, thank you,
 
I have no problem with the column header. I have problems with the header rows. See the picture. The row below the column header is the header row (ReportControl.HeaderRows). The HitTest for this row don`t work.
 


Posted By: Rafael
Date Posted: 25 January 2008 at 9:17am
Yes, I understand you are looking at the header and not the column header.
 
Taken from the sample, the following code will say you hit an unknown area when you do a hit test.
 
<code>
Private Sub wndReportControl_MouseDown(Button As Integer, Shift As Integer, X As Long, Y As Long)
    Dim hitColumn As ReportColumn
    Dim hitRow As ReportRow
    Dim hitItem As ReportRecordItem
    'The MouseDown event is being used to illustrate how the HitTest method can be used. The HitTest method does not have
    'to be used with a mouse event, it can be used to test any X and Y coordinate on the screen to see if the ReportControl
    'occupies these pixes and what part of the ReportControl is at the specified pixel (Group Box, Row, Item, etc).
    'If it is dertermined that a ReportControl component is at the X and Y coordinates, the HitTest method can return a
    'reference to that component (Column, Row, Record, Item, etc...).
    'Determines which part of the ReportControl the mouse was positioned over when clicked.
    Select Case wndReportControl.HitTest(X, Y).ht
        'If MouseDown while positioned anywhere over the Group Box (Even over Column Headers in Group Box)
        Case xtpHitTestGroupBox:
            Debug.Print "MouseDown in Group Box"
        'If MouseDown while positioned anywhere over the ColumnHeader area. This does NOT include
        'column header in the Group Box
        Case xtpHitTestHeader:
            Debug.Print "MouseDown in Column Header Area (Not in Group Box)"
        'If MouseDown while positioned over the Report Area, this would includ, rows, columns, items, goup rows, expand buttons
        Case xtpHitTestReportArea:
            Debug.Print "MouseDown in Report Area"
        'This case will never happen, Unknown is returned when HitTest is called and the mouse is positioned
        'over an area outside of the report control
        Case xtpHitTestUnknown:
            Debug.Print "Mouse is in an Unknown Area"
    End Select
 
End Sub
</code>
 
 
 
 
The unknown area is hit when you click on the header or footer, but it will not give you a row number or item where you clicked.  So its not useful.
 
I just wanted to show you that you can get the hit test to say something besides nothing.  But your right, it still needs to give use item info.


Posted By: Rafael
Date Posted: 25 January 2008 at 9:21am
I have 11.2.0, is there any changes in the 11.2.2?


Posted By: Rafael
Date Posted: 25 January 2008 at 9:29am
I guess I should have looked before asking.  Found in the what's new page:
 
 
Release Date
Version 11.2.2 December 12, 2007
Xtreme Report Control
# Type Description
1 Fixing source WatermarkAlignment added, use IconIndex and Alignment from item metrics
2 New feature Added HeaderRowsEnableSelection and FooterRowsEnableSelection properties
3 Sample update VB.Net sample updated to show new report features related to header/footer rows

Version 11.2.1 November 2, 2007
Xtreme Report Control
# Type Description
1 Fixing source AddRecordEx, RemoveRecordEx changed to work with records tree (record which has children)
2 New feature UpdateRecord method added to update record position after changing data
3 New feature HeaderRowsAllowAccess, FooterRowsAllowAccess properties added
4 Fixing source Office 2007 theme added for 'Outlook' style of header/footer rows divider
5 Fixing source Header/Footer rows small fixes
6 Fixing source Fixed access violation bug with header/footer rows printing. (Issue #15020)
7 Fixing source Removed unnecessary calls for CWnd::OnH/VScroll. Added pointer verification for not NULL before call
8 Fixing source Bug in CXTPReportControl::SetFullColumnScrolling fixed (check for m_hWnd for window related operation added)
9 New feature XTP_NM_REPORT_SELCHANGING added (Issue #15097)
10 Fixing source Other small fixes with selection, moving focus, ...
11 Sample update ReportCustomDraw MFC sample project moved from ExtendedSamples to general samples folder
 
 
 
Lots of changes to the header/footer action, we should get the new version.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net