dabo Commit
Revision 5951
Date: 2010-08-04 09:57:52 -0700 (Wed, 04 Aug 2010)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5951

Changed:
U   trunk/dabo/dReportWriter.py
U   trunk/dabo/ui/uiwx/dReportProgress.py

Log:
This seems to work out my cancel button issues on all platforms.

Diff:
Modified: trunk/dabo/dReportWriter.py
===================================================================
--- trunk/dabo/dReportWriter.py 2010-08-04 16:24:20 UTC (rev 5950)
+++ trunk/dabo/dReportWriter.py 2010-08-04 16:57:52 UTC (rev 5951)
@@ -46,7 +46,7 @@
                win = self.ProgressControl
                if win:
                        win.updateProgress(0, len(self.Cursor))
-                       win.Visible = True
+                       win.show()
                        win.Form.fitToSizer()
                        #dabo.ui.yieldUI()  ## getting wxYield called 
recursively, sometimes. Doesn't appear to be needed, here
 
@@ -59,7 +59,7 @@
        def _hideProgress(self):
                win = self.ProgressControl
                if win:
-                       win.Visible = False
+                       win.hide()
                        win.Form.fitToSizer()
                        dabo.ui.yieldUI()
 

Modified: trunk/dabo/ui/uiwx/dReportProgress.py
===================================================================
--- trunk/dabo/ui/uiwx/dReportProgress.py       2010-08-04 16:24:20 UTC (rev 
5950)
+++ trunk/dabo/ui/uiwx/dReportProgress.py       2010-08-04 16:57:52 UTC (rev 
5951)
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+import wx
 import dabo
 if __name__ == "__main__":
        dabo.ui.loadUI("wx")
@@ -14,13 +15,33 @@
                ms = self.Sizer = dabo.ui.dBorderSizer(self, "v", 
DefaultBorder=5)
                self.gauge = dGauge(self, Size=(75,12))
                lblTitle = dLabel(self, Caption="Processing report...", 
FontBold=True)
-               butCancel = dButton(self, NameBase="butCancelReportProgress", 
CancelButton=True, Caption="Cancel", OnHit=self.onCancel)
+               butCancel = dButton(self, Name="butCancelReportProgress", 
CancelButton=False, 
+                               Caption="Cancel", Enabled=False, 
OnHit=self.onCancel)
                ms.append(lblTitle)
                ms.append(self.gauge, "expand")
                ms.append(butCancel, alignment="right")
                self.fitToSizer()
                self.Visible = False
 
+       def show(self):
+               self.oldCancel = self.Form.FindWindowById(wx.ID_CANCEL)
+               if self.oldCancel:
+                       self.oldCancelEnabled = self.oldCancel.Enabled
+                       self.oldCancel.Enabled = False
+                       self.oldCancel.CancelButton = False
+               self.butCancelReportProgress.Enabled = True
+               self.butCancelReportProgress.CancelButton = True
+               self.Visible = True
+
+       def hide(self):
+               self.Visible = False
+               self.butCancelReportProgress.Enabled = False
+               self.butCancelReportProgress.CancelButton = False
+               if self.oldCancel:
+                       if self.oldCancelEnabled:
+                               self.oldCancel.Enabled = True
+                       self.oldCancel.CancelButton = True
+
        def updateProgress(self, val, range):
                self.gauge.Range = range
                self.gauge.Value = val



_______________________________________________
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