index 0b2e703d502e67db1c08f4ae0dbaf8a267491067..91cc695d1e442dc03753e43b1de29ff63e8443a9 100644 (file)
--- a/src/editor/f_options.pas
+++ b/src/editor/f_options.pas
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;
// Общие настройки:
implementation
uses
- f_main, StdConvs, CONFIG, g_language;
+ f_main, StdConvs, CONFIG, g_language, g_resources;
{$R *.lfm}
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
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
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
else
DotSize := 1;
- config := TConfig.CreateFile(EditorDir+'\Editor.cfg');
+ config := TConfig.CreateFile(EditorDir+'Editor.cfg');
config.WriteInt('Editor', 'DotColor', DotColor);
config.WriteBool('Editor', 'DotEnable', DotEnable);
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
MainForm.RefreshRecentMenu();
end;
- config.SaveFile(EditorDir+'\Editor.cfg');
+ config.SaveFile(EditorDir+'Editor.cfg');
config.Free();
Close();
end;