Changeset 10
- Timestamp:
- Jan 25, 2015, 9:54:33 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 104 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormPreferences.lfm
r9 r10 21 21 Top = 376 22 22 Width = 75 23 Anchors = [akRight, akBottom] 23 24 Caption = 'Save' 24 25 ModalResult = 1 … … 30 31 Top = 375 31 32 Width = 75 33 Anchors = [akRight, akBottom] 32 34 Caption = 'Cancel' 33 35 ModalResult = 2 34 36 TabOrder = 2 35 37 end 38 object ComboBoxLanguage: TComboBox 39 Left = 192 40 Height = 35 41 Top = 64 42 Width = 292 43 ItemHeight = 0 44 Style = csDropDownList 45 TabOrder = 3 46 end 47 object Label1: TLabel 48 Left = 18 49 Height = 25 50 Top = 65 51 Width = 95 52 Caption = 'Language:' 53 ParentColor = False 54 end 36 55 end -
trunk/Forms/UFormPreferences.pas
r9 r10 16 16 ButtonCancel: TButton; 17 17 CheckBoxRememberDatabase: TCheckBox; 18 ComboBoxLanguage: TComboBox; 19 Label1: TLabel; 18 20 private 19 21 { private declarations } … … 30 32 {$R *.lfm} 31 33 34 uses 35 UCore, ULanguages; 36 32 37 { TFormPreferences } 33 38 … … 35 40 begin 36 41 CheckBoxRememberDatabase.Checked := Preferences.RememberDatabase; 42 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items); 43 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language); 44 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 37 45 end; 38 46 … … 40 48 begin 41 49 Preferences.RememberDatabase := CheckBoxRememberDatabase.Checked; 50 if ComboBoxLanguage.ItemIndex <> -1 then 51 Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 42 52 end; 43 53 -
trunk/MyData.lpi
r9 r10 12 12 </General> 13 13 <i18n> 14 <EnableI18N LFM="False"/> 14 <EnableI18N Value="True"/> 15 <OutDir Value="Languages"/> 15 16 </i18n> 16 17 <VersionInfo> … … 67 68 </local> 68 69 </RunParams> 69 <RequiredPackages Count=" 3">70 <RequiredPackages Count="5"> 70 71 <Item1> 71 <PackageName Value="FCL"/> 72 <PackageName Value="TemplateGenerics"/> 73 <DefaultFilename Value="Packages/TemplateGenerics/TemplateGenerics.lpk" Prefer="True"/> 72 74 </Item1> 73 75 <Item2> 74 <PackageName Value="Common"/> 76 <PackageName Value="CoolTranslator"/> 77 <DefaultFilename Value="Packages/CoolTranslator/CoolTranslator.lpk" Prefer="True"/> 75 78 </Item2> 76 79 <Item3> 80 <PackageName Value="FCL"/> 81 </Item3> 82 <Item4> 83 <PackageName Value="Common"/> 84 <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/> 85 </Item4> 86 <Item5> 77 87 <PackageName Value="LCL"/> 78 </Item 3>88 </Item5> 79 89 </RequiredPackages> 80 90 <Units Count="17"> -
trunk/MyData.lpr
r9 r10 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UFormTables, UDatabase, UCore, Common, UEngineXML, UFormTable, 11 UFormRecords, UFormRecord, UFormFields, UFormField, UDataTypes, UEngineMySQL, 12 UEngineSQLite, UFormMain, UFormConnect, UFormDatabases, UFormPreferences; 10 Forms, UFormTables, UDatabase, UCore, Common, CoolTranslator, UEngineXML, 11 UFormTable, UFormRecords, UFormRecord, UFormFields, UFormField, UDataTypes, 12 TemplateGenerics, UEngineMySQL, UEngineSQLite, UFormMain, UFormConnect, 13 UFormDatabases, UFormPreferences; 13 14 14 15 {$R *.res} -
trunk/UCore.lfm
r9 r10 1456 1456 end 1457 1457 end 1458 object CoolTranslator1: TCoolTranslator 1459 POFilesFolder = 'Languages' 1460 left = 288 1461 top = 304 1462 end 1458 1463 end -
trunk/UCore.pas
r9 r10 6 6 7 7 uses 8 Classes, SysUtils, XMLConf, FileUtil, Controls, ActnList, UDatabase, Forms; 8 Classes, SysUtils, XMLConf, FileUtil, Controls, ActnList, UDatabase, 9 UCoolTranslator, Forms; 9 10 10 11 type … … 17 18 AExit: TAction; 18 19 ActionList1: TActionList; 20 CoolTranslator1: TCoolTranslator; 19 21 ImageList1: TImageList; 20 22 XMLConfig1: TXMLConfig; … … 163 165 Preferences.RememberDatabase := XMLConfig1.GetValue('RememberDatabase', True); 164 166 Preferences.LastDatabaseName := XMLConfig1.GetValue('LastDatabaseName', ''); 167 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(XMLConfig1.GetValue('Language', '')); 165 168 end; 166 169 … … 177 180 XMLConfig1.SetValue('RememberDatabase', Preferences.RememberDatabase); 178 181 XMLConfig1.SetValue('LastDatabaseName', Preferences.LastDatabaseName); 182 XMLConfig1.SetValue('Language', CoolTranslator1.Language.Code); 179 183 end; 180 184
Note:
See TracChangeset
for help on using the changeset viewer.