Solved

TToolbar component

Posted on 1997-09-18
4
398 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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