Check-in [69e577d0a7]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added configuration controls.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 69e577d0a7dcc925584541fe69237ef331109864
User & Date: MCO 2014-09-04 11:40:31
Context
2014-09-04
11:50
Added sample .ini file. check-in: 8704f6c1c7 user: MCO tags: trunk
11:40
Added configuration controls. check-in: 69e577d0a7 user: MCO tags: trunk
2014-09-03
16:54
First working version. No config yet. check-in: e610b70763 user: MCO tags: trunk
Changes

Changes to src/F_Config.dfm.

1
2
3
4
5
6
7
8
9
10
11
12
13
14




15
16






17












































































































object frmConfig: TfrmConfig
  Left = 0
  Top = 0
  Caption = 'Datum+ configuratie'
  ClientHeight = 282
  ClientWidth = 418
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  Position = poScreenCenter




  PixelsPerInch = 96
  TextHeight = 13






end
















































































































|









>
>
>
>


>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
object frmConfig: TfrmConfig
  Left = 0
  Top = 0
  Caption = 'Datum+ configuratie'
  ClientHeight = 314
  ClientWidth = 418
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  Position = poScreenCenter
  OnCreate = FormCreate
  DesignSize = (
    418
    314)
  PixelsPerInch = 96
  TextHeight = 13
  object lblLanguage: TLabel
    Left = 8
    Top = 8
    Width = 24
    Height = 13
    Caption = '&Taal:'
  end
  object lblFont: TLabel
    Left = 8
    Top = 38
    Width = 55
    Height = 13
    Caption = '&Lettertype:'
  end
  object lblBackColor: TLabel
    Left = 8
    Top = 65
    Width = 87
    Height = 13
    Caption = '&Achtergrondkleur:'
  end
  object lblTextColor: TLabel
    Left = 8
    Top = 93
    Width = 53
    Height = 13
    Caption = '&Tekstkleur:'
  end
  object cbxLanguage: TComboBox
    Left = 104
    Top = 8
    Width = 193
    Height = 21
    AutoDropDown = True
    Style = csDropDownList
    Anchors = [akLeft, akTop, akRight]
    DropDownCount = 16
    TabOrder = 0
  end
  object cbxFont: TComboBox
    Left = 104
    Top = 35
    Width = 193
    Height = 21
    AutoDropDown = True
    Style = csDropDownList
    Anchors = [akLeft, akTop, akRight]
    DropDownCount = 16
    TabOrder = 1
  end
  object cbxBackColor: TColorBox
    Left = 104
    Top = 62
    Width = 193
    Height = 22
    AutoDropDown = True
    Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbCustomColor, cbPrettyNames]
    Anchors = [akLeft, akTop, akRight]
    DropDownCount = 16
    TabOrder = 2
  end
  object cbxTextColor: TColorBox
    Left = 104
    Top = 90
    Width = 193
    Height = 22
    AutoDropDown = True
    DefaultColorColor = clWhite
    Selected = clWhite
    Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbCustomColor, cbPrettyNames]
    Anchors = [akLeft, akTop, akRight]
    DropDownCount = 16
    TabOrder = 3
  end
  object btnOK: TButton
    Left = 320
    Top = 8
    Width = 90
    Height = 25
    Anchors = [akTop, akRight]
    Caption = 'OK'
    Default = True
    ModalResult = 1
    TabOrder = 4
  end
  object btnCancel: TButton
    Left = 320
    Top = 39
    Width = 90
    Height = 25
    Anchors = [akTop, akRight]
    Cancel = True
    Caption = 'Ann&uleren'
    ModalResult = 2
    TabOrder = 5
  end
  object pnlSample: TPanel
    AlignWithMargins = True
    Left = 8
    Top = 128
    Width = 402
    Height = 178
    Margins.Left = 8
    Margins.Top = 8
    Margins.Right = 8
    Margins.Bottom = 8
    Align = alBottom
    Anchors = [akLeft, akTop, akRight, akBottom]
    BevelOuter = bvLowered
    TabOrder = 6
    ExplicitLeft = 0
    ExplicitTop = 136
    ExplicitWidth = 418
  end
end

Changes to src/F_Config.pas.

1
2
3
4
5
6
7

8
9
10












11
12
13
14
15
16
17
18
19
20
21
22
23


























24
unit F_Config;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs;


type
  TfrmConfig = class(TForm)












  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmConfig: TfrmConfig;

implementation

{$R *.dfm}



























end.






|
>



>
>
>
>
>
>
>
>
>
>
>
>













>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

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
unit F_Config;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids, Vcl.ValEdit, Vcl.StdCtrls,
  Vcl.ExtCtrls;

type
  TfrmConfig = class(TForm)
    lblLanguage: TLabel;
    cbxLanguage: TComboBox;
    lblFont: TLabel;
    cbxFont: TComboBox;
    cbxBackColor: TColorBox;
    lblBackColor: TLabel;
    lblTextColor: TLabel;
    cbxTextColor: TColorBox;
    btnOK: TButton;
    btnCancel: TButton;
    pnlSample: TPanel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmConfig: TfrmConfig;

implementation

{$R *.dfm}

procedure TfrmConfig.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  cbxLanguage.Items.BeginUpdate;
  for i := 0 to Languages.Count - 1 do begin
    cbxLanguage.Items.AddObject(Languages.Name[i], TObject(NativeUInt(Languages.LocaleID[i])));
  end;
  cbxLanguage.Sorted := True;
  cbxLanguage.Sorted := False;
  cbxLanguage.Items.Insert(0, 'system - ' + Languages.NameFromLocaleID[Languages.UserDefaultLocale]);
  cbxLanguage.Items.EndUpdate;

  cbxFont.Items.BeginUpdate;
  for i := 0 to Screen.Fonts.Count - 1 do begin
    if (Length(Screen.Fonts[i]) > 0) and (Screen.Fonts[i][1] <> '@') then
      cbxFont.Items.Add(Screen.Fonts[i]);
  end;
  cbxFont.Sorted := True;
  cbxFont.Sorted := False;
  cbxFont.Items.InsertObject(0, '(default)', TObject(NativeInt(-1)));
  cbxFont.Items.EndUpdate;

  // TODO: load settings
end;

end.

Changes to src/F_Main.pas.

60
61
62
63
64
65
66


67
68
69
70
71
72
73
        if not Screen.Monitors[i].Primary then begin
          Application.CreateForm(TfrmMain, frmSub);
          frmSub.Position := poDesigned;
          frmSub.Left := Screen.Monitors[i].Left;
          frmSub.WindowState := wsMaximized;
        end;
      end;


    end;
  end else begin
    // TODO: code only for non-primary monitors
  end;

  FormResize(Self);
  Show;







>
>







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
        if not Screen.Monitors[i].Primary then begin
          Application.CreateForm(TfrmMain, frmSub);
          frmSub.Position := poDesigned;
          frmSub.Left := Screen.Monitors[i].Left;
          frmSub.WindowState := wsMaximized;
        end;
      end;
    end else begin
      // TODO: reparent this form to the given handle?
    end;
  end else begin
    // TODO: code only for non-primary monitors
  end;

  FormResize(Self);
  Show;

Changes to src/ssdatum.dproj.

76
77
78
79
80
81
82

83
84
85
86
87
88
89
90
91
...
103
104
105
106
107
108
109

110
111
112
113
114
115
116
        <DCC_DebugDCUs>true</DCC_DebugDCUs>
        <DCC_Optimize>false</DCC_Optimize>
        <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
        <DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
        <DCC_RemoteDebug>true</DCC_RemoteDebug>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">

        <VerInfo_Locale>1033</VerInfo_Locale>
        <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
        <DCC_RemoteDebug>false</DCC_RemoteDebug>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Cfg_2)'!=''">
        <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
        <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
        <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
        <DCC_DebugInformation>0</DCC_DebugInformation>
................................................................................
        </DCCReference>
        <DCCReference Include="SingleInstance.pas"/>
        <DCCReference Include="ScreenSaverUtils.pas"/>
        <DCCReference Include="F_Config.pas">
            <Form>frmConfig</Form>
            <FormType>dfm</FormType>
        </DCCReference>

        <BuildConfiguration Include="Release">
            <Key>Cfg_2</Key>
            <CfgParent>Base</CfgParent>
        </BuildConfiguration>
        <BuildConfiguration Include="Base">
            <Key>Base</Key>
        </BuildConfiguration>







>

<







 







>







76
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
        <DCC_DebugDCUs>true</DCC_DebugDCUs>
        <DCC_Optimize>false</DCC_Optimize>
        <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
        <DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
        <DCC_RemoteDebug>true</DCC_RemoteDebug>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
        <Debugger_RunParams>/c</Debugger_RunParams>
        <VerInfo_Locale>1033</VerInfo_Locale>

        <DCC_RemoteDebug>false</DCC_RemoteDebug>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Cfg_2)'!=''">
        <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
        <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
        <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
        <DCC_DebugInformation>0</DCC_DebugInformation>
................................................................................
        </DCCReference>
        <DCCReference Include="SingleInstance.pas"/>
        <DCCReference Include="ScreenSaverUtils.pas"/>
        <DCCReference Include="F_Config.pas">
            <Form>frmConfig</Form>
            <FormType>dfm</FormType>
        </DCCReference>
        <None Include="ssdatum.sample.ini"/>
        <BuildConfiguration Include="Release">
            <Key>Cfg_2</Key>
            <CfgParent>Base</CfgParent>
        </BuildConfiguration>
        <BuildConfiguration Include="Base">
            <Key>Base</Key>
        </BuildConfiguration>