Ignore:
Timestamp:
Sep 9, 2007, 1:58:38 PM (18 years ago)
Author:
RBRi
Message:

refactoring
unused things removed, unit tests written, save translations improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Components/ACLMessageForm.pas

    r15 r226  
    4040  End;
    4141
     42
     43
     44
    4245Implementation
    4346
     
    5861  NoButtonCaption: string;
    5962
    60 Procedure OnLanguageEvent( Language: TLanguageFile;
    61                            const Apply: boolean );
     63Procedure OnLanguageEvent(Language: TLanguageFile; const Apply: boolean);
     64var
     65  tmpPrefix : String;
    6266begin
    63   if Language <> nil then
    64     Language.Prefix := 'MessageForm.'; // use messageform captions
    65 
    66   LoadString( Language,Apply, OKButtonCaption, 'OKButtonCaption', '~OK' );
    67   LoadString( Language,Apply, CancelButtonCaption, 'CancelButtonCaption', '~Cancel' );
    68   LoadString( Language,Apply, HelpButtonCaption, 'HelpButtonCaption', '~Help' );
    69   LoadString( Language,Apply, YesButtonCaption, 'YesButtonCaption', '~Yes' );
    70   LoadString( Language,Apply, NoButtonCaption, 'NoButtonCaption', '~No' );
     67  tmpPrefix := '';
     68  if Language = nil then
     69  begin
     70    OKButtonCaption := '~OK';
     71    CancelButtonCaption := '~Cancel';
     72    HelpButtonCaption := '~Help';
     73    YesButtonCaption := '~Yes';
     74    NoButtonCaption := '~No';
     75  end
     76  else
     77  begin
     78    tmpPrefix := 'MessageForm' + LANGUAGE_LABEL_DELIMITER; // use messageform captions
     79
     80    Language.LL(Apply, OKButtonCaption, tmpPrefix + 'OKButtonCaption', '~OK');
     81    Language.LL(Apply, CancelButtonCaption, tmpPrefix + 'CancelButtonCaption', '~Cancel');
     82    Language.LL(Apply, HelpButtonCaption, tmpPrefix + 'HelpButtonCaption', '~Help');
     83    Language.LL(Apply, YesButtonCaption, tmpPrefix + 'YesButtonCaption', '~Yes');
     84    Language.LL(Apply, NoButtonCaption, tmpPrefix + 'NoButtonCaption', '~No');
     85  end;
    7186end;
    7287
     
    223238
    224239Initialization
    225   RegisterClasses ([ TButton, TImage,
    226     TMessageForm, TCustomMemo, TListBox]);
     240  RegisterClasses ([TButton, TImage, TMessageForm, TCustomMemo, TListBox]);
    227241
    228242  RegisterProcForLanguages( OnLanguageEvent );
Note: See TracChangeset for help on using the changeset viewer.