Changeset 13 for trunk/Forms
- Timestamp:
- Oct 5, 2019, 11:16:00 AM (5 years ago)
- Location:
- trunk/Forms
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNew.lfm
r8 r13 1 1 object FormNew: TFormNew 2 Left = 75 92 Left = 753 3 3 Height = 212 4 Top = 82 24 Top = 825 5 5 Width = 487 6 6 Caption = 'New game' … … 32 32 '9 x 9' 33 33 '10 x 10 ' 34 '11 x 11' 35 '12 x 12' 34 36 ) 35 37 Style = csDropDownList -
trunk/Forms/UFormNew.pas
r8 r13 1 1 unit UFormNew; 2 2 3 {$mode objfpc}{$H+}3 {$mode delphi}{$H+} 4 4 5 5 interface -
trunk/Forms/UFormSettings.lfm
r11 r13 8 8 ClientWidth = 480 9 9 DesignTimePPI = 144 10 OnClose = FormClose 11 OnCreate = FormCreate 10 12 OnShow = FormShow 11 13 LCLVersion = '2.0.2.0' … … 48 50 TabOrder = 2 49 51 end 52 object ComboBoxLanguage: TComboBox 53 Left = 208 54 Height = 43 55 Top = 86 56 Width = 230 57 ItemHeight = 0 58 Style = csDropDownList 59 TabOrder = 3 60 end 61 object Label2: TLabel 62 Left = 19 63 Height = 26 64 Top = 94 65 Width = 88 66 Caption = 'Language:' 67 ParentColor = False 68 end 50 69 end -
trunk/Forms/UFormSettings.lrj
r11 r13 3 3 {"hash":69745274,"name":"tformsettings.label1.caption","sourcebytes":[65,110,105,109,97,116,105,111,110,32,115,112,101,101,100,58],"value":"Animation speed:"}, 4 4 {"hash":1339,"name":"tformsettings.buttonok.caption","sourcebytes":[79,75],"value":"OK"}, 5 {"hash":77089212,"name":"tformsettings.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"} 5 {"hash":77089212,"name":"tformsettings.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"}, 6 {"hash":82521866,"name":"tformsettings.label2.caption","sourcebytes":[76,97,110,103,117,97,103,101,58],"value":"Language:"} 6 7 ]} -
trunk/Forms/UFormSettings.pas
r11 r13 6 6 7 7 uses 8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls; 8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls, 9 ULanguages; 9 10 10 11 type … … 15 16 ButtonOk: TButton; 16 17 ButtonCancel: TButton; 18 ComboBoxLanguage: TComboBox; 17 19 Label1: TLabel; 20 Label2: TLabel; 18 21 TrackBar1: TTrackBar; 19 22 procedure ButtonCancelClick(Sender: TObject); 20 23 procedure ButtonOkClick(Sender: TObject); 24 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 25 procedure FormCreate(Sender: TObject); 21 26 procedure FormShow(Sender: TObject); 22 27 private … … 29 34 FormSettings: TFormSettings; 30 35 36 31 37 implementation 32 38 … … 35 41 uses 36 42 UCore; 43 44 resourcestring 45 SLanguageChangeTitle = 'Language change'; 46 SLanguageChangeMessage = 'Interface language was changed. It may require restart of application.'; 47 37 48 38 49 { TFormSettings } … … 46 57 begin 47 58 Core.Game.AnimationDuration := TrackBar1.Position; 59 if ComboBoxLanguage.ItemIndex <> -1 then begin 60 if (Core.Translator1.Language <> TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex])) then 61 MessageDlg(SLanguageChangeTitle, SLanguageChangeMessage, mtInformation, [mbOk], 0); 62 Core.Translator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 63 end; 48 64 Close; 65 end; 66 67 procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction 68 ); 69 begin 70 Core.PersistentForm1.Save(Self); 71 end; 72 73 procedure TFormSettings.FormCreate(Sender: TObject); 74 begin 75 Core.Translator1.LanguageListToStrings(ComboBoxLanguage.Items); 49 76 end; 50 77 51 78 procedure TFormSettings.FormShow(Sender: TObject); 52 79 begin 80 Core.PersistentForm1.Load(Self); 53 81 TrackBar1.Position := Core.Game.AnimationDuration; 82 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Translator1.Language); 83 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 54 84 end; 55 85
Note:
See TracChangeset
for help on using the changeset viewer.