Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to save and restore the position of TCoolBar bands Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
27-Aug-02
Category
VCL-General
Language
Delphi 4.x
Views
69
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

I can save the TToolbar positions but I never succeed in restoring their positions. 
I put them in either in TControlBar or TCoolBar. How do I position them correctly?

Answer:

Saving:

1   {Coolbar}
2   for i := 0 to Coolbar.Bands.Count - 1 do
3     with Coolbar.Bands[i] do
4       seOptions['Band' + IntToStr(ID)] := Format('%d,%d,%d,%d', [Integer(Break),
5         Width, Index, Integer(Control.Visible)]);
6   
7   
8   //Loading:
9   
10  {Coolbar}
11  for i := 0 to Coolbar.Bands.Count - 1 do
12    with Coolbar.Bands[i] do
13    begin
14      BandInfo := seOptions['Band' + IntToStr(ID)];
15      if BandInfo <> '' then
16      try
17        Break := Boolean(StrToInt(CutFirst(BandInfo)));
18        Width := StrToInt(CutFirst(BandInfo));
19        Index := StrToInt(CutFirst(BandInfo));
20        Control.Visible := Boolean(StrToInt(CutFirst(BandInfo))); {this line untested}
21      except;
22      end;
23    end;


seOptions is a settings object and can store values 'by name'. BandInfo is a string. CutFirst returns the first value from a comma separated list string and removes it from the string.

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC