Professional UI Solutions
Site Map   /  Register
 
 

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.

Forums » Prof-UIS Tech Support » Tree cell joining still not working in 2.84 Collapse All
Subject Author Date
Offer Har Nov 18, 2008 - 3:09 PM

I got the latests build (Nov 17)


I have a two column tree grid, I too joing two cells, and I have the HTREEITEM. this is what I do:


 


    GridCellJoinSet(CSize(2,1), 0, ItemGetVisibleIndexOf(hti));


I see that something is happeneing, but it does not look good... when the text is too long, it looks lite it is cut and placed on top of the first part of the text.


Is this the right way to join cells?


Please note that I use the setting of the auto adjust of the columns width using __EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS.

Offer Har Nov 19, 2008 - 9:09 AM

Here is a picture to explain the bug:


Technical Support Nov 20, 2008 - 1:13 PM

We have fixed this issue. You can re-download the latest source code marked with 2008-11-19 text in the name of ZIP file. Alternatively, you can update only the source code for the following method:

 bool CExtGridWnd::OnSiwWalkCell(
      CDC & dc,
      LPVOID pQueryData,
      LONG nVisibleColNo,
      LONG nVisibleRowNo,
      LONG nColNo,
      LONG nRowNo,
      const RECT & rcCellExtra,
      const RECT & rcCell,
      const RECT & rcVisibleRange,
      bool & bVirtualRightReached,
      bool & bVirtualBottomReached,
      DWORD dwAreaFlags,
      bool bFocusedControl
      ) const
{
      ASSERT_VALID( this );
INT nColType = CExtGridHitTestInfo::GetInnerOuterTypeOfColumn( dwAreaFlags );
INT nRowType = CExtGridHitTestInfo::GetInnerOuterTypeOfRow( dwAreaFlags );
INT nFriendlyColNo = nColNo;
INT nFriendlyRowNo = nRowNo;
      if(         ( nColType != 0 || nRowType != 0 )
            &&    ( nFriendlyColNo < 0 || nFriendlyRowNo < 0 )
            )
      {
            ASSERT( ! (nFriendlyColNo < 0 && nFriendlyRowNo < 0 ) );
            if( nFriendlyColNo < 0 )
                  nFriendlyColNo = (-nFriendlyColNo) - 1;
            if( nFriendlyRowNo < 0 )
                  nFriendlyRowNo = (-nFriendlyRowNo) - 1;
            ASSERT( nFriendlyColNo >= 0 );
            ASSERT( nFriendlyRowNo >= 0 );
      } // if( ( dwAreaFlags & __EGBWA_OUTER_CELLS ) != 0 ...
      else
      {
            ASSERT( nFriendlyColNo >= 0 );
            ASSERT( nFriendlyRowNo >= 0 );
      } // else from if( ( dwAreaFlags & __EGBWA_OUTER_CELLS ) != 0 ...
CSize sizeJoin = OnGbwCellJoinQueryInfo( nFriendlyColNo, nFriendlyRowNo, nColType, nRowType );
CRect rcCellExtraA = rcCellExtra, rcCellA = rcCell;
      if(         sizeJoin.cx != 1
            ||    sizeJoin.cy != 1
            )
      {
            bool bRetVal = OnGbwCalcVisibleItemRect( nFriendlyColNo, nFriendlyRowNo, nColType, nRowType, rcCellExtraA, rcCellA );
            if( ! bRetVal )
                  return false;
            CExtMemoryDC dcX;
            CFont * pRequiredFont = NULL, * pOldFont = NULL;
            if( dc.GetSafeHdc() != NULL )
            {
                  CRect rcMemDcItem = rcCellExtra;
                  dcX.__InitMemoryDC(
                        &dc,
                        &rcMemDcItem,
                        CExtMemoryDC::MDCOPT_TO_MEMORY | CExtMemoryDC::MDCOPT_RTL_COMPATIBILITY
                        );
                  dcX.SetTextColor( dc.GetTextColor() );
                  dcX.SetBkColor( dc.GetBkColor() );
                  dcX.SetBkMode( dc.GetBkMode() );
                  pRequiredFont = dc.SelectObject( & OnSiwGetDefaultFont() );
                  pOldFont = dcX.SelectObject( pRequiredFont );
                  OnSiwPaintBackground( dcX, bFocusedControl );
                  OnGbwEraseArea( dcX, rcMemDcItem, dwAreaFlags );
            }
            LONG nRealColNo = nFriendlyColNo, nRealRowNo = nFriendlyRowNo;
            if( sizeJoin.cx <= 0 || sizeJoin.cy <= 0 )
            {
                  if( sizeJoin.cx < 0 )
                        nRealColNo += sizeJoin.cx;
                  if( sizeJoin.cy < 0 )
                        nRealRowNo += sizeJoin.cy;
                  CRect rcCellExtraReJoined = rcCellExtraA;
                  CRect rcCellReJoined = rcCellA;
                  OnGbwAdjustRects(
                        nRealColNo, nRealRowNo,
                        CExtGridHitTestInfo::GetInnerOuterTypeOfColumn(dwAreaFlags),
                        CExtGridHitTestInfo::GetInnerOuterTypeOfRow(dwAreaFlags),
                        rcCellExtraReJoined, rcCellReJoined
                        );
                  if( sizeJoin.cx < 0 )
                  {
                        rcCellExtraA.left = rcCellExtraReJoined.left;
                        rcCellExtraA.right = rcCellExtraReJoined.right;
                        rcCellA.left = rcCellReJoined.left;
                        rcCellA.right = rcCellReJoined.right;
                  }
                  if( sizeJoin.cy < 0 )
                  {
                        rcCellExtraA.top = rcCellExtraReJoined.top;
                        rcCellExtraA.bottom = rcCellExtraReJoined.bottom;
                        rcCellA.top = rcCellReJoined.top;
                        rcCellA.bottom = rcCellReJoined.bottom;
                  }
            }
            bRetVal =
                  CExtGridBaseWnd::OnSiwWalkCell(
                        dcX, pQueryData, nVisibleColNo, nVisibleRowNo, nRealColNo, nRealRowNo, rcCellExtraA, rcCellA,
                        rcVisibleRange, bVirtualRightReached, bVirtualBottomReached, dwAreaFlags, bFocusedControl
                        );
            if( dc.GetSafeHdc() != NULL )
            {
                  pRequiredFont = dcX.SelectObject( pOldFont );
                  dc.SelectObject( pRequiredFont );
                  dcX.__Flush( TRUE );
                  // fix with shifted outline
                  if( ( dwAreaFlags & __EGBWA_INNER_CELLS ) != 0 )
                  {
                        bool bGridLinesHorz = false, bGridLinesVert = false;
                        if(         sizeJoin.cx > 1
                              &&    sizeJoin.cy >= 0
                              )
                        {
                              bGridLinesHorz =
                                    ( rcCell.top == rcCellA.top && rcCell.bottom == rcCellA.bottom )
                                    &&
                              //    GridLinesHorzGet();
                                    OnGbwQueryCellGridLines(
                                          true, dc,
                                          nVisibleColNo, nVisibleRowNo, nRealColNo, nRealRowNo,
                                          rcCellExtraA, rcCellA, rcVisibleRange, dwAreaFlags, 0
                                          );
                        }
                        if(         sizeJoin.cx >= 0
                              &&    sizeJoin.cy > 1
                              )
                        {
                              bGridLinesVert =
                                    ( rcCell.left == rcCellA.left && rcCell.right == rcCellA.right )
                                    &&
                              //    GridLinesVertGet();
                                    OnGbwQueryCellGridLines(
                                          false, dc,
                                          nVisibleColNo, nVisibleRowNo, nRealColNo, nRealRowNo,
                                          rcCellExtraA, rcCellA, rcVisibleRange, dwAreaFlags, 0
                                          );
                        }
                        if( bGridLinesHorz || bGridLinesVert )
                        {
                              COLORREF clrFace = OnGbwQueryGridLinesColor();
                              if( bGridLinesHorz )
                              {
                                    dc.FillSolidRect( rcCell.left - 1, rcCell.top - 1, rcCell.right - rcCell.left, 1, clrFace );
                                    dc.FillSolidRect( rcCell.left - 1, rcCell.bottom - 1, rcCell.right - rcCell.left, 1, clrFace );
                              }
                              if( bGridLinesVert )
                              {
                                    dc.FillSolidRect( rcCell.left - 1, rcCell.top, 1, rcCell.bottom - rcCell.top, clrFace );
                                    dc.FillSolidRect( rcCell.right - 1, rcCell.top, 1, rcCell.bottom - rcCell.top, clrFace );
                              }
                        }
                  }
            }
            return bRetVal;
      }
bool bRetVal =
            CExtGridBaseWnd::OnSiwWalkCell(
                  dc, pQueryData, nVisibleColNo, nVisibleRowNo, nColNo, nRowNo, rcCellExtraA, rcCellA,
                  rcVisibleRange, bVirtualRightReached, bVirtualBottomReached, dwAreaFlags, bFocusedControl
                  );
      if( ! bRetVal )
            return false;
      return true;
}