Solved

How to size CDialogBar?

Posted on 1998-09-24
5
638 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
Comment Utility
good example you can find at: http://www.codeguru.com/docking/index.shtml
0
 

Author Comment

by:SHULTZ
Comment Utility
To: migel:
Your suggestion feel good.
0
 
LVL 1

Expert Comment

by:jclanz
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
not able to insert into temp table 68 150
move a line in eclipse 3 60
sum28 challenge 31 95
scoreUp challenge 14 47
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now