Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CoolBar: how to save and restore the layout

Posted on 1997-11-11
5
Medium Priority
?
283 Views
Last Modified: 2010-04-04
i do not know how to change at runtime the layout from a Coolbar because the Coolbands do not have top or height properties. if i set the properties from toolbar - this of course does not work.

thanks for help
Bernhard Angerer
angerer@eftuv1.tuwien.ac.at
0
Comment
Question by:angerer
[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
  • 3
5 Comments
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 200 total points
ID: 1349922
Hi

Manipulating Coolbars is a bit of a nuisance, and not as easy as most other Delphi controls.  Maybe Borland got bored???

Anyway, you have to send the coolbar messages to manipulate bands.  (See function TCoolBar.UpdateItem in ComCtrls.pas.)

Here is a very simple example.  This code puts the first 3 bands onto the 1st row (each with width = 75) and any more bands onto new rows by themselves.  (Add CommCtrl to your "uses" list.)

procedure TForm1.Button1Click(Sender: TObject);
var
    i: Integer;
    BandInfo: TReBarBandInfo;
begin
    // Delete all the bands!!
    for i := 0 to Coolbar1.Bands.Count - 1 do
        Coolbar1.Perform(RB_DELETEBAND, 0, 0);

    // Reinsert the bands as we want them.
    for i := 0 to Coolbar1.Bands.Count - 1 do
    begin
        FillChar(BandInfo, SizeOf(TReBarBandInfo), 0);
        BandInfo.cbSize := SizeOf(TReBarBandInfo);
        BandInfo.fMask := RBBIM_SIZE or RBBIM_CHILD or RBBIM_CHILDSIZE or RBBIM_STYLE;

        Coolbar1.Perform(RB_GETBANDINFO, i, Integer(@BandInfo));

        if (i > 2) then BandInfo.fStyle := BandInfo.fStyle or RBBS_BREAK;

        BandInfo.hwndChild := Coolbar1.Bands[i].Control.Handle;
        BandInfo.cx := 75;
        BandInfo.cxMinChild := Coolbar1.Bands[i].MinWidth;
        BandInfo.cyMinChild := Coolbar1.Bands[i].MinHeight;
        Coolbar1.Perform(RB_INSERTBAND, i, Integer(@BandInfo));
    end;
end;

This sample is a bit rough and ready.  I have inherited a new component from TCoolbar which allows you to manipulate bands better.  It works kind of like the Top & Height properties you were referring to.  I can e-mail it to you if you want...

Regards,
JB
0
 
LVL 2

Expert Comment

by:freter
ID: 2373955
JimBob,

I am interested in the derived coolbar component you mentioned. Could you please send me a copy to freter@gmx.net?

TIA,
freter
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 2429461
Hi Freter

I am away on business in China for 2 weeks.  When I get back home I will send you the code.

Regards,
JB
0
 
LVL 1

Author Comment

by:angerer
ID: 2481316
thanks very much !

i also would be interested in the inherited component. my new email is
angerer@mail.ift.tuwien.ac.at

regards
bernhard
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 2507960
Hi all

I have sent you both e-mail in this regard.  Unfortunately I cannot find the component I mentioned above, but I have e-mailed to both of you a sample which allows you to manipulate Coolbar bands.

Cheers,
JB
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

650 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