Board index » cppbuilder » Scrolling toolbar

Scrolling toolbar


2004-04-01 03:31:44 PM
cppbuilder89
Hello,
I am looking for a solution to the following problem.
The problem is a toolbar which may contain to many buttons for a single
row. I only want to have a single row. I tried to use a TPageScroller
but there does not seem to be a combination which works (BCB4).
Can anyone tell me how to use a TPageScroller or has anyone another
solution? For instance a popup menu for the buttons which do not fit
(like the Windows Explorer) would be nice too.
Eelke
 
 

Re:Scrolling toolbar

Eelke Klein < XXXX@XXXXX.COM >wrote:
Quote
[...] Can anyone tell me how to use a TPageScroller
Set the ToolBar's Align property to alNone and it's Wrapable
property to false. The catch is that I wasn't able to get it
to work when the hidden portion of the ToolBar was larger than
the unhidden portion.
IOW - the viewable area of the ToolBar must be 50% (or more)
of the total ToolBar height or width depending if the
TPageScroller's Orientation is horz or vert.
~ JD
 

Re:Scrolling toolbar

ToolButtons have a DropDownMenu property and a style to set this up. Set ToolButton1's Style property to
tbsDropDown, set up a PopupMenu1 somewhere, with the menu you want to appear, and then set the DropDownMenu
property of the ToolButton to the Name of this PopupMenu. Good, isn't it!?!
--
Mark Jacobs
DK Computing
www.dkcomputing.co.uk
XXXX@XXXXX.COM
"Eelke Klein" < XXXX@XXXXX.COM >wrote in message news:406bc5a3$ XXXX@XXXXX.COM ...
Quote
Hello,

I am looking for a solution to the following problem.

The problem is a toolbar which may contain to many buttons for a single
row. I only want to have a single row. I tried to use a TPageScroller
but there does not seem to be a combination which works (BCB4).

Can anyone tell me how to use a TPageScroller or has anyone another
solution? For instance a popup menu for the buttons which do not fit
(like the Windows Explorer) would be nice too.


Eelke
 

{smallsort}

Re:Scrolling toolbar

Quote
Set the ToolBar's Align property to alNone and it's Wrapable
property to false. The catch is that I wasn't able to get it
to work when the hidden portion of the ToolBar was larger than
the unhidden portion.
It doesn't work for me. I forgot to mention that the buttons on the
toolbar are modified, inserted and removed on runtime. This seems to be
the source of the problems. When I create a few buttons at design time
and do not change anything on runtime it works. However I need to change
the buttons.
I allready tried to reinitialize the control property of the
PageScroller but that doesn't seem to help.
Eelke
 

Re:Scrolling toolbar

I have put an example project you can play around with yourself, up at www.dkcomputing.co.uk/prjx.zip
It is for BCB5, although you'll get the idea from the DFMs. You need to compile and link it to run it.
--
Mark Jacobs
DK Computing
www.dkcomputing.co.uk
XXXX@XXXXX.COM
"Mark Jacobs" < XXXX@XXXXX.COM >wrote in message
Quote
ToolButtons have a DropDownMenu property and a style to set this up. Set ToolButton1's Style property to
tbsDropDown, set up a PopupMenu1 somewhere, with the menu you want to appear, and then set the DropDownMenu
property of the ToolButton to the Name of this PopupMenu. Good, isn't it!?!

"Eelke Klein" < XXXX@XXXXX.COM >wrote in message news:406bc5a3$ XXXX@XXXXX.COM ...
>The problem is a toolbar which may contain to many buttons for a single
>row. I only want to have a single row. I tried to use a TPageScroller
>but there does not seem to be a combination which works (BCB4).
>
>Can anyone tell me how to use a TPageScroller or has anyone another
>solution? For instance a popup menu for the buttons which do not fit
>(like the Windows Explorer) would be nice too.
 

Re:Scrolling toolbar

Quote
ToolButtons have a DropDownMenu property and a style to set this up. Set ToolButton1's Style property to
tbsDropDown, set up a PopupMenu1 somewhere, with the menu you want to appear, and then set the DropDownMenu
property of the ToolButton to the Name of this PopupMenu. Good, isn't it!?!
Yes but you misunderstood me!
What I am looking for is someway for the user to access toolbuttons
which fall outside the space reserved for the toolbar. With the popup
menu I was refering to a solution to the above problem which is used in
the explorer as an alternative for the scrolling solution.
When you start the explorer and make its window small enough there will
appear a double arrow at the right side of the toolbar. Clicking on this
arrow displays a menu containing the toolbuttons which didn't fit.
Eelke
 

Re:Scrolling toolbar

Sorry about that. There is no really good ToolBar object in BCB. I must admit, I always use a Panel with
BitBtn's on it. This way I have complete control over placement. Instead of a Panel, you could try a Scrolling
Region (ScrollBox object on the "Additional" component Tab, next to CheckListBox - it took me ages to find it
too!) and this should introduce scrollable arrows when you place buttons in the ScrollBox (similar to a Panel)
that lie outside of the visible screen area. That's the theory, anyway. Let me know if it works out.
--
Mark Jacobs
DK Computing
www.dkcomputing.co.uk
XXXX@XXXXX.COM
"Eelke Klein" < XXXX@XXXXX.COM >wrote in message news:406beda8$ XXXX@XXXXX.COM ...
Quote
>ToolButtons have a DropDownMenu property and a style to set this up. Set ToolButton1's Style property to
>tbsDropDown, set up a PopupMenu1 somewhere, with the menu you want to appear, and then set the
DropDownMenu
>property of the ToolButton to the Name of this PopupMenu. Good, isn't it!?!

Yes but you misunderstood me!

What I am looking for is someway for the user to access toolbuttons
which fall outside the space reserved for the toolbar. With the popup
menu I was refering to a solution to the above problem which is used in
the explorer as an alternative for the scrolling solution.

When you start the explorer and make its window small enough there will
appear a double arrow at the right side of the toolbar. Clicking on this
arrow displays a menu containing the toolbuttons which didn't fit.
 

Re:Scrolling toolbar

Mark Jacobs wrote:
Quote
Sorry about that. There is no really good ToolBar object in BCB. I must admit, I always use a Panel with
BitBtn's on it. This way I have complete control over placement. Instead of a Panel, you could try a Scrolling
Region (ScrollBox object on the "Additional" component Tab, next to CheckListBox - it took me ages to find it
too!) and this should introduce scrollable arrows when you place buttons in the ScrollBox (similar to a Panel)
that lie outside of the visible screen area. That's the theory, anyway. Let me know if it works out.
I have some experience with the scrollbox but I do not like the idea of
having a scrollbar. Guess I will have to find a better component or
write something myself. Actualy I think I will prefer something in the
explorer style.
Thanks,
Eelke
 

Re:Scrolling toolbar

Eelke Klein wrote:
Quote
It doesn't work for me. I forgot to mention that the buttons on the
toolbar are modified, inserted and removed on runtime. This seems to be
the source of the problems. When I create a few buttons at design time
and do not change anything on runtime it works. However I need to change
the buttons.
Can you have multiple toolbars and switch them instead of buttons on the
same toolbar?
.a
 

Re:Scrolling toolbar

Eelke Klein < XXXX@XXXXX.COM >wrote:
Quote
[...] I forgot to mention that the buttons on the toolbar
are modified, inserted and removed on runtime. This seems to
be the source of the problems.
Did you try to delete the PageScroller and reallocate it?
~ JD
 

Re:Scrolling toolbar

Quote
Can you have multiple toolbars and switch them instead of buttons on the
same toolbar?
Theoratically yes but practical no as it would require updating about
400 units!
Eelke
 

Re:Scrolling toolbar

Quote
Did you try to delete the PageScroller and reallocate it?
I have now ;)
It works better but the scroller still makes to much errors. It seems to
use the wrong size for the toolbar. Sometimes resizing the window helps
but not allways. Because of this the scroll buttons are not allways
displayed when they should and do not scroll the complete bar.
Eelke
 

Re:Scrolling toolbar

Eelke Klein < XXXX@XXXXX.COM >wrote:
Quote
>Did you try to delete the PageScroller and reallocate it?
I have now ;)

It works better but the scroller still makes to much errors.
That's my results too.
~ JD