Click here to Skip to main content
15,891,667 members
Articles / Multimedia / GDI

An Apple Style Docking Bar Implemented by eGui lib

Rate me:
Please Sign up or sign in to vote.
2.21/5 (10 votes)
22 Dec 2007CPOL 36.9K   1.2K   26   4
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:

C++
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<nitems;i++) pimagewidget="new" />

History

  • 22nd December, 2007: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Question丢人,连dll都没有 Pin
Jason.LYJ7-Sep-17 15:10
professionalJason.LYJ7-Sep-17 15:10 
GeneralMy vote of 2 Pin
bolivar1233-Mar-09 5:25
bolivar1233-Mar-09 5:25 
GeneralRe: My vote of 2 Pin
Martial Spirit19-Sep-15 2:51
Martial Spirit19-Sep-15 2:51 
I very agree you vote 2 Blush | :O
Best Regards

QuestionEGUI.DLL missing ??? Pin
MyRock4-Oct-08 23:54
MyRock4-Oct-08 23:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.