dabo Commit
Revision 5492
Date: 2009-10-26 05:04:05 -0700 (Mon, 26 Oct 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5492

Changed:
U   trunk/dabo/dEvents.py
U   trunk/dabo/ui/uiwx/__init__.py
U   trunk/dabo/ui/uiwx/dEditor.py

Log:
Added the EditorStyleNeeded event to support custom styling in dEditor.


Diff:
Modified: trunk/dabo/dEvents.py
===================================================================
--- trunk/dabo/dEvents.py       2009-10-24 15:31:01 UTC (rev 5491)
+++ trunk/dabo/dEvents.py       2009-10-26 12:04:05 UTC (rev 5492)
@@ -183,6 +183,12 @@
        appliesToClass = classmethod(appliesToClass)
 
 
+class ControlNavigationEvent(dEvent):
+       def appliesToClass(eventClass, objectClass):
+               return issubclass(objectClass, (dabo.ui.dPage, dabo.ui.dForm))
+       appliesToClass = classmethod(appliesToClass)
+
+
 class SashEvent(dEvent):
        def appliesToClass(eventClass, objectClass):
                return issubclass(objectClass, dabo.ui.dSplitter)
@@ -831,6 +837,11 @@
        pass
 
 
+class EditorStyleNeeded(EditorEvent):
+       """Occurs when the underlying editor control requires restyling."""
+       pass
+
+
 class ValueChanged(dEvent):
        """Occurs when the control's value has changed, whether
        programmatically or interactively.

Modified: trunk/dabo/ui/uiwx/__init__.py
===================================================================
--- trunk/dabo/ui/uiwx/__init__.py      2009-10-24 15:31:01 UTC (rev 5491)
+++ trunk/dabo/ui/uiwx/__init__.py      2009-10-26 12:04:05 UTC (rev 5492)
@@ -552,6 +552,37 @@
        except AttributeError:
                # wxPython 2.6 and earlier doesn't seem to have this event
                pass
+               
+       if isinstance(wxEvt, wx.stc.StyledTextEvent):
+               # Adding all the event getters, even though most don't seem
+               # to do anything.
+               ed["alt"] = wxEvt.GetAlt()
+               ed["control"] = wxEvt.GetControl()
+               ed["dragAllowMove"] = wxEvt.GetDragAllowMove()
+               ed["dragResult"] = wxEvt.GetDragResult()
+               ed["dragText"] = wxEvt.GetDragText()
+               ed["extraLong"] = wxEvt.GetExtraLong()
+               ed["foldLevelNow"] = wxEvt.GetFoldLevelNow()
+               ed["foldLevelPrev"] = wxEvt.GetFoldLevelPrev()
+               ed["int"] = wxEvt.GetInt()
+               ed["key"] = wxEvt.GetKey()
+               ed["lParam"] = wxEvt.GetLParam()
+               ed["length"] = wxEvt.GetLength()
+               ed["line"] = wxEvt.GetLine()
+               ed["linesAdded"] = wxEvt.GetLinesAdded()
+               ed["listType"] = wxEvt.GetListType()
+               ed["margin"] = wxEvt.GetMargin()
+               ed["message"] = wxEvt.GetMessage()
+               ed["modificationType"] = wxEvt.GetModificationType()
+               ed["modifiers"] = wxEvt.GetModifiers()
+               ed["position"] = wxEvt.GetPosition()
+               ed["selection"] = wxEvt.GetSelection()
+               ed["shift"] = wxEvt.GetShift()
+               ed["string"] = wxEvt.GetString()
+               ed["text"] = wxEvt.GetText()
+               ed["wParam"] = wxEvt.GetWParam()
+               ed["x"] = wxEvt.GetX()
+               ed["y"] = wxEvt.GetY()
 
        return ed
 

Modified: trunk/dabo/ui/uiwx/dEditor.py
===================================================================
--- trunk/dabo/ui/uiwx/dEditor.py       2009-10-24 15:31:01 UTC (rev 5491)
+++ trunk/dabo/ui/uiwx/dEditor.py       2009-10-26 12:04:05 UTC (rev 5492)
@@ -645,6 +645,7 @@
                        return
                self._styleTimer.mode = self.Language.lower()
                self._styleTimer.start()
+               self.raiseEvent(dEvents.EditorStyleNeeded, evt)
                
                
        def onIdle(self, evt):




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to