diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-02-27 21:50:06 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-02-27 21:50:06 +0000 |
commit | 9059c000d334becd0c7b08eb50aa88ce2ca78905 (patch) | |
tree | 264853634b8a2aaf8e69d9adb2ca7b798c32ebfa /src | |
parent | 3664cd44e2aadad9c06d3d1c00469f67f5e087fd (diff) | |
download | fpGUI-9059c000d334becd0c7b08eb50aa88ce2ca78905.tar.xz |
* Created two new units called: gfx_pofiles.pas and gfx_translations.pas. They are used for reading PO files and translating the resourcestrings.
* TranslateResourceStrings are now called in TfpgApplication.InternalInit().
* Added a new include file for gfx_utils unit. It's a include file for common code across platforms.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/fpgfx.pas | 5 | ||||
-rw-r--r-- | src/corelib/gdi/fpgfx_package.lpk | 10 | ||||
-rw-r--r-- | src/corelib/gdi/fpgfx_package.pas | 2 | ||||
-rw-r--r-- | src/corelib/gdi/gfx_utils.pas | 4 | ||||
-rw-r--r-- | src/corelib/gfx_pofiles.pas | 379 | ||||
-rw-r--r-- | src/corelib/gfx_translations.pas | 192 | ||||
-rw-r--r-- | src/corelib/gfx_utils_impl.inc | 23 | ||||
-rw-r--r-- | src/corelib/gfx_utils_intf.inc | 7 | ||||
-rw-r--r-- | src/corelib/x11/fpgfx_package.lpk | 10 | ||||
-rw-r--r-- | src/corelib/x11/fpgfx_package.pas | 2 | ||||
-rw-r--r-- | src/corelib/x11/gfx_utils.pas | 3 | ||||
-rw-r--r-- | src/gui/gui_dialogs.pas | 10 |
12 files changed, 637 insertions, 10 deletions
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas index 31026fe8..3bb156cd 100644 --- a/src/corelib/fpgfx.pas +++ b/src/corelib/fpgfx.pas @@ -307,7 +307,8 @@ implementation uses gfx_imgfmt_bmp, gfx_stdimages, - gfx_extinterpolation; // only so that it get auto compiled + gfx_extinterpolation, // only so that it get auto compiled + gfx_translations; var fpgTimers: TList; @@ -811,6 +812,8 @@ begin fpgCaret := TfpgCaret.Create; fpgImages := TfpgImages.Create; fpgCreateStandardImages; + + TranslateResourceStrings(ExtractFilePath(ParamStr(0)), ''); end; procedure TfpgApplication.Flush; diff --git a/src/corelib/gdi/fpgfx_package.lpk b/src/corelib/gdi/fpgfx_package.lpk index 17591fc7..afac8510 100644 --- a/src/corelib/gdi/fpgfx_package.lpk +++ b/src/corelib/gdi/fpgfx_package.lpk @@ -26,7 +26,7 @@ <License Value="Modified LGPL "/> <Version Minor="6" Release="1"/> - <Files Count="16"> + <Files Count="18"> <Item1> <Filename Value="..\gfxbase.pas"/> <UnitName Value="gfxbase"/> @@ -91,6 +91,14 @@ <Filename Value="..\gfx_constants.pas"/> <UnitName Value="gfx_constants"/> </Item16> + <Item17> + <Filename Value="..\gfx_pofiles.pas"/> + <UnitName Value="gfx_pofiles"/> + </Item17> + <Item18> + <Filename Value="..\gfx_translations.pas"/> + <UnitName Value="gfx_translations"/> + </Item18> </Files> <RequiredPkgs Count="1"> <Item1> diff --git a/src/corelib/gdi/fpgfx_package.pas b/src/corelib/gdi/fpgfx_package.pas index 12c6944c..0753d2ee 100644 --- a/src/corelib/gdi/fpgfx_package.pas +++ b/src/corelib/gdi/fpgfx_package.pas @@ -10,7 +10,7 @@ uses gfxbase, fpgfx, gfx_gdi, gfx_stdimages, gfx_imgfmt_bmp, gfx_widget, gfx_UTF8utils, gfx_extinterpolation, gfx_cmdlineparams, gfx_utils, gfx_popupwindow, gfx_impl, gfx_command_intf, gfx_wuline, gfx_imagelist, - gfx_constants; + gfx_constants, gfx_pofiles, gfx_translations; implementation diff --git a/src/corelib/gdi/gfx_utils.pas b/src/corelib/gdi/gfx_utils.pas index f5822fc6..3b23dff8 100644 --- a/src/corelib/gdi/gfx_utils.pas +++ b/src/corelib/gdi/gfx_utils.pas @@ -14,6 +14,10 @@ uses implementation +// the common code for all platforms +{$I gfx_utils_impl.inc} + + // File utils function ExtractTargetSymLinkPath(ALink: string): string; begin diff --git a/src/corelib/gfx_pofiles.pas b/src/corelib/gfx_pofiles.pas new file mode 100644 index 00000000..67c5d74f --- /dev/null +++ b/src/corelib/gfx_pofiles.pas @@ -0,0 +1,379 @@ +{ + + Abstract: + Methods and classes for loading translations/localizations from po files. + + Example 1: Load a specific .po file: + + procedure TForm1.FormCreate(Sender: TObject); + var + PODirectory: String; + begin + PODirectory:='/path/to/languages/'; + TranslateUnitResourceStrings('StrConsts',PODirectory+'gui.%s.po', + 'nl',''); + MessageDlg('Title','Text',mtInformation,[mbOk,mbCancel,mbYes],0); + end; + + + Example 2: Load the current language file using the GetLanguageIDs function + of the gettext unit: + + procedure TForm1.FormCreate(Sender: TObject); + var + PODirectory, Lang, FallbackLang: String; + begin + PODirectory:='/path/to/languages/'; + GetLanguageIDs(Lang,FallbackLang); // in unit gettext + TranslateUnitResourceStrings('StrConsts',PODirectory+'gui.%s.po', + Lang,FallbackLang); + MessageDlg('Title','Text',mtInformation,[mbOk,mbCancel,mbYes],0); + end; +} +unit gfx_pofiles; + +{$mode objfpc}{$H+}{$INLINE ON} + +interface + +uses + Classes, + SysUtils, + Contnrs; + +type + TPOFileItem = class(TObject) + public + Identifier: string; + Original: string; + Translation: string; + constructor Create(const TheIdentifier, TheOriginal, TheTranslated: string); + end; + + + TPOFile = class(TObject) + protected + FItems: TFPList; // list of TPOFileItem + FIdentifierToItem: TFPObjectHashTable; + FOriginalToItem: TFPObjectHashTable; + public + constructor Create(const AFilename: string); + constructor Create(AStream: TStream); + destructor Destroy; override; + procedure ReadPOText(const s: string); + procedure Add(const Identifier, OriginalValue, TranslatedValue: string); + function Translate(const Identifier, OriginalValue: string): string; + end; + + + EPOFileError = class(Exception); + + +var + SystemCharSetIsUTF8: Boolean = True;// the fpGUI interfaces expect UTF-8 as default + // if you don't use UTF-8, install a proper widestring manager and set this + // to false. You're on your own then! + + +// translate resource strings for one unit +procedure TranslateUnitResourceStrings(const ResUnitName, BaseFilename, Lang, FallbackLang: string); +function TranslateUnitResourceStrings(const ResUnitName, AFilename: string): boolean; +function UTF8ToSystemCharSet(const s: string): string; {$ifndef MultiLocale} inline;{$endif} + + +procedure DebugLn(const s1: string); +procedure DebugLn(const s1, s2: string); +procedure DebugLn(const s1, s2, s3: string); +procedure DebugLn(const s1, s2, s3, s4: string); + +implementation + +uses + gfx_UTF8utils; + +procedure DebugLn(const s1: string); +begin + { TODO : Improve this to work under Windows GUI apps as well.} + writeln(s1); +end; + +procedure DebugLn(const s1, s2: string); +begin + writeln(s1 + s2); +end; + +procedure DebugLn(const s1, s2, s3: string); +begin + writeln(s1 + s2 + s3); +end; + +procedure DebugLn(const s1, s2, s3, s4: string); +begin + writeln(s1 + s2 + s3 + s4); +end; + + +procedure DumpExceptionBackTrace; +var + FrameCount: integer; + Frames: PPointer; + FrameNumber: integer; +begin + DebugLn(' Stack trace:'); + DebugLn(BackTraceStrFunc(ExceptAddr)); + FrameCount := ExceptFrameCount; + Frames := ExceptFrames; + for FrameNumber := 0 to FrameCount - 1 do + DebugLn(BackTraceStrFunc(Frames[FrameNumber])); +end; + + +function UTF8ToSystemCharSet(const s: string): string; {$ifndef MultiLocale} inline; +{$endif} +begin + if SystemCharSetIsUTF8 then + Exit(s); + {$IFDEF NoUTF8Translations} + Result := s; + {$ELSE} + {$IFNDEF MultiLocale} + Result := Utf8ToAnsi(s); + {$ELSE} + try + if (LowerCase(GetDefaultCodepage) <> 'utf8') and (LowerCase(GetDefaultCodepage) <> 'utf-8') then + Result := CPConvert(s, 'utf8', LowerCase(GetDefaultCodepage)) + else + Result := s; + except + Result := s; + end; + {$ENDIF} + {$ENDIF} +end; + +{$ifndef ver2_0} +function Translate(Name, Value: ansistring; Hash: longint; arg: Pointer): ansistring; +var + po: TPOFile; +begin + po := TPOFile(arg); + // get UTF8 string + Result := po.Translate(Name, Value); + // convert UTF8 to current local + if Result <> '' then + Result := UTF8ToSystemCharSet(Result); +end; + +{$endif ver2_0} + +function TranslateUnitResourceStrings(const ResUnitName, AFilename: string): boolean; +var +{$ifdef ver2_0} + TableID, StringID, TableCount: integer; + s: string; + DefValue: string; +{$endif ver2_0} + po: TPOFile; +begin + Result := False; + //debugln('TranslateUnitResourceStrings) ResUnitName="',ResUnitName,'" AFilename="',AFilename,'"'); + if (ResUnitName = '') or (AFilename = '') or (not FileExists(AFilename)) then + Exit; + try + po := nil; + // read .po file + po := TPOFile.Create(AFilename); + try +{$ifdef ver2_0} + for TableID := 0 to ResourceStringTableCount - 1 do + begin + TableCount := ResourceStringCount(TableID); + + // check if this table belongs to the ResUnitName + if TableCount = 0 then + continue; + s := GetResourceStringName(TableID, 0); + if CompareText(ResUnitName + '.', LeftStr(s, length(ResUnitName) + 1)) <> 0 then + continue; + + // translate all resource strings of the unit + for StringID := 0 to TableCount - 1 do + begin + DefValue := GetResourceStringDefaultValue(TableID, StringID); + // get UTF8 string + s := po.Translate(GetResourceStringName(TableID, StringID), DefValue); + + if Length(s) > 0 then + begin + // convert UTF8 to current local + s := UTF8ToSystemCharSet(s); + SetResourceStringValue(TableID, StringID, s); + end; + end; + end; +{$else ver2_0} + SetUnitResourceStrings(ResUnitName, @Translate, po); +{$endif ver2_0} + finally + po.Free; + end; + Result := True; + except + on e: Exception do + begin + DebugLn('Exception while translating ', ResUnitName); + DebugLn(e.Message); + DumpExceptionBackTrace; + end; + end; +end; + +procedure TranslateUnitResourceStrings(const ResUnitName, BaseFilename, Lang, FallbackLang: string); +begin + if (ResUnitName = '') or (BaseFilename = '') then + Exit; + + //debugln('TranslateUnitResourceStrings BaseFilename="',BaseFilename,'"'); + if (FallbackLang <> '') then + TranslateUnitResourceStrings(ResUnitName, Format(BaseFilename, [FallbackLang])); + if (Lang <> '') then + TranslateUnitResourceStrings(ResUnitName, Format(BaseFilename, [Lang])); +end; + +{ TPOFile } + +constructor TPOFile.Create(const AFilename: string); +var + f: TStream; +begin + f := TFileStream.Create(AFilename, fmOpenRead); + try + Self.Create(f); + finally + f.Free; + end; +end; + +constructor TPOFile.Create(AStream: TStream); +var + Size: integer; + s: string; +begin + inherited Create; + FItems := TFPList.Create; + FIdentifierToItem := TFPObjectHashTable.Create(False); + FOriginalToItem := TFPObjectHashTable.Create(False); + + Size := AStream.Size - AStream.Position; + if Size <= 0 then + Exit; //==> + SetLength(s, Size); + AStream.Read(s[1], Size); + ReadPOText(s); +end; + +destructor TPOFile.Destroy; +var + i: integer; +begin + for i := 0 to FItems.Count - 1 do + TObject(FItems[i]).Free; + FItems.Free; + FIdentifierToItem.Free; + FOriginalToItem.Free; + inherited Destroy; +end; + +procedure TPOFile.ReadPOText(const s: string); +{ Read a .po file. Structure: + +Example +#: lazarusidestrconsts:lisdonotshowsplashscreen +msgid " Do not show splash screen" +msgstr "" + +} +const + sCommentIdentifier: PChar = '#: '; + sMsgID: PChar = 'msgid "'; + sMsgStr: PChar = 'msgstr "'; +var + l: integer; + LineLen: integer; + p: PChar; + LineStart: PChar; + LineEnd: PChar; + Identifier: string; + MsgID: string; + MsgStr: string; + TextEnd: PChar; +begin + if s = '' then + Exit; //==> + l := Length(s); + p := PChar(s); + LineStart := p; + TextEnd := p + l; + while LineStart < TextEnd do + begin + LineEnd := LineStart; + while (not (LineEnd^ in [#0, #10, #13])) do + Inc(LineEnd); + LineLen := LineEnd - LineStart; + if LineLen > 0 then + if CompareMem(LineStart, sCommentIdentifier, 3) then + Identifier := copy(s, LineStart - p + 4, LineLen - 3) + else if CompareMem(LineStart, sMsgID, 7) then + MsgID := UTF8CStringToUTF8String(LineStart + 7, LineLen - 8) + else if CompareMem(LineStart, sMsgStr, 8) then + begin + //MsgStr:=copy(s,LineStart-p+9,LineLen-9); + MsgStr := UTF8CStringToUTF8String(LineStart + 8, LineLen - 9); + Add(Identifier, MsgID, MsgStr); + end; + LineStart := LineEnd + 1; + while (LineStart < TextEnd) and (LineStart^ in [#10, #13]) do + Inc(LineStart); + end; +end; + +procedure TPOFile.Add(const Identifier, OriginalValue, TranslatedValue: string); +var + Item: TPOFileItem; +begin + if (TranslatedValue = '') then + Exit; //==> + Item := TPOFileItem.Create(Identifier, OriginalValue, TranslatedValue); + FItems.Add(Item); + FIdentifierToItem.Add(Identifier, Item); + FOriginalToItem.Add(OriginalValue, Item); +end; + +function TPOFile.Translate(const Identifier, OriginalValue: string): string; +var + Item: TPOFileItem; +begin + Item := TPOFileItem(FIdentifierToItem.Items[Identifier]); + if Item = nil then + Item := TPOFileItem(FOriginalToItem.Items[OriginalValue]); + if Item <> nil then + begin + Result := Item.Translation; + if Result = '' then + raise Exception.Create('TPOFile.Translate Inconsistency'); + end + else + Result := OriginalValue; +end; + +{ TPOFileItem } + +constructor TPOFileItem.Create(const TheIdentifier, TheOriginal, TheTranslated: string); +begin + Identifier := TheIdentifier; + Original := TheOriginal; + Translation := TheTranslated; +end; + +end. + diff --git a/src/corelib/gfx_translations.pas b/src/corelib/gfx_translations.pas new file mode 100644 index 00000000..4dc6c388 --- /dev/null +++ b/src/corelib/gfx_translations.pas @@ -0,0 +1,192 @@ +{ + Methods and classes for loading the translations/localizations. +} + +unit gfx_translations; + +{$mode objfpc}{$H+} + +{.$Define DEBUG} + +interface + +uses + Classes + ,SysUtils + ; + + +type + + TTranslation = class(TObject) + private + FID: string; + public + property ID: string read FID; + end; + PTranslation = ^TTranslation; + + + TTranslationList = class(TObject) + private + FCount: integer; + FItems: PTranslation; + function GetItems(Index: integer): TTranslation; + public + destructor Destroy; override; + function IndexOf(const ID: string): integer; + procedure Add(const ID: string); + procedure Clear; + public + property Count: integer read FCount; + property Items[Index: integer]: TTranslation read GetItems; default; + end; + + +procedure TranslateResourceStrings(const BaseDirectory, CustomLang: string); + + +implementation + +uses + GetText + ,gfx_pofiles + ,gfx_constants + ,gfx_utils + ; + + +var + TranslationList: TTranslationList; + SystemLanguageID1: string; + SystemLanguageID2: string; + + +procedure CollectTranslations(const BaseDir: string); +var + FileInfo: TSearchRec; + ID: string; + SearchMask: string; +begin + // search for all languages/fpgui.xxx.po files + if TranslationList = nil then + TranslationList := TTranslationList.Create + else + TranslationList.Clear; + // add automatic and english translation + TranslationList.Add(''); + TranslationList.Add('en'); + // search existing translations + + SearchMask := fpgAddTrailingValue(BaseDir, PathDelim, false) + {'languages' + PathDelim +} 'fpgui.*.po'; + //writeln('CollectTranslations ',SearchMask); + if SysUtils.FindFirst(SearchMask, faAnyFile, FileInfo) = 0 + then begin + repeat + if (FileInfo.Name = '.') or (FileInfo.Name = '..') or (FileInfo.Name = '') then + Continue; + ID := copy(FileInfo.Name,length('fpgui.')+1, + length(FileInfo.Name)-length('fpgui..po')); + //writeln('CollectTranslations A ',FileInfo.Name,' ID=',ID); + if (ID <> '') and (Pos('.',ID) < 1) and (TranslationList.IndexOf(ID) < 0) then + begin + //writeln('CollectTranslations ID=',ID); + TranslationList.Add(ID); + end; + until SysUtils.FindNext(FileInfo) <> 0; + end; + SysUtils.FindClose(FileInfo); +end; + +procedure TranslateResourceStrings(const BaseDirectory, CustomLang: string); +const + Ext = '.%s.po'; +var + Lang: string; + FallbackLang: string; + Dir: string; +begin +// writeln('TranslateResourceStrings A CustomLang=',CustomLang); + if TranslationList = nil then + CollectTranslations(BaseDirectory); + + if CustomLang = '' then + begin + Lang := SystemLanguageID1; + FallbackLang := SystemLanguageID2; + end + else + begin + Lang := CustomLang; + FallbackLang := ''; + end; +// writeln('TranslateResourceStrings A Lang=',Lang,' FallbackLang=',FallbackLang); + Dir := fpgAddTrailingValue(BaseDirectory, PathDelim, false); + + // We use one translation file for all fpGUI related text + TranslateUnitResourceStrings('gfx_constants', + Dir + {'languages/}'fpgui' + Ext, Lang, FallbackLang); + + {$IFDEF DEBUG} + writeln('SystemLanguageID1 = ' + SystemLanguageID1); + writeln('SystemLanguageID2 = ' + SystemLanguageID2); + writeln('Translation file = ' +Dir + {'languages/}'fpgui' + Ext); + {$ENDIF} +// writeln(Lang); +end; + + +{ TTranslationList } + +function TTranslationList.GetItems(Index: integer): TTranslation; +begin + Result := FItems[Index]; +end; + +destructor TTranslationList.Destroy; +begin + Clear; + inherited Destroy; +end; + +procedure TTranslationList.Add(const ID: string); +var + NewTranslation: TTranslation; +begin + if IndexOf(ID)>=0 then + raise Exception.Create('TTranslationList.Add ' + + 'ID="' + ID + '" already exists.'); + NewTranslation := TTranslation.Create; + NewTranslation.FID := ID; + inc(FCount); + ReallocMem(FItems, SizeOf(Pointer)*FCount); + FItems[FCount-1] := NewTranslation; +end; + +function TTranslationList.IndexOf(const ID: string): integer; +begin + Result := FCount - 1; + while (Result >= 0) and (CompareText(ID, FItems[Result].ID) <> 0) do + dec(Result); +end; + +procedure TTranslationList.Clear; +var + i: Integer; +begin + for i := 0 to FCount-1 do + FItems[i].Free; + FCount := 0; + ReallocMem(FItems, 0); +end; + +initialization + TranslationList := nil; + GetLanguageIDs(SystemLanguageID1, SystemLanguageID2); + +finalization + TranslationList.Free; + TranslationList := nil; + +end. + diff --git a/src/corelib/gfx_utils_impl.inc b/src/corelib/gfx_utils_impl.inc new file mode 100644 index 00000000..c541dcad --- /dev/null +++ b/src/corelib/gfx_utils_impl.inc @@ -0,0 +1,23 @@ +{%mainunit gfx_utils.pas} + +function fpgAddTrailingValue(const ALine, AValue: string; ADuplicates: boolean = true): string; +begin + if ALine = '' then + begin + result := ALine; + Exit; //==> + end; + + if ADuplicates then + begin + result := ALine + AValue; + Exit; //==> + end; + + if (not SameText(Copy(ALine, Length(ALine) - Length(AValue) + 1, Length(AValue)), AValue)) then + result := ALine + AValue + else + result := ALine; +end; + + diff --git a/src/corelib/gfx_utils_intf.inc b/src/corelib/gfx_utils_intf.inc index a133d2a4..0fd059fc 100644 --- a/src/corelib/gfx_utils_intf.inc +++ b/src/corelib/gfx_utils_intf.inc @@ -1,5 +1,12 @@ {%mainunit gfx_utils.pas} +// Common functions for all platforms +function fpgAddTrailingValue(const ALine, AValue: string; ADuplicates: boolean = true): string; + + + +// Functions with platform specific implementations + // File utils function ExtractTargetSymLinkPath(ALink: string): string; function FileIsSymlink(const AFilename: string): boolean; diff --git a/src/corelib/x11/fpgfx_package.lpk b/src/corelib/x11/fpgfx_package.lpk index 587ea3ad..f2a3d477 100644 --- a/src/corelib/x11/fpgfx_package.lpk +++ b/src/corelib/x11/fpgfx_package.lpk @@ -24,7 +24,7 @@ <License Value="Modified LGPL "/> <Version Minor="6" Release="1"/> - <Files Count="18"> + <Files Count="20"> <Item1> <Filename Value="x11_xft.pas"/> <UnitName Value="x11_xft"/> @@ -97,6 +97,14 @@ <Filename Value="../gfx_constants.pas"/> <UnitName Value="gfx_constants"/> </Item18> + <Item19> + <Filename Value="../gfx_pofiles.pas"/> + <UnitName Value="gfx_pofiles"/> + </Item19> + <Item20> + <Filename Value="../gfx_translations.pas"/> + <UnitName Value="gfx_translations"/> + </Item20> </Files> <LazDoc Paths="../../../docs/xml/corelib/;../../../docs/xml/corelib/x11/;../../../docs/xml/corelib/gdi/"/> <RequiredPkgs Count="1"> diff --git a/src/corelib/x11/fpgfx_package.pas b/src/corelib/x11/fpgfx_package.pas index e0827831..d1484532 100644 --- a/src/corelib/x11/fpgfx_package.pas +++ b/src/corelib/x11/fpgfx_package.pas @@ -10,7 +10,7 @@ uses x11_xft, x11_keyconv, gfxbase, gfx_x11, fpgfx, gfx_stdimages, gfx_imgfmt_bmp, gfx_widget, gfx_UTF8utils, gfx_extinterpolation, gfx_cmdlineparams, gfx_utils, gfx_popupwindow, gfx_impl, gfx_command_intf, gfx_wuline, - gfx_imagelist, gfx_constants; + gfx_imagelist, gfx_constants, gfx_pofiles, gfx_translations; implementation diff --git a/src/corelib/x11/gfx_utils.pas b/src/corelib/x11/gfx_utils.pas index 39ef7d86..3117a282 100644 --- a/src/corelib/x11/gfx_utils.pas +++ b/src/corelib/x11/gfx_utils.pas @@ -15,6 +15,9 @@ implementation uses baseunix; + +// the common code for all platforms +{$I gfx_utils_impl.inc} // File utils function ExtractTargetSymLinkPath(ALink: string): string; diff --git a/src/gui/gui_dialogs.pas b/src/gui/gui_dialogs.pas index abe41396..308e94b5 100644 --- a/src/gui/gui_dialogs.pas +++ b/src/gui/gui_dialogs.pas @@ -707,7 +707,7 @@ begin cbBold := TfpgCheckBox.Create(self); with cbBold do begin - SetPosition(461, 32, 87, 20); + SetPosition(461, 32, 110, 20); Text := rsBold; OnChange := @OnParamChange; end; @@ -715,7 +715,7 @@ begin cbItalic := TfpgCheckBox.Create(self); with cbItalic do begin - SetPosition(461, 56, 87, 20); + SetPosition(461, 56, 110, 20); Text := rsItalic; OnChange := @OnParamChange; end; @@ -723,15 +723,15 @@ begin cbUnderline := TfpgCheckBox.Create(self); with cbUnderline do begin - SetPosition(461, 80, 87, 20); - Text := 'Underline'; + SetPosition(461, 80, 110, 20); + Text := rsUnderScore; OnChange := @OnParamChange; end; cbAntiAlias := TfpgCheckBox.Create(self); with cbAntiAlias do begin - SetPosition(461, 124, 99, 20); + SetPosition(461, 124, 110, 20); Text := 'Anti aliasing'; OnChange := @OnParamChange; Checked := True; |