Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
PANEL event problem #439555
04/04/14 19:56
04/04/14 19:56
Joined: Sep 2009
Posts: 987
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 987
Budapest
I have created a panel with pan_create statement.
I have set its event like this:
Code:
new_panel.event = pan_event_handler;


I've created the function like this:
Code:
function pan_event_handler() {
	if (event_type == EVENT_RELEASE) {
		printf("EVENT_RELEASE");
	}
	if (event_type == EVENT_CLICK) {
		printf("EVENT_CLICK");
	}
	if(is(my,ENABLE_CLICK))
		printf("ENABLE_CLICK ON");
	else
		printf("ENABLE_CLICK OFF");
}


I inserted the third if into the code, because i was curious am i able to get the state of the panel.
The "EVENT_CLICK" message appeared, but i was shocked when the program aborted with E1513 at that statement.
I was sure i can use the my pointer here, but the message suggests to me it is not true.
Please, help me i would like to get the state of the panel, how should i do that?

Re: PANEL event problem [Re: Aku_Aku] #439558
04/04/14 20:11
04/04/14 20:11
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
See here: http://www.conitec.net/beta/apanel-on_click.htm
Use (PANEL* panel) as a function argument and then you can use panel instead of my for various operations/ checks.
Keep in mind that ENABLE_CLICK is an emask flag, not an eflags. The is() macro only works for eflags, you have to check ENABLE_CLICK manually:

if(panel.emask & ENABLE_CLICK) ...


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: PANEL event problem [Re: Superku] #439561
04/04/14 20:21
04/04/14 20:21
Joined: Sep 2009
Posts: 987
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 987
Budapest
Superku thanks for your quick problem-solving answer.
Really, i forgot to use the function argument.
Apart to that, that is also good you reminded me the ENABLE_CLICK is an emask flag.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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