[wxruby-users] lose focus event?
Mario Steele
mario at ruby-im.net
Sat Jan 19 12:39:49 EST 2008
Hello David,
First off, welcome to the wxRuby community. Always nice to see new faces
around, and more interest being sparked in wxRuby, especially since it is
getting more stable with every release we make. To capture Focus Lost, you
would need to use evt_kill_focus(), this detects when a control looses
focus. It's specifically for Windows, but since 99.9 percent of the classes
we use in wxRuby, are derived from wxWindow, you should be able to utilize
the evt_kill_focus() to detect when a control (Such as a combo box), has
lost focus.
Don't think we have a full example of evt_kill_focus() and it's counterpart
evt_set_focus(), but it's pretty simple, and you can find the docs for it
here: http://wxruby.rubyforge.org/doc/focusevent.html
If you have any more questions, feel free to ask, we're more then happy to
help out.
L8ers,
Mario Steele
On 1/19/08, David Morton <mortonda at dgrmm.net> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm new to wxruby, and I haven't found any answer with google: Is
> there a way to capture a lose focus event on controls, such as a combo
> box? All my experiments show events when changing the text, but not
> when leaving the box.
>
> I want to make a combobox that autocompletes if I press tab (or down
> arrow or something), but if I click out or hit enter it needs to
> prompt me to add a new value. I'm trying to duplicate a behaviour in
> an Access app - I'd really like to ditch Access!
>
>
> On a higher level explanation, in case there's a better way to do it...
>
> I want it to search as I type, displaying possible matches, and let me
> complete with one of the matches, or if there is no match use the
> current search to create a new record.
>
> David Morton
> Maia Mailguard http://www.maiamailguard.com
> mortonda at dgrmm.net
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (Darwin)
>
> iD8DBQFHkipRUy30ODPkzl0RAi1bAKDNUbpfevGbpbkDQ8SqXXLZdDcrwQCfcE9G
> 3SLeVn92PcX8dgBXonwo0TA=
> =ndvX
> -----END PGP SIGNATURE-----
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>
--
Mario Steele
http://www.trilake.net
http://www.ruby-im.net
http://rubyforge.org/projects/wxruby/
http://rubyforge.org/projects/wxride/
http://rubyforge.org/projects/vwmc/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080119/ac39483a/attachment-0001.html
More information about the wxruby-users
mailing list