The Ribbon (suite)

To make a Ribbon button with various shapes (elements), you have to define a bimap. In my case, I have a large image named ShapesInfra.png defined in the resource as IDB_SHAPES_INFRA.

The code to create the ribbon element is simple:

CRibbonListButton *pListBtnInfra = new CRibbonListButton(ID_DESIGN_SHAPESINFRA, _T("Infrastructurenti"), 20, -1, FALSE);
pListBtnInfra->AddGroup(_T("Built-In"), IDB_SHAPES_INFRA, 64, m_arInfraShapes);
pListBtnInfra->SetIconsInRow(4);
pListBtnInfra->EnableMenuResize();
pPanelDesign->Add(pListBtnInfra);

To display a text under each bitmap,we initialize a StringArray previously in the class:

m_arInfraShapes.RemoveAll();
m_arInfraShapes.Add(_T("AD Server"));
m_arInfraShapes.Add(_T("Server"));
m_arInfraShapes.Add(_T("Web Server "));
m_arInfraShapes.Add(_T("Database Server"));
m_arInfraShapes.Add(_T("Workstation"));
m_arInfraShapes.Add(_T("Laptop"));
m_arInfraShapes.Add(_T("Firewall"));
m_arInfraShapes.Add(_T("Network"));
m_arInfraShapes.Add(_T("Virtual Server"));
m_arInfraShapes.Add(_T("Virtual Web Server"));
m_arInfraShapes.Add(_T("Virtual Database Server"));
m_arInfraShapes.Add(_T("Virtualization Server"));
m_arInfraShapes.Add(_T("AD Server"));
m_arInfraShapes.Add(_T("Server"));
m_arInfraShapes.Add(_T("Database Server"));
m_arInfraShapes.Add(_T("Server Farm"));
m_arInfraShapes.Add(_T("Workstation"));
m_arInfraShapes.Add(_T("laptop"));

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: