Board index » delphi » Toolbars (captions and a gripe!)

Toolbars (captions and a gripe!)

Is it possible to have a caption display on one toolbarbutton on an
item and not on the others.  I have deleted the captions from the
other button.  But they all seem to have to be the same size.  To me
this is a bug and I wonder if anyone knows if this is address in
Delphi 5.  How does delphi actually do it also.

And why did they get rid of the bitmap for the Project options
shortcut.  It looks stupid that I have words on my toolbar and not
pictures.  Can we assign bitmaps to short cuts in delphi 5?

Jeremy

 

Re:Toolbars (captions and a gripe!)


Quote
> Is it possible to have a caption display on one toolbarbutton on an
> item and not on the others.  I have deleted the captions from the
> other button.  But they all seem to have to be the same size.  To me
> this is a bug and I wonder if anyone knows if this is address in
> Delphi 5.  How does delphi actually do it also.

What you see is the behaviour of the Windows common control behind
TToolbar. Delphi can do little to amend it. Use a classic panel with
speedbuttons on it and you have full control over each individual
button. The Toolbar buttons are not even real buttons, they are fakes
drawn by the toolbar.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Re:Toolbars (captions and a gripe!)


So in delphi all of those buttons are speedbuttons not toolbarbuttons?
What is this 'common control' behind the toolbar.  Can I use it?

On Sun, 15 Aug 1999 18:46:05 +0200, "Peter Below (TeamB)"

Quote
<100113.1...@compuXXserve.com> wrote:
>> Is it possible to have a caption display on one toolbarbutton on an
>> item and not on the others.  I have deleted the captions from the
>> other button.  But they all seem to have to be the same size.  To me
>> this is a bug and I wonder if anyone knows if this is address in
>> Delphi 5.  How does delphi actually do it also.

>What you see is the behaviour of the Windows common control behind
>TToolbar. Delphi can do little to amend it. Use a classic panel with
>speedbuttons on it and you have full control over each individual
>button. The Toolbar buttons are not even real buttons, they are fakes
>drawn by the toolbar.

>Peter Below (TeamB)  100113.1...@compuserve.com)
>No e-mail responses, please, unless explicitly requested!

Re:Toolbars (captions and a gripe!)


Quote
> So in delphi all of those buttons are speedbuttons not toolbarbuttons?

The D2/3/4 IDE does use the TToolbar class, D1 did use a panel with
speedbuttons on it, if memory serves, since the toolbar control is a
Win32 thing.

Quote
> What is this 'common control' behind the toolbar.  Can I use it?

You use it every time you use a TToolbar. All the components on the Win32
tab of the component palette are just wrapper classes around some Windows
controls, most of them implemented in the Windows COMCTL32.DLL. The
commctrl unit contains the API interface for these controls. This unit
defines classnames, messages and styles for the common controls, as well
as a bunch of functions that make access to the message interface of
these controls a bit easier (the API C header files define these as
macros). The Unit defines

const
  TOOLBARCLASSNAME = 'ToolbarWindow32';

for instance, that is the control class name you would use with
CreateWindowEx to create such a control API-style in code.

Look at win32.hlp, at the topics starting with "common control" in the
index.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Re:Toolbars (captions and a gripe!)


Sorry to do this to you Peter but...

If Delphi is using the same buttons as the component in delphi, why
can't my toolbars have a mixture of captions and bitmaps.

Like    Button1  Caption and Bitmap shows (set toolbar to
ShowCaptions)
        Button2  Caption only (ok set bitmap to -1
        Button3  Bitmap only  (ok set caption to empty)

BUT!
Also how do I get rid of the uniform size.  That is a pain in the
butt.  If I have a long caption I dont want all of my buttons to be
huge with a little bitmap on it.

Oh I just read that they use the Toolbar class (from your prev
message) is that the difference?

Jeremy

On Mon, 16 Aug 1999 13:26:45 +0200, "Peter Below (TeamB)"

Quote
<100113.1...@compuXXserve.com> wrote:
>> So in delphi all of those buttons are speedbuttons not toolbarbuttons?

>The D2/3/4 IDE does use the TToolbar class, D1 did use a panel with
>speedbuttons on it, if memory serves, since the toolbar control is a
>Win32 thing.

>> What is this 'common control' behind the toolbar.  Can I use it?

>You use it every time you use a TToolbar. All the components on the Win32
>tab of the component palette are just wrapper classes around some Windows
>controls, most of them implemented in the Windows COMCTL32.DLL. The
>commctrl unit contains the API interface for these controls. This unit
>defines classnames, messages and styles for the common controls, as well
>as a bunch of functions that make access to the message interface of
>these controls a bit easier (the API C header files define these as
>macros). The Unit defines

>const
>  TOOLBARCLASSNAME = 'ToolbarWindow32';

>for instance, that is the control class name you would use with
>CreateWindowEx to create such a control API-style in code.

>Look at win32.hlp, at the topics starting with "common control" in the
>index.

>Peter Below (TeamB)  100113.1...@compuserve.com)
>No e-mail responses, please, unless explicitly requested!

Re:Toolbars (captions and a gripe!)


Quote
> If Delphi is using the same buttons as the component in delphi, why
> can't my toolbars have a mixture of captions and bitmaps.
-snip-  
> Oh I just read that they use the Toolbar class (from your prev
> message) is that the difference?

We somehow fail to communicate here. The Delphi IDE is build using the same
classes you have available on the component palette, plus a few custom
classes (e.g. for the editor) which are not available to anybody outside
Borland. That is, the IDE toolbars are build using the TToolbar and TCoolbar
classes and these classes are wrappers around some Windows common control
classes. MS enhances these common control with new features from time to
time, publishing new versions of the comctl32.dll, which contains most of
these controls. The VCL wrapper classes do not always expose all of the
functionalities of the common control they are based on, often because the
"missing" features were simply not available at the time D4 was released.
They usually crop up in the next version of Delphi, though, and in the
meantime one can sometimes make use of them by dropping to the API level (all
the VCL wrapper classes have a Handle property that gives you the window
handle of the control, which is usually all that is needed for API-level
access) but you have to find out what to do by studying the latest MS docs
for the controls on MSDN.microsoft.com.

To summaries: the VCL wrapper classes cannot do what you require and if the
common controls classes they wrap can to it in their latest
incarnation (which i have not investigated) you will have to use the proper
API methods (e.g. sending them messages) to access the features you need.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads