Visit our Sponsor   Visit our Sponsor
delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
497 Users Online NOW
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi



Loremo - the 1.5 liter car coming in 2009




Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (2)


Display DBNavigator's Buttons' captionFormat this article printer-friendly!Bookmark function is only available for registered users!
DBNavigator has only Icons, but no captions
Product:
Delphi 5.x (or higher)
Category:
Component Writing
Skill Level:
Scoring:
Last Update:
04/01/2002
Search Keys:
delphi delphi3000 article borland vcl code-snippet DBNavigator TDBNavigator Captions Robert zxg
Times Scored:
2
Visits:
2583
Uploader: Robert zxg
Company: ChinaBird
Reference: N/A
 
Question/Problem/Abstract:
My customers complain that they feel puzzled about those buttons'
functions, and they hate to wait for "hint"s. :(
Answer:



{Define a new class as a desendant of TDBNavigator, and assign captions to TDBNavigator's buttons}



type
  
TZxgDBNavigator = class(TDBNavigator)
  private
    
//...
  
public
    Constructor
Create(Aowner:Tcomponent); override;
    //...
  
end;

  
const

  
DefaultCaptions: array[TNavigateBtn]of string=('FIRST', 'PRIOR', 'NEXT',
     'LAST', 'INSERT', 'DELETE', 'EDIT', 'POST', 'CANCEL', 'REFRESH');

   //  You Can Define DefaultCaptions in your native language, e.g.
   //  Chinese Version is --
   {
   DefaultCaptions: array[TNavigateBtn]of string=('Æðʼ','Ïòǰ','Ïòºó',
     'ĩβ','²åÈë','ɾ³ý','±à¼­','±£´æ','È¡Ïû','Ë¢ÐÂ');
   }

//...

constructor TZxgDBNavigator.Create(Aowner:Tcomponent);
var
  
lp:TNavigateBtn;
begin
  inherited
create(Aowner);

  for lp:=low (TNavigateBtn)to high(TNavigateBtn)do
    
buttons[lp].Caption:=DefaultCaptions[lp];

end;

//...






Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
Exclude First, Prior, Next and Last
    Andreas Schmidt (Apr 2 2002 2:50PM)

Maybe you want to exclude the really obvious Buttons,
because everyone knows the "taperecorder" buttons:

// start with Insert Button
for lp:=low (TNavigateBtn)+4 to high(TNavigateBtn)do
    buttons[lp].Caption:=DefaultCaptions[lp];
Respond

RE: Exclude First, Prior, Next and Last
Robert zxg (Apr 3 2002 9:03AM)

Sure!

You can also define DefaultCaptions as below:
DefaultCaptions: array[TNavigateBtn]of string=(' ', ' ', ' ',
     ' ', 'INSERT', 'DELETE', 'EDIT', 'POST', 'CANCEL', 'REFRESH');
['FIRST', 'PRIOR', 'NEXT', 'LAST' -->4 SPACEs]
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
D. Wischnewski
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)