Mega Code Archive

 
Categories / Delphi / ADO Database
 

Display DBNavigators Buttons caption

Title: Display DBNavigator's Buttons' caption Question: 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; //...