KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Setfocus method releases pressed button

 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
Bert
KiXforms Regular
KiXforms Regular


Joined: 06 Oct 2003
Posts: 56
Location: Netherlands

PostPosted: Mon Dec 08, 2003 10:31 pm    Post subject: Setfocus method releases pressed button Reply with quote

Hi,

When a button is depressed en kept depressed with the mousebutton and a Form.SetFocus method is used Kixforms sets the button to a released state. Then when you release the mousbutton no OnClick event is triggered.
The following kixlet demonstrates this.

Code:

$form = createobject ("kixtart.form")

$button = $form.controls.button ("Press me and keep me pressed")
$button.center
$button.onclick = "? 'Button was clicked'"

$timer = $form.controls.timer
$timer.interval = 500
$timer.ontimer = "$$form.setfocus"

$form.show

while $form.visible
   $ = execute ($form.doevents())
loop


BTW I love Kixtart and Kixforms. I have build some nifty things with it. Thanx and keep up the good work.

_________________
Bert

There are 10 kinds of people. Those who can count binary and those who can't.
Back to top
View user's profile Send private message
Bert
KiXforms Regular
KiXforms Regular


Joined: 06 Oct 2003
Posts: 56
Location: Netherlands

PostPosted: Fri Jan 09, 2004 12:57 pm    Post subject: Reply with quote

Shawn?
_________________
Bert

There are 10 kinds of people. Those who can count binary and those who can't.
Back to top
View user's profile Send private message
Chris S.
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 241

PostPosted: Fri Jan 09, 2004 1:07 pm    Post subject: Reply with quote

I could be wrong but I would expect this to be expected behavior. Click and hold the "home" button in your internet explorer window, drag the mouse off of it and then release the mouse button. What happens? Nothing. Changing the focus of an event, by default, cancels the event.
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Jan 09, 2004 2:59 pm    Post subject: Reply with quote

I'm glad Chris figured it out because I had no idea. Here's a modified version of your script that demonstrates this behavior. At least it appears to be expected. But if you feel otherwise lets hear about it.


Code:

break on

$form = createobject ("kixtart.form")

$button = $form.controls.button ("Press me and keep me pressed")
$button.center
$button.onclick = "? 'Button was clicked'"

$button2 = $form.controls.button ("Then Tab here!")
$button2.center
$button2.top = $button.bottom+10

$timer = $form.controls.timer
$timer.interval = 500
;$timer.ontimer = "$$form.setfocus"

$form.show

while $form.visible
   $ = execute ($form.doevents())
loop
 
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Jan 09, 2004 3:03 pm    Post subject: Reply with quote

Actually, you can see this behavior in any dialog box - like Internet Explorer Options ... just click and hold the OK button, then tab (set focus) to any other field or button.
Back to top
View user's profile Send private message
Bert
KiXforms Regular
KiXforms Regular


Joined: 06 Oct 2003
Posts: 56
Location: Netherlands

PostPosted: Fri Jan 09, 2004 9:40 pm    Post subject: Reply with quote

Oke guys,

I agree with you.

What I wanted to do was to activate the form repeatedly, not a control on the form.
But so far I have not found any noticeble effect of the setfocus method of a form object. So I stopped using it.

Moreover I have found that timer events should be used very carefully. Just setting properties in the ontimer event could give the mentioned behaviour of buttons. So I have used extra code to avoid this problem.

Thanx for your reaction.

_________________
Bert

There are 10 kinds of people. Those who can count binary and those who can't.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group