[INTERFACE]
DIALOG, "Скриншот", 666, 207;
STATIC, "Создать скрин", 4, 4, 80, 20;
COMBO, "Экран""Окно по указателю", 88, 4, 152, 60, string Scr;
STATIC, "Указатель на окно", 344, 4, 100, 20;
EDIT, 444, 4, 212, 20, win W;
STATIC, "Зона старт X", 4, 28, 72, 20;
EDIT, 80, 28, 80, 20, int StX;
STATIC, "Зона старт Y", 168, 28, 72, 20;
EDIT, 240, 28, 80, 20, int StY;
STATIC, "Зона финиш X", 328, 28, 76, 20;
EDIT, 408, 28, 80, 20, int FinX;
STATIC, "Зона финиш Y", 496, 28, 76, 20;
EDIT, 576, 28, 80, 20, int FinY;
STATIC, "Переменная", 4, 52, 72, 20;
EDIT, 80, 52, 164, 20, int Screen;
CHECK, "Сохранить на диск в формате", 4, 76, 176, 20, int Save_Disc;
COMBO, "BMP" "JPG" "PNG", 184, 76, 100, 80, string Formats;
STATIC, "Путь к папке", 4, 100, 68, 20;
EDIT, 76, 100, 344, 20, string Path;
BUTTON_PATH, "Выбрать путь", 424, 100, 100, 20, Path;
EDIT, 528, 100, 128, 20, string File;
STATIC, "Комментарий", 4, 124, 76, 20;
EDIT, 84, 124, 572, 20, unknown Comment;
BUTTON_OK, "Принять", 452, 152, 100, 20;
BUTTON_CANCEL, "Закрыть", 556, 152, 100, 20;
[END]


[APPEARANCE]
COLOR = 90, 150, 120;
SIZE_X = 8;
SIZE_Y =4;
[END]

[INFO]
[ENDL]>>Scr>>[ENDL]>>Comment
[END]

[ASSOC_VAR]
Scr="Экран";
W=W_Kib;
StX=0;
StY=0;
FinX=500;
FinY=500;
Screen=Screen;
Save_Disc=0;
Formats="BMP";
Path="C:\";
File="Screen";
W_V = #~W~;
V_Screen=#~Screen~;
Comment=;
[END]

[GLOBAL_VAR]
win ~W~;
int ~Screen~[3000][3000];  
[END]

[EVENT]
IF (Scr=="Экран")ENABLE(GETID(W), 0);
IF (Scr=="Окно по указателю")ENABLE(GETID(W), 1);
IF (Save_Disc==0)ENABLE(GETID(Formats), 0);
IF (Save_Disc==0)ENABLE(GETID(Path), 0);
IF (Save_Disc==0)ENABLE(GETID(File), 0);
IF (Save_Disc==1)ENABLE(GETID(Formats), 1);
IF (Save_Disc==1)ENABLE(GETID(Path), 1);
IF (Save_Disc==1)ENABLE(GETID(File), 1);
[END]


[FUNCTION_BODY]
function(int #Scr, string scr, win #w, int stx, int sty, int finx, int finy, int save_disc, string formats, string path, string file)
{
if (scr=="Экран") screen (#Scr[0][0], stx, sty, finx, finy, -1);
else screen (#Scr[0][0], stx, sty, finx, finy, w);
  if (save_disc)
  {
  sleep(100);
  if (formats=="BMP")saveimage(#Scr[0][0], path+file+".bmp");
  if (formats=="JPG")saveimage(JPG, #Scr[0][0], path+file+".jpg");
  if (formats=="PNG")saveimage(PNG, #Scr[0][0], path+file+".png");
  }
}
[END]

[CALL]
(V_Screen[0][0], Scr, W_V, StX, StY, FinX, FinY, Save_Disc, Formats, Path, File)
[END]

