Добавил окна добавления интеграций с ОБС
This commit is contained in:
@@ -0,0 +1,190 @@
|
||||
unit uCreateNotify;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
|
||||
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, fFontSettings,
|
||||
fColorSettings, FMX.StdCtrls, FMX.Edit, FMX.Controls.Presentation,
|
||||
FMX.ListBox, FMX.EditBox, FMX.SpinBox, FMX.Colors;
|
||||
|
||||
type
|
||||
TfCreateNotify = class(TForm)
|
||||
btnESImageOpen: TButton;
|
||||
btnESSoundOpen: TButton;
|
||||
edtESImage: TEdit;
|
||||
edtESSound: TEdit;
|
||||
edtESTitle: TEdit;
|
||||
Label58: TLabel;
|
||||
Label68: TLabel;
|
||||
frColorSettings1: TfrColorSettings;
|
||||
frFontSettings2: TfrFontSettings;
|
||||
GroupBox10: TGroupBox;
|
||||
Label38: TLabel;
|
||||
sbTimeMsg: TSpinBox;
|
||||
Label39: TLabel;
|
||||
sbWebServerPort: TSpinBox;
|
||||
Label2: TLabel;
|
||||
cbEventsType: TComboBox;
|
||||
Label3: TLabel;
|
||||
edtIF: TEdit;
|
||||
btnCreateEvent: TButton;
|
||||
btnESTest: TButton;
|
||||
GroupBox1: TGroupBox;
|
||||
GroupBox2: TGroupBox;
|
||||
frFontSettings3: TfrFontSettings;
|
||||
edtESMessage: TEdit;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
fCreateNotify: TfCreateNotify;
|
||||
|
||||
implementation
|
||||
|
||||
uses uGeneral;
|
||||
|
||||
{$R *.fmx}
|
||||
|
||||
procedure TfCreateNotify.FormCreate(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
SavedColor: TAlphaColor;
|
||||
c: TComponent;
|
||||
ColorStr: string;
|
||||
begin
|
||||
for i := 0 to frColorSettings1.ComponentCount - 1 do
|
||||
begin
|
||||
c := frColorSettings1.Components[i];
|
||||
if c is TComboBox then
|
||||
begin
|
||||
TComboBox(c).ItemIndex :=
|
||||
strtoint(DB.ReadSetting(TComboBox(c).Name, '0'));
|
||||
end;
|
||||
if c is TColorComboBox then
|
||||
begin
|
||||
TColorComboBox(c).ItemIndex :=
|
||||
strtoint(DB.ReadSetting(TComboBox(c).Name, '147'));
|
||||
end;
|
||||
if c is TSpinBox then
|
||||
begin
|
||||
TSpinBox(c).text := DB.ReadSetting(TSpinBox(c).Name, '1');
|
||||
end;
|
||||
if c is TColorPanel then
|
||||
begin
|
||||
ColorStr := DB.ReadSetting(TColorPanel(c).Name, 'FF000000');
|
||||
if TryStrToUInt('$' + ColorStr, Cardinal(SavedColor)) then
|
||||
TColorPanel(c).Color := SavedColor
|
||||
else
|
||||
TColorPanel(c).Color := TAlphaColorRec.Black;
|
||||
end;
|
||||
if c is TEdit then
|
||||
begin
|
||||
if TEdit(c).Name <> 'edtPortServer' then
|
||||
TEdit(c).text := DB.ReadSetting(TEdit(c).Name, '0');
|
||||
end;
|
||||
if c is TCheckBox then
|
||||
begin
|
||||
TCheckBox(c).IsChecked := DB.ReadSetting(TCheckBox(c).Name) = '1';
|
||||
end;
|
||||
end;
|
||||
for i := 0 to frFontSettings2.ComponentCount - 1 do
|
||||
begin
|
||||
c := frFontSettings2.Components[i];
|
||||
if c is TComboBox then
|
||||
begin
|
||||
TComboBox(c).ItemIndex :=
|
||||
strtoint(DB.ReadSetting(TComboBox(c).Name, '0'));
|
||||
end;
|
||||
if c is TColorComboBox then
|
||||
begin
|
||||
TColorComboBox(c).ItemIndex :=
|
||||
strtoint(DB.ReadSetting(TComboBox(c).Name, '147'));
|
||||
end;
|
||||
if c is TSpinBox then
|
||||
begin
|
||||
TSpinBox(c).text := DB.ReadSetting(TSpinBox(c).Name, '1');
|
||||
end;
|
||||
if c is TColorPanel then
|
||||
begin
|
||||
ColorStr := DB.ReadSetting(TColorPanel(c).Name, 'FF000000');
|
||||
if TryStrToUInt('$' + ColorStr, Cardinal(SavedColor)) then
|
||||
TColorPanel(c).Color := SavedColor
|
||||
else
|
||||
TColorPanel(c).Color := TAlphaColorRec.Black;
|
||||
end;
|
||||
if c is TEdit then
|
||||
begin
|
||||
if TEdit(c).Name <> 'edtPortServer' then
|
||||
TEdit(c).text := DB.ReadSetting(TEdit(c).Name, '0');
|
||||
end;
|
||||
if c is TCheckBox then
|
||||
begin
|
||||
TCheckBox(c).IsChecked := DB.ReadSetting(TCheckBox(c).Name) = '1';
|
||||
end;
|
||||
end;
|
||||
|
||||
for i := 0 to frFontSettings3.ComponentCount - 1 do
|
||||
begin
|
||||
c := frFontSettings3.Components[i];
|
||||
if c is TComboBox then
|
||||
begin
|
||||
TComboBox(c).ItemIndex :=
|
||||
strtoint(DB.ReadSetting(TComboBox(c).Name, '0'));
|
||||
end;
|
||||
if c is TColorComboBox then
|
||||
begin
|
||||
TColorComboBox(c).ItemIndex :=
|
||||
strtoint(DB.ReadSetting(TComboBox(c).Name, '147'));
|
||||
end;
|
||||
if c is TSpinBox then
|
||||
begin
|
||||
TSpinBox(c).text := DB.ReadSetting(TSpinBox(c).Name, '1');
|
||||
end;
|
||||
if c is TColorPanel then
|
||||
begin
|
||||
ColorStr := DB.ReadSetting(TColorPanel(c).Name, 'FF000000');
|
||||
if TryStrToUInt('$' + ColorStr, Cardinal(SavedColor)) then
|
||||
TColorPanel(c).Color := SavedColor
|
||||
else
|
||||
TColorPanel(c).Color := TAlphaColorRec.Black;
|
||||
end;
|
||||
if c is TEdit then
|
||||
begin
|
||||
if TEdit(c).Name <> 'edtPortServer' then
|
||||
TEdit(c).text := DB.ReadSetting(TEdit(c).Name, '0');
|
||||
end;
|
||||
if c is TCheckBox then
|
||||
begin
|
||||
TCheckBox(c).IsChecked := DB.ReadSetting(TCheckBox(c).Name) = '1';
|
||||
end;
|
||||
end;
|
||||
var
|
||||
n := 1;
|
||||
var
|
||||
cDir := myconst.fontsPath; // Èñêàòü â ïàïêå ñ ïðîãðàììîé
|
||||
var
|
||||
FileName := '*.*'; // Èùåì âñå ôàéëû
|
||||
ChDir(cDir); // âîéòè â êàòàëîã
|
||||
var
|
||||
SearchRec: TSearchRec;
|
||||
if FindFirst(FileName, faArchive, SearchRec) = 0 then
|
||||
repeat
|
||||
if (SearchRec.Attr and faAnyFile) = SearchRec.Attr then
|
||||
begin
|
||||
frFontSettings2.cbFontStyleDefault.Items.Add(SearchRec.Name);
|
||||
frFontSettings3.cbFontStyleDefault.Items.Add(SearchRec.Name);
|
||||
|
||||
Inc(n);
|
||||
end;
|
||||
until FindNext(SearchRec) <> 0;
|
||||
ChDir('..');
|
||||
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in New Issue
Block a user