Solved

How to size CDialogBar?

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ BOOL WINAPI ReadFile fails on windows 10 when reading from USB cable 9 547
if loop in java 3 174
wordcount challenge 11 163
Can not remove SSL certificate on iPhone 6 - iOS10.2 12 1,670
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 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