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 » Dynamically changing CExtPropertyGridCtrl Collapse All
Subject Author Date
Niksa Orlic Aug 9, 2005 - 12:57 PM

I want to change the CExtPropertyCategory title when user clicks a button. I construct the category item using this code:

m_pConfigurationCategory = 
	new CExtPropertyCategory(configurationCategoryName);
m_catBuildConfigurations->ItemInsert(m_pConfigurationCategory);

Where m_pConfigurationCategory is CExtPropertyCategory* - everything works fine here.


When a button is pressed, the following code is executed:

m_pConfigurationCategory->NameSet(someText);

m_propertyCtrl.PropertyStoreSynchronize();

m_propertyCtrl is CExtPropertyGridCtrl. The program crashes inside the call to PropertySyncronize(), with the following error:

The value of ESP was not properly saved across a function call. This is 
usually a result of calling a function declared with one calling convention 
with a function pointer declared with a different calling convention.

If I don’t call PropertySyncronize(), the visible name on the screen is not changed. What am I doing wrong?


Best regards,
Niksa

Technical Support Aug 10, 2005 - 12:49 PM

We updated the source code both for the CExtPropertyGridCtrl class and the classes implementing its parts. Now the property grid control is much more safer for rebuilding tree grid’s content when finalizing the input in the grid cell. Drop us e-mail so that we can provide you with the latest source code.

Additionally we should note that synchronization of the property store resets the collapsed/expanded state for all the rows in the tree grids into their initial state. So, it is also possible to update text in the grid cell describing the renamed property category instead of invoking the property store synchronization control. First of all, your code should rename the property category as you did before:

CExtPropertyCategory * m_pConfigurationCategory = . . .
LPCTSTR strNewNameOfTheCategory = . . .
    m_pConfigurationCategory->NameSet(
        strNewNameOfTheCategory
        );

Then your code should access all the grid cells instantiated for this property category in all the tree grid windows created in the property grid control:
CExtPropertyGridCtrl * pPGC = . . .
CTypedPtrArray
        < CPtrArray, CExtPropertyGridWnd * >
        arrGrids;
    pPGC->OnPgcQueryGrids( arrGrids );
INT nGridIdx = 0;
    for( ; nGridIdx < arrGrids.GetSize(); nGridIdx ++ )
    {
        CExtPropertyGridWnd * pGrid =
            arrGrids[ nGridIdx ];
        ASSERT_VALID( pGrid );
        HTREEITEM hTreeItem =
            pGrid->PropertyItemToTreeItem(
                m_pConfigurationCategory
                );
        if( hTreeItem == NULL )
            continue;
        CExtGridCell * pCellCategory =
            pGrid->ItemGetCell( hTreeItem, 0 );
        ASSERT_VALID( pCellCategory );
        pCellCategory->TextSet(
            strNewNameOfTheCategory
            );
        if( ! pGrid->IsWindowVisible() )
            continue;
        int nPlainRowIndex =
            pGrid->ItemGetVisibleIndexOf(
                hTreeItem
                );
        if( nPlainRowIndex < 0 )
            continue;
        CRect rcCellExtra;
        pGrid->GridCellRectsGet(
            0,
            nPlainRowIndex,
            0,
            0,
            NULL,
            &rcCellExtra
            );
        pGrid->InvalidateRect(
            &rcCellExtra
            );
        pGrid->UpdateWindow();
    }

Niksa Orlic Aug 10, 2005 - 1:38 PM

My email is niksa.orlic AT fer.hr.


Another question: I want resizable control bar to look just like fixed size panel (with toolbar-like gripper instead of titlebar). Is there any ’easy’ way to do this, or I have to mess with paint manager?


Thanks,
Niksa

Technical Support Aug 11, 2005 - 11:50 AM

We have sent you instructions on how to download the latest source code.

Please let us know details on the custom panel bar. Would you like to see the dot-based gripper like in toolbars when the style 2003 is applied or you want to see the toolbar used in the caption of the panel bar as it is done in the task area in MS Word 2003? Could you tell us whether you have seen the bar you need and send us a screen shot? We will help you get exactly what you need.

Niksa Orlic Aug 12, 2005 - 3:42 AM

I want to see the dot-based gripper in resizable control bar. Currently my control bar looks like this:


http://www.midletpascal.com/img1.png


But I want it to appear like in this picture:


http://www.midletpascal.com/img2.png


One more thing: how can I determine which CExtGridCell is currently selected in CExtPropertyGridCtrl?


Thanks for your great support,
Niksa

Technical Support Aug 14, 2005 - 12:26 PM

Thank you for sharing your ideas and requirements with us. We are working on a new sample application which will demonstrate the customizable behavior of resizable control bars and we will implement the control bars like on your screen shot in it. Could you wait a few days until this application is ready?

Niksa Orlic Aug 16, 2005 - 12:29 AM

No problem and thanks again.

Niksa