2 registered members (AndrewAMD, VoroneTZ),
919
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
can't click a panel button
#338586
08/19/10 11:54
08/19/10 11:54
|
Joined: May 2006
Posts: 53 Puerto Rico
monchito
OP
Junior Member
|
OP
Junior Member
Joined: May 2006
Posts: 53
Puerto Rico
|
Hi I'm using Comm v7.86 in windows XP Started to use the PANEL's buttons today and is not working, used some samples already without any luck. The panel shows ok with the button images. Used events, functions, combination of flags and nothing is working with the buttons. Any help or reference is appreciated. Thanks
function DoReset() { ... }
PANEL* menu_pan = { pos_x = 10; pos_y = 340; button(0, 0,"button_new.bmp","button_new.bmp",NULL,DoReset,NULL,NULL); flags = VISIBLE; event = MenuEvent; } //... function main() { enable_mouse = 2; set(menu_pan, ENABLE_CLICK); //...
|
|
|
Re: can't click a panel button
[Re: monchito]
#338587
08/19/10 12:01
08/19/10 12:01
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
Serious User
|
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
you have to put this in your main loop:
vec_set(mouse_pos, mouse_cursor);
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: can't click a panel button
[Re: monchito]
#338588
08/19/10 12:06
08/19/10 12:06
|
Joined: Dec 2008
Posts: 605 47°19'02.40" N 8°32'54.67" E...
hopfel
User
|
User
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
|
@edit: someone was faster.... -.- Try this:
PANEL* menu_pan =
{
pos_x = 10;
pos_y = 340;
button(0,0,"button_new.bmp","button_new.bmp","button_new.bmp",DoReset,NULL,NULL);
layer=900; //to be sure nothing is above the panel
flags = VISIBLE;}
function DoReset() { ... } //You can write this function under the panel-definition also
//...
function main() {
mouse_mode=2;
mouse_map=bmap_create("button_new.bmp");
while(1)
{
vec_set(mouse_pos.x,mouse_cursor.x);
wait(1);}
//...
I do it that way, if I want to create a button on a panel. If this isn't working also, try to use different bitmaps for the three button-states. Hope I could help.
Hilf mir, dir zu helfen!
|
|
|
Re: can't click a panel button
[Re: painkiller]
#338589
08/19/10 12:07
08/19/10 12:07
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
you have to put this in your main loop:
vec_set(mouse_pos, mouse_cursor);
would need to be in a while loop, though unnecessary just use to update mouse position
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|