commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r9239 - in trunk/gnue-forms/src/uidrivers/wx26: . widgets


From: johannes
Subject: [gnue] r9239 - in trunk/gnue-forms/src/uidrivers/wx26: . widgets
Date: Tue, 9 Jan 2007 09:38:10 -0600 (CST)

Author: johannes
Date: 2007-01-09 09:38:08 -0600 (Tue, 09 Jan 2007)
New Revision: 9239

Modified:
   trunk/gnue-forms/src/uidrivers/wx26/UIdriver.py
   trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
Log:
Moved required wx-version for OS X to 2.8.  This means focus works for 
all kind of widgets (including buttons and checkboxes) as well as better 
support for dropdowns


Modified: trunk/gnue-forms/src/uidrivers/wx26/UIdriver.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/UIdriver.py     2007-01-09 15:19:41 UTC 
(rev 9238)
+++ trunk/gnue-forms/src/uidrivers/wx26/UIdriver.py     2007-01-09 15:38:08 UTC 
(rev 9239)
@@ -28,7 +28,10 @@
 try:
   if not hasattr(sys, 'frozen'):
     import wxversion
-    wxversion.ensureMinimal('2.6')
+    if sys.platform == 'darwin':
+        wxversion.ensureMinimal('2.8')
+    else:
+        wxversion.ensureMinimal('2.6')
 
 except ImportError:
   raise Exceptions.DriverNotSupported, \

Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2007-01-09 
15:19:41 UTC (rev 9238)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py        2007-01-09 
15:38:08 UTC (rev 9239)
@@ -292,16 +292,10 @@
     def __on_text_changed(self, event):
 
         widget = event.GetEventObject()
-        text = event.GetString()
+        cursor = widget.GetInsertionPoint()
 
-        if isinstance(widget, wx.ComboBox) and 'wxMac' in wx.PlatformInfo:
-            cursor = widget._entry.GetInsertionPoint()
-        else:
-            cursor = widget.GetInsertionPoint()
+        self._request('REPLACEVALUE', text=widget.GetValue(), position=cursor)
 
-        self._request('REPLACEVALUE', text=event.GetString(), position=cursor)
-        event.Skip()
-
     # -------------------------------------------------------------------------
 
     def __on_gtk_text_changed(self, event):
@@ -410,9 +404,11 @@
             colour = wx.NullColour
         else:
             colour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)
-        self.widgets[index].SetBackgroundColour(colour)
 
+        self.widgets[index].SetBackgroundColour(wx.RED)
+        self.widgets[index].Refresh()
 
+
     # -------------------------------------------------------------------------
     # Set the value of a widget
     # -------------------------------------------------------------------------
@@ -464,7 +460,7 @@
                     widget._gnue_label_.SetValue(value)
 
             widget.SetEvtHandlerEnabled(True)
-            widget.Refresh ()
+            widget.Refresh()
 
 
     # ------------------------------------------------------------------------
@@ -482,10 +478,7 @@
         widget = self.widgets[index]
 
         if isinstance (widget, wx.ComboBox):
-            if 'wxMac' in wx.PlatformInfo:
-                widget._entry.SetInsertionPoint(position)
-            else:
-                widget.SetMark(position, position)
+            widget.SetMark(position, position)
 
         elif hasattr (widget, 'SetInsertionPoint'):
             widget.SetInsertionPoint(position)
@@ -507,10 +500,7 @@
         widget = self.widgets[index]
 
         if isinstance(widget, wx.ComboBox):
-            if 'wxMac' in wx.PlatformInfo:
-                widget._entry.SetSelection(selection1, selection2)
-            else:
-                widget.SetMark(selection1, selection2)
+            widget.SetMark(selection1, selection2)
 
         elif hasattr(widget, 'SetSelection'):
             widget.SetSelection(selection1, selection2)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]