Author: johannes
Date: 2006-11-09 08:05:03 -0600 (Thu, 09 Nov 2006)
New Revision: 9015
Modified:
trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
Log:
Focus is moved into a dropdown on wxMac when the wx.Choice-part is
opened.
Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py 2006-11-09
13:11:05 UTC (rev 9014)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py 2006-11-09
14:05:03 UTC (rev 9015)
@@ -165,7 +165,8 @@
for child in result.GetChildren():
if isinstance(child, wx.TextCtrl):
item = result._entry = child
- break
+ elif isinstance(child, wx.Choice):
+ child.Bind(wx.EVT_LEFT_DOWN, self.__on_mac_choice_clicked)
else:
item = result
@@ -265,6 +266,16 @@
# -------------------------------------------------------------------------
+ def __on_mac_choice_clicked(self, event):
+
+ lookup = event.GetEventObject().GetParent()
+ lookup._entry.SetFocus()
+ self._gfObject._event_set_focus(self.widgets.index(lookup))
+ event.Skip()
+
+
+ # -------------------------------------------------------------------------
+
def __on_toggle_checkbox(self, event):
self._request('TOGGLECHKBOX')
@@ -394,13 +405,13 @@
if not widget:
return
- widget.SetEvtHandlerEnabled (False)
+ widget.SetEvtHandlerEnabled(False)
try:
if self._gfObject.style in ['dropdown', 'listbox']:
field = self._gfObject._field
if field._allowedValues != widget._orig_allowed_values:
- self.update_choices (widget)
+ self.update_choices(widget)
if isinstance (widget, wx.StaticText):
widget.SetLabel (value)
@@ -434,11 +445,10 @@
else:
widget._gnue_label_.SetValue(value)
- widget.SetEvtHandlerEnabled (True)
+ widget.SetEvtHandlerEnabled(True)
widget.Refresh ()
-
# ------------------------------------------------------------------------
# Set the cursor's location in a widget
# ------------------------------------------------------------------------
_______________________________________________
commit-gnue mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/commit-gnue