Originally posted by: MinhDung
In the SDBDEMO project, I don't known where the pointer m_pDockBar is declared. Is it a CDockBar pointer?. How can I use it? Please tell me. Thank you very much.
ReplyOriginally posted by: Arnaud Lemoy
I need to intercept buttons closing. I use the following
code on a derived class from CSizingControlBar. Could someone tell me if there is a better way to do
this.
void C... ::OnNcLButtonDown(UINT nHitTest, CPoint point)
{
if (nHitTest == HTCLOSE)
.....
CSizingControlBar::OnNcLButtonDown(nHitTest, point);
}
Originally posted by: Russ Russell
Anyone know how to make CDialogBars fit into this type of functionality easily? Specifically saving/loading the resized windows in their correct positions.
ReplyOriginally posted by: Cristi Posea
Hi all,
From the start I will say that using CView-based classes to implement children of control bars is not the best ideea. The MFC framework for doc/view/frame is not that flexible. There are a lot of issues related to this, and if you are not a MFC guru, it is likely you will run into trouble.
As an exercise, please look after CWnd::GetParentFrame() implementation in the MFC sources (wincore.cpp) and hunt for the places it is called from.
A view has a close relationship with it's parent frame. The bad news is that the control bars can switch the parent frames: when a bar is docked, it is ultimately the child of CMainFrame (usually a CMDIFrameWnd for MDI or CFrameWnd for SDI). When it is floating, it's parent frame is a CMiniDockFrameWnd, which in turn is child of the desktop (no parents).
The things get more complicated when a doc is involved. OnCloseDocument() destroys the parent frames of all its views.
There are more of this, and I will not list them here. If you are curious, of if you are determined to put a view on a control bar, take a look at the articles in this section, as well as at the ones in "advanced ui". You will find useful information if you also read the comments :)
Here are the main issues:
1.doc template/doc/parent/view frame relationship
2.activation/focus control
3.message routing/accelerators
4.creation/destruction
So, my advice is to use plain CWnd based controls where you can. Dialogs, toolbars(!), are good too.
Updated 15.06.1999:
A few users told me that they successfully used CView derived windows with this control bar by providing
a parent frame which is the real child of the bar (so the view's parent frame is always the same, and can be
controlled).
I didn't try this until now, but you can give this a try.
Cheers,
Cristi
Reply
Originally posted by: newton1
I'm trying to use this funky toolbar/button ctrl in my app. What I'm having problems with is the frame always taking up the width of my client area when docked. I've reset the default button size to always be consistent with my other toolbar buttons, but with the frame extending way beyond the button size, this doesn't allow me to position my other toolbars right up next to the sizable toolbar. If anyone has any insight on this matter, please let me know either here or email me at newton1@hotmail.com
Thanks for the help, and Cristi...excellent class!!!
Sincerely,
newton
Originally posted by: sexy boy
this docking window class can't adjust size width and height at once ?
...
Reply
Originally posted by: dharry
I created a dialog template and created it in my CControlBar derived class. However, the edit control that is on the dialog will not respond to returns; even though I set it to multiline. How can I get it to work?
ReplyOriginally posted by: Don O'Neill
One major difference between the dockable windows this class creates and the dockable windows in VB is focus. In VB if you select a code window (MDI child) the focus switches from the Dockable window to the MDI child and the menus change to suite that window. Is it possible to get the same behavour from this class and if so how would I go about it ?
Thanks for some really neat code !
Don.
Originally posted by: Steve Coul
Has any body managed to get themselves into the state where when resizing a docked window by dragging its' border the inverted tracking rectangle has the wrong position and can overwrite areas of the Main Frame??
Have I done something stupid here?
Cheers,
Steve Coul
"A recent convert from Win32API to MFC!"
Reply
Originally posted by: Brett Calcott
I do this with my derived class after it has been created:
Oh, I should mention, this is a *very* cool implementation!
I'm trying to create a fixed size (or at least fixed width) toolbar, however it asserts as soon as I click on
it when it is docked.
wnd->SetBarStyle(wnd->GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_FIXED);
wnd->EnableDocking(CBRS_ALIGN_RIGHT | CBRS_ALIGN_LEFT);
DockControlBar(wnd, AFX_IDW_DOCKBAR_LEFT);
And it asserts here (804)
BOOL CSizingControlBar::NegociateSpace(int nLengthAvail, BOOL bHorz)
{
>>>> ASSERT(bHorz == IsHorzDocked());
Am I doing the right thing?
Thanks.