Click here to Skip to main content
Click here to Skip to main content

Collapsible, resizable and dockable XP style control bar

By , 22 Sep 2003
 

Introduction

This class can be used to create a collapsible, resizable and dockable XP style control bar with very few lines of code.

The following files must be added to your project.

  • CollapsiblePanel.h
  • CollapsiblePanel.cpp

Resources

  • An empty dialog to define the initial control bar size.
  • A bitmap image for the logo of the button (if required).
  • A bitmap image for the expand icon of the button.
  • A dialog that will be displayed by the collapsible button.

Sample code

In your CMainFrame header file, define a variable of the type CCollapsiblePanel :

CCollapsiblePanel m_wndCollapsiblePanel;

In the CMainFrame::OnCreate() method, create the CDialog corresponding to the panels of the collapsible button :

CDialog* m_wndView1 = new CDialogButton1();

Set the Collapsible control bar (dockable, color and bitmaps.) :

m_wndCollapsiblePanel.CreateTheContainer(this, IDD_PANEL, true);
m_wndCollapsiblePanel.SetTheBkColor(RGB(100, 149, 237)); 
//m_wndCollapsiblePanel.SetDefaultSystemColor();
m_wndCollapsiblePanel.SetExpandBitmap(IDB_BITMAP_EXPAND);

Indicate if the program uses a toolbar or a status bar.

m_wndCollapsiblePanel.SetTheControlBar(&m_wndToolBar, &m_wndStatusBar);

Finally append the buttons.

m_wndCollapsiblePanel.AppendButton("Text Button 1", 
  IDB_BITMAP_DW, m_wndView1, IDD_DIALOG_BUTTON1);
m_wndCollapsiblePanel.AppendButton("Text Button 2", IDB_BITMAP_FW, 
  m_wndView2, IDD_DIALOG_BUTTON2);
m_wndCollapsiblePanel.AppendButton("text Button 3", NULL, NULL, NULL);

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

About the Author

Nicolas Gazelle
Web Developer
Monaco Monaco
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralXP Colors of your barsmemberMichael A. Rusakov30 Sep '03 - 2:41 
Hello!
 
You are using the static colors which would not be changed if I change a WinXP visual theme. How to find constans of such colors (for example WinXP shows different, theme dependend colors on it's search panel). I'm looking for these, and I mean they are undocumented?
 
I'm wondering if you know. Wink | ;)
 
Please advise.
Thank you!
 
Sincerely,
Michael Rusakov.
http://www.wincatalog.com
GeneralRe: XP Colors of your barsmemberNguyen Huu Hoa1 Oct '03 - 20:24 
I found Bruno Podetti implement it in his "New Menu" project (can be reached at www.podetti.com/NewMenu .You can find a function that can detect current theme for WinXP (now it is only for Blue, Oliver Green, and Silver) called CNewMenu::GetMenuBarColor2003();
 
Hope this help.
Hoa, Nguyen H.
GeneralRe: XP Colors of your barsmemberMichael A. Rusakov3 Oct '03 - 2:43 
Hi!
 
Thank you for your answer! It helped. A bit. Smile | :)
 
The declared function (called CNewMenu::GetMenuBarColor2003()) works only for standard predefined schemes. Now I can define colors in my application for each of them. But there are heaps of free and non-free custom XP themes. How to make my software supported all of them?
 
Here is my problem... Shucks | :->
 
Thanks again and thanks forward for your answers!
 
Sincerely,
Michael Rusakov.
http://www.wincatalog.com

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

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 23 Sep 2003
Article Copyright 2003 by Nicolas Gazelle
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid