dabo Commit
Revision 3136
Date: 2007-05-25 16:30:26 -0700 (Fri, 25 May 2007)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/3136

Changed:
U   trunk/dabo/ui/uiwx/dHtmlBox.py

Log:
Add ShowScrollBars property to dHtmlBox. Make sure that the HtmlLinkClicked 
event
is bound before any user-level bindings, so that the user code has a chance to
stop the default behavior from occuring.


Diff:
Modified: trunk/dabo/ui/uiwx/dHtmlBox.py
===================================================================
--- trunk/dabo/ui/uiwx/dHtmlBox.py      2007-05-25 20:37:30 UTC (rev 3135)
+++ trunk/dabo/ui/uiwx/dHtmlBox.py      2007-05-25 23:30:26 UTC (rev 3136)
@@ -36,9 +36,11 @@
                else:
                        # no such event, so we need to override the 
OnCellClicked event
                        self.OnCellClicked = self.__OnCellClicked
+
+       def _initEvents(self):
                self.bindEvent(dEvents.HtmlLinkClicked, self.__onLinkClicked)
+               self.super()
 
-
        def __OnCellClicked(self, cell, x, y, evt):
                self.raiseEvent(dEvents.HtmlLinkClicked, 
href=cell.GetLink().GetHref())
                
@@ -135,6 +137,17 @@
                        self.SetPage(val)
 
 
+       def _getShowScrollBars(self):
+               return not self._hasWindowStyleFlag(wx.html.HW_SCROLLBAR_NEVER)
+       
+       def _setShowScrollBars(self, val):
+               if bool(val):
+                       self._delWindowStyleFlag(wx.html.HW_SCROLLBAR_NEVER)
+                       self._addWindowStyleFlag(wx.html.HW_SCROLLBAR_AUTO)
+               else:
+                       self._delWindowStyleFlag(wx.html.HW_SCROLLBAR_AUTO)
+                       self._addWindowStyleFlag(wx.html.HW_SCROLLBAR_NEVER)
+
        def _getVerticalScroll(self):
                return self._verticalScroll
 
@@ -144,7 +157,6 @@
                rt = self.GetScrollPixelsPerUnit()
                self.SetScrollRate(rt[0], {True:rt[1], False:0}[val])
 
-
        HorizontalScroll = property(_getHorizontalScroll, _setHorizontalScroll, 
None,
                        _("Controls whether this object will scroll 
horizontally (default=True)  (bool)"))
 
@@ -154,6 +166,9 @@
        RespondToLinks = property(_getRespondToLinks, _setRespondToLinks, None,
                        _("When True (default), clicking a link will attempt to 
load that linked page.  (bool)"))
 
+       ShowScrollBars = property(_getShowScrollBars, _setShowScrollBars, None,
+                       _("When Tru (default), scrollbars will be shown as 
needed.  (bool)"))
+
        Source = property(_getSource, _setSource, None,
                        _("Html source of the current page being display. 
(default='')  (string)"))
 




_______________________________________________
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/dabo-dev/[EMAIL PROTECTED]

Reply via email to