dabo Commit
Revision 4028
Date: 2008-04-04 10:35:30 -0700 (Fri, 04 Apr 2008)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/4028

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

Log:
When the appdev is going to place the ok/cancel buttons, they'll want more
control over the placement than the big default border around the buttons
provides. This enhances it to not break the default functionality, but to
have the smallest amount of space taken up around the buttons if the 
appdev's code places the buttons.

The main problem I'm solving for myself here is that by default, the 
buttons take up an entire horizontal line of the main vertical sizer, and
in the case of the dialog I'm working on, that is a waste of screen
real estate.



Diff:
Modified: trunk/dabo/ui/uiwx/dDialog.py
===================================================================
--- trunk/dabo/ui/uiwx/dDialog.py       2008-04-04 12:30:03 UTC (rev 4027)
+++ trunk/dabo/ui/uiwx/dDialog.py       2008-04-04 17:35:30 UTC (rev 4028)
@@ -238,12 +238,9 @@
                buttonSizer.AddButton(self.btnOK)
                buttonSizer.AddButton(self.btnCancel)
                buttonSizer.Realize()
+               self._btnSizer = bsWrapper = dabo.ui.dSizer("v")
+               bsWrapper.append(buttonSizer, "x")
        
-               self._btnSizer = bs = dabo.ui.dSizer("v")
-               bs.append((0, sz.DefaultBorder/2))
-               bs.append(buttonSizer, "x")
-               bs.append((0, sz.DefaultBorder))
-
                # Wx rearranges the order of the buttons per platform 
conventions, but
                # doesn't rearrange the tab order for us. So, we do it manually:
                buttons = []
@@ -261,6 +258,10 @@
 
                if self.ButtonSizerPosition is None:
                        # User code didn't add it, so we must.
+                       bs = dabo.ui.dSizer("v")
+                       bs.append((0, sz.DefaultBorder/2))
+                       bs.append(self.ButtonSizer, "x")
+                       bs.append((0, sz.DefaultBorder))
                        sz.append(bs, "x")
                
                self.layout()




_______________________________________________
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