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 » Small Icons in Ribbonbar Collapse All
Subject Author Date
Eddie Judson Dec 4, 2006 - 11:40 PM

Hi,
I have three ribbon groups in a bar the code for the customers group is below, it should have one large icon and two small. It works sometimes but other times they are all large, can you tell me what I am doing wrong?

CExtRibbonNodeGroup * pRibbonGroup = new CExtRibbonNodeGroup( ID_RIBBON_GROUP_CUSTOMERS );
    pRibbonGroup->SetTextInToolbar( _T("Customers") );

    
    CExtRibbonNode * pNodeAddCustomers =
            new CExtRibbonNode( ID_ADD_CUSTOMER, 0, NULL, 0, _T("Add Customer") );
        pNodeAddCustomers->RibbonILE_RuleArrayGet().RemoveAll();
        HICON hIcon=(HICON)::LoadImage(::AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_ADDCUSTOMER),IMAGE_ICON,24,24,0);
        pNodeAddCustomers->m_iconBig.AssignFromHICON(hIcon,false);
    
    pRibbonGroup->InsertNode(
            NULL,
            pNodeAddCustomers
            );

    pRibbonGroup->InsertNode(
        NULL,
        new CExtRibbonNode // separator
        );

    CExtRibbonNode * pNodeEditCustomer =
            new CExtRibbonNode( ID_EDIT_CUSTOMER, 0, NULL, 0, _T("Edit Customer") );
        pNodeEditCustomer->RibbonILE_RuleArrayGet().RemoveAll();
        hIcon=(HICON)::LoadImage(::AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_EDITCUSTOMER),IMAGE_ICON,16,16,0);
        pNodeEditCustomer->m_iconSmall.AssignFromHICON(hIcon,false);
        pNodeEditCustomer->RibbonILE_RuleArrayGet().Add(__EXT_RIBBON_MAKE_RULE_ARRAY_ENTRY(__EXT_RIBBON_ILE_MAX,__EXT_RIBBON_ILV_SIMPLE_SMALL,true));
        pRibbonGroup->InsertNode(
            NULL,
            pNodeEditCustomer
            );

    CExtRibbonNode * pNodeDeleteCustomer =
            new CExtRibbonNode( ID_DELETE_CUSTOMER, 0, NULL, 0, _T("Delete Customer") );
        pNodeDeleteCustomer->RibbonILE_RuleArrayGet().RemoveAll();
        hIcon=(HICON)::LoadImage(::AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_DELETECUSTOMER),IMAGE_ICON,16,16,0);

        pNodeDeleteCustomer->m_iconSmall.AssignFromHICON(hIcon,false);
        pNodeDeleteCustomer->RibbonILE_RuleArrayGet().Add(__EXT_RIBBON_MAKE_RULE_ARRAY_ENTRY(__EXT_RIBBON_ILE_MAX,__EXT_RIBBON_ILV_SIMPLE_SMALL,true));
        pRibbonGroup->InsertNode(
            NULL,
            pNodeDeleteCustomer
            );
    

        return pRibbonGroup;



Regards,
Eddie

Technical Support Dec 5, 2006 - 1:24 PM

There two calls of pNode...->RibbonILE_RuleArrayGet().Add(...) in your code. Please invoke pNode...->RibbonILE_RuleArrayGet().RemoveAll() before each of them. The RemoveAll() produces a rule when each nodes has only a small button regardless of the window width. Is that what you are asking about?