Solved

How to size CDialogBar?

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
not able to insert into temp table 68 169
how do i create updater to My Activex application? 3 97
Doc'in system (example?) BA 7 116
EvenOdd challenge 10 128
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 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