Update of /cvsroot/pythoncard/PythonCard/docs/html
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16687/docs/html
Modified Files:
faq.html
Log Message:
added navigation key example
Index: faq.html
===================================================================
RCS file: /cvsroot/pythoncard/PythonCard/docs/html/faq.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** faq.html 14 Aug 2004 21:25:46 -0000 1.11
--- faq.html 23 Sep 2004 21:16:32 -0000 1.12
***************
*** 43,46 ****
--- 43,64 ----
A. Yes, using <a href="http://starship.python.net/crew/theller/py2exe/">py2exe</a> or Gordon McMillan's installer. On Mac OS X, you can use <a href="http://www.python.org/moin/BundleBuilder">BundleBuilder</a> to make standalones. The minimalStandalone
sample includes example scripts for all of them.</p>
+ <p>Q. How can I make the Return key act like the Tab key in a field, so that pressing Return navigates to the next component?<br />
+ A. The wxPython 2.5.2.x MigrationGuide.html document has an example using wx.NavigationKeyEvent,
+ which is new in wxPython 2.5.2. Adapting that to cause the Return key to behave the same as the Tab key using PythonCard event
+ attribute names gives us this example:</p>
+ <pre>
+ def on_keyDown(self, event):
+ # wx.WXK_RETURN is 13
+ if event.keyCode == wx.WXK_RETURN:
+ if event.shiftDown:
+ flags = wx.NavigationKeyEvent.IsBackward
+ else:
+ flags = wx.NavigationKeyEvent.IsForward
+ if event.controlDown:
+ flags |= wx.NavigationKeyEvent.WinChange
+ event.target.Navigate(flags)
+ else:
+ event.skip()
+ </pre>
<p>Q. Where is the home page?<br />
A. <a href="http://pythoncard.sourceforge.net/">http://pythoncard.sourceforge.net/</a></p>
|