thanks ,guys.
did you have any good idea to design it?
pan_setbutton(gp[0],0,1,10,10,gb[1],gb[2],gb[3],NULL,buttonpro(1),NULL,NULL);is it possiable to pass any arguments for buttonpro?
if not,did you have any good ideas to do that?
...............................................................................
why i want to do write code like this:buttonpro(1)?
my point of view:
in code files,just used a few of functions to do any things like butt on events.
one panel objest has 3 buttons events ,so you must be to creat 3 functions . i think it is not better than just used one functions .
if there are much more function`s name ,it`s so hard to mangaged them.
well,just want to find a good way to managed my codes. it is so import.
ok show my idea,just used one function to control their events,and different for your mouse postion.
var gv;
function buttonpro(var i){
var x = mouse_pos.x;
var y = mouse_pos.y;
if(gp[0].flag=SHOW){ //gp[0] is a panel object
if(x>=0&&x<=40){
if(y>=0&&y<=20){//btn1
gv = 20;
}
if(y>=40&&y<=60){//btn2
gv = 60;
}
}
}
}
pan_setbutton(gp[0],0,1,0,0,gb[1],gb[2],gb[3],NULL,buttonpro,NULL,NULL); //btn1
pan_setbutton(gp[0],0,1,0,40,gb[1],gb[2],gb[3],NULL,buttonpro,NULL,NULL);//btn2