X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Feditor%2Ff_options.pas;h=feffc4b02ee4064d0366689e4828cad70d01cae5;hb=15a213d12de831aa04871cdd05dcf79749b82161;hp=1f297ec217b0a6f7ba490f50f63a858f876d053b;hpb=797ba76501e5360f4d02d6aade613dc529a24213;p=d2df-editor.git diff --git a/src/editor/f_options.pas b/src/editor/f_options.pas index 1f297ec..feffc4b 100644 --- a/src/editor/f_options.pas +++ b/src/editor/f_options.pas @@ -7,13 +7,18 @@ interface uses LCLIntf, LCLType, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, - ExtCtrls, ComCtrls, Registry; + ExtCtrls, ComCtrls, Registry, Math; type + + { TOptionsForm } + TOptionsForm = class (TForm) bOK: TButton; bCancel: TButton; cbCheckerboard: TCheckBox; + cbCompress: TCheckBox; + cbBackup: TCheckBox; ColorDialog: TColorDialog; GroupBox1: TGroupBox; // Общие настройки: @@ -72,7 +77,7 @@ procedure RegisterFileType(ext: String; FileName: String); implementation uses - f_main, StdConvs, CONFIG, g_language; + f_main, StdConvs, CONFIG, g_language, g_resources, g_options; {$R *.lfm} @@ -117,6 +122,8 @@ begin sBackColor.Brush.Color := BackColor; sPreviewColor.Brush.Color := PreviewColor; cbCheckerboard.Checked := UseCheckerboard; + cbCompress.Checked := Compress; + cbBackup.Checked := Backup; if Scale = 2 then cbScale.ItemIndex := 1 else @@ -175,8 +182,8 @@ begin d1 := True else d1 := False; - DotStepOne := StrToIntDef(eDotStepOne.Text, 16); - DotStepTwo := StrToIntDef(eDotStepTwo.Text, 8); + DotStepOne := EnsureRange(StrToIntDef(eDotStepOne.Text, 16), 4, 2048); + DotStepTwo := EnsureRange(StrToIntDef(eDotStepTwo.Text, 8), 4, 2048); if d1 then DotStep := DotStepOne else @@ -187,6 +194,8 @@ begin BackColor := sBackColor.Brush.Color; PreviewColor := sPreviewColor.Brush.Color; UseCheckerboard := cbCheckerboard.Checked; + Compress := cbCompress.Checked; + Backup := cbBackup.Checked; if cbScale.ItemIndex = 1 then Scale := 2 @@ -198,7 +207,7 @@ begin else DotSize := 1; - config := TConfig.CreateFile(EditorDir+'Editor.cfg'); + config := TConfig.CreateFile(CfgFileName); config.WriteInt('Editor', 'DotColor', DotColor); config.WriteBool('Editor', 'DotEnable', DotEnable); @@ -214,6 +223,8 @@ begin config.WriteInt('Editor', 'Scale', cbScale.ItemIndex); config.WriteInt('Editor', 'RecentCount', re); config.WriteStr('Editor', 'Language', gLanguage); + config.WriteBool('Editor', 'Compress', Compress); + config.WriteBool('Editor', 'Backup', Backup); if RecentCount <> re then begin @@ -221,7 +232,7 @@ begin MainForm.RefreshRecentMenu(); end; - config.SaveFile(EditorDir+'Editor.cfg'); + config.SaveFile(CfgFileName); config.Free(); Close(); end;