Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

An Apple Style Docking Bar Implemented by eGui lib

0.00/5 (No votes)
22 Dec 2007 1  
An apple style docking bar implemented by eGui lib
Screenshot -

Introduction

With eGUI widget lib, you can easily implement an apple-style docking bar. Here I introduce some code for how to implement this bar. You can visit eGui project to know more about eGUI project and source codes of eGui lib.

Using the Code

eGUI provides a CBarWidget used to implement this feature. It is easy to use using the following steps:

void CMainMenuView::TestBarWidget()
{
int nItems=8;
//Create a CBarWidget
CBarWidget* pBarWidget = new CBarWidget();
m_pBarWidget=pBarWidget;
//Listen to the CBarWidget's event
this->m_pBarWidget->GetEventModel()->AddListener(this->GetEventListener());
pBarWidget->SetBackgroundColor(RGB(216,233,226));
//Insert the CBarWidget into container.
this->m_pRootContainer->InsertWidget(pBarWidget);
WRect rc;
this->m_pRootContainer->GetRect(&rc);
rc.x=0;
rc.y=rc.dy-100;
rc.dy=150;
//Set Bar Widget's size, note which will be re-sized automatically if you add more items.
pBarWidget->SetRect(&rc);
//Use a for loop to add the CImageWidget as the item.
//note, the item can be any type widget.
char draw_cmd[128];
char img_fn[128];
CImageWidget* pImageWidget = NULL;
rc.dy=48;
rc.dx=48;
WRect rcW;
for(int i=0;i"new" />

History

  • 22nd December, 2007: Initial post

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here