You've already forked lazarus-ccr
GridPrinter: Minor rework in multi-language demo.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8615 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -2,10 +2,10 @@ object MainForm: TMainForm
|
||||
Left = 331
|
||||
Height = 491
|
||||
Top = 127
|
||||
Width = 656
|
||||
Width = 651
|
||||
Caption = 'Multi-Language Demonstration of TGridPrinter'
|
||||
ClientHeight = 491
|
||||
ClientWidth = 656
|
||||
ClientWidth = 651
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '2.3.0.0'
|
||||
object StringGrid1: TStringGrid
|
||||
@ -18,7 +18,7 @@ object MainForm: TMainForm
|
||||
Left = 8
|
||||
Height = 411
|
||||
Top = 39
|
||||
Width = 640
|
||||
Width = 635
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Around = 8
|
||||
ColCount = 6
|
||||
@ -85,7 +85,7 @@ object MainForm: TMainForm
|
||||
Left = 348
|
||||
Height = 22
|
||||
Top = 459
|
||||
Width = 300
|
||||
Width = 295
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 8
|
||||
DropDownCount = 24
|
||||
@ -110,13 +110,13 @@ object MainForm: TMainForm
|
||||
Left = 8
|
||||
Height = 23
|
||||
Top = 8
|
||||
Width = 640
|
||||
Width = 635
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 8
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 23
|
||||
ClientWidth = 640
|
||||
ClientWidth = 635
|
||||
TabOrder = 5
|
||||
object Label1: TLabel
|
||||
AnchorSideLeft.Control = Panel1
|
||||
@ -137,7 +137,7 @@ object MainForm: TMainForm
|
||||
Left = 61
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 579
|
||||
Width = 574
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
ItemHeight = 15
|
||||
@ -148,9 +148,9 @@ object MainForm: TMainForm
|
||||
end
|
||||
object GridPrinter1: TGridPrinter
|
||||
Grid = StringGrid1
|
||||
Footer.Font.Height = -11
|
||||
Header.Font.Height = -11
|
||||
Header.Text = 'test||'
|
||||
Footer.FontSize = 0
|
||||
Header.Text = 'Test||'
|
||||
Header.FontSize = 0
|
||||
Left = 168
|
||||
Top = 96
|
||||
end
|
||||
|
@ -30,7 +30,7 @@ type
|
||||
StringGrid1: TStringGrid;
|
||||
procedure btnPrintClick(Sender: TObject);
|
||||
procedure btnPreviewClick(Sender: TObject);
|
||||
procedure ccbPreviewOptionsItemChange(Sender: TObject; AIndex: Integer);
|
||||
procedure ccbPreviewOptionsItemChange(Sender: TObject; {%H-}AIndex: Integer);
|
||||
procedure cmbLanguagesChange(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
@ -115,15 +115,15 @@ const
|
||||
var
|
||||
i, r, c: Integer;
|
||||
begin
|
||||
FLanguagesDir := ExpandFileName(Application.Location + '../../languages/');
|
||||
PopulateLanguages;
|
||||
SelectLanguage(cmbLanguages.ItemIndex);
|
||||
|
||||
cmbDialogs.ItemIndex := 2;
|
||||
ccbPreviewOptions.ItemIndex := 0;
|
||||
for i := 0 to ccbPreviewOptions.Count-1 do
|
||||
ccbPreviewOptions.Checked[i] := TGridPrintPreviewOption(i) in DEFAULT_GRIDPRN_OPTIONS;
|
||||
|
||||
FLanguagesDir := ExpandFileName(Application.Location + '../../languages/');
|
||||
PopulateLanguages;
|
||||
SelectLanguage(cmbLanguages.ItemIndex);
|
||||
|
||||
StringGrid1.BeginUpdate;
|
||||
try
|
||||
StringGrid1.Clear;
|
||||
@ -149,10 +149,12 @@ var
|
||||
List: TStringList;
|
||||
s, lang: String;
|
||||
i, j: Integer;
|
||||
appLangMask: String;
|
||||
begin
|
||||
List := TStringList.Create;
|
||||
try
|
||||
FindAllFiles(List, FLanguagesDir, 'multilanguage_demo.*.po');
|
||||
appLangMask := ChangeFileExt(ExtractFileName(Application.ExeName), '.*.po');
|
||||
FindAllFiles(List, FLanguagesDir, appLangMask);
|
||||
for i := 0 to List.Count-1 do
|
||||
begin
|
||||
s := List[i];
|
||||
@ -166,6 +168,7 @@ begin
|
||||
case lowercase(lang) of
|
||||
'de': List[i] := 'de - Deutsch';
|
||||
'en': List[i] := 'en - English';
|
||||
// Add more cases when translations are available...
|
||||
end;
|
||||
end;
|
||||
List.Sort;
|
||||
|
Reference in New Issue
Block a user