//////////////////////////////////////////
// Free GUI-EXAMPLE for all 3D gs use //
// written by Patrick Ratz //
//////////////////////////////////////////
var i_1 = 0;
var i_2 = 0;
var i_3 = 0;
BMAP* arrow = "mouse_1.bmp";
BMAP* hWnd_win_2 = "hwnd_win_256.bmp";
BMAP* hWnd_win_3 = "hwnd_win_512.bmp";
BMAP* hWnd_but_1_up = "hWnd_but_1_up.bmp";
BMAP* hWnd_but_1_down = "hWnd_but_1_down.bmp";´
BMAP* hWnd_but_2_up = "hWnd_but_2_up.bmp";
BMAP* hWnd_but_2_down = "hWnd_but_2_down.bmp";
PANEL* hWnd_win_1_pan[100];
function start_gui();
function create_hWnd_win_1();
function move_hWnd_win_1();
function kill_hWnd_win_1();
////////////////////////////////////////////////
function move_hWnd_win_1()
{
while(mouse_left == 1)
{
mouse_panel.pos_x += mickey.x;
mouse_panel.pos_y += mickey.y;
wait(1);
}
}
function kill_hWnd_win_1()
{
reset(mouse_panel,SHOW);
}
/////////////////////////////////////////
function create_hWnd_win_1()
{
hWnd_win_1_pan[i_1] = pan_create
(
"bmap = hWnd_win_2;
pos_x = 100;
pos_y = 100;
button(234,6,hWnd_but_2_down,hWnd_but_2_up,hWnd_but_2_down,kill_hWnd_win_1,NULL,NULL);
button(218,6,hWnd_but_2_down,hWnd_but_2_up,hWnd_but_2_down,move_hWnd_win_1,NULL,NULL);
flags = SHOW | TRANSLUCENT ",10
);
}
function start_gui()
{
while(1)
{
if (key_a ==1)
{
wait(-1);
i_1 += 1;
create_hWnd_win_1();
}
wait(1);
}
}
function main()
{
start_gui();
mouse_mode = 4;
mouse_map = arrow;
}