X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Feditor%2Ff_options.pas;h=feffc4b02ee4064d0366689e4828cad70d01cae5;hb=9d717c612a7756b30839103d1d6e8d89e2596393;hp=0b2e703d502e67db1c08f4ae0dbaf8a267491067;hpb=b72e164f0fb64e3301ae8ca217449daf6a9d301d;p=d2df-editor.git diff --git a/src/editor/f_options.pas b/src/editor/f_options.pas index 0b2e703..feffc4b 100644 --- a/src/editor/f_options.pas +++ b/src/editor/f_options.pas @@ -1,18 +1,24 @@ unit f_options; -{$MODE Delphi} +{$INCLUDE ../shared/a_modes.inc} interface uses - LCLIntf, LCLType, LMessages, Messages, SysUtils, Variants, Classes, + 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; // Общие настройки: @@ -71,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} @@ -115,6 +121,9 @@ begin eDotStepTwo.Text := IntToStr(DotStepTwo); 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 @@ -173,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 @@ -184,6 +193,9 @@ begin DrawPanelSize := cbShowSize.Checked; BackColor := sBackColor.Brush.Color; PreviewColor := sPreviewColor.Brush.Color; + UseCheckerboard := cbCheckerboard.Checked; + Compress := cbCompress.Checked; + Backup := cbBackup.Checked; if cbScale.ItemIndex = 1 then Scale := 2 @@ -195,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); @@ -207,9 +219,12 @@ begin config.WriteBool('Editor', 'DrawPanelSize', DrawPanelSize); config.WriteInt('Editor', 'BackColor', BackColor); config.WriteInt('Editor', 'PreviewColor', PreviewColor); + config.WriteBool('Editor', 'UseCheckerboard', UseCheckerboard); 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 @@ -217,7 +232,7 @@ begin MainForm.RefreshRecentMenu(); end; - config.SaveFile(EditorDir+'\Editor.cfg'); + config.SaveFile(CfgFileName); config.Free(); Close(); end;