Цитата:
int pos_size_button0[1][4];
string text_button0[1];
int flag_button0[1];
pos_size_button0[0][0]=73; pos_size_button0[0][1]=147; pos_size_button0[0][2]=100; pos_size_button0[0][3]=20;
text_button0[0]="Кнопка 0";
//////////
int pos_size_edit0[2][4];
string text_edit0[2];
pos_size_edit0[0][0]=127; pos_size_edit0[0][1]=8; pos_size_edit0[0][2]=100; pos_size_edit0[0][3]=20;
pos_size_edit0[1][0]=128; pos_size_edit0[1][1]=37; pos_size_edit0[1][2]=100; pos_size_edit0[1][3]=20;
text_edit0[0]="Поле 0"; text_edit0[1]="Поле 1";
//////////
int pos_size_check0[2][4];
string text_check0[2];
int flag_check0[2];
pos_size_check0[0][0]=21; pos_size_check0[0][1]=65; pos_size_check0[0][2]=60; pos_size_check0[0][3]=17;
pos_size_check0[1][0]=22; pos_size_check0[1][1]=93; pos_size_check0[1][2]=60; pos_size_check0[1][3]=17;
text_check0[0]="Галка 0"; text_check0[1]="Галка 1";
flag_check0[0]=0; flag_check0[1]=0;
//////////
int pos_size_combo0[1][4];
string text_combo0[1][1];
int strok_combo0[1];
int flag_combo0[1];
pos_size_combo0[0][0]=129; pos_size_combo0[0][1]=72; pos_size_combo0[0][2]=100; pos_size_combo0[0][3]=22;
strok_combo0[0]=1;
text_combo0[0][0]="Список 0";
flag_combo0[0]=0;
//////////
int pos_size_static0[2][4];
string text_static0[2];
pos_size_static0[0][0]=19; pos_size_static0[0][1]=12; pos_size_static0[0][2]=100; pos_size_static0[0][3]=12;
pos_size_static0[1][0]=21; pos_size_static0[1][1]=36; pos_size_static0[1][2]=100; pos_size_static0[1][3]=12;
text_static0[0]="Текст 0"; text_static0[1]="Текст 1";
//////////
createdialog(0, BUTTON, #pos_size_button0[0][0], #text_button0[0], #flag_button0[0] |
EDIT, #pos_size_edit0[0][0], #text_edit0[0] |
CHECK, #pos_size_check0[0][0], #text_check0[0], #flag_check0[0] |
COMBO, #pos_size_combo0[0][0], #text_combo0[0][0], #strok_combo0[0], #flag_combo0[0] |
STATIC, #pos_size_static0[0][0], #text_static0[0]);
//////////
showdialog(0, "Диалог", 558, 234, 250, 210, 1, 1);
//////////
win dialog;
// ждём когда диалог откроется
while(window("Диалог")==0)
{
sleep(50);
}
dialog=window("Диалог");
int nl=0, n;
rectangle(#pos_size_button0[0][0]);
for (n=0; n<2; n++)rectangle(#pos_size_edit0[n][0]);
for (n=0; n<2; n++)rectangle(#pos_size_check0[n][0]);
rectangle(#pos_size_combo0[0][0]);
for (n=0; n<2; n++)rectangle(#pos_size_static0[n][0]);
loop() sleep(10);//Убрать после теста
function rectangle(int #res)
{
line(res[0][0]-2, res[0][1]-2, res[0][0]+res[0][2]+1, res[0][1]-2, 255, dialog);
line(res[0][0]-2, res[0][1]+res[0][3]+1, res[0][0]+res[0][2]+1, res[0][1]+res[0][3]+1, 255, dialog);
line(res[0][0]-2, res[0][1]-2, res[0][0]-2, res[0][1]+res[0][3]+1, 255, dialog);
line(res[0][0]+res[0][2]+1, res[0][1]-2, res[0][0]+res[0][2]+1, res[0][1]+res[0][3]+1, 255, dialog);
}
function line(int xs, int ys, int xf, int yf, int color, win w)
{
int image[250][210];// по размеру диалога
int x1, y1, x2, y2;
if (xf>xs){x1=xs; x2=xf;}
else {x2=xs; x1=xf;}
if (yf>ys){y1=ys; y2=yf;}
else {y2=ys; y1=yf;}
for (int y=y1; y<y2+1; y++)
{
for (int x=x1; x<x2+1; x++)image[x][y]=color;
}
visualwindow (w, nl, x1, y1, x2+1, y2+1, x1, y1, 100, #image[0][0]);
nl++;
}