Author: reinhard Date: 2009-10-26 17:12:46 -0500 (Mon, 26 Oct 2009) New Revision: 10008
Modified: trunk/gnue-forms/src/GFObjects/GFTabStop.py trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py Log: Do not try to set the focus on "label" style entries, but if the user clicks on one of them, at least move the database cursor to the corresponding record. Modified: trunk/gnue-forms/src/GFObjects/GFTabStop.py =================================================================== --- trunk/gnue-forms/src/GFObjects/GFTabStop.py 2009-10-26 21:19:19 UTC (rev 10007) +++ trunk/gnue-forms/src/GFObjects/GFTabStop.py 2009-10-26 22:12:46 UTC (rev 10008) @@ -485,6 +485,22 @@ # ------------------------------------------------------------------------- + # UI events (called from UIEntry) + # ------------------------------------------------------------------------- + + def _event_jump_records(self, index): + """ + Move the database cursor as a result of the user clicking on a part of + the grid which can't receive the focus. + + If the user clicks on a part of the grid which can receive the focus, + the database cursor is moved implicitly throug the set_focus magic. + """ + + self._block.jump_records(index - self._visibleIndex) + + + # ------------------------------------------------------------------------- # Clipboard and selection # ------------------------------------------------------------------------- Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py =================================================================== --- trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py 2009-10-26 21:19:19 UTC (rev 10007) +++ trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py 2009-10-26 22:12:46 UTC (rev 10008) @@ -247,11 +247,16 @@ other = item._gnue_label_ if other == label: - if item.IsEnabled(): - # the UI focus is not on the entry yet (actually it's not + if item.IsEnabled() and self._gfObject.style.lower() != 'label': + # The UI focus is not on the entry yet (actually it's not # even visible yet), so we have to move the focus on both # the UI and GF level. self._gfObject.set_focus(self.widgets.index(item)) + else: + # This entry is not focusable, so we at least move the + # database cursor to the record behind this entry. + self._gfObject._event_jump_records( + self.widgets.index(item)) return event.Skip() _______________________________________________ commit-gnue mailing list commit-gnue@gnu.org http://lists.gnu.org/mailman/listinfo/commit-gnue