Добавил режим редактирования интеграций, но нужно в форму передать режим редактирования что бы не создавать, а изменять
This commit is contained in:
@@ -34,13 +34,15 @@ type
|
|||||||
|
|
||||||
procedure UpdateGridFromArray;
|
procedure UpdateGridFromArray;
|
||||||
procedure AddChat(newRecord: TOBSChat);
|
procedure AddChat(newRecord: TOBSChat);
|
||||||
procedure DelChat(aPort: integer);
|
procedure EdtChat(aPort: Integer);
|
||||||
|
procedure DelChat(aPort: Integer);
|
||||||
|
|
||||||
procedure AddNotify(newRecord: TOBSNotify);
|
procedure AddNotify(newRecord: TOBSNotify);
|
||||||
procedure DelNotify(aPort: integer);
|
procedure EdtNotify(aPort: Integer);
|
||||||
|
procedure DelNotify(aPort: Integer);
|
||||||
|
|
||||||
procedure AddKandinsky(newRecord: TOBSKandinsky);
|
procedure AddKandinsky(newRecord: TOBSKandinsky);
|
||||||
procedure DelKandinsky(aPort: integer);
|
procedure DelKandinsky(aPort: Integer);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -78,29 +80,29 @@ end;
|
|||||||
|
|
||||||
procedure TfrOBS.btnCreateOBSChatClick(Sender: TObject);
|
procedure TfrOBS.btnCreateOBSChatClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
dport, i: integer;
|
dport, i: Integer;
|
||||||
begin
|
begin
|
||||||
dport := 8080;
|
dport := 8080;
|
||||||
for I := 0 to sgWebChats.RowCount - 1 do
|
for i := 0 to sgWebChats.RowCount - 1 do
|
||||||
begin
|
begin
|
||||||
if strtoint(sgWebChats.Cells[0, I]) >= dport then
|
if strtoint(sgWebChats.Cells[0, i]) >= dport then
|
||||||
dport := strtoint(sgWebChats.Cells[0, I]) + 1;
|
dport := strtoint(sgWebChats.Cells[0, i]) + 1;
|
||||||
end;
|
end;
|
||||||
fCreateChat.sbWebServerPort.Value:=dport;
|
fCreateChat.sbWebServerPort.Value := dport;
|
||||||
fCreateChat.Show;
|
fCreateChat.Show;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrOBS.btnCreateOBSKandinskyClick(Sender: TObject);
|
procedure TfrOBS.btnCreateOBSKandinskyClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
dport: integer;
|
dport: Integer;
|
||||||
I: integer;
|
i: Integer;
|
||||||
rk: TOBSKandinsky;
|
rk: TOBSKandinsky;
|
||||||
begin
|
begin
|
||||||
dport := 8080;
|
dport := 8080;
|
||||||
for I := 0 to sgWebChats.RowCount - 1 do
|
for i := 0 to sgWebChats.RowCount - 1 do
|
||||||
begin
|
begin
|
||||||
if strtoint(sgWebChats.Cells[0, I]) >= dport then
|
if strtoint(sgWebChats.Cells[0, i]) >= dport then
|
||||||
dport := strtoint(sgWebChats.Cells[0, I]) + 1;
|
dport := strtoint(sgWebChats.Cells[0, i]) + 1;
|
||||||
end;
|
end;
|
||||||
rk.port := dport;
|
rk.port := dport;
|
||||||
AddKandinsky(rk);
|
AddKandinsky(rk);
|
||||||
@@ -109,15 +111,15 @@ end;
|
|||||||
|
|
||||||
procedure TfrOBS.btnCreateOBSNotifyClick(Sender: TObject);
|
procedure TfrOBS.btnCreateOBSNotifyClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
dport, i: integer;
|
dport, i: Integer;
|
||||||
begin
|
begin
|
||||||
dport := 8080;
|
dport := 8080;
|
||||||
for I := 0 to sgWebChats.RowCount - 1 do
|
for i := 0 to sgWebChats.RowCount - 1 do
|
||||||
begin
|
begin
|
||||||
if strtoint(sgWebChats.Cells[0, I]) >= dport then
|
if strtoint(sgWebChats.Cells[0, i]) >= dport then
|
||||||
dport := strtoint(sgWebChats.Cells[0, I]) + 1;
|
dport := strtoint(sgWebChats.Cells[0, i]) + 1;
|
||||||
end;
|
end;
|
||||||
fCreateNotify.sbWebServerPort.Value:=dport;
|
fCreateNotify.sbWebServerPort.Value := dport;
|
||||||
fCreateNotify.Show;
|
fCreateNotify.Show;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -137,17 +139,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrOBS.DelChat(aPort: integer);
|
procedure TfrOBS.DelChat(aPort: Integer);
|
||||||
var
|
var
|
||||||
I, j: integer;
|
i, j: Integer;
|
||||||
begin
|
begin
|
||||||
// Èùåì â îáðàòíîì ïîðÿäêå äëÿ áåçîïàñíîãî óäàëåíèÿ
|
// Èùåì â îáðàòíîì ïîðÿäêå äëÿ áåçîïàñíîãî óäàëåíèÿ
|
||||||
for I := High(listChats) downto 0 do
|
for i := High(listChats) downto 0 do
|
||||||
begin
|
begin
|
||||||
if listChats[I].port = aPort then
|
if listChats[i].port = aPort then
|
||||||
begin
|
begin
|
||||||
// Ñäâèãàåì ýëåìåíòû ìàññèâà
|
// Ñäâèãàåì ýëåìåíòû ìàññèâà
|
||||||
for j := I to High(listChats) - 1 do
|
for j := i to High(listChats) - 1 do
|
||||||
listChats[j] := listChats[j + 1];
|
listChats[j] := listChats[j + 1];
|
||||||
// Óìåíüøàåì ðàçìåð ìàññèâà
|
// Óìåíüøàåì ðàçìåð ìàññèâà
|
||||||
SetLength(listChats, Length(listChats) - 1);
|
SetLength(listChats, Length(listChats) - 1);
|
||||||
@@ -160,17 +162,17 @@ begin
|
|||||||
UpdateGridFromArray;
|
UpdateGridFromArray;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrOBS.DelKandinsky(aPort: integer);
|
procedure TfrOBS.DelKandinsky(aPort: Integer);
|
||||||
var
|
var
|
||||||
I, j: integer;
|
i, j: Integer;
|
||||||
begin
|
begin
|
||||||
// Èùåì â îáðàòíîì ïîðÿäêå äëÿ áåçîïàñíîãî óäàëåíèÿ
|
// Èùåì â îáðàòíîì ïîðÿäêå äëÿ áåçîïàñíîãî óäàëåíèÿ
|
||||||
for I := High(listKandinsky) downto 0 do
|
for i := High(listKandinsky) downto 0 do
|
||||||
begin
|
begin
|
||||||
if listKandinsky[I].port = aPort then
|
if listKandinsky[i].port = aPort then
|
||||||
begin
|
begin
|
||||||
// Ñäâèãàåì ýëåìåíòû ìàññèâà
|
// Ñäâèãàåì ýëåìåíòû ìàññèâà
|
||||||
for j := I to High(listKandinsky) - 1 do
|
for j := i to High(listKandinsky) - 1 do
|
||||||
listKandinsky[j] := listKandinsky[j + 1];
|
listKandinsky[j] := listKandinsky[j + 1];
|
||||||
// Óìåíüøàåì ðàçìåð ìàññèâà
|
// Óìåíüøàåì ðàçìåð ìàññèâà
|
||||||
SetLength(listKandinsky, Length(listKandinsky) - 1);
|
SetLength(listKandinsky, Length(listKandinsky) - 1);
|
||||||
@@ -182,17 +184,17 @@ begin
|
|||||||
db.SaveRecordArray<TOBSKandinsky>('listKandinsky', listKandinsky);
|
db.SaveRecordArray<TOBSKandinsky>('listKandinsky', listKandinsky);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrOBS.DelNotify(aPort: integer);
|
procedure TfrOBS.DelNotify(aPort: Integer);
|
||||||
var
|
var
|
||||||
I, j: integer;
|
i, j: Integer;
|
||||||
begin
|
begin
|
||||||
// Èùåì â îáðàòíîì ïîðÿäêå äëÿ áåçîïàñíîãî óäàëåíèÿ
|
// Èùåì â îáðàòíîì ïîðÿäêå äëÿ áåçîïàñíîãî óäàëåíèÿ
|
||||||
for I := High(listNotify) downto 0 do
|
for i := High(listNotify) downto 0 do
|
||||||
begin
|
begin
|
||||||
if listNotify[I].port = aPort then
|
if listNotify[i].port = aPort then
|
||||||
begin
|
begin
|
||||||
// Ñäâèãàåì ýëåìåíòû ìàññèâà
|
// Ñäâèãàåì ýëåìåíòû ìàññèâà
|
||||||
for j := I to High(listNotify) - 1 do
|
for j := i to High(listNotify) - 1 do
|
||||||
listNotify[j] := listNotify[j + 1];
|
listNotify[j] := listNotify[j + 1];
|
||||||
// Óìåíüøàåì ðàçìåð ìàññèâà
|
// Óìåíüøàåì ðàçìåð ìàññèâà
|
||||||
SetLength(listNotify, Length(listNotify) - 1);
|
SetLength(listNotify, Length(listNotify) - 1);
|
||||||
@@ -205,9 +207,102 @@ begin
|
|||||||
db.SaveRecordArray<TOBSNotify>('listNotify', listNotify);
|
db.SaveRecordArray<TOBSNotify>('listNotify', listNotify);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrOBS.EdtChat(aPort: Integer);
|
||||||
|
var
|
||||||
|
rChat: TOBSChat;
|
||||||
|
i: Integer;
|
||||||
|
f: boolean;
|
||||||
|
SavedColor: TAlphaColor;
|
||||||
|
begin
|
||||||
|
f := false;
|
||||||
|
for i := 0 to High(listChats) - 1 do
|
||||||
|
begin
|
||||||
|
if listChats[i].port = aPort then
|
||||||
|
begin
|
||||||
|
rChat := listChats[i];
|
||||||
|
f := true;
|
||||||
|
Break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if not f then
|
||||||
|
exit;
|
||||||
|
if TryStrToUInt('$' + rChat.ColorBlock, Cardinal(SavedColor)) then
|
||||||
|
fCreateChat.frChatSettings1.cpStyleBlockColor.Color := SavedColor
|
||||||
|
else
|
||||||
|
fCreateChat.frChatSettings1.cpStyleBlockColor.Color := TAlphaColorRec.Black;
|
||||||
|
fCreateChat.frChatSettings1.ccbStyleBorderColor.ItemIndex :=
|
||||||
|
rChat.ColorBorder;
|
||||||
|
fCreateChat.frChatSettings1.ccbBColor.ItemIndex := rChat.ColorBackground;
|
||||||
|
fCreateChat.frChatSettings1.sbStyleBlockBorderSize.Value := rChat.SolidBorder;
|
||||||
|
fCreateChat.frChatSettings1.sbStyleBlockPadding.Value := rChat.Paddings;
|
||||||
|
|
||||||
|
fCreateChat.frFontSettings1.ccbFontColor.ItemIndex := rChat.ColorFont;
|
||||||
|
fCreateChat.frFontSettings1.sbFontSize.Value := rChat.SizeFont;
|
||||||
|
fCreateChat.frFontSettings1.cbFontStyleDefault.ItemIndex := rChat.StyleFont;
|
||||||
|
|
||||||
|
fCreateChat.sbTimeMsg.Value := rChat.TimeMess;
|
||||||
|
fCreateChat.sbMaxMsg.Value := rChat.MaxCountMess;
|
||||||
|
fCreateChat.sbWebServerPort.Value := rChat.port;
|
||||||
|
fCreateChat.Show;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrOBS.EdtNotify(aPort: Integer);
|
||||||
|
var
|
||||||
|
OBSNotify: TOBSNotify;
|
||||||
|
i: Integer;
|
||||||
|
SavedColor: TAlphaColor;
|
||||||
|
f: boolean;
|
||||||
|
begin
|
||||||
|
f := false;
|
||||||
|
for i := 0 to High(listNotify) - 1 do
|
||||||
|
begin
|
||||||
|
if listNotify[i].port = aPort then
|
||||||
|
begin
|
||||||
|
OBSNotify := listNotify[i];
|
||||||
|
f := true;
|
||||||
|
Break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if not f then
|
||||||
|
exit;
|
||||||
|
with OBSNotify do
|
||||||
|
begin
|
||||||
|
fCreateNotify.edtESImage.Text := Picture;
|
||||||
|
fCreateNotify.edtESSound.Text := Sound;
|
||||||
|
|
||||||
|
if TryStrToUInt('$' + ColorBlock, Cardinal(SavedColor)) then
|
||||||
|
fCreateNotify.frColorSettings1.cpStyleBlockColor.Color := SavedColor
|
||||||
|
else
|
||||||
|
fCreateNotify.frColorSettings1.cpStyleBlockColor.Color :=
|
||||||
|
TAlphaColorRec.Black;
|
||||||
|
|
||||||
|
// fCreateNotify. ColorBlock:= GetColorFromColorPanel(frColorSettings1.cpStyleBlockColor.Color);
|
||||||
|
fCreateNotify.frColorSettings1.sbStyleBlockBorderSize.Value := SolidBorder;
|
||||||
|
fCreateNotify.frColorSettings1.sbStyleBlockPadding.Value := Paddings;
|
||||||
|
fCreateNotify.frColorSettings1.ccbStyleBorderColor.ItemIndex := ColorBorder;
|
||||||
|
fCreateNotify.frColorSettings1.ccbBColor.ItemIndex := ColorBackground;
|
||||||
|
|
||||||
|
fCreateNotify.edtESTitle.Text := HeaderText;
|
||||||
|
fCreateNotify.frFontSettings2.ccbFontColor.ItemIndex := HeaderColorFont;
|
||||||
|
fCreateNotify.frFontSettings2.sbFontSize.Value := HeaderSizeFont;
|
||||||
|
fCreateNotify.frFontSettings2.cbFontStyleDefault.ItemIndex :=
|
||||||
|
HeaderStyleFont;
|
||||||
|
|
||||||
|
fCreateNotify.edtESMessage.Text := MessText;
|
||||||
|
fCreateNotify.frFontSettings3.ccbFontColor.ItemIndex := MessColorFont;
|
||||||
|
fCreateNotify.frFontSettings3.sbFontSize.Value := MessSizeFont;
|
||||||
|
fCreateNotify.frFontSettings3.cbFontStyleDefault.ItemIndex := MessStyleFont;
|
||||||
|
|
||||||
|
fCreateNotify.sbTimeMsg.Value := TimeMess;
|
||||||
|
fCreateNotify.cbEventsType.ItemIndex := TypeEvent;
|
||||||
|
fCreateNotify.edtIF.Text := TypeEdit;
|
||||||
|
fCreateNotify.sbWebServerPort.Value := port;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrOBS.UpdateGridFromArray;
|
procedure TfrOBS.UpdateGridFromArray;
|
||||||
var
|
var
|
||||||
I, rowIndex: integer;
|
i, rowIndex: Integer;
|
||||||
begin
|
begin
|
||||||
sgWebChats.BeginUpdate;
|
sgWebChats.BeginUpdate;
|
||||||
try
|
try
|
||||||
@@ -216,32 +311,35 @@ begin
|
|||||||
rowIndex := 0; // Îòäåëüíûé ñ÷åò÷èê äëÿ ñòðîê ñåòêè
|
rowIndex := 0; // Îòäåëüíûé ñ÷åò÷èê äëÿ ñòðîê ñåòêè
|
||||||
|
|
||||||
// listChats
|
// listChats
|
||||||
for I := 0 to High(listChats) do
|
for i := 0 to High(listChats) do
|
||||||
begin
|
begin
|
||||||
sgWebChats.RowCount := rowIndex + 1;
|
sgWebChats.RowCount := rowIndex + 1;
|
||||||
sgWebChats.Cells[0, rowIndex] := inttostr(listChats[I].port);
|
sgWebChats.Cells[0, rowIndex] := inttostr(listChats[i].port);
|
||||||
sgWebChats.Cells[1, rowIndex] := '×àò';
|
sgWebChats.Cells[1, rowIndex] := '×àò';
|
||||||
sgWebChats.Cells[2, rowIndex] := 'http://127.0.0.1:' + inttostr(listChats[I].port);
|
sgWebChats.Cells[2, rowIndex] := 'http://127.0.0.1:' +
|
||||||
|
inttostr(listChats[i].port);
|
||||||
Inc(rowIndex); // Óâåëè÷èâàåì ñ÷åò÷èê ñòðîê
|
Inc(rowIndex); // Óâåëè÷èâàåì ñ÷åò÷èê ñòðîê
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// listNotify
|
// listNotify
|
||||||
for I := 0 to High(listNotify) do
|
for i := 0 to High(listNotify) do
|
||||||
begin
|
begin
|
||||||
sgWebChats.RowCount := rowIndex + 1;
|
sgWebChats.RowCount := rowIndex + 1;
|
||||||
sgWebChats.Cells[0, rowIndex] := inttostr(listNotify[I].port);
|
sgWebChats.Cells[0, rowIndex] := inttostr(listNotify[i].port);
|
||||||
sgWebChats.Cells[1, rowIndex] := 'Îïîâåùåíèå';
|
sgWebChats.Cells[1, rowIndex] := 'Îïîâåùåíèå';
|
||||||
sgWebChats.Cells[2, rowIndex] := 'http://127.0.0.1:' + inttostr(listNotify[I].port);
|
sgWebChats.Cells[2, rowIndex] := 'http://127.0.0.1:' +
|
||||||
|
inttostr(listNotify[i].port);
|
||||||
Inc(rowIndex); // Óâåëè÷èâàåì ñ÷åò÷èê ñòðîê
|
Inc(rowIndex); // Óâåëè÷èâàåì ñ÷åò÷èê ñòðîê
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// listKandinsky
|
// listKandinsky
|
||||||
for I := 0 to High(listKandinsky) do
|
for i := 0 to High(listKandinsky) do
|
||||||
begin
|
begin
|
||||||
sgWebChats.RowCount := rowIndex + 1;
|
sgWebChats.RowCount := rowIndex + 1;
|
||||||
sgWebChats.Cells[0, rowIndex] := inttostr(listKandinsky[I].port);
|
sgWebChats.Cells[0, rowIndex] := inttostr(listKandinsky[i].port);
|
||||||
sgWebChats.Cells[1, rowIndex] := 'Kandinsky';
|
sgWebChats.Cells[1, rowIndex] := 'Kandinsky';
|
||||||
sgWebChats.Cells[2, rowIndex] := 'http://127.0.0.1:' + inttostr(listKandinsky[I].port);
|
sgWebChats.Cells[2, rowIndex] := 'http://127.0.0.1:' +
|
||||||
|
inttostr(listKandinsky[i].port);
|
||||||
Inc(rowIndex); // Óâåëè÷èâàåì ñ÷åò÷èê ñòðîê
|
Inc(rowIndex); // Óâåëè÷èâàåì ñ÷åò÷èê ñòðîê
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
|
|||||||
+5
-5
@@ -139,7 +139,7 @@ object fCreateNotify: TfCreateNotify
|
|||||||
Position.X = 8.000000000000000000
|
Position.X = 8.000000000000000000
|
||||||
Position.Y = 135.000000000000000000
|
Position.Y = 135.000000000000000000
|
||||||
Text = #1057#1086#1073#1099#1090#1080#1077
|
Text = #1057#1086#1073#1099#1090#1080#1077
|
||||||
TabOrder = 60
|
TabOrder = 59
|
||||||
end
|
end
|
||||||
object cbEventsType: TComboBox
|
object cbEventsType: TComboBox
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
@@ -153,17 +153,17 @@ object fCreateNotify: TfCreateNotify
|
|||||||
Size.Width = 192.000000000000000000
|
Size.Width = 192.000000000000000000
|
||||||
Size.Height = 22.000000000000000000
|
Size.Height = 22.000000000000000000
|
||||||
Size.PlatformDefault = False
|
Size.PlatformDefault = False
|
||||||
TabOrder = 61
|
TabOrder = 60
|
||||||
end
|
end
|
||||||
object Label3: TLabel
|
object Label3: TLabel
|
||||||
Position.X = 8.000000000000000000
|
Position.X = 8.000000000000000000
|
||||||
Position.Y = 190.000000000000000000
|
Position.Y = 190.000000000000000000
|
||||||
Text = #1059#1089#1083#1086#1074#1080#1077' '#1089#1091#1084#1084#1099
|
Text = #1059#1089#1083#1086#1074#1080#1077' '#1089#1091#1084#1084#1099
|
||||||
TabOrder = 62
|
TabOrder = 61
|
||||||
end
|
end
|
||||||
object edtIF: TEdit
|
object edtIF: TEdit
|
||||||
Touch.InteractiveGestures = [LongTap, DoubleTap]
|
Touch.InteractiveGestures = [LongTap, DoubleTap]
|
||||||
TabOrder = 63
|
TabOrder = 62
|
||||||
Position.X = 8.000000000000000000
|
Position.X = 8.000000000000000000
|
||||||
Position.Y = 215.000000000000000000
|
Position.Y = 215.000000000000000000
|
||||||
Size.Width = 192.000000000000000000
|
Size.Width = 192.000000000000000000
|
||||||
@@ -204,7 +204,7 @@ object fCreateNotify: TfCreateNotify
|
|||||||
object edtESTitle: TEdit
|
object edtESTitle: TEdit
|
||||||
Touch.InteractiveGestures = [LongTap, DoubleTap]
|
Touch.InteractiveGestures = [LongTap, DoubleTap]
|
||||||
Align = Top
|
Align = Top
|
||||||
TabOrder = 38
|
TabOrder = 37
|
||||||
Text = '[NICK] '#1085#1072#1095#1072#1083' '#1086#1090#1089#1083#1077#1078#1080#1074#1072#1090#1100' '#1074#1072#1089
|
Text = '[NICK] '#1085#1072#1095#1072#1083' '#1086#1090#1089#1083#1077#1078#1080#1074#1072#1090#1100' '#1074#1072#1089
|
||||||
Position.X = 10.000000000000000000
|
Position.X = 10.000000000000000000
|
||||||
Position.Y = 20.000000000000000000
|
Position.Y = 20.000000000000000000
|
||||||
|
|||||||
+1
-1
@@ -100,7 +100,7 @@ begin
|
|||||||
TimeMess:=round(sbTimeMsg.Value);
|
TimeMess:=round(sbTimeMsg.Value);
|
||||||
TypeEvent:=cbEventsType.ItemIndex;
|
TypeEvent:=cbEventsType.ItemIndex;
|
||||||
TypeEdit:=edtIF.Text;
|
TypeEdit:=edtIF.Text;
|
||||||
Port:=round(sbWebServerPort.Value);;
|
Port:=round(sbWebServerPort.Value);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TTW_Bot.frOBS1.AddNotify(OBSNotify);
|
TTW_Bot.frOBS1.AddNotify(OBSNotify);
|
||||||
|
|||||||
Reference in New Issue
Block a user