File: prefs.pas

package info (click to toggle)
mricron 0.20140804.1~dfsg.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 13,508 kB
  • sloc: pascal: 114,876; sh: 49; makefile: 35
file content (107 lines) | stat: -rwxr-xr-x 2,695 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
unit prefs; 

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
  Spin, Buttons;

type

  { TPrefForm }

  TPrefForm = class(TForm)
    SingleRowCheck: TCheckBox;
    OrthoCheck: TCheckBox;
    XBarClr: TButton;
    OKBtn: TButton;
    CancelBtn: TButton;
    ThinPenCheck: TCheckBox;
    GroupBox2: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    ResliceCheck: TCheckBox;
    GroupBox1: TGroupBox;
    MaxDimEdit: TSpinEdit;
    ThreadEdit: TSpinEdit;
    SigDigEdit: TSpinEdit;
    procedure CancelBtnClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure OKBtnClick(Sender: TObject);
    procedure ResliceCheckClick(Sender: TObject);
    procedure XBarClrClick(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end; 

var
  PrefForm: TPrefForm;

implementation
             uses
    nifti_img_view;
{ TPrefForm }

procedure TPrefForm.CancelBtnClick(Sender: TObject);
begin
       Close;
end;

procedure TPrefForm.FormCreate(Sender: TObject);
begin

end;

procedure TPrefForm.FormShow(Sender: TObject);
begin
       ResliceCheck.checked := gBGImg.ResliceOnLoad;
       //OrthoCheck.Visible := not gBGImg.ResliceOnLoad;
       OrthoCheck.checked := gBGImg.OrthoReslice;
     MaxDimEdit.value := gBGImg.MaxDim;
     ThreadEdit.value := gnCPUThreads;
     //DrawCheck.checked := ImgForm.ToolPanel.Visible;
     ThinPenCheck.Checked := gBGImg.ThinPen;
     SigDigEdit.value := gBGImg.SigDig;
          SingleRowCheck.checked := gBGImg.SingleRow;
end;

procedure TPrefForm.OKBtnClick(Sender: TObject);
begin
       gBGImg.ResliceOnLoad := ResliceCheck.checked;
          gBGImg.OrthoReslice := OrthoCheck.checked;
     gBGImg.MaxDim := MaxDimEdit.value;
     gnCPUThreads := ThreadEdit.value;
     //ImgForm.ToolPanel.Visible := DrawCheck.checked;
     //ImgForm.DrawMenu.Visible := DrawCheck.checked;
     gBGImg.ThinPen := ThinPenCheck.Checked;
     gBGImg.SigDig := SigDigEdit.value;
     if gBGImg.SingleRow <> SingleRowCheck.Checked then begin
        gBGImg.SingleRow := SingleRowCheck.Checked;
        ImgForm.DefaultControlPanel;
        ImgForm.RefreshImagesTimer.enabled := true;
     end;
     Close;
end;

procedure TPrefForm.ResliceCheckClick(Sender: TObject);
begin
    OrthoCheck.Visible := not ResliceCheck.checked;
end;

procedure TPrefForm.XBarClrClick(Sender: TObject);
begin
  ImgForm.XBarColor;
  PrefForm.BringToFront;
end;

initialization
  {$I prefs.lrs}

end.