X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Feditor%2Ff_options.pas;h=91cc695d1e442dc03753e43b1de29ff63e8443a9;hb=e84d42dae1ae6b645a6feaa09544e6836a85c648;hp=28debba765666f781e334d94807db7cdd40e0cdd;hpb=3dc2fe6b3d29cd54425db8f590e922f2dce50e99;p=d2df-editor.git diff --git a/src/editor/f_options.pas b/src/editor/f_options.pas index 28debba..91cc695 100644 --- a/src/editor/f_options.pas +++ b/src/editor/f_options.pas @@ -5,14 +5,20 @@ unit f_options; 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; {$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 @@ -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