TToolbar component

     Is it possible to place buttons on the TToolbar component and have them keep the location they were placed in? Every time I drop a speedbutton on it it aligns the controls on the left.
khenr29jAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
JimBob091197Connect With a Mentor Commented:
I presume that you mean to create a new control by copying the code from TToolbar, creating a new control (e.g. TMyToolbar) which is NOT inherited from TToolbar (i.e. a copy of TToolbar), and deleting code which you don't need.  

The TToolButton makes many calls to TToolbar (e.g. FToolBar.RepositionButtons(0);) so if you want to start yanking code out of TToolbar, you'll also have to yank code out of TToolButton.  I.e. you'll also need a TMyToolButton.

This is a completely separate issue from your original question:
"Is it possible to place buttons on the TToolbar component..." and is certainly not worth the hassle for 50 pts.

0
 
JimBob091197Commented:
I would say it's not possible because of TToolbar's call to RepositionButtons, which gets called by AdjustControl, which in turn gets called by AlignControls, which really messes things up.

AlignControls can be overriden, but unfortunately RepositionButtons is not virtual (thus cannot be overriden).

In addition, the call "Perform(TB_AUTOSIZE, 0, 0);" resides in ResizeButtons, which is declared privately & thus also cannot be overriden...

0
 
khenr29jAuthor Commented:
I have access to the source code, so yanking the offending code is not a problem. What lines do I need to comment out to make it work the way I want it to?
0
 
khenr29jAuthor Commented:
I found a component named TSpeedbar that does what I wanted, available from http://rx.unionjv.ru/rxengl.htm
I also don't use the TToolButton but instead the TSpeedButton.
0
All Courses

From novice to tech pro — start learning today.