dabo Commit
Revision 6448
Date: 2011-02-19 06:36:17 -0800 (Sat, 19 Feb 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6448
Changed:
U trunk/dabo/dLocalize.py
U trunk/dabo/settings.py
U trunk/dabo/ui/uiwx/dDateTextBox.py
U trunk/dabo/ui/uiwx/dSizerMixin.py
Log:
Fixed a problem in the code that defaults to English if the default language is
not installed.
Diff:
Modified: trunk/dabo/dLocalize.py
===================================================================
--- trunk/dabo/dLocalize.py 2011-02-18 22:35:20 UTC (rev 6447)
+++ trunk/dabo/dLocalize.py 2011-02-19 14:36:17 UTC (rev 6448)
@@ -107,7 +107,7 @@
Languages = %s
Codeset = %s """ % (daboLocaleDir, ustr(lang), charset))
# Default to US English
- daboTranslation = gettext.translation("dabo",
daboLocaleDir, languages="en", codeset=charset)
+ daboTranslation = gettext.translation("dabo",
daboLocaleDir, languages=["en"], codeset=charset)
_currentTrans = daboTranslation.ugettext
for domain, localedir in _domains.items():
Modified: trunk/dabo/settings.py
===================================================================
--- trunk/dabo/settings.py 2011-02-18 22:35:20 UTC (rev 6447)
+++ trunk/dabo/settings.py 2011-02-19 14:36:17 UTC (rev 6448)
@@ -104,7 +104,8 @@
defaultFontSize = 10
# Default language to use when none is specified
-defaultLanguage = "en"
+#defaultLanguage = "en"
+defaultLanguage = "zz"
# Default encoding to use when none is specified
defaultEncoding = "utf-8"
Modified: trunk/dabo/ui/uiwx/dDateTextBox.py
===================================================================
--- trunk/dabo/ui/uiwx/dDateTextBox.py 2011-02-18 22:35:20 UTC (rev 6447)
+++ trunk/dabo/ui/uiwx/dDateTextBox.py 2011-02-19 14:36:17 UTC (rev 6448)
@@ -77,7 +77,7 @@
self.continueAtBoundary = True
# Do we display a button on the right side for activating the
calendar?
### TODO: still needs a lot of work to display properly.
- self.showCalButton = False
+ self.showCalButton = True
# Do we display datetimes in 24-hour clock, or with AM/PM?
self.ampm = False
# Do we use the extended format for the calendar display?
@@ -92,10 +92,10 @@
self.Value = None ## If it is still blank, default to
None so the control works correctly
if self.showCalButton:
# Create a button that will display the calendar
- self.calButton = dButton(self.Parent,
Size=(self.Height, self.Height),
- Right=self.Right, Caption="V")
+ self.calButton = dabo.ui.dBitmapButton(self.Parent,
Picture="downArrow",
+ DownPicture="downTriangleBlack",
Size=(self.Height, self.Height),
+ Left=self.Right,
OnHit=self._onCalButton)
self.calButton.Visible = True
- self.calButton.bindEvent(dEvents.Hit, __onBtnClick)
# Tooltip help
self._defaultToolTipText = _("""Available Keys:
@@ -129,13 +129,12 @@
""" Display a calendar to allow users to select dates."""
self.showCalendar()
- def __onBtnClick(self,evt):
+
+ def _onCalButton(self,evt):
""" Display a calendar to allow users to select dates."""
self.showCalendar()
-
-
def showCalendar(self):
if self.ReadOnly:
# ignore
@@ -147,9 +146,6 @@
fp.show()
-
-
-
def __onChar(self, evt):
""" If a shortcut key was pressed, process that. Otherwise, eat
inappropriate characters.
@@ -461,5 +457,12 @@
if __name__ == "__main__":
- import test
- test.Test().runTest(dDateTextBox)
+ class TestForm(dabo.ui.dForm):
+ def afterInit(self):
+ self.datetext = dDateTextBox(self,
Value=datetime.date.today())
+ self.Sizer.append(self.datetext, halign="center",
border=25)
+
+ app = dabo.dApp(MainFormClass=TestForm)
+ app.start()
+# import test
+# test.Test().runTest(dDateTextBox)
Modified: trunk/dabo/ui/uiwx/dSizerMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dSizerMixin.py 2011-02-18 22:35:20 UTC (rev 6447)
+++ trunk/dabo/ui/uiwx/dSizerMixin.py 2011-02-19 14:36:17 UTC (rev 6448)
@@ -149,6 +149,7 @@
# If compressed to .pyo, __doc__ will be None.
pass
+
def layout(self):
"""Layout the items in the sizer.
@@ -178,6 +179,7 @@
# If compressed to .pyo, __doc__ will be None.
pass
+
def remove(self, itm, destroy=None):
"""This will remove the item from the sizer. It will not cause
the item to be destroyed unless the 'destroy' parameter is True.
@@ -221,6 +223,7 @@
else:
itm = self.Insert(pos, spacer, proportion=proportion,
userData=self)
itm.setSpacing = itm.SetSpacer
+ itm._controllingSizer = self
return itm
_______________________________________________
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]