Solved

How to size CDialogBar?

Posted on 1998-09-24
5
671 Views
Last Modified: 2013-11-19
VC5 - MFC

I would like to build a dialog bar with a listview. It is easy to do, but I need a docking resizeable dialog bar... and I cannot find any solution.
I use a CDialogBar type object.
0
Comment
Question by:SHULTZ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 12

Expert Comment

by:migel
ID: 1322583
good example you can find at: http://www.codeguru.com/docking/index.shtml
0
 

Author Comment

by:SHULTZ
ID: 1322584
To: migel:
Your suggestion feel good.
0
 
LVL 1

Expert Comment

by:jclanz
ID: 1322585
To set the size of the dialog bar, you must derive a class from the CDialogBar and override the function CalcFixedLayout()

CSize CMyDialogBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
{
  CSize size;
  size.cx = m_Width;   // fix the width of the dialog
  size.cy = m_Height;  // fix the height of the dialog
  return size;
}

Of course, you must capture the mouse events, track the dialog bar size and position and save this in the dialog bar.

regards, jean-claude.

0
 

Author Comment

by:SHULTZ
ID: 1322586
My problem is just in the clause you begin with "Of course" :-)
I'm looking for some examples about tracking and resizing docking dialogbar. Sorry.
0
 

Accepted Solution

by:
exseal earned 100 total points
ID: 1322587
http://www.codeguru.com/

If you will look at the "advanced ui" setion here at Code Guru, I am certain that you will find answers, In particular, Kirk Stowell has the MFCUIX Library and demo code to do this.

I would recommend to you to go there and download the Source for MFCUIX.

Creating a Dialog bar with a listview is very easy. If you create a dialog bar with an initial size (CSize(200,220) and dock it to AFX_IDW_TOOLBAR_LEFT it will fill the client area on it's own. When it floats, it will be 200,220.
The Listview will have to be sized to the rect of the Dialog bar.

The rest is onWindowPosChanged, and other windoes messages. Look at Kirk's stuff.. Solid example.
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question