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 » About PropertyStoreSynchronize Collapse All
Subject Author Date
tera t Mar 18, 2008 - 7:02 PM

Hello.

When I carry out PropertyStoreSynchronize
Scroll is updated at the midway point of the position.

http://www.yukai.jp/~ifreeta/20080319/image01.jpg

Will not the screen update be possible in the state that fixed a scroll position?

Or,
I acquire a scroll position beforehand.
After property screen update
I want to set a scroll position

Thanks,

Technical Support Mar 19, 2008 - 6:49 AM

The CExtPropertyGridCtrl::PropertyStoreSynchronize() method completely rebuilds the content of the tree grid windows inside the property store. This method is needed when the tree structure of your property store changes seriously: the number of properties and/or categories were changed, names of properties and/or categories were changed. If your code changes the active grid cell of some property value only, then you can avoid invoking the CExtPropertyGridCtrl::PropertyStoreSynchronize() method and synchronize one property value only:

CExtPropertyGridCtrl * pPGC = . . .
CExtPropertyValue * pPV = . . .
CExtGridCell * pCellSrc = pPV->ValueActiveGet();
     ASSERT_VALID( pCellSrc );

// We assume your code will change
// the active grid cell inside pPV
// (which is pCellSrc) here.

CTypedPtrArray < CPtrArray, CExtPropertyGridWnd * > arrGrids;
       pPGC->OnPgcQueryGrids( arrGrids );
INT nGridIdx = 0;
       for( ; nGridIdx < arrGrids.GetSize(); nGridIdx ++ )
       {
                 CExtPropertyGridWnd * pGrid = arrGrids[ nGridIdx ];
                 ASSERT_VALID( pGrid );
                 // Get HTREEITEM handle which corresponds to
                 // the pPV property value:
                 HTREEITEM hTreeItem = pGrid->PropertyItemToTreeItem( pPV );
                 if( hTreeItem == NULL )
                         continue;
                 // Get the destination grid cell which is cloned from
                 // the active cell of the pPV property value:
                 CExtGridCell * pCellDst = pGrid->ItemGetCell( hTreeItem, 1 );
                 if( pCellDst == NULL )
                         continue;
                 ASSERT_VALID( pCellDst );
                 // Update destination grid cell’s value:
                 pCellDst->Assign( *pCellSrc );
                 // Repaint required part of the tree grid:
                 if( ! pGrid->IsWindowVisible() )
                         continue;
                 LONG nRowNo = pGrid->ItemGetVisibleIndexOf( hTreeItem );
                 if( nRowNo < 0 )
                         continue;
                 CRect rc;
                 if( pGrid->GridCellRectsGet(
                                   1,
                                   nRowNo,
                                   0,
                                   0,
                                   NULL,
                                   &rc
                                   )
                         )
                 {
                         CRect rcClient;
                         pGrid->GetClientRect( &rcClient );
                         rc.left = rcClient.left;
                         rc.right = rcClient.right;
                         pGrid->InvalidateRect( &rc );
                 }
       }


tera t Apr 16, 2008 - 7:13 PM

Hello.


Only in InvalidateRect, there was time when it was not updated immediately.

So I carried out pGrid->UpdateWindow.


pGrid->InvalidateRect( &rc );

pGrid->UpdateWindow();


Is there a problem?


 

Technical Support Apr 18, 2008 - 3:33 AM

Yes, you can invoke the InvalidateRect() Win32 API many times for marking parts of window surface which needs to be repainted. Then you can invoke the UpdateWindow() Win32 API once for immediate repainting.