|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Martin Baumgaertner
|
Jan 17, 2008 - 10:38 AM
|
Hello ProfUIS-Team,
after having updated from v2.80 to v2.82 there seems to be a different behaviour concerning the alignment of the first column when there are at least two items present in the group area: in v2.80 the first column was nicely aligned with the lowermost group item, while in v2.82 the first column is always left aligned with respect to the first header column.
Is there a way (option?) to get the "old" behaviour under v2.82?
Thanks in advance and greetings from Germany (you’re doing a great job!),
Martin
|
|
Martin Baumgaertner
|
Jan 28, 2008 - 3:36 AM
|
Just not to be forgotten ... ;-)
Should I override some special virtual function from base class to get the correct behaviour?
Martin
|
|
Martin Baumgaertner
|
Jan 18, 2008 - 6:47 AM
|
Now I took the code from v2.82 to override CExtReportGridWnd::OnGbwAdjustRects (the code from above didn’t indent the first column) and it nearly works like it should.
The only thing that is not so nice is that if selecting a data row then a dotted rectangle is drawn around the whole row and not only around the indented part of the row.
Should I override some special virtual function from base class to get the correct behaviour?
Martin
|
|
Technical Support
|
Jan 18, 2008 - 4:22 AM
|
The new row layout was requested many times by Prof-UIS users and it’s better looking in a horizontally scrollable item-by-item report grid (this is well supported starting from 2.82 only). Here is the older version of the CExtReportGridWnd::OnGbwAdjustRects() virtual method which you can override in your report grid class and make rows having the older fashion: void CExtReportGridWnd::OnGbwAdjustRects(
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
RECT & rcCellExtraA,
RECT & rcCellA
) const
{
ASSERT_VALID( this );
LONG nChildCount = 0L;
HTREEITEM hTreeItem = NULL;
if( nRowType == 0 && nColType == NULL )
{
hTreeItem = ItemGetByVisibleRowIndex( nRowNo );
if( hTreeItem != NULL )
{
nChildCount = ItemGetChildCount( hTreeItem );
if( nChildCount == 0 )
return;
}
}
CExtTreeGridWnd::OnGbwAdjustRects(
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtraA,
rcCellA
);
if( nColType != 0 || nRowType != 0 )
return;
LONG nColFirst = 0, nColLast = 0, nColFirstOffset = 0;
OnGbwQueryVisibleColumnRange(
nColFirst,
nColLast,
nColFirstOffset
);
ASSERT( nColFirst <= nColLast );
if( nColNo != nColFirst )
{
::SetRectEmpty( &rcCellA );
::SetRectEmpty( &rcCellExtraA );
return;
} // if( nColNo != nColFirst )
CRect rcClient = OnSwGetClientRect();
CSize _sizeTotal = OnSwGetTotalSize();
CPoint _pos = OnSwGetScrollPos();
DWORD dwBseStyleEx = BseGetStyleEx();
DWORD dwScrollTypeH = SiwScrollTypeHGet();
if( dwScrollTypeH == __ESIW_ST_NONE
&& (dwBseStyleEx&__EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS) != 0
)
{
_sizeTotal.cx = OnSwGetClientRect().Width();
_pos.x = 0;
}
if( _sizeTotal.cx < 0 )
_sizeTotal.cx = 0;
if( _sizeTotal.cy < 0 )
_sizeTotal.cy = 0;
LONG nRight = rcClient.left + _sizeTotal.cx - _pos.x;
rcCellA.right = rcCellExtraA.right = nRight;
if( rcCellA.right < rcCellA.left )
rcCellA.right = rcCellA.left;
if( rcCellExtraA.right < rcCellExtraA.left )
rcCellExtraA.right = rcCellExtraA.left;
}
|
|
Suhai Gyorgy
|
Jan 18, 2008 - 2:34 AM
|
The "old" behaviour was buggy. Check out this thread: Grouped ReportGrid - painting problem. I don’t see in the version history anything that would suggest that the "other mode for data rows" mentioned in the above thread would be available.
|
|