CodeProject: Collapsible, resizable and dockable XP style control bar. Free source code and programming help
2008-07-24 23:19
776 查看
Download demo project - 209 Kb
The following files must be added to your project.
CollapsiblePanel.h
CollapsiblePanel.cpp
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.
In the
Set the Collapsible control bar (dockable, color and bitmaps.) :
Indicate if the program uses a toolbar or a status bar.
Finally append the buttons.
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 yourCMainFrameheader file, define a variable of the type
CCollapsiblePanel:
CCollapsiblePanelm_wndCollapsiblePanel;
In the
CMainFrame::OnCreate()method, create the
CDialogcorresponding 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);
相关文章推荐
- CodeProject: MP3FileInfo - Extract Header and ID3 Tags of an MP3 File. Free source code and programming help
- CodeProject: EasySize - Dialog resizing in no time!. Free source code and programming help
- CodeProject. Free source code and programming help
- CodeProject: EasySize - Dialog resizing in no time!. Free source code and programming help
- Serial library for C++. Free source code and programming help
- 音乐频谱显示 FFT of waveIn audio signals. Free source code and programming help
- Ctags and Taglist: Convert Vim Editor to Beautiful Source Code Browser for Any Programming Language
- Programming tutorials and source code examples
- How does NDepend help me have a better understanding and control over my .NET code?
- Atlas Control Toolkit and Source Code for the Build-in Asp.Net 2.0 Providers
- Using Source Code Control with LabVIEW and Perforce
- Licenses.licx gets modified whenever a form is modified in design mode and must be checked in if the project is under Source Control
- Atlas Control Toolkit and Source Code for the Build-in Asp.Net 2.0 Providers
- 6 Source Code Search Engines You Can Use For Programming Projects
- Free Numerical, Mathematical, Statistics Libraries and Source Code
- neural style demo and source code
- Code and Project Source Tips
- SVN: 源代码控制【Source Control Using VisualSVN Server and Tortois
- Test-Driven C#: Improve the Design and Flexibility of Your Project with Extreme Programming Techniques
- How to build and debug android source code