HitTest and HeaderRows |
Post Reply |
Author | |
mlatona
Senior Member Joined: 19 April 2005 Location: Germany Status: Offline Points: 124 |
Post Options
Thanks(0)
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
|
|
Rafael
Newbie Joined: 26 November 2007 Location: United States Status: Offline Points: 28 |
Post Options
Thanks(0)
|
Are you clicking on a column header? You can catch that event with ReportControl_ColumnClick(column)
|
|
mlatona
Senior Member Joined: 19 April 2005 Location: Germany Status: Offline Points: 124 |
Post Options
Thanks(0)
|
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.
|
|
Rafael
Newbie Joined: 26 November 2007 Location: United States Status: Offline Points: 28 |
Post Options
Thanks(0)
|
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?
|
|
mlatona
Senior Member Joined: 19 April 2005 Location: Germany Status: Offline Points: 124 |
Post Options
Thanks(0)
|
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.
|
|
Rafael
Newbie Joined: 26 November 2007 Location: United States Status: Offline Points: 28 |
Post Options
Thanks(0)
|
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.
|
|
Rafael
Newbie Joined: 26 November 2007 Location: United States Status: Offline Points: 28 |
Post Options
Thanks(0)
|
I have 11.2.0, is there any changes in the 11.2.2?
|
|
Rafael
Newbie Joined: 26 November 2007 Location: United States Status: Offline Points: 28 |
Post Options
Thanks(0)
|
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.
|
|
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 |