Solved

How to size CDialogBar?

Posted on 1998-09-24
5
647 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
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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need a Shell script to start a service checking the port 6 50
unable to delete all specified values regedit 38 420
has22 challenge 11 96
Path of Workbook 3 79
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

810 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