Re: Dockable tool bars with scrollbars if larger than parent frame

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: TVR Fan (nosuch_at_address.com)
Date: 05/05/04


Date: Wed, 5 May 2004 10:16:12 +0100

That looks interesting, I'm downloading an evaluation copy to play with.
However, I've managed to get something close to what I want using the CReBar
control. I found this article at CodeProject:
http://www.codeproject.com/docking/chevrons.asp which does what I need.

The problem now is that my toolbar originally defaulted to placing itself
down the left edge of the application. Trying the same thing with the
CReBar, I can get the ReBar going down the left edge, but the toolbar inside
it looks like it's still going horizontally: I can see the first button at
the top of the rebar with a chevron next to it which holds the rest of the
buttons as if the ReBar was too small. The remainder of the ReBar, below the
first button, is not being drawn so the windows underneath show through.

Here's how I've tried to create them:
m_wndReBar.Create(this,
       RBS_BANDBORDERS,
       WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
CBRS_ALIGN_LEFT | CBRS_ORIENT_VERT
       ) ;
 m_wndToolBar.CreateEx(this,
        TBSTYLE_FLAT,
        WS_CHILD | WS_VISIBLE | CBRS_ALIGN_LEFT | CCS_LEFT |
CBRS_ORIENT_VERT
        ) ;

I've tried various combinations of the orientation and alignment flags but I
can't seem to get the toolbar to go vertical inside the ReBar.

Any ideas?

--- Al.

"Neel Roy" <neelagain@hotmail.com> wrote in message
news:%23rbq16jMEHA.3712@TK2MSFTNGP10.phx.gbl...
> http://www.codeguru.com/Cpp/controls/controls/article.php/c2199/
>
> I was looking for this...
>
> "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
> news:%23A$arwjMEHA.3052@TK2MSFTNGP12.phx.gbl...
> > CToolBar is derived from CControlBar; so you are not going to gain
> anything
> > going to CControlBar unless you do the work yourself. Something which
can
> > helpyou is the pager control(thats the chevron that you see in some
apps).
> > Look at codeguru/codeproject to see if something is there regarding
this.
> >
> > --
> > Ajay Kalra [MVP - VC++]
> > ajaykalra@yahoo.com
> >
> >
> > "TVR Fan" <nosuch@address.com> wrote in message
> > news:#27WlHdMEHA.3944@tk2msftngp13.phx.gbl...
> > > My VC++6 MFC MDI application has a dockable toolbar with 7 or 8
buttons
> > that
> > > are added to it on startup. Trouble is, when the toolbar is docked,
the
> > > application can be sized such that some of the toolbar buttons are
> > clipped.
> > > I want to be able to dynamically add another couple of thin buttons
with
> > > forward / back symbols (I can se problems here with verticle /
> horizontal
> > > docking), or possibly a scrollbar running along the bottom / down the
> side
> > > of the toolbar so that the user can get to these hidden buttons.
> > >
> > > Its been suggested that I try using CReBar or CControlBar. I can't use
> > > CReBar as it doesn't support docking and I can't see how to do it
using
> > > CControlBar.
> > >
> > > Can anyone help?
> > >
> > > --- Al.
> > >
> > >
> >
> >
>
>


Quantcast