Solved

TToolbar component

Posted on 1997-09-18
4
375 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how do i create updater to My Activex application? 3 79
FMX enumerated colours 2 84
Correct Component for Shopping Cart. 2 96
Create a path if not exists 7 69
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now