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 » Category in CExtToolBoxWnd Collapse All
Subject Author Date
Andrew Cochran Jul 13, 2006 - 2:29 AM

I need to delete or hide categories in ToolBox, would you suggest me how to do this?

For example I have such:

- Category 1
element 1
element 2
element 3
.........
element N

But want it to look like this:

element 1
element 2
element 3
.......
element N

Andrew Cochran Jul 13, 2006 - 4:42 AM

I have to do it dynamically in runtime. Is there any way to do it?

Technical Support Jul 13, 2006 - 12:25 PM

You should use a CExtToolBoxWnd-derived class in which the OnToolBoxWndMasureItem() virtual method is overriden like as follows:

CSize CYourToolBoxWithoutGroups::OnToolBoxWndMasureItem(
    CExtToolBoxWnd::TOOLBOX_ITEM_DATA * pTBCI,
    CDC & dc
    )
{
    ASSERT_VALID( this );
    if( pTBCI->ItemGetNext( __TBCGN_PARENT ) == ItemGetRoot() )
        return CSize( 0, 0 );
    return CExtToolBoxWnd::OnToolBoxWndMasureItem( pTBCI, dc );
}
This implementation of the OnToolBoxWndMeasureItem() virtual method simply makes all group items having a zero size and, as result, you do not see any groups at all. But you should not forget to expand programmatically all the "invisible" groups to make the bottom level toolbox items accessible for the user.

To make toolbox layout modifications visible at run time, you should invoke the CExtToolBoxWnd::UpdateToolBoxWnd() method to apply the layout changes.

Andrew Cochran Jul 19, 2006 - 2:47 AM

Thank you, very much.

It was helpfull!

Best regards!