dabo Commit
Revision 6015
Date: 2010-09-12 14:38:13 -0700 (Sun, 12 Sep 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6015
Changed:
U trunk/demo/DaboDemo.py
U trunk/demo/Modules.py
U trunk/demo/samples/bubblet.py
U trunk/demo/samples/dBitmapButton.py
U trunk/demo/samples/dButton.py
U trunk/demo/samples/dCheckBox.py
U trunk/demo/samples/dDateTextBox.py
U trunk/demo/samples/dDockTabs.py
U trunk/demo/samples/dEditBox.py
U trunk/demo/samples/dGauge.py
U trunk/demo/samples/dGrid.py
U trunk/demo/samples/dGridSizer.py
U trunk/demo/samples/dHyperLink.py
U trunk/demo/samples/dImage.py
U trunk/demo/samples/dLabel.py
U trunk/demo/samples/dLed.py
U trunk/demo/samples/dPageFrame.py
U trunk/demo/samples/dPageList.py
U trunk/demo/samples/dPageSelect.py
U trunk/demo/samples/dPageStyled.py
U trunk/demo/samples/dPageToolBar.py
U trunk/demo/samples/dSizer.py
U trunk/demo/samples/dSlidePanelControl.py
U trunk/demo/samples/dSlider.py
U trunk/demo/samples/dSpinner.py
U trunk/demo/samples/dTextBox.py
U trunk/demo/samples/dToggleButton.py
U trunk/demo/samples/dTreeView.py
U trunk/demo/samples/games/Minesweeper.py
U trunk/demo/samples/games/Montana.py
U trunk/demo/samples/games/bubblet/BubbleBizobj.py
U trunk/demo/samples/games/bubblet/BubblePanel.py
U trunk/demo/samples/games/bubblet/BubbletForm.py
U trunk/demo/samples/games/bubblet/StatsForm.py
U trunk/demo/samples/games/cardlib.py
U trunk/demo/samples/montana.py
Log:
Mass-removed all trailing whitespace. No code logic changes at all.
Diff:
Modified: trunk/demo/DaboDemo.py
===================================================================
--- trunk/demo/DaboDemo.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/DaboDemo.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -20,7 +20,7 @@
app.start()
-
+
if __name__ == '__main__':
main()
Modified: trunk/demo/Modules.py
===================================================================
--- trunk/demo/Modules.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/Modules.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
""" These classes are taken from the wxPython demo, and
modified to be consistent with Dabo style guidelines. Otherwise,
-they are essentially the work of Robin Dunn. Here is the
+they are essentially the work of Robin Dunn. Here is the
header from the Main.py file from which they were lifted:
#----------------------------------------------------------------------------
@@ -33,7 +33,7 @@
"""Emulates a module with a dynamically compiled __dict__"""
def __init__(self, dict):
self.dict = dict
-
+
def __getattr__(self, name):
if name in self.dict:
return self.dict[name]
@@ -54,7 +54,7 @@
except:
# Used to be named differently. Keep this for
backward-compatibility for a while.
getUserAppDataDirectory = utils.getUserDaboDirectory
- modDir = os.path.join(getUserAppDataDirectory(),
+ modDir = os.path.join(getUserAppDataDirectory(),
"DaboDemo", "modified")
if not os.path.exists(modDir):
os.makedirs(modDir)
@@ -64,11 +64,11 @@
self.modActive = -1
# Index used in self.modules for orig and modified versions
self.name = name
- # (dict , source , filename ,
description , error information )
- # ( 0 , 1 ,
2 , 3 , 4
)
+ # (dict , source , filename ,
description , error information )
+ # ( 0 , 1 ,
2 , 3 , 4
)
self.modules = [[None, "" , "" ,
"<original>" , None],
[None, "" , "" ,
"<modified>" , None]]
-
+
fname = "%s/%s.py" % (self.origDir, name)
# load original module
self.loadFromFile(fname, self.modOrig)
@@ -101,7 +101,7 @@
description = self.modules[modID][2]
try:
self.modules[modID][0] = {}
- code = compile(source, description, "exec")
+ code = compile(source, description, "exec")
exec code in self.modules[modID][0]
except:
self.modules[modID][4] =
DemoError(sys.exc_info())
@@ -125,7 +125,7 @@
def getActiveID(self):
return self.modActive
-
+
def getSource(self, modID=None):
if modID is None:
modID = self.modActive
@@ -142,12 +142,12 @@
if modID is None:
modID = self.modActive
return self.modules[modID][4]
-
+
def exists(self, modID):
return self.modules[modID][1] != ""
-
-
+
+
def hasModified(self):
return self.modules[self.modMod][1] != ""
@@ -162,18 +162,18 @@
self.modules[self.modMod][1] = code
self.updateFile(self.modMod)
self.loadDict(self.modMod)
-
-
+
+
def getOrigDir(cls):
return cls.origDir
getOrigDir = classmethod(getOrigDir)
-
-
+
+
def getModDir(cls):
return cls.modDir
getModDir = classmethod(getModDir)
-
-
+
+
def deleteModified(self):
fname = self.modules[self.modMod][2]
if not fname:
@@ -182,7 +182,7 @@
self.modules[self.modMod][1] = ""
os.remove(fname)
-
+
def updateFile(self, modID=None):
"""Updates the file from which a module was loaded
with (possibly updated) source
@@ -191,7 +191,7 @@
modID = self.modActive
source = self.modules[modID][1]
filename = self.modules[modID][2]
- try:
+ try:
file = open(filename, "wt")
file.write(source)
finally:
@@ -211,7 +211,7 @@
"""Wraps and stores information about the current exception"""
def __init__(self, exc_info):
import copy
-
+
excType, excValue = exc_info[:2]
# traceback list entries: (filename, line number, function
name, text)
self.traceback = traceback.extract_tb(exc_info[2])
@@ -242,7 +242,7 @@
self.exception_details = "<unprintable %s object>" &
type(excValue).__name__
del exc_info
-
+
def __str__(self):
ret = "Type %s \n \
Traceback: %s \n \
@@ -272,7 +272,7 @@
sz.append(bs, halign="center", border=5)
- lst = self.tbList = dabo.ui.dListControl(self,
BorderStyle="sunken",
+ lst = self.tbList = dabo.ui.dListControl(self,
BorderStyle="sunken",
MultipleSelect=False)
lst.bindEvent(dEvents.MouseLeftDoubleClick,
self.onListDoubleClick)
lst.addColumn(_("Filename"))
@@ -281,7 +281,7 @@
lst.addColumn(_("Code"))
self.insertTraceback(lst, demoError.traceback)
lst.autoSizeColumns((0,1,2))
-
+
sz.appendSpacer(10)
sz.append(dabo.ui.dLabel(self, Caption=_("Traceback")))
sz.appendSpacer(5)
@@ -298,7 +298,7 @@
for tbNum in range(len(traceback)):
data = traceback[tbNum]
lst.append( (os.path.basename(data[0]), ustr(data[1]),
ustr(data[2]), ustr(data[3])))
-
+
# Check whether this entry is from the demo module
pth = os.path.split(data[0])[0]
codeDirs = (DemoModules.getOrigDir(),
DemoModules.getModDir())
@@ -314,5 +314,5 @@
# If double-clicking on a demo's entry, jump to the line number
num = self.tbList.getItemData(self.tbList.PositionValue)
dabo.ui.callAfter(self.Form.showCode, num)
-
+
Modified: trunk/demo/samples/bubblet.py
===================================================================
--- trunk/demo/samples/bubblet.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/bubblet.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -11,25 +11,25 @@
def afterInit(self):
sz = self.Sizer = dabo.ui.dSizer("v")
sz.appendSpacer(40)
-
+
lbl = dabo.ui.dLabel(self, Caption="Bubblet is a fun and
somewhat addictive game.\n\nFor instructions, please see the Overview tab.")
sz.append(lbl, halign="center")
sz.appendSpacer(30)
btn = dabo.ui.dButton(self, Caption="Run the Bubblet Game",
OnHit=self.runGame)
sz.append(btn, halign="center")
-
+
def runGame(self, evt):
frm = BubbletForm(self.Form, Size=(400,300), Centered=True)
frm.show()
-
+
category = "Games.Bubblet"
-overview = """
-<h3>About Bubblet</h3>
+overview = """
+<h3>About Bubblet</h3>
<p><b>Bubblet</b> is a fun and somewhat addictive game. There are columns
of bubbles of 4 different colors. If there are at least two adjacent
bubbles of the same color, clicking on one of them will select the
@@ -73,9 +73,9 @@
two fresh columns of bubbles when you pop them. </p>
-<h3>End of Game</h3>
+<h3>End of Game</h3>
<p>When there are no longer any adjacent bubbles
of the same color, the game is over. Your score will be added to the
statistics, which keeps track of your high game, as well as the total
-number of games you've played and your average score for those games.</p>
+number of games you've played and your average score for those games.</p>
"""
Modified: trunk/demo/samples/dBitmapButton.py
===================================================================
--- trunk/demo/samples/dBitmapButton.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dBitmapButton.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -7,10 +7,10 @@
class TestPanel(dabo.ui.dPanel):
def afterInit(self):
- sz = self.Sizer = dabo.ui.dSizer("v", DefaultBorder=20,
+ sz = self.Sizer = dabo.ui.dSizer("v", DefaultBorder=20,
DefaultBorderLeft=True)
sz.appendSpacer(25)
-
+
lbl = dabo.ui.dLabel(self, Alignment="Center", Width=400,
WordWrap=True)
lbl.Caption = "Below are three dBitmapButtons. They will
normally " + \
"display the Ace of Spades, but when the mouse
hovers over them, their " + \
@@ -18,7 +18,7 @@
"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,
+ lbl = dabo.ui.dLabel(self, FontItalic=True,
Caption="These effects don't display on
Mac OS X, unfortunately")
lbl.FontSize -= 2
sz.appendSpacer(5)
@@ -26,25 +26,25 @@
sz.appendSpacer(10)
hsz = dabo.ui.dSizer("h")
- btn = dabo.ui.dBitmapButton(self,
Picture="media/cards/small/s1.png",
+ btn = dabo.ui.dBitmapButton(self,
Picture="media/cards/small/s1.png",
FocusPicture="media/cards/small/h1.png",
DownPicture="media/cards/small/s13.png",
Height=80, Width=80)
btn.bindEvent(dEvents.Hit, self.onButtonHit)
hsz.append(btn)
sz.appendSpacer(10)
- btn = dabo.ui.dBitmapButton(self,
Picture="media/cards/small/s1.png",
+ btn = dabo.ui.dBitmapButton(self,
Picture="media/cards/small/s1.png",
FocusPicture="media/cards/small/h1.png",
DownPicture="media/cards/small/s13.png",
Height=80, Width=80)
btn.bindEvent(dEvents.Hit, self.onButtonHit)
hsz.append(btn)
-
- btn = dabo.ui.dBitmapButton(self,
Picture="media/cards/small/s1.png",
+
+ btn = dabo.ui.dBitmapButton(self,
Picture="media/cards/small/s1.png",
FocusPicture="media/cards/small/h1.png",
DownPicture="media/cards/small/s13.png",
Height=80, Width=80)
btn.bindEvent(dEvents.Hit, self.onButtonHit)
hsz.append(btn)
-
+
sz.append(hsz, halign="center")
Modified: trunk/demo/samples/dButton.py
===================================================================
--- trunk/demo/samples/dButton.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dButton.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -7,7 +7,7 @@
class TestPanel(dabo.ui.dPanel):
def afterInit(self):
- sz = self.Sizer = dabo.ui.dSizer("v", DefaultBorder=20,
+ sz = self.Sizer = dabo.ui.dSizer("v", DefaultBorder=20,
DefaultBorderLeft=True)
sz.appendSpacer(25)
@@ -40,8 +40,8 @@
order to start some action. You can display a text prompt on the button
by setting its Caption property.</p>
-<p>Two other properties affect behavior: <b>DefaultButton</b> and
-<b>CancelButton</b>. When DefaultButton is True, the button will respond
+<p>Two other properties affect behavior: <b>DefaultButton</b> and
+<b>CancelButton</b>. When DefaultButton is True, the button will respond
when the user presses the 'Enter' key as if it had been clicked. When
CancelButton
is True, it responds to pressing the 'Escape' key as if it were clicked.</p>
"""
Modified: trunk/demo/samples/dCheckBox.py
===================================================================
--- trunk/demo/samples/dCheckBox.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dCheckBox.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -7,7 +7,7 @@
class TestPanel(dabo.ui.dPanel):
def afterInit(self):
- sz = self.Sizer = dabo.ui.dSizer("v", DefaultBorder=20,
+ sz = self.Sizer = dabo.ui.dSizer("v", DefaultBorder=20,
DefaultBorderLeft=True)
sz.appendSpacer(25)
@@ -27,13 +27,13 @@
sz.appendSpacer(10)
chk = dabo.ui.dCheckBox(self, Caption="Three State Check Box",
- Alignment="Left", ThreeState=True, UserThreeState=True,
+ Alignment="Left", ThreeState=True, UserThreeState=True,
Name="3Check")
chk.bindEvent(dEvents.Hit, self.onCheckHit)
sz.append(chk, halign="center")
sz.appendSpacer(10)
-
+
def onCheckHit(self, evt):
obj = evt.EventObject
nm, val = obj.Name, obj.Value
@@ -43,10 +43,10 @@
category = "Controls.dCheckBox"
overview = """
-<p>The <b>dCheckBox</b> class is used to indicate boolean values: yes/no,
+<p>The <b>dCheckBox</b> class is used to indicate boolean values: yes/no,
enabled/disabled, True/False, etc. It has its own Caption property,
-which means you commonly don't need a separate dLabel control to
-let your users know what it represents. You can use the Alignment
+which means you commonly don't need a separate dLabel control to
+let your users know what it represents. You can use the Alignment
property to control whether the box appears to the left of the Caption
(default), or on the right. (Right-alignment currently does not work
under OS X).</p>
@@ -54,6 +54,6 @@
<p>Checkboxes also optionally support three-state operation, which
corresponds to Yes/No/Unknown, or True/False/None.</p>
-<p>Clicking the control to change its value raises a <b>Hit</b> event, which
+<p>Clicking the control to change its value raises a <b>Hit</b> event, which
you can trap and handle as needed.</p>
"""
Modified: trunk/demo/samples/dDateTextBox.py
===================================================================
--- trunk/demo/samples/dDateTextBox.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dDateTextBox.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -8,7 +8,7 @@
class TestPanel(dabo.ui.dPanel):
def afterInit(self):
- sz = self.Sizer = dabo.ui.dSizer("v", DefaultBorder=20,
+ sz = self.Sizer = dabo.ui.dSizer("v", DefaultBorder=20,
DefaultBorderLeft=True)
sz.appendSpacer(25)
@@ -25,16 +25,16 @@
Height=36, Width=180)
sz.append(txt, halign="center")
dabo.ui.callAfter(self.layout)
-
+
category = "Controls.dDateTextBox"
overview = """
<p>The dDateTextBox class is a specialized subclass of dTextBox. It is
-optimized for handling date values, and includes a popup calendar
+optimized for handling date values, and includes a popup calendar
for selecting date values.</p>
-<p>It also features several keyboard shortcuts for quickly changing the
+<p>It also features several keyboard shortcuts for quickly changing the
date. If you are familiar with the behavior of date fields in the personal
finance program '<b>Quicken</b>', you will recognize these keys. They are:</p>
Modified: trunk/demo/samples/dDockTabs.py
===================================================================
--- trunk/demo/samples/dDockTabs.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dDockTabs.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -42,7 +42,7 @@
return self.pgf
def onPageChanged(self, evt):
- self.Form.logit("Page number changed from %s to %s" %
+ self.Form.logit("Page number changed from %s to %s" %
(evt.oldPageNum, evt.newPageNum))
@@ -56,7 +56,7 @@
<p><b>dDockTabs</b> is a variation on the common tabbed page control.
The tabs are fully draggable, allowing you to not only re-arrange their order,
but
-also detach them and dock their page to any edge of the control. You can place
the
+also detach them and dock their page to any edge of the control. You can place
the
tabs at the top or bottom of the pages, and change that interactively.
dDockTabs
does not support tabs on the left or right sides, though.
</p>
Modified: trunk/demo/samples/dEditBox.py
===================================================================
--- trunk/demo/samples/dEditBox.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dEditBox.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -9,7 +9,7 @@
def afterInit(self):
sz = self.Sizer = dabo.ui.dSizer("v")
sz.appendSpacer(25)
-
+
self.edt = dabo.ui.dEditBox(self, Width=400, Height=200)
self.edt.Value = self.getGetty()
sz.append(self.edt, halign="center")
@@ -18,15 +18,15 @@
btn = dabo.ui.dButton(self, Caption="Selection Info")
btn.bindEvent(dEvents.Hit, self.onSelectionInfo)
sz.append(btn, halign="center")
-
-
+
+
def onSelectionInfo(self, evt):
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)
-
+
def getGetty(self):
"""Return Lincoln's Gettysburg Address."""
return " ".join(["Four score and seven years ago our fathers
brought",
@@ -60,8 +60,8 @@
category = "Controls.dEditBox"
overview = """
-<p>The <b>dEditBox</b> class allows text to be displayed and edited (if
desired).
-It is best suited for cases where there can be a large amount of text
-that needs to be displayed in a small area on the screen. You should
+<p>The <b>dEditBox</b> class allows text to be displayed and edited (if
desired).
+It is best suited for cases where there can be a large amount of text
+that needs to be displayed in a small area on the screen. You should
use <b>dTextBox</b> instead if you only need to display a single line of
text.</p>
"""
Modified: trunk/demo/samples/dGauge.py
===================================================================
--- trunk/demo/samples/dGauge.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dGauge.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -62,13 +62,13 @@
category = "Controls.dGauge"
overview = """
-<p>A <b>dGauge</b> is a horizontal or vertical bar which shows a quantity in a
graphical
-fashion. It is often used to indicate progress through lengthy tasks, such as
file copying or
+<p>A <b>dGauge</b> is a horizontal or vertical bar which shows a quantity in a
graphical
+fashion. It is often used to indicate progress through lengthy tasks, such as
file copying or
data analysis.</p>
-<p>You set the Range property of dGauge to set the 'total' for the task, and
then update it
-by setting the <b>Value</b> property to the current value; the gauge then
updates to
-reflect the percentage of the total for that value. You can alternately set
the <b>Percentage</b>
+<p>You set the Range property of dGauge to set the 'total' for the task, and
then update it
+by setting the <b>Value</b> property to the current value; the gauge then
updates to
+reflect the percentage of the total for that value. You can alternately set
the <b>Percentage</b>
property, and the appropriate Value for that Percentage will be set.</p>
<p>Gauges do not raise any events, or respond to user interaction. They are
simply a convenient way to display the progress of a task or process.</p>
Modified: trunk/demo/samples/dGrid.py
===================================================================
--- trunk/demo/samples/dGrid.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dGrid.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -34,7 +34,7 @@
DataType="string", Width=200,
Caption="Celebrity Name",
Sortable=True, Searchable=True, Editable=True,
Expand=False)
self.addColumn(col)
-
+
col.HeaderFontItalic = True
col.HeaderBackColor = "orange"
col.HeaderVerticalAlignment = "Top"
@@ -64,59 +64,59 @@
def afterInit(self):
sz = self.Sizer = dabo.ui.dSizer("v")
sz.appendSpacer(20)
-
- txt = _("Click on a column's header to sort on that column. The
leftmost column is set to not be sortable, though. " +
- "You can also drag the columns to re-arrange
their order. Right-clicking on a column header gives you auto-size " +
+
+ txt = _("Click on a column's header to sort on that column. The
leftmost column is set to not be sortable, though. " +
+ "You can also drag the columns to re-arrange
their order. Right-clicking on a column header gives you auto-size " +
"choices. You can also drag the lines between
columns or rows to manually change their size.")
lbl = self.gridCaption = dabo.ui.dLabel(self,
Alignment="center", Caption=txt, WordWrap=True)
# Keep the label 80% of the panel
lbl.DynamicWidth = lambda: self.Width * 0.8
lbl.FontSize -= 1
-
+
sz.append(lbl, halign="center")
sz.appendSpacer(15)
-
+
self.grid = DemoGrid(self)
sz.append(self.grid, 2, "x", border=40, borderSides=("left",
"right"))
- sz.appendSpacer(20)
+ sz.appendSpacer(20)
gsz = dabo.ui.dGridSizer(HGap=15)
-
+
chk = dabo.ui.dCheckBox(self, Caption="Allow Editing?",
DataSource=self.grid, DataField="Editable")
chk.refresh()
gsz.append(chk, row=0, col=0)
-
- chk = dabo.ui.dCheckBox(self, Caption="Show Row Labels",
+
+ chk = dabo.ui.dCheckBox(self, Caption="Show Row Labels",
DataSource=self.grid, DataField="ShowRowLabels")
gsz.append(chk, row=1, col=0)
chk.refresh()
-
- chk = dabo.ui.dCheckBox(self, Caption="Size All Rows
Together?",
+
+ chk = dabo.ui.dCheckBox(self, Caption="Size All Rows Together?",
DataSource=self.grid, DataField="SameSizeRows")
gsz.append(chk, row=2, col=0)
chk.refresh()
-
- chk = dabo.ui.dCheckBox(self, Caption="Alternate Row
Coloring?",
+
+ chk = dabo.ui.dCheckBox(self, Caption="Alternate Row Coloring?",
DataSource=self.grid,
DataField="AlternateRowColoring")
gsz.append(chk, row=3, col=0)
chk.refresh()
-
- chk = dabo.ui.dCheckBox(self, Caption="Show Cell Borders?",
+
+ chk = dabo.ui.dCheckBox(self, Caption="Show Cell Borders?",
DataSource=self.grid,
DataField="ShowCellBorders")
gsz.append(chk, row=0, col=1)
chk.refresh()
-
- chk = dabo.ui.dCheckBox(self, Caption="Allow Multiple
Selection?",
+
+ chk = dabo.ui.dCheckBox(self, Caption="Allow Multiple
Selection?",
DataSource=self.grid,
DataField="MultipleSelection")
chk.refresh()
gsz.append(chk, row=1, col=1)
- chk = dabo.ui.dCheckBox(self, Caption="Allow Row Resizing?",
+ chk = dabo.ui.dCheckBox(self, Caption="Allow Row Resizing?",
DataSource=self.grid, DataField="ResizableRows")
chk.refresh()
gsz.append(chk, row=2, col=1)
- chk = dabo.ui.dCheckBox(self, Caption="Allow Column Resizing?",
+ chk = dabo.ui.dCheckBox(self, Caption="Allow Column Resizing?",
DataSource=self.grid,
DataField="ResizableColumns")
chk.refresh()
gsz.append(chk, row=3, col=1)
@@ -126,13 +126,13 @@
DataSource=self.grid, DataField="SelectionMode")
radSelect.refresh()
gsz.append(radSelect, row=0, col=2, rowSpan=4)
-
+
sz.append(gsz, halign="Center", border=10)
gsz.setColExpand(True, 2)
-
+
hsz = dabo.ui.dSizer("h")
lbl = dabo.ui.dLabel(self, Caption="Col. 1 Header:")
- hsz.append(lbl)
+ hsz.append(lbl)
hsz.appendSpacer(4)
btn = dabo.ui.dButton(self, Caption="Text")
btn.bindEvent(dEvents.Hit, self.onSetHeadColor)
@@ -144,7 +144,7 @@
hsz.appendSpacer(40)
lbl = dabo.ui.dLabel(self, Caption="Selected Cells:")
- hsz.append(lbl)
+ hsz.append(lbl)
hsz.appendSpacer(4)
btn = dabo.ui.dButton(self, Caption="Text")
btn.bindEvent(dEvents.Hit, self.onSetSelColor)
@@ -154,7 +154,7 @@
btn.bindEvent(dEvents.Hit, self.onSetSelColor)
hsz.append(btn)
-
+
sz.appendSpacer(4)
sz.append(dabo.ui.dLine(self), "x", border=50,
borderSides=("left","right"))
sz.appendSpacer(8)
@@ -192,6 +192,6 @@
category = "Controls.dGrid"
overview = """
-<p>The <b>dGrid</b> class is used to display (and optionally edit)
-tabular data.
+<p>The <b>dGrid</b> class is used to display (and optionally edit)
+tabular data.
"""
Modified: trunk/demo/samples/dGridSizer.py
===================================================================
--- trunk/demo/samples/dGridSizer.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dGridSizer.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -9,7 +9,7 @@
def afterInit(self):
sz = self.Sizer = dabo.ui.dSizer("V")
sz.appendSpacer(50)
-
+
intro = _("This demo shows the effect of the HGap and VGap
properties on a GridSizer. "
"The panel containing the grid sizer has a tan
background, and the various controls "
"in the sizer have a light blue background.
These colors help you to visualize the effect "
@@ -17,11 +17,11 @@
cap = dabo.ui.dLabel(self, Caption=intro, Width=400,
WordWrap=True)
sz.append(cap, halign="center")
sz.appendSpacer(25)
-
+
# Create the grid sizer
gridPanel = dabo.ui.dPanel(self, BackColor="moccasin")
gs = self.gridSizer = gridPanel.Sizer =
dabo.ui.dGridSizer(MaxCols=2, HGap=3, VGap=8)
-
+
lbl = dabo.ui.dLabel(gridPanel, Caption="First",
BackColor="powderblue")
ctl = dabo.ui.dTextBox(gridPanel, BackColor="powderblue")
gs.append(lbl, halign="right")
@@ -38,7 +38,7 @@
ctl = dabo.ui.dTextBox(gridPanel, BackColor="powderblue")
gs.append(lbl, halign="right")
gs.append(ctl)
-
+
hs = dabo.ui.dSizer("H")
hs.append(gridPanel, valign="middle")
@@ -56,7 +56,7 @@
DataField="VGap")
spn.bindEvent(dEvents.Hit, self.onChangeLayout)
gs.append(spn)
-
+
# Add this *before* the first grid sizer
hs.prependSpacer(30)
hs.insert(0, gs, valign="middle")
@@ -73,7 +73,7 @@
category = "Layout.dGridSizer"
overview = """
-<p><b>dGridSizer</b> is a two-dimensional sizer for laying out items in a grid
+<p><b>dGridSizer</b> is a two-dimensional sizer for laying out items in a grid
of rows and columns. You can specify a particular row/col position when you add
an item, or simply call '<b>append()</b>' and the grid will place it in the
first
available cell.</p>
Modified: trunk/demo/samples/dHyperLink.py
===================================================================
--- trunk/demo/samples/dHyperLink.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dHyperLink.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -10,13 +10,13 @@
def afterInit(self):
sz = self.Sizer = dabo.ui.dSizer("v")
sz.appendSpacer(20)
-
+
lbl = dabo.ui.dLabel(self, FontItalic=True,
WordWrap=True, Caption="Click on the link below
to launch the URL in your default browser.")
lbl.FontSize += 2
sz.append(lbl, halign="center")
sz.appendSpacer(5)
-
+
bs = dabo.ui.dBorderSizer(self)
lnk = self.link = dabo.ui.dHyperLink(self, Caption="The Dabo
Wiki", FontSize=24,
URL="http://wiki.dabodev.com/",
LinkColor="olive",
@@ -25,14 +25,14 @@
bs.append(lnk, border=20)
sz.append(bs, halign="center")
sz.appendSpacer(20)
-
+
bs = dabo.ui.dBorderSizer(self, "v", Caption="Hyperlink
Properties",
DefaultSpacing=8)
-
+
class ColorPropPanel(dabo.ui.dPanel):
def beforeInit(self):
self._colorProp = ""
-
+
def afterInit(self):
hs = self.Sizer = dabo.ui.dSizer("h",
DefaultSpacing=4)
pnl = dabo.ui.dPanel(self, Size=(25,15),
BorderWidth=1, BorderColor="black",
@@ -49,10 +49,10 @@
def changeColor(self, evt):
self.Parent.changeColor(self.ColorProp)
-
+
def getColor(self):
return self.Parent.getColor(self.ColorProp)
-
+
def _getColorProp(self):
return self._colorProp
@@ -65,9 +65,9 @@
ColorProp = property(_getColorProp, _setColorProp, None,
_("Name of property managed by this
panel (str)"))
- #--------- end of ColorPropPanel class definition
--------------
-
-
+ #--------- end of ColorPropPanel class definition --------------
+
+
lbl = dabo.ui.dLabel(self, Caption="Caption:")
txt = dabo.ui.dTextBox(self, DataSource=self.link,
DataField="Caption",
ToolTipText="The text that appears in the
hyperlink",
@@ -104,7 +104,7 @@
bs.append(chk)
sz.append(bs, halign="center")
sz.appendSpacer(5)
-
+
self.Form.update()
self.layout()
self.refresh()
@@ -123,7 +123,7 @@
category = "Controls.dHyperLink"
overview = """
-<b>dHyperLink</b> creates a text link that, when clicked, launches the
+<b>dHyperLink</b> creates a text link that, when clicked, launches the
specified URL in the user's default browser (if the <b>ShowInBrowser</b>
property
is True), or raises a Hit event for your code to respond to (if the
<b>ShowInBrowser</b>
property is False). You can control the appearance of the link through its
various properties.
Modified: trunk/demo/samples/dImage.py
===================================================================
--- trunk/demo/samples/dImage.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dImage.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -9,14 +9,14 @@
def afterInit(self):
# Set the idle update flag
self.needUpdate = False
-
+
# Create a panel with horiz. and vert. sliders
self.imgPanel = dabo.ui.dPanel(self)
self.VSlider = dabo.ui.dSlider(self, Orientation="V", Min=1,
Max=100,
Value=100, Continuous=True, OnHit=self.onSlider)
self.HSlider = dabo.ui.dSlider(self, Orientation="H", Min=1,
Max=100,
Value=100, Continuous=True, OnHit=self.onSlider)
-
+
mainSizer = self.Sizer = dabo.ui.dSizer("V")
psz = self.imgPanel.Sizer = dabo.ui.dSizer("V")
hsz = dabo.ui.dSizer("H")
@@ -34,36 +34,36 @@
# Create the image control
self.img = dabo.ui.dImage(self.imgPanel, BackColor="yellow",
DroppedFileHandler=self)
-
+
hsz = dabo.ui.dSizer("H")
hsz.DefaultSpacing = 10
btn = dabo.ui.dBitmapButton(self, Picture="rotateCW",
OnHit=self.rotateCW)
hsz.append(btn)
btn = dabo.ui.dBitmapButton(self, Picture="rotateCCW",
OnHit=self.rotateCCW)
- hsz.append(btn)
-
- self.ddScale = dabo.ui.dDropdownList(self,
+ hsz.append(btn)
+
+ self.ddScale = dabo.ui.dDropdownList(self,
Choices = ["Proportional", "Stretch", "Clip"],
PositionValue = 0,
ValueMode = "String")
self.ddScale.DataSource = self.img
self.ddScale.DataField = "ScaleMode"
-
+
btn = dabo.ui.dButton(self, Caption=_("Load Your Own Image"),
OnHit=self.onLoadImage)
-
+
hsz.append(self.ddScale, "x")
hsz.append(btn, "x")
mainSizer.append(hsz, alignment="right")
mainSizer.appendSpacer(25)
-
+
# Load an image
self.img.Picture = "media/homer.jpg"
-
-
+
+
def processDroppedFiles(self, filelist):
self.img.Picture = filelist[0]
-
+
def rotateCW(self, evt):
self.img.rotateClockwise()
@@ -81,15 +81,15 @@
self.img.Height = (self.imgPanel.Height * val)
# Without Dabo, you need to create this exact string to get the same
behavior.
- # JPEG Files (*.jpg)|*.jpg|PNG Files (*.png)|*.png|GIF Files
(*.gif)|*.gif|Bitmap Files (*.bmp)|*.bmp|All Files (*)|*
- def onLoadImage(self, evt):
+ # JPEG Files (*.jpg)|*.jpg|PNG Files (*.png)|*.png|GIF Files
(*.gif)|*.gif|Bitmap Files (*.bmp)|*.bmp|All Files (*)|*
+ def onLoadImage(self, evt):
f = dabo.ui.getFile("jpg", "png", "gif", "bmp", "*")
if f:
self.img.Picture = f
-
+
def onResize(self, evt):
self.needUpdate = True
-
+
def onIdle(self, evt):
if self.needUpdate:
self.needUpdate = False
@@ -101,12 +101,12 @@
category = "Controls.dImage"
overview = """
-<p>The <b>dImage</b> class is used to display images in your app. It provides
-simple ways to control the sizing, scaling and rotation of images. It can use
any
-of the following common image formats: <b>PNG</b>, <b>JPEG</b>,
+<p>The <b>dImage</b> class is used to display images in your app. It provides
+simple ways to control the sizing, scaling and rotation of images. It can use
any
+of the following common image formats: <b>PNG</b>, <b>JPEG</b>,
<b>GIF</b> and <b>BMP</b>.</p>
-<p>To display an image, just set the <b>Picture</b> property to the path to
the
+<p>To display an image, just set the <b>Picture</b> property to the path to the
file containing the image; the class will do the rest. You can also set the
DataSource
and DataField to an image column in a database.</p>
Modified: trunk/demo/samples/dLabel.py
===================================================================
--- trunk/demo/samples/dLabel.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dLabel.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -8,27 +8,27 @@
def afterInit(self):
sz = self.Sizer = dabo.ui.dSizer("v")
sz.appendSpacer(20)
-
+
# Plain Label
lbl = dabo.ui.dLabel(self, Caption=_("This label has the
default font."))
sz.append(lbl)
-
+
lbl = dabo.ui.dLabel(self, Caption=_("FontSize 5 points
bigger"))
lbl.FontSize += 5
sz.append(lbl)
-
+
lbl = dabo.ui.dLabel(self, Caption=_("FontSize 10 points
bigger"))
lbl.FontSize += 10
sz.append(lbl)
-
+
lbl = dabo.ui.dLabel(self, Caption=_("FontSize = 64"))
lbl.FontSize = 64
sz.append(lbl)
-
+
lbl = dabo.ui.dLabel(self, Caption=_("FontFace = Courier"))
lbl.FontFace = _("Courier")
sz.append(lbl)
-
+
lbl = dabo.ui.dLabel(self, Caption=_("FontBold = True"))
lbl.FontBold = True
sz.append(lbl)
@@ -36,7 +36,7 @@
lbl = dabo.ui.dLabel(self, Caption=_("FontItalic = True"))
lbl.FontItalic = True
sz.append(lbl)
-
+
lbl = dabo.ui.dLabel(self, Caption=_("FontBold and FontItalic =
True"))
lbl.FontBold = True
lbl.FontItalic = True
@@ -45,17 +45,17 @@
lbl = dabo.ui.dLabel(self, Caption=_("ForeColor = 'red'"))
lbl.ForeColor = "red"
sz.append(lbl)
-
+
lbl = dabo.ui.dLabel(self, Caption=_("BackColor = 'yellow'"))
lbl.BackColor = "yellow"
sz.append(lbl)
-
+
lbl = self.dynamicLabel = dabo.ui.dLabel(self, Caption="")
lbl.DynamicFontSize = lambda: self.Width * .05
lbl.DynamicCaption = self.getDynamicCaption
sz.append(lbl)
dabo.ui.callAfter(self.update)
-
+
sz.appendSpacer(20)
sz.append(dabo.ui.dLine(self, Width=500), halign="Center")
sz.appendSpacer(20)
@@ -63,40 +63,40 @@
btn = dabo.ui.dButton(self, Caption=_("Show WordWrap demo"))
btn.bindEvent(dEvents.Hit, self.onShowWWDemo)
sz.append(btn, halign="center")
-
+
def getDynamicCaption(self):
return "DynamicFontSize: %s" %
int(round(self.dynamicLabel.FontSize, 0))
-
+
def onShowWWDemo(self, evt):
class WordWrapDialog(dabo.ui.dDialog):
def addControls(self):
sz = self.Sizer
sz.appendSpacer(25)
-
+
lbl = dabo.ui.dLabel(self, FontBold=True,
ForeColor="darkred", WordWrap=True,
Alignment="center",
Caption=_("The label below has WordWrap=True. " + \
"Use the slider to resize the
label to see it in action."))
lbl.FontSize += 1
sz.append(lbl, "x", border=40,
borderSides=("Left", "Right"))
-
+
sld = self.slider = dabo.ui.dSlider(self,
Value=100, Continuous=True)
sld.bindEvent(dEvents.Hit, self.onSlider)
sld.bindEvent(dEvents.Resize, self.onSlider)
sz.append(sld, "x", border=10)
-
+
txt = getGettyAddr()
lbl = self.gettyLabel = dabo.ui.dLabel(self,
Caption=txt, WordWrap=True)
sz.append(lbl, 1, border=10)
-
+
self.Caption = _("WordWrap Demo")
self.Width = 640
self.Height = 480
self.layout()
-
+
def onSlider(self, evt):
wd = (self.slider.Value/100.0) *
self.slider.Width
self.gettyLabel.Width = wd
-
+
dlg = WordWrapDialog(self, BorderResizable=True,
AutoSize=False, Centered=True)
dlg.show()
Modified: trunk/demo/samples/dLed.py
===================================================================
--- trunk/demo/samples/dLed.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dLed.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -10,12 +10,12 @@
self.Sizer.appendSpacer(50)
hs = dabo.ui.dSizer('h')
self.Sizer.append(hs)
-
+
self.LED = dabo.ui.dLed(self, Height=100, Width=100)
hs.appendSpacer(50)
hs.append(self.LED)
hs.appendSpacer(25)
-
+
bs = dabo.ui.dBorderSizer(self, Caption="LED Options",
DefaultBorder=5)
gs = dabo.ui.dGridSizer(MaxCols=2, VGap=5, HGap=5)
gs.setColExpand(1, 1)
@@ -26,17 +26,17 @@
gs.append(dabo.ui.dLabel(self, Caption="Off Color:"))
gs.append(dabo.ui.dDropdownList(self,
Choices=dabo.dColors.colors, DataSource=self.LED, DataField="OffColor",
Value="darkred", OnHit=self.changeOffColor))
hs.append(bs)
-
+
self.LED.On = True
self.update()
self.layout()
-
+
def toggleLED(self, evt):
self.Form.logit("LED Toggled to %s" % {True:"On",
False:"Off"}[self.LED.On])
-
+
def changeOnColor(self, evt):
self.Form.logit("LED Color when on was changed to %s" %
self.LED.OnColor)
-
+
def changeOffColor(self, evt):
self.Form.logit("LED Color whenn off was changed to %s" %
self.LED.OffColor)
Modified: trunk/demo/samples/dPageFrame.py
===================================================================
--- trunk/demo/samples/dPageFrame.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dPageFrame.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -37,7 +37,7 @@
return self.pgf
def onPageChanged(self, evt):
- self.Form.logit("Page number changed from %s to %s" %
+ self.Form.logit("Page number changed from %s to %s" %
(evt.oldPageNum, evt.newPageNum))
def onNewPosition(self, evt):
@@ -49,7 +49,7 @@
except AttributeError:
self.Form.seenTabPositionWarning = True
msg = """TabPosition must be defined when the
control
-is created, and cannot be changed afterwards.
+is created, and cannot be changed afterwards.
The current dPageFrame control will be destroyed,
and a new control with the position you selected
@@ -57,7 +57,7 @@
dabo.ui.info(msg, "TabPosition Limitation")
self.currentTabPosition = newpos
self.createPageFrame()
- # Need to update the
+ # Need to update the
# gsz = dabo.ui.dGridSizer(MaxCols=2)
# for num, pos in enumerate(("Top", "Right", "Bottom", "Left")):
@@ -74,9 +74,9 @@
# gsz.setColExpand(True, "all")
# gsz.setRowExpand(True, "all")
# self.Sizer.append1x(gsz)
-#
+#
# def onPageChanged(self, evt):
-# self.Form.logit("TabPosition: %s; page number changed from %s
to %s" %
+# self.Form.logit("TabPosition: %s; page number changed from %s
to %s" %
# (evt.EventObject.TabPosition, evt.oldPageNum,
evt.newPageNum))
Modified: trunk/demo/samples/dPageList.py
===================================================================
--- trunk/demo/samples/dPageList.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dPageList.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -38,7 +38,7 @@
return self.pgf
def onPageChanged(self, evt):
- self.Form.logit("Page number changed from %s to %s" %
+ self.Form.logit("Page number changed from %s to %s" %
(evt.oldPageNum, evt.newPageNum))
def onNewPosition(self, evt):
@@ -50,7 +50,7 @@
except AttributeError:
self.Form.seenTabPositionWarning = True
msg = """TabPosition must be defined when the
control
-is created, and cannot be changed afterwards.
+is created, and cannot be changed afterwards.
The current dPageList control will be destroyed,
and a new control with the position you selected
Modified: trunk/demo/samples/dPageSelect.py
===================================================================
--- trunk/demo/samples/dPageSelect.py 2010-09-12 21:35:04 UTC (rev 6014)
+++ trunk/demo/samples/dPageSelect.py 2010-09-12 21:38:13 UTC (rev 6015)
@@ -38,7 +38,7 @@
return self.pgf
def onPageChanged(self, evt):
- self.Form.logit("Page number changed from %s to %s" %
+ self.Form.logit("Page number changed from %s to %s" %
(evt.oldPageNum, evt.newPageNum))
def onNewPosition(self, evt):
@@ -50,7 +50,7 @@
except AttributeError:
self.Form.seenTabPositionWarning = True
msg = """TabPosition must be defined when the
control
-is created, and cannot be changed afterwards.
+is created, and cannot be changed afterwards.
The current dPageSelect control will be destroyed,
and a new control with th
(65237 bytes were truncated as it was too long for the email (max 40000 bytes.)
_______________________________________________
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]