"AddEvent" and "buttonUp/buttonDown"

Byak@

Active Member
Licensed User
if i'm use
B4X:
addevent("button1",click,"b_click")
it work fine.but if i'm use
B4X:
addevent("imagebutton1",buttonup,"b_click")
it's not work.why?:confused:
 

Cableguy

Expert
Licensed User
Longtime User
The b4p imagebutton does NOT support buttonup or buttondown, only the click event..
To Trap those events, you must use the door lib, and add the event from it...
 

Byak@

Active Member
Licensed User
stop!you not right!imagebutton support buttonup and buttondown!when i creat this event from IDE it's work fine.
 

Cableguy

Expert
Licensed User
Longtime User
Open the IDE in the form designer, add an image button, select it and choose EVENTS... only the click event is visible FROM WITHIN basic4ppc...
 

Byak@

Active Member
Licensed User
and what about it?
img-100880-1.JPG
 

Cableguy

Expert
Licensed User
Longtime User
Ok, Sorry!!!
I'm at work and I only have the 5.5 version of the IDE, in my work PC, but remeber that the events name are case sensitive...
So you should try "ButtonUp" and "ButtonDown"....
 

Byak@

Active Member
Licensed User
nothing to sorry,all ok =)

i'm try some variants and what i'm see:
when i'm use
B4X:
sub app_start
form1.show
addevent("imagebutton1",ButtonDown,"b1")
end sub

sub b1
msgbox(1)
end sub
it's not work BUT when i'm use
B4X:
sub app_start
form1.show
addevent("imagebutton1",ButtonDown,"b1")
end sub

sub b1
msgbox(1)
end sub

sub imagebutton1_ButtonDown

end sub
it's work!!!
but it's not good,my programm contain ~30 buttons
how can i add event without creating it with IDE
 

agraham

Expert
Licensed User
Longtime User
Actually the event names are not case-sensitive in B4ppc. It is only when using the Door library that things become case-sensitive. This seems to be an IDE bug. Both legacy and compiled apps add the event OK (in version 6.42 at least), the IDE doesn't.
 

Byak@

Active Member
Licensed User
agraham please help me!how add 1 event for many imagebuttons?
event "buttondown".i'm use b4p 6.30
 

Byak@

Active Member
Licensed User
no...they are labelled sequentially but you use event "click".but i want "ButtonDown" event!!!and it is big problem
 

Byak@

Active Member
Licensed User
oh?,sorry)now i understand!thnx
 
Top