Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Docked or not? What is the position?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Docked or not? What is the position?

 Post Reply Post Reply
Author
Message
chrisjohnson View Drop Down
Newbie
Newbie


Joined: 28 March 2005
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisjohnson Quote  Post ReplyReply Direct Link To This Post Topic: Docked or not? What is the position?
    Posted: 07 April 2005 at 3:34am
I have an MDI child window (CXTPFrameWndBase<CMDIChildWnd>) with a toolbar on it.  This child window also hosts a splitter window (CXTSplitterWnd member created using CreateStatic in OnCreateClient). I want the toolbar to be able to be docked on any side of the MDI window. It is also possible that I will have multiple toolbars which could be docked (or floating) anywhere.

I have overridden the OnSize method for the child window, so that I can call "MoveWindow" on the splitter window member, so that it is resized properly.  Unfortunately, I am having trouble determining the new window position because of the toolbars. (Note: In all of the demo applications (that I could see) that do something similar, there is only one toolbar, and it is assumed that it is docked at the top.)

GetClientRect returns a rect that includes the toolbars, so now I have to trim down that rect with toolbar rects (which also means deriving from CXTPCommandBar to access the private m_barPosition member).

Is there an easier way to do this? Am I doing something wrong?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 07 April 2005 at 1:16pm

See in MSDN RepositionBars function

nFlag must be CWnd::reposQuery   



Edited by oleg
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
chrisjohnson View Drop Down
Newbie
Newbie


Joined: 28 March 2005
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisjohnson Quote  Post ReplyReply Direct Link To This Post Posted: 07 April 2005 at 2:14pm
Thanks.

Actually as I was doing the work to use what you suggested, I noticed that I no longer need to call MoveWindow on the splitter... I don't know what changed, but everything works fine without that call now.

Chris
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.