Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (monarch), 1,259 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
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 Offline OP
Junior Member
monchito  Offline 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 Offline
Serious User
painkiller  Offline
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
you have to put this in your main loop:

Code:
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 Offline
User
hopfel  Offline
User

Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
@edit: someone was faster.... -.-

Try this:

Code:
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
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Originally Posted By: painkiller
you have to put this in your main loop:

Code:
vec_set(mouse_pos, mouse_cursor);

would need to be in a while loop, though unnecessary

just use to update mouse position
Code:
mouse_mode = 4;



Re: can't click a panel button [Re: monchito] #338630
08/19/10 19:23
08/19/10 19:23
Joined: May 2006
Posts: 53
Puerto Rico
monchito Offline OP
Junior Member
monchito  Offline OP
Junior Member

Joined: May 2006
Posts: 53
Puerto Rico
Now its working ok. Thanks to all.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1