procedure
TNewEdit
.
DelFoto(Sender: TObject);
var
i,ButtonSelect:
integer
;
begin
ButtonSelect:=Application
.
MessageBox(
'Óäàëèòü ôîòîãðàôèþ?'
,
'Ôîòîãðàôèè'
,mb_IconQuestion+mb_YesNo+mb_TaskModal);
if
(ButtonSelect=idYes)
then
begin
DMUnit
.
Foto
.
First;
if
Sender=DelFoto1
then
begin
Foto1
.
Picture
.
Bitmap
.
FreeImage;
Foto1
.
Picture:=
nil
;
i:=DMUnit
.
Foto
.
MoveBy(FotoScroll
.
Position-
1
);
DMUnit
.
Foto
.
Delete;
DMUnit
.
Foto
.
Refresh;
FotoScrollClick(self,btNext);
end
;
if
Sender=DelFoto2
then
begin
Foto2
.
Picture
.
Bitmap
.
FreeImage;
Foto2
.
Picture:=
nil
;
i:=DMUnit
.
Foto
.
MoveBy(FotoScroll
.
Position);
DMUnit
.
Foto
.
Delete;
DMUnit
.
Foto
.
Refresh;
FotoScrollClick(self,btNext);
end
;
if
Sender=DelFoto3
then
begin
Foto3
.
Picture
.
Bitmap
.
FreeImage;
Foto3
.
Picture:=
nil
;
i:=DMUnit
.
Foto
.
MoveBy(FotoScroll
.
Position+
1
);
DMUnit
.
Foto
.
Delete;
DMUnit
.
Foto
.
Refresh;
FotoScrollClick(self,btNext);
end
;
end
;
end
;