Эксперт
Просматривает форум
Сообщений всего: 4464
Дата рег-ции: Нояб. 2017
Репутация: 585
|
CODE:#define WS_VISIBLE 0x10000000
#define WS_CHILD 0x40000000
#define BS_AUTORADIOBUTTON 0x00000009
#define BM_SETCHECK 0x00F1
#define BST_CHECKED 0x0001
external(INT, "CreateWindow", "CreateWindowExA", "User32.dll" );
int radiobutton[2];
int flag_radiobutton = 0;
//////// код с виз. редактора диалогов
int pos_size_button0[1][4];
string text_button0[1];
int flag_button0[1];
pos_size_button0[0][0]=10; pos_size_button0[0][1]=10; pos_size_button0[0][2]=100; pos_size_button0[0][3]=20;
text_button0[0]="Кнопка 0";
int pos_size_edit0[1][4];
string text_edit0[1];
pos_size_edit0[0][0]=10; pos_size_edit0[0][1]=35; pos_size_edit0[0][2]=100; pos_size_edit0[0][3]=20;
text_edit0[0]="Поле 0";
createdialog(0, BUTTON, #pos_size_button0[0][0], #text_button0[0], #flag_button0[0] |
EDIT, #pos_size_edit0[0][0], #text_edit0[0]);
showdialog(0, "Диалог", 835, 390, 250, 300, 1, 1);
////////////
loop()
{
textout(0, 300, 200, "Выбрано: "+format(flag_radiobutton), 0);
sleep(100);
}
function getmessage(0, WM_CREATE)
{
radiobutton[0]=CreateWindow(0, "BUTTON", "Check0", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 10, 70, 70, 20, gethwnd(0), 0, 0, 0);
radiobutton[1]=CreateWindow(0, "BUTTON", "Check1", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 10, 90, 70, 20, gethwnd(0), 0, 0, 0);
sendmessage(BM_SETCHECK, BST_CHECKED, 0, formatiw(radiobutton[flag_radiobutton]));
}
function getmessage(0, WM_COMMAND)
{
if (message.lparam==radiobutton[0])flag_radiobutton=0;
if (message.lparam==radiobutton[1])flag_radiobutton=1;
} |