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

ComboBox OnChange Event

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


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jan 14, 2004 2:03 pm    Post subject: ComboBox OnChange Event Reply with quote

Refering to this feature request:

ComboBox OnChange

What behavior would you like to see for OnChange ? Are we looking at something like OnTextChanged for TextBox, where the event will trigger whenever the Text in the ComboBox changes ?
Back to top
View user's profile Send private message
Bert
KiXforms Regular
KiXforms Regular


Joined: 06 Oct 2003
Posts: 56
Location: Netherlands

PostPosted: Thu Jan 15, 2004 8:11 pm    Post subject: Reply with quote

Shawn,

I didn't know that for a textbox the event ontextChanged was available. I am using the onChange event.
I would like to know that the contents of the checkbox is changed before the focus is lost.
When the user changes the combobox by clicking one of the choices the onclick event is triggered.
For editing with the keyboard I can only think of triggering an onchange event after each character typed.
It is evident that this event than can not be used for validating the contents of the combobox because the text might not be complete yet. This could be done with the onlostfocus event.
But with the onchange event you can test the combobox for being empty or not. This is what I use to enable a button. And I copy the contents on every change in a variable that is used when another button is pressed which needs the contents of the combobox but has no knowledge of the combobox object.
(I have build a generic wizard for specific installations that is far to big to post here).

So for me the onchange event should be triggered whenever the contents changes, either by mouseclick or by the keyboard.

_________________
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
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Jan 15, 2004 9:02 pm    Post subject: Reply with quote

ja, I have been slowly moving away from the old vb5/6 event naming schemes and more toward the new dotnet names. So OnChange became OnTextChanged in one of the prior releases. I like the new dotnet names much better because the names indicates whats has changed.

The new scheme has sort of a loose name standard like:

On<what changed><how its changing>

for example OnTextChanged means "The Text property changed" and OnClosing means "I am closing, but I haven't closed yet" ... This also leads to really long names like OnSelectedIndexChanged but you take the good with the bad.

In terms of Kixtart and Kixforms ... its would be really tricky to implement these "changing" types of events, where something is happening and you may want to stop it from happening. By the time the script gets notified, its already too late to stop it.

Anyways, let me look into this OnTextChanged for ComboBox !


-Shawn
Back to top
View user's profile Send private message
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Wed Jan 28, 2004 12:53 am    Post subject: Reply with quote

Quote:
Anyways, let me look into this OnTextChanged for ComboBox !


This will be a big help! I'm glad you are creating events based on the naming convention of VB.NET. I too, agree the event names are more detailed on what's changed.

-pearly
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Feb 04, 2004 12:53 am    Post subject: Reply with quote

OnTextChanged for ComboBox is in Build 42.
Back to top
View user's profile Send private message
AndyD
KiXforms Novice
KiXforms Novice


Joined: 09 Feb 2004
Posts: 1

PostPosted: Mon Feb 09, 2004 11:00 am    Post subject: Re: ComboBox OnChange Event Reply with quote

Shawn wrote:
Refering to this feature request:

ComboBox OnChange

What behavior would you like to see for OnChange ? Are we looking at something like OnTextChanged for TextBox, where the event will trigger whenever the Text in the ComboBox changes ?


I was hoping for if the ListIndex changed in any way at all......up/down arrows, using the dropdown, typing.

I assume typing an entry not on the list returns a value of -1 ?

Can we have auto complete too ? I notice it does if you press down arrow after typing the start of an entry but if it could fill it in with the 1st matching entry as you type....that would be nice Wink
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Tue Feb 10, 2004 3:01 pm    Post subject: Reply with quote

Heres what I put into Build 42, the CHM was a little off in terms of documenting this stuff, this has been corrected ...


ComboBox.SelectedIndex

Gets or sets the index of the currently selected item in the control.

Syntax

SelectedIndex [ = Long ]

Property Value

The zero-based index of the currently selected item. The default is -1, which is also the value if no item is selected.

ComboBox.OnSelectedIndexChanged

Description

Gets or sets the event handler that is called when the SelectedIndex property changes.

Syntax

OnSelectedIndexChanged [ = String ]

Example:

Code:

Break On

$System = CreateObject("Kixtart.System")

$Form = $System.Form()

$Form.ComboBox1 = $Form.Controls.ComboBox()
$Form.ComboBox1.Center
$Form.ComboBox1.List = 1,2,3,4,5
$Form.ComboBox1.SelectedIndex = 2
$Form.ComboBox1.OnSelectedIndexChanged = "Changed()"

Function Changed()
 ?"Index=" $Form.ComboBox1.SelectedIndex
EndFunction

$Form.Show()
While $Form.Visible
 $=Execute($Form.DoEvents)
Loop

Exit 1


-Shawn
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