Bonsoir Alex.
J'ai un problème avec "evt_key_down() { | event | ... }".
Je m'explique:
Quand j'ouvre mon application, "evt_key_down() { | event | ... }"
fonctionne correctement, mais à partir du moment que je fait un clique
avec la souris sur TextCtrl par exemple, "evt_key_down() { | event | ...
}" ce désactive et ne fonctionne plus.
Que faut-il que je fasse pour que "evt_key_down() { | event | ... }"
reste activé?
merci.
on 2011-03-02 22:22
on 2011-03-03 01:29
Bonjour Sbastien,
Le problme que vous rencontrez, est d au fait que evt_key_down () {|
vnement | ...} est li l'instance que votre question lorsque vous
l'invoquez. En d'autres termes, evt_key_down () est fix en fonction de
votre fentre / cadre, pas le TextCtrl. Le TextCtrl a son propre systme
de
touche de gestion, qui est contrle en interne par la bibliothque
wxWidgets. Afin de saisir le texte entr dans un TextCtrl, vous devez
utiliser evt_text () {| vnement | ...} afin de capturer le texte saisi
dans un TextCtrl. Si vous voulez capturer des vnements Tab ainsi, vous
devrez ajouter le Wx:: drapeau TE_PROCESS_TAB la cration de votre
TextCtrl. Mme avec le traitement d'un retour, vous devez utiliser Wx::
TE_PROCESS_ENTER pour capturer le retour aussi.Mais pour le traitement
de
Wx:: TE_PROCESS_ENTER, vous devez utiliser la evt_text_enter () {|
vnement
| ...} pour le processus.
((
Hello Sebastian,
The problem you are having, is due to the fact that evt_key_down()
{|event|
...} is bound to the instance that your dealing with when you invoke it.
In
other words, evt_key_down() is being set on your Window / Frame, not the
TextCtrl. The TextCtrl has it's own Key Handling system, that is
controlled
internally by the wxWidgets library. In order to capture text entered
in a
TextCtrl, you need to use evt_text() {|event| ...} in order to capture
text
entered in a TextCtrl. If you want to capture Tab Events as well, you
will
need to add the Wx::TE_PROCESS_TAB flag to the creation of your
TextCtrl.
Same with processing a Return, you need to use Wx::TE_PROCESS_ENTER to
capture the return as well. But for processing Wx::TE_PROCESS_ENTER,
you
need to use the evt_text_enter() {|event| ...} to process it.
hth,
Mario
))
2011/3/2 Sbastien <sebastien.bureaux@dbmail.com>
>
> Bonsoir Alex.
> J'ai un problme avec "evt_key_down() { | event | ... }".
> Je m'explique:
> Quand j'ouvre mon application, "evt_key_down() { | event | ... }"
fonctionne correctement, mais partir du moment que je fait un clique
avec
la souris sur TextCtrl par exemple, "evt_key_down() { | event | ... }"
ce
dsactive et ne fonctionne plus.
> Que faut-il que je fasse pour que "evt_key_down() { | event | ... }" reste
activ?
> merci.
>
> _______________________________________________
> wxruby-users mailing list
> wxruby-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
((
Good evening Alex.
I have a problem with "evt_key_down () {| event | ...}".
Let me explain:
When I open my application, "evt_key_down () {| event | ...}" works
fine,
but from the time I made a mouse click on TextCtrl for example,
"evt_key_down () {| event |. ..} "this off and no longer works.
What should I do to that "evt_key_down () {| event | ...}" is enabled?
thank you.
))
--
Mario Steele
Lieutenant Commander 3
XO - Geo 99
XO - STO IFT Fleet
http://www.trekfederation.com
http://geo99.ruby-im.net
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.