Resizable Docking Window 2 Kansas

Visual Studio-like dialogbar

Local Companies

Midwest CAM Solutions (GibbsCAM)
877-444-0982
NOW SERVING: KANSAS
Wichita, KS
Professional Software Inc
(316) 269-4264
800 E 1st St Ste 150
Wichita, KS
Radio Shack Dealer
(913) 755-2772
537 Main St
Osawatomie, KS
Jass Consulting Llc
(913) 837-5392
PO Box 1122
Louisburg, KS
Brainworks Software
(316) 722-8100
7570 W 21st St N
Wichita, KS
Mersoft Corporation
913-871-6196
9300 W. 110th Street
Overland Park, KS
Access Group LLC
(316) 264-0270
348 Ida St.
Wichita, KS
Allen Gibbs & Houlik L C Agh
(316) 267-7231
301 N Main St Ste 1700 Epic Center
Wichita, KS
First Student Inc
(913) 294-4425
1010 N Pearl St
Paola, KS
Backup Solutions
(316) 944-4448
2707 W Douglas Ave Ste B
Wichita, KS

provided by: 
Originally published at Internet.com


This article was contributed by Cristi Posea.

Features

Control bar like in DevStudio, that size both when docked and when floating.

The source code is free !

Easy to use: just derive your own control bar from CSizingControlBar and add your child controls.

Instructions

Derive a class from CSizingControlBar (you have an example in mybar.h and mybar.cpp).

Add a member variable to CMainFrame (in mainfrm.h). CMyBar m_wndMyBar;

Create the bar in CMainFrame::OnCreate(). Then set bar styles, enable it to dock... like any control bar. if (!m_wndMyBar.Create(this, CSize(200, 100), AFX_IDW_CONTROLBAR_FIRST + 32)) { TRACE0("Failed to create mybar\n"); return -1; // fail to create }

Override CMainFrame::RecalcLayout().
Note: use the base framewnd class member function, ie if you have an SDI application replace CMDIFrameWnd with CFrameWnd below. void CMainFrame::RecalcLayout(BOOL bNotify) { CMDIFrameWnd::RecalcLayout(bNotify); CMDIFrameWnd::RecalcLayout(bNotify); }

Because of RecalcLayout mechanism in MFC, I had to use several tricks to improve the look of control bar. One of them is the double call to RecalcLayout() for controlbar to stretch correctly. The other is that the height of the control bar is 4 pixel larger than its DockBar when docked vertically. So take care of OnSize() member function of your derived class. An example for a control bar with one child control is CMyBar, also included.

Download Source 8KB
The zip file contains the CSizingControlBar class, a sample class CMyBar derived from CSizingControlBar and the CMainFrame class from a MDI application which have a CMyBar control bar.

Author: Cristi Posea

Read article at Internet.com site

Featured Local Company

Mersoft Corporation

913-871-6196
9300 W. 110th Street
Overland Park, KS
http://www.mersoft.com

Related Local Event
Influencing without Authority
Dates: 12/3/2009 - 12/3/2009
Location: CMD Training Center WSU campus
Wichita, KS
View Details

Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML