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
StatusBar: any number of panels and use the same procedure to update 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
10-Nov-03
Category
VCL-General
Language
Delphi 2.x
Views
98
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Eber Irigoyen

Some times the use of a StatusBar is a hassle, when using 2 or more panels... and 
probably you write your procedure to update the statusbar... but then you notice 
you have to add another panel, then you have to change all the occurrences...

Answer:

you can put this procedure in a separate unit ("goodys.pas" in this example) 
1   
2   procedure SetStatusBar(var StB: TStatusBar; Strs: array of string);
3   var
4     X: Byte;
5   begin
6     for X := Low(Strs) to High(Strs) do
7       if not (Strs[X] = '') then
8         StB.Panels[X].Text := Strs[X];
9     Application.ProcessMessages
10  end;
11  
12  //Then include that unit in your formunit 
13  
14  implementation
15  
16  uses goodys;


and whenever you need to update your status bar, make a call 
17  
18  SetStatusBar(MyStatusBar, ['panel', '', 'another panel'])


no matter how many panels the StatusBar has, you can use the same procedure: 

SetStatusBar(MyStatusBar, ['update my first panel only'])

Notes: 
- to empty a panel, make a call with an space: 
19  
20  SetStatusBar(MyStatus, ['panel 2 should be empty', ' '])


- and make sure you have at least one panel in your statusbar, and the simplepanel property is False 

			
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