добавил режим изменения
This commit is contained in:
@@ -24,6 +24,7 @@ type
|
||||
procedure btnCreateOBSKandinskyClick(Sender: TObject);
|
||||
procedure btnCreateOBSChatClick(Sender: TObject);
|
||||
procedure btnCreateOBSNotifyClick(Sender: TObject);
|
||||
procedure sgWebChatsCellDblClick(const Column: TColumn; const Row: Integer);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
@@ -34,11 +35,11 @@ type
|
||||
|
||||
procedure UpdateGridFromArray;
|
||||
procedure AddChat(newRecord: TOBSChat);
|
||||
procedure EdtChat(aPort: Integer);
|
||||
procedure EdtChat(newRecord: TOBSChat);
|
||||
procedure DelChat(aPort: Integer);
|
||||
|
||||
procedure AddNotify(newRecord: TOBSNotify);
|
||||
procedure EdtNotify(aPort: Integer);
|
||||
procedure EdtNotify(newRecord: TOBSNotify);
|
||||
procedure DelNotify(aPort: Integer);
|
||||
|
||||
procedure AddKandinsky(newRecord: TOBSKandinsky);
|
||||
@@ -89,6 +90,7 @@ begin
|
||||
dport := strtoint(sgWebChats.Cells[0, i]) + 1;
|
||||
end;
|
||||
fCreateChat.sbWebServerPort.Value := dport;
|
||||
fCreateChat.isEdit:=false;
|
||||
fCreateChat.Show;
|
||||
end;
|
||||
|
||||
@@ -120,6 +122,7 @@ begin
|
||||
dport := strtoint(sgWebChats.Cells[0, i]) + 1;
|
||||
end;
|
||||
fCreateNotify.sbWebServerPort.Value := dport;
|
||||
fCreateNotify.isEdit:=false;
|
||||
fCreateNotify.Show;
|
||||
end;
|
||||
|
||||
@@ -207,25 +210,13 @@ begin
|
||||
db.SaveRecordArray<TOBSNotify>('listNotify', listNotify);
|
||||
end;
|
||||
|
||||
procedure TfrOBS.EdtChat(aPort: Integer);
|
||||
procedure TfrOBS.EdtChat(newRecord: TOBSChat);
|
||||
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;
|
||||
rChat:= newRecord;
|
||||
|
||||
if TryStrToUInt('$' + rChat.ColorBlock, Cardinal(SavedColor)) then
|
||||
fCreateChat.frChatSettings1.cpStyleBlockColor.Color := SavedColor
|
||||
else
|
||||
@@ -246,25 +237,12 @@ begin
|
||||
fCreateChat.Show;
|
||||
end;
|
||||
|
||||
procedure TfrOBS.EdtNotify(aPort: Integer);
|
||||
procedure TfrOBS.EdtNotify(newRecord: TOBSNotify);
|
||||
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;
|
||||
OBSNotify:=newRecord;
|
||||
with OBSNotify do
|
||||
begin
|
||||
fCreateNotify.edtESImage.Text := Picture;
|
||||
@@ -300,6 +278,21 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrOBS.sgWebChatsCellDblClick(const Column: TColumn;
|
||||
const Row: Integer);
|
||||
begin
|
||||
if sgWebChats.Cells[1,row] = 'Îïîâåùåíèå' then
|
||||
begin
|
||||
fCreateNotify.isEdit:=true;
|
||||
fCreateNotify.Show;
|
||||
end;
|
||||
if sgWebChats.Cells[1,row] = '×àò' then
|
||||
begin
|
||||
fCreateChat.isEdit:=true;
|
||||
fCreateChat.Show;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrOBS.UpdateGridFromArray;
|
||||
var
|
||||
i, rowIndex: Integer;
|
||||
|
||||
Reference in New Issue
Block a user