dabo Commit
Revision 6107
Date: 2010-10-16 15:14:03 -0700 (Sat, 16 Oct 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6107

Changed:
U   trunk/demo/samples/dBitmapButton.py
U   trunk/demo/samples/dEditBox.py

Log:
Fixed the display of the explanation label in dBitmapButton so that it wraps 
properly.

Added code to dEditBox so that it demonstrates the characters before/after 
cursor functionality.


Diff:
Modified: trunk/demo/samples/dBitmapButton.py
===================================================================
--- trunk/demo/samples/dBitmapButton.py 2010-10-16 16:06:11 UTC (rev 6106)
+++ trunk/demo/samples/dBitmapButton.py 2010-10-16 22:14:03 UTC (rev 6107)
@@ -11,19 +11,32 @@
                                DefaultBorderLeft=True)
                sz.appendSpacer(25)
 
-               lbl = dabo.ui.dLabel(self, Alignment="Center", Width=400, 
WordWrap=True)
+               lbl = dabo.ui.dLabel(self, Alignment="Center", 
ForeColor="darkblue",
+                               Width=500, WordWrap=True)
+               lbl.FontSize -= 3
                lbl.Caption = "Below are three dBitmapButtons. They will 
normally " + \
                                "display the Ace of Spades, but when the mouse 
hovers over them, their " + \
                                "normal image will be the Ace of Hearts. If you 
click on them, the image " + \
                                "will change to the King of Spades for as long 
as you hold the mouse down."
-               sz.append(lbl, halign="center")
-               if self.Application.Platform == "Mac":
-                       lbl = dabo.ui.dLabel(self, FontItalic=True,
-                                       Caption="These effects don't display on 
Mac OS X, unfortunately")
-                       lbl.FontSize -= 2
-                       sz.appendSpacer(5)
-                       sz.append(lbl, halign="center")
-               sz.appendSpacer(10)
+               bsz = dabo.ui.dBorderSizer(self, "v")
+               bsz.append(lbl, 1, halign="center")
+               # This is the proportion used for the section with the cards.
+               bottomWeight = 4
+               plat = self.Application.Platform
+               if plat == "Mac":
+                       cap = "These effects don't display on Mac OS X, 
unfortunately"
+               elif plat == "GTK":
+                       cap = "Some of these effects don't display correctly on 
Gtk"
+               else:
+                       cap = ""
+               if cap:
+                       bottomWeight -= 3
+                       lbl = dabo.ui.dLabel(self, FontItalic=True, Caption=cap)
+                       lbl.FontSize -= 4
+                       bsz.appendSpacer(5)
+                       bsz.append(lbl, halign="center")
+               sz.append(bsz, 1, halign="center")
+               sz.appendSpacer(20)
 
                hsz = dabo.ui.dSizer("h")
                btn = dabo.ui.dBitmapButton(self, 
Picture="media/cards/small/s1.png",
@@ -45,7 +58,8 @@
                btn.bindEvent(dEvents.Hit, self.onButtonHit)
                hsz.append(btn)
 
-               sz.append(hsz, halign="center")
+               sz.append(hsz, 3, halign="center")
+               sz.layout()
 
 
        def onButtonHit(self, evt):

Modified: trunk/demo/samples/dEditBox.py
===================================================================
--- trunk/demo/samples/dEditBox.py      2010-10-16 16:06:11 UTC (rev 6106)
+++ trunk/demo/samples/dEditBox.py      2010-10-16 22:14:03 UTC (rev 6107)
@@ -24,6 +24,8 @@
                self.Form.logit(_("Selected Text: %s") % self.edt.SelectedText)
                self.Form.logit(_("Selection Start position: %s") % 
self.edt.SelectionStart)
                self.Form.logit(_("Selection End position: %s") % 
self.edt.SelectionEnd)
+               self.Form.logit(_("Character before InsertionPoint: %s") % 
self.edt.charsBeforeCursor())
+               self.Form.logit(_("Character after InsertionPoint: %s") % 
self.edt.charsAfterCursor())
 
 
 



_______________________________________________
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