Solved

TToolbar component

Posted on 1997-09-18
4
389 Views
Last Modified: 2011-09-20
     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.
0
Comment
Question by:khenr29j
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1345495
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
 

Author Comment

by:khenr29j
ID: 1345496
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
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 50 total points
ID: 1345497
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
 

Author Comment

by:khenr29j
ID: 1345498
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question