Changeset 507 for ProjectTemplates/FileMenuProject/Forms
- Timestamp:
- Mar 29, 2018, 10:11:06 AM (7 years ago)
- Location:
- ProjectTemplates/FileMenuProject/Forms
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
ProjectTemplates/FileMenuProject/Forms/UFormAbout.lfm
r497 r507 11 11 OnShow = FormShow 12 12 Position = poScreenCenter 13 LCLVersion = '1.8. 0.6'13 LCLVersion = '1.8.2.0' 14 14 object LabelDescription: TLabel 15 15 Left = 25 -
ProjectTemplates/FileMenuProject/Forms/UFormAbout.pas
r497 r507 49 49 procedure TFormAbout.FormShow(Sender: TObject); 50 50 begin 51 Core.ThemeManager1.UseTheme(Self); 51 52 if Assigned(ApplicationInfo) then begin 52 53 LabelAppName.Caption := ApplicationInfo.AppName; -
ProjectTemplates/FileMenuProject/Forms/UFormMain.lfm
r497 r507 13 13 OnCreate = FormCreate 14 14 OnShow = FormShow 15 LCLVersion = '1.8. 0.6'15 LCLVersion = '1.8.2.0' 16 16 object CoolBar1: TCoolBar 17 17 Left = 0 -
ProjectTemplates/FileMenuProject/Forms/UFormMain.pas
r499 r507 46 46 procedure MenuItemToolbarClick(Sender: TObject); 47 47 private 48 procedure SetToolbarHints; 48 49 procedure UpdateFormTitle; 49 50 public … … 70 71 begin 71 72 Core.PersistentForm1.Save(Self); 73 Core.Finalize; 72 74 end; 73 75 … … 78 80 end; 79 81 80 procedure TFormMain. FormCreate(Sender: TObject);82 procedure TFormMain.SetToolbarHints; 81 83 var 82 84 I: Integer; 85 J: Integer; 86 Control: TControl; 83 87 begin 84 for I := 0 to ToolBarFile.ButtonCount - 1 do 85 ToolBarFile.Buttons[I].Hint := ToolBarFile.Buttons[I].Caption; 88 for J := 0 to CoolBar1.ControlCount - 1 do begin 89 Control := CoolBar1.Controls[J]; 90 if Control is TToolBar then begin 91 for I := 0 to TToolBar(Control).ButtonCount - 1 do begin 92 TToolBar(Control).Buttons[I].ShowHint := True; 93 TToolBar(Control).Buttons[I].Hint := TToolBar(Control).Buttons[I].Caption; 94 end; 95 end; 96 end; 97 end; 98 99 procedure TFormMain.FormCreate(Sender: TObject); 100 begin 86 101 end; 87 102 88 103 procedure TFormMain.FormShow(Sender: TObject); 89 104 begin 105 Core.Initialize; 90 106 Core.PersistentForm1.Load(Self); 91 Core.Initialize; 107 Core.ThemeManager1.UseTheme(Self); 108 SetToolbarHints; 92 109 end; 93 110 -
ProjectTemplates/FileMenuProject/Forms/UFormSettings.lfm
r497 r507 1 1 object FormSettings: TFormSettings 2 Left = 7983 Height = 3 004 Top = 3675 Width = 4812 Left = 429 3 Height = 336 4 Top = 289 5 Width = 530 6 6 Caption = 'Settings' 7 ClientHeight = 3 008 ClientWidth = 4817 ClientHeight = 336 8 ClientWidth = 530 9 9 Constraints.MinHeight = 300 10 10 Constraints.MinWidth = 400 11 11 DesignTimePPI = 120 12 OnClose = FormClose 12 13 OnCreate = FormCreate 13 14 OnShow = FormShow 14 15 Position = poScreenCenter 15 LCLVersion = '1.8.0.6' 16 object ComboBoxLanguage: TComboBox 17 Left = 160 18 Height = 28 19 Top = 30 20 Width = 260 21 ItemHeight = 20 22 Style = csDropDownList 23 TabOrder = 0 24 end 25 object Label1: TLabel 26 Left = 20 27 Height = 20 28 Top = 30 29 Width = 68 30 Caption = 'Language:' 31 ParentColor = False 32 end 16 LCLVersion = '1.8.2.0' 33 17 object ButtonOk: TButton 34 Left = 37618 Left = 425 35 19 Height = 31 36 Top = 2 5620 Top = 292 37 21 Width = 94 38 22 Anchors = [akRight, akBottom] … … 40 24 ModalResult = 1 41 25 OnClick = ButtonOkClick 42 TabOrder = 226 TabOrder = 1 43 27 end 44 28 object ButtonCancel: TButton 45 Left = 25629 Left = 305 46 30 Height = 31 47 Top = 2 5631 Top = 292 48 32 Width = 94 49 33 Anchors = [akRight, akBottom] 50 34 Caption = 'Cancel' 51 35 ModalResult = 2 52 TabOrder = 136 TabOrder = 0 53 37 end 54 object CheckBoxAutomaticDPI: TCheckBox 55 Left = 16 56 Height = 24 57 Top = 104 58 Width = 120 59 Caption = 'Automatic DPI' 60 OnChange = CheckBoxAutomaticDPIChange 61 TabOrder = 3 62 Visible = False 63 end 64 object SpinEditDPI: TSpinEdit 65 Left = 152 66 Height = 28 67 Top = 144 68 Width = 121 69 MaxValue = 300 70 MinValue = 96 71 TabOrder = 4 72 Value = 96 73 Visible = False 74 end 75 object LabelDPI: TLabel 76 Left = 80 77 Height = 20 78 Top = 152 79 Width = 26 80 Caption = 'DPI:' 81 ParentColor = False 82 Visible = False 83 end 84 object CheckBoxReopenLastFileOnStart: TCheckBox 85 Left = 16 86 Height = 24 87 Top = 72 88 Width = 181 89 Caption = 'Reopen last file on start' 90 TabOrder = 5 91 end 92 object Bevel1: TBevel 93 Left = 10 94 Height = 2 95 Top = 240 96 Width = 456 97 Anchors = [akLeft, akRight, akBottom] 38 object PageControl1: TPageControl 39 Left = 8 40 Height = 278 41 Top = 8 42 Width = 513 43 ActivePage = TabSheetGeneral 44 Anchors = [akTop, akLeft, akRight, akBottom] 45 TabIndex = 0 46 TabOrder = 2 47 object TabSheetGeneral: TTabSheet 48 Caption = 'General' 49 ClientHeight = 245 50 ClientWidth = 505 51 object ComboBoxLanguage: TComboBox 52 Left = 160 53 Height = 28 54 Top = 30 55 Width = 260 56 ItemHeight = 20 57 Style = csDropDownList 58 TabOrder = 0 59 end 60 object Label1: TLabel 61 Left = 20 62 Height = 20 63 Top = 30 64 Width = 68 65 Caption = 'Language:' 66 ParentColor = False 67 end 68 object CheckBoxAutomaticDPI: TCheckBox 69 Left = 16 70 Height = 24 71 Top = 104 72 Width = 120 73 Caption = 'Automatic DPI' 74 OnChange = CheckBoxAutomaticDPIChange 75 TabOrder = 1 76 Visible = False 77 end 78 object SpinEditDPI: TSpinEdit 79 Left = 152 80 Height = 28 81 Top = 144 82 Width = 121 83 MaxValue = 300 84 MinValue = 96 85 TabOrder = 2 86 Value = 96 87 Visible = False 88 end 89 object LabelDPI: TLabel 90 Left = 80 91 Height = 20 92 Top = 146 93 Width = 26 94 Caption = 'DPI:' 95 ParentColor = False 96 Visible = False 97 end 98 object CheckBoxReopenLastFileOnStart: TCheckBox 99 Left = 16 100 Height = 24 101 Top = 72 102 Width = 181 103 Caption = 'Reopen last file on start' 104 TabOrder = 3 105 end 106 object Label2: TLabel 107 Left = 20 108 Height = 20 109 Top = 184 110 Width = 48 111 Caption = 'Theme:' 112 ParentColor = False 113 end 114 object ComboBoxTheme: TComboBox 115 Left = 160 116 Height = 28 117 Top = 184 118 Width = 260 119 ItemHeight = 20 120 Style = csDropDownList 121 TabOrder = 4 122 end 123 end 98 124 end 99 125 end -
ProjectTemplates/FileMenuProject/Forms/UFormSettings.pas
r497 r507 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 Menus, Spin, ExtCtrls, ULanguages;9 Menus, Spin, ExtCtrls, ComCtrls, ULanguages; 10 10 11 11 type … … 14 14 15 15 TFormSettings = class(TForm) 16 Bevel1: TBevel;17 16 ButtonOk: TButton; 18 17 ButtonCancel: TButton; 18 CheckBoxAutomaticDPI: TCheckBox; 19 19 CheckBoxReopenLastFileOnStart: TCheckBox; 20 CheckBoxAutomaticDPI: TCheckBox;21 20 ComboBoxLanguage: TComboBox; 21 ComboBoxTheme: TComboBox; 22 22 Label1: TLabel; 23 Label2: TLabel; 23 24 LabelDPI: TLabel; 25 PageControl1: TPageControl; 24 26 SpinEditDPI: TSpinEdit; 27 TabSheetGeneral: TTabSheet; 25 28 procedure ButtonOkClick(Sender: TObject); 26 29 procedure CheckBoxAutomaticDPIChange(Sender: TObject); 27 30 procedure CheckBoxStartOnLogonChange(Sender: TObject); 31 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 28 32 procedure FormCreate(Sender: TObject); 29 33 procedure FormShow(Sender: TObject); … … 44 48 45 49 uses 46 UCore ;50 UCore, UTheme; 47 51 48 52 { TFormSettings } … … 50 54 procedure TFormSettings.FormShow(Sender: TObject); 51 55 begin 52 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items); 53 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language); 54 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 56 Core.PersistentForm1.Load(Self); 57 Core.ThemeManager1.UseTheme(Self); 55 58 end; 56 59 57 60 procedure TFormSettings.ButtonOkClick(Sender: TObject); 58 61 begin 59 if ComboBoxLanguage.ItemIndex <> -1 then60 Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);61 62 end; 62 63 … … 71 72 end; 72 73 74 procedure TFormSettings.FormClose(Sender: TObject; var CloseAction: TCloseAction 75 ); 76 begin 77 Core.PersistentForm1.Save(Self); 78 end; 79 73 80 procedure TFormSettings.FormCreate(Sender: TObject); 74 81 begin … … 81 88 SpinEditDPI.Value := Core.ScaleDPI1.DPI.X; 82 89 CheckBoxReopenLastFileOnStart.Checked := Core.ReopenLastFileOnStart; 90 91 Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items); 92 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language); 93 if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0; 94 95 Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items); 96 ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.ThemeManager1.Theme); 97 if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0; 98 83 99 UpdateInterface; 84 100 end; … … 89 105 Core.ScaleDPI1.DPI := Point(SpinEditDPI.Value, SpinEditDPI.Value); 90 106 Core.ReopenLastFileOnStart := CheckBoxReopenLastFileOnStart.Checked; 107 if ComboBoxLanguage.ItemIndex <> -1 then 108 Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 109 if ComboBoxTheme.ItemIndex <> -1 then 110 Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 91 111 end; 92 112
Note:
See TracChangeset
for help on using the changeset viewer.