dabo Commit
Revision 4434
Date: 2008-08-22 11:32:48 -0700 (Fri, 22 Aug 2008)
Author: Nate
Trac: http://svn.dabodev.com/trac/dabo/changeset/4434
Changed:
U branches/Nate/dabo/__version__.py
U branches/Nate/dabo/ui/uiwx/__init__.py
A branches/Nate/dabo/ui/uiwx/dCheckList.py
D branches/Nate/dabo/ui/uiwx/dCheckListBox.py
U branches/Nate/dabo/ui/uiwx/dComboBox.py
U branches/Nate/dabo/ui/uiwx/dControlItemMixin.py
U branches/Nate/dabo/ui/uiwx/dMenuItem.py
U branches/Nate/dabo/ui/uiwx/dPageFrame.py
U branches/Nate/ide/ClassDesigner.py
U branches/Nate/ide/ClassDesignerControlMixin.py
U branches/Nate/ide/ClassDesignerEditor.py
U branches/Nate/ide/ClassDesignerPropSheet.py
U branches/Nate/ide/wizards/AppWizard/AppWizard.py
Log:
Merged trunk changes. Changed the name of dAdvancedPageFrame to DPageFrame.
Diff:
Modified: branches/Nate/dabo/__version__.py
===================================================================
--- branches/Nate/dabo/__version__.py 2008-08-21 21:03:58 UTC (rev 4433)
+++ branches/Nate/dabo/__version__.py 2008-08-22 18:32:48 UTC (rev 4434)
@@ -3,7 +3,7 @@
# Everything else is boilerplate copied also to other dabo repositories.
package_name = "dabo"
_version = "0.8.4"
-_approximateRevision = "~4414"
+_approximateRevision = "~4432"
import os
import lib
Modified: branches/Nate/dabo/ui/uiwx/__init__.py
===================================================================
--- branches/Nate/dabo/ui/uiwx/__init__.py 2008-08-21 21:03:58 UTC (rev
4433)
+++ branches/Nate/dabo/ui/uiwx/__init__.py 2008-08-22 18:32:48 UTC (rev
4434)
@@ -74,7 +74,7 @@
from dCalendar import dCalendar
from dCalendar import dExtendedCalendar
from dCheckBox import dCheckBox
-from dCheckListBox import dCheckListBox
+from dCheckList import dCheckList
from dColorDialog import dColorDialog
from dComboBox import dComboBox
from dDateTextBox import dDateTextBox
@@ -153,7 +153,7 @@
#The flatnotebook version we need is not avialable with wxPython < 2.8.4
if wx.VERSION >= (2, 8, 4):
- from dPageFrame import dAdvancedPageFrame
+ from dPageFrame import DPageFrame
# dDockForm is not available with wxPython < 2.7
if wx.VERSION >= (2, 7):
@@ -165,11 +165,16 @@
def __init__(self, *args, **kwargs):
warnings.warn(_("'dFoldPanelBar' is a deprecated name. Use
'dSlidePanelControl' instead"), DeprecationWarning)
super(dFoldPanelBar, self).__init__(*args, **kwargs)
+
class dFoldPanel(dSlidePanel):
def __init__(self, *args, **kwargs):
warnings.warn(_("'dFoldPanel' is a deprecated name. Use
'dSlidePanel' instead"), DeprecationWarning)
super(dFoldPanel, self).__init__(*args, **kwargs)
+class dCheckListBox(dCheckList):
+ def __init__(self, *args, **kwargs):
+ warnings.warn(_("'dCheckListBox' is a deprecated name. Use
'dCheckList' instead"), DeprecationWarning)
+ super(dCheckListBox, self).__init__(*args, **kwargs)
artConstants = {}
for item in (it for it in dir(wx) if it.startswith("ART_")):
Copied: branches/Nate/dabo/ui/uiwx/dCheckList.py (from rev 4433,
trunk/dabo/ui/uiwx/dCheckList.py)
===================================================================
--- branches/Nate/dabo/ui/uiwx/dCheckList.py (rev 0)
+++ branches/Nate/dabo/ui/uiwx/dCheckList.py 2008-08-22 18:32:48 UTC (rev
4434)
@@ -0,0 +1,113 @@
+# -*- coding: utf-8 -*-
+import wx
+import dabo
+if __name__ == "__main__":
+ dabo.ui.loadUI("wx")
+import dControlItemMixin as dcm
+import dabo.dEvents as dEvents
+from dabo.dLocalize import _
+
+
+class dCheckList(dcm.dControlItemMixin, wx.CheckListBox):
+ """Creates a listbox, allowing the user to choose one or more items
+ by checking/unchecking each one.
+ """
+ def __init__(self, parent, properties=None, attProperties=None, *args,
**kwargs):
+ self._baseClass = dCheckList
+ self._choices = []
+ preClass = wx.PreCheckListBox
+ dcm.dControlItemMixin.__init__(self, preClass, parent,
properties,
+ attProperties, *args, **kwargs)
+
+
+ def _initEvents(self):
+ super(dCheckList, self)._initEvents()
+ self.Bind(wx.EVT_CHECKLISTBOX, self._onWxHit)
+
+
+ def GetSelections(self):
+ # Need to override the native method, as this reports the
+ # line with focus, not the checked items.
+ ret = []
+ for cnt in xrange(self.Count):
+ if self.IsChecked(cnt):
+ ret.append(cnt)
+ return ret
+
+
+ def selectAll(self):
+ """Set all items to checked."""
+ for cnt in xrange(self.Count):
+ self.Check(cnt, True)
+
+
+ def clearSelections(self):
+ """Set all items to unchecked."""
+ for cnt in xrange(self.Count):
+ self.Check(cnt, False)
+ # Just to keep the naming consistent
+ selectNone = clearSelections
+
+
+ def invertSelections(self):
+ """Switch all the items from False to True, and vice-versa."""
+ for cnt in xrange(self.Count):
+ self.Check(cnt, not self.IsChecked(cnt))
+
+
+ def setSelection(self, index):
+ if self.Count > index:
+ self.Check(index, True)
+ else:
+ ## pkm: The user probably set the Value property from
inside initProperties(),
+ ## and it is getting set before the Choice
property has been applied.
+ ## If this is the case, callAfter is the ticket.
+ dabo.ui.callAfter(self.Check, index, True)
+
+
+ def _getMultipleSelect(self):
+ return True
+
+
+ MultipleSelect = property(_getMultipleSelect, None, None,
+ _("MultipleSelect for dCheckList is always True."))
+
+
+
+class _dCheckList_test(dCheckList):
+ def initProperties(self):
+ # Simulate a database:
+ actors = ({"lname": "Jason Leigh", "fname": "Jennifer", "iid":
42},
+ {"lname": "Cates", "fname": "Phoebe", "iid": 23},
+ {"lname": "Reinhold", "fname": "Judge", "iid": 13})
+
+ choices = []
+ keys = {}
+
+ for actor in actors:
+ choices.append("%s %s" % (actor['fname'],
actor['lname']))
+ keys[actor["iid"]] = len(choices) - 1
+
+ self.Choices = choices
+ self.Keys = keys
+ self.ValueMode = 'Key'
+ self.Value = 23
+
+ def onHit(self, evt):
+ print "HIT:"
+ print "\tKeyValue: ", self.KeyValue
+ print "\tPositionValue: ", self.PositionValue
+ print "\tStringValue: ", self.StringValue
+ print "\tValue: ", self.Value
+ print "\tCount: ", self.Count
+
+ def onMouseLeftDoubleClick(self, evt):
+ print "double click"
+
+ def onMouseLeftDown(self, evt):
+ print "mousedown"
+
+if __name__ == "__main__":
+ import test
+ test.Test().runTest(_dCheckList_test)
+
Deleted: branches/Nate/dabo/ui/uiwx/dCheckListBox.py
Modified: branches/Nate/dabo/ui/uiwx/dComboBox.py
===================================================================
--- branches/Nate/dabo/ui/uiwx/dComboBox.py 2008-08-21 21:03:58 UTC (rev
4433)
+++ branches/Nate/dabo/ui/uiwx/dComboBox.py 2008-08-22 18:32:48 UTC (rev
4434)
@@ -17,6 +17,10 @@
self._baseClass = dComboBox
self._choices = []
self._userVal = False
+ # Used to force the case of entered text
+ self._forceCase = None
+ self._inForceCase = False
+ self._textLength = None
# Flag for appending items when the user presses 'Enter'
self._appendOnEnter = False
# Holds the text to be appended
@@ -59,6 +63,57 @@
self.raiseEvent(dabo.dEvents.Hit, evt)
+ def __onKeyChar(self, evt):
+ """This handles KeyChar events when ForceCase is set to a
non-empty value."""
+ if not self:
+ # The control is being destroyed
+ return
+ keyChar = evt.keyChar
+ if keyChar is not None and (keyChar.isalnum()
+ or keyChar in """,./<>?;':"[]\\{}|[EMAIL
PROTECTED]&*()-_=+"""):
+ dabo.ui.callAfter(self._checkForceCase)
+ dabo.ui.callAfter(self._checkTextLength)
+
+
+ def _checkTextLength(self):
+ """If the TextLength property is set, checks the current value
of the control
+ and truncates it if too long"""
+ if not self:
+ # The control is being destroyed
+ return
+ if not isinstance(self.GetValue(), basestring):
+ #Don't bother if it isn't a string type
+ return
+ length = self.TextLength
+ if not length:
+ return
+ val = self.GetValue()
+ if len(val) > length:
+ dabo.ui.beep()
+ self.SetValue(val[:length])
+
+
+ def _checkForceCase(self):
+ """If the ForceCase property is set, casts the current value of
the control
+ to the specified case.
+ """
+ if not self:
+ # The control is being destroyed
+ return
+ if not isinstance(self.GetValue(), basestring):
+ # Don't bother if it isn't a string type
+ return
+ case = self.ForceCase
+ if not case:
+ return
+ if case == "upper":
+ self.SetValue(self.GetValue().upper())
+ elif case == "lower":
+ self.SetValue(self.GetValue().lower())
+ elif case == "title":
+ self.SetValue(self.GetValue().title())
+
+
def beforeAppendOnEnter(self):
"""Hook method that is called when user-defined text is entered
into the combo box and Enter is pressed (when self.AppendOnEnter
@@ -96,6 +151,46 @@
self._properties["AppendOnEnter"] = val
+ def _getForceCase(self):
+ return self._forceCase
+
+ def _setForceCase(self, val):
+ if self._constructed():
+ if val is None:
+ valKey = None
+ else:
+ valKey = val[0].upper()
+ self._forceCase = {"U": "upper", "L": "lower", "T":
"title", None: None,
+ "None": None}.get(valKey)
+ self._checkForceCase()
+ self.unbindEvent(dEvents.KeyChar, self.__onKeyChar)
+ if self._forceCase or self._textLength:
+ self.bindEvent(dEvents.KeyChar,
self.__onKeyChar)
+ else:
+ self._properties["ForceCase"] = val
+
+
+ def _getTextLength(self):
+ return self._textLength
+
+ def _setTextLength(self, val):
+ if self._constructed():
+ if val == None:
+ self._textLength = None
+ else:
+ val = int(val)
+ if val < 1:
+ raise ValueError, 'TextLength must be a
positve Integer'
+ self._textLength = val
+ self._checkTextLength()
+
+ self.unbindEvent(dEvents.KeyChar, self.__onKeyChar)
+ if self._forceCase or self._textLength:
+ self.bindEvent(dEvents.KeyChar,
self.__onKeyChar)
+ else:
+ self._properties["TextLength"] = val
+
+
def _getUserValue(self):
if self._userVal:
return self.GetValue()
@@ -116,6 +211,17 @@
_("""Flag to determine if user-entered text is appended
when they
press 'Enter' (bool)"""))
+ ForceCase = property(_getForceCase, _setForceCase, None,
+ _("""Determines if we change the case of entered text.
Possible values are:
+ None, "" (empty string): No changes made
(default)
+ "Upper": FORCE TO UPPER CASE
+ "Lower": force to lower case
+ "Title": Force To Title Case
+ These can be abbreviated to "u", "l" or "t" (str)"""))
+
+ TextLength = property(_getTextLength, _setTextLength, None,
+ _("""The maximum length the entered text can be.
(int)"""))
+
UserValue = property(_getUserValue, _setUserValue, None,
_("""Specifies the text displayed in the textbox
portion of the ComboBox.
@@ -155,7 +261,7 @@
def beforeAppendOnEnter(self):
txt = self._textToAppend.strip().lower()
if txt == "dabo":
- dabo.infoLog.write("Attempted to add Dabo to the
list!!!")
+ print _("Attempted to add Dabo to the list!!!")
return False
elif txt.find("nixon") > -1:
self._textToAppend = "Tricky Dick"
Modified: branches/Nate/dabo/ui/uiwx/dControlItemMixin.py
===================================================================
--- branches/Nate/dabo/ui/uiwx/dControlItemMixin.py 2008-08-21 21:03:58 UTC
(rev 4433)
+++ branches/Nate/dabo/ui/uiwx/dControlItemMixin.py 2008-08-22 18:32:48 UTC
(rev 4434)
@@ -101,6 +101,12 @@
sortFunction = self._sortFunction
self._choices.sort(sortFunction)
+ def _resetChoices(self):
+ self.Clear()
+ self._setSelection(-1)
+ if self._sorted:
+ self.sort()
+ self.AppendItems(self._choices)
# Property get/set/del methods follow. Scroll to bottom to see the
property
# definitions themselves.
@@ -117,11 +123,8 @@
self.lockDisplay()
vm = self.ValueMode
oldVal = self.Value
- self.Clear()
self._choices = list(choices)
- if self._sorted:
- self.sort()
- self.AppendItems(self._choices)
+ self._resetChoices()
if oldVal is not None:
# Try to get back to the same row:
try:
@@ -202,29 +205,29 @@
# Clear all current selections:
self.clearSelections()
- # Check what type of key collection we are using: dict
or list
- keysAreDict = isinstance(self.Keys, dict)
+ invalidSelections = []
# Select items that match indices in value:
for key in value:
- if keysAreDict:
- if not self.Keys.has_key(key):
- # If the appdev set up a key
for None, use it.
- key = None
+ if isinstance(self.Keys, dict):
try:
self.setSelection(self.Keys[key])
except KeyError:
- # The specified key isn't
found, and there's no None key. We
- # can't cope but wxPython can
set a blank value:
- self._setSelection(-1)
-
+ invalidSelections.append(key)
else:
- # we are using a tuple/list of keys.
Find its position
try:
self.setSelection(self.Keys.index(key))
except ValueError:
- # No such key; write an info
message, but otherwise ignore it.
- dabo.infoLog.write(_("Key '%s'
not found") % key)
- continue
+ invalidSelections.append(key)
+
+ if len(value) == 0 or (self._isMultiSelect() and
invalidSelections == [None]):
+ # Value being set to an empty tuple, list, or
dict, or to None in a Multi-Select control,
+ # which means "nothing is selected":
+ self._resetChoices()
+ invalidSelections = []
+
+ if invalidSelections:
+ raise ValueError, _("Trying to set %s.Value to
these invalid selections: %s") % (self.Name, invalidSelections)
+
self._afterValueChanged()
else:
self._properties["KeyValue"] = value
Modified: branches/Nate/dabo/ui/uiwx/dMenuItem.py
===================================================================
--- branches/Nate/dabo/ui/uiwx/dMenuItem.py 2008-08-21 21:03:58 UTC (rev
4433)
+++ branches/Nate/dabo/ui/uiwx/dMenuItem.py 2008-08-22 18:32:48 UTC (rev
4434)
@@ -137,11 +137,11 @@
def _setIcon(self, val):
if self._constructed():
+ if val in (None, ""):
+ return
if isinstance(val, basestring):
# Icon name was passed; get the actual bitmap
val = dabo.ui.strToBmp(val)
- if val is None:
- val = wx.EmptyBitmap(1, 1)
self.SetBitmap(val)
# Win32 at least needs the following line, or the
caption
Modified: branches/Nate/dabo/ui/uiwx/dPageFrame.py
===================================================================
--- branches/Nate/dabo/ui/uiwx/dPageFrame.py 2008-08-21 21:03:58 UTC (rev
4433)
+++ branches/Nate/dabo/ui/uiwx/dPageFrame.py 2008-08-22 18:32:48 UTC (rev
4434)
@@ -208,7 +208,7 @@
dDockTabs = dPageFrame
if _USE_FLAT:
- class dAdvancedPageFrame(dPageFrameMixin, fnb.FlatNotebook):
+ class DPageFrame(dPageFrameMixin, fnb.FlatNotebook):
"""Creates a pageframe, which can contain an unlimited number
of pages,
each of which should be a subclass/instance of the dPage class.
"""
@@ -217,7 +217,7 @@
_tabposBottom = readonly(fnb.FNB_BOTTOM)
def __init__(self, parent, properties=None, attProperties=None,
*args, **kwargs):
- self._baseClass = dAdvancedPageFrame
+ self._baseClass = DPageFrame
preClass = fnb.FlatNotebook
self._inactiveTabTextColor = None
@@ -233,7 +233,7 @@
dPageFrameMixin.__init__(self, preClass, parent,
properties, attProperties, *args, **kwargs)
def _initEvents(self):
- super(dAdvancedPageFrame, self)._initEvents()
+ super(DPageFrame, self)._initEvents()
self.Bind(fnb.EVT_FLATNOTEBOOK_PAGE_CLOSING,
self.__onPageClosing)
self.Bind(fnb.EVT_FLATNOTEBOOK_PAGE_CLOSED,
self.__onPageClosed)
self.Bind(fnb.EVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU,
self.__onPageContextMenu)
@@ -242,7 +242,7 @@
if sys.platform[:3] == "win":
## This keeps Pages from being ugly on Windows:
self.SetBackgroundColour(self.GetBackgroundColour())
- super(dAdvancedPageFrame, self)._afterInit()
+ super(DPageFrame, self)._afterInit()
def __onPageClosing(self, evt):
"""The page has not yet been closed, so we can veto it
if conditions call for it."""
@@ -257,7 +257,7 @@
return self.beforePageClose(page)
def insertPage(self, *args, **kwargs):
- page = super(dAdvancedPageFrame,
self).insertPage(*args, **kwargs)
+ page = super(DPageFrame, self).insertPage(*args,
**kwargs)
self.SetAllPagesShapeAngle(self._tabSideIncline)
#incline isn't autoset on new page add so set it
return page
@@ -522,7 +522,7 @@
class _dPageSelect_test(TestMixin, dPageSelect): pass
class _dDockTabs_test(TestMixin, dDockTabs): pass
if _USE_FLAT:
- class _dAdvancedPageFrame_test(TestMixin, dAdvancedPageFrame):
+ class _DPageFrame_test(TestMixin, DPageFrame):
def initProperties(self):
print "in init properties"
self.Width = 400
@@ -546,4 +546,4 @@
test.Test().runTest(_dPageSelect_test)
test.Test().runTest(_dDockTabs_test)
if _USE_FLAT:
- test.Test().runTest(_dAdvancedPageFrame_test)
+ test.Test().runTest(_DPageFrame_test)
Modified: branches/Nate/ide/ClassDesigner.py
===================================================================
--- branches/Nate/ide/ClassDesigner.py 2008-08-21 21:03:58 UTC (rev 4433)
+++ branches/Nate/ide/ClassDesigner.py 2008-08-22 18:32:48 UTC (rev 4434)
@@ -670,7 +670,7 @@
frm.Controller = self
self.CurrentForm = frm
frm._classFile = pth
- frm._formMode = frm.SaveRestorePosition = isFormClass
+ frm._formMode = isFormClass
if isFormClass:
# See if there is any code associated with the form
code = clsd.get("code", "")
@@ -835,7 +835,11 @@
defAtts["Sizer_%s" % key] = val
defAtts.update(dictStringify(atts))
atts = defAtts
- sz.setPropertiesFromAtts(atts)
+ if isinstance(sz.Parent, dabo.ui.dSlidePanel):
+ # Main sizer for a slide panel; don't
do anything
+ pass
+ else:
+ sz.setPropertiesFromAtts(atts)
if classID:
sz.classID = classID
if not fromSzr:
@@ -1029,7 +1033,7 @@
grandkids =
kid.get("children", [])
if grandkids:
self._srcObj =
pnl
-
self.recreateChildren(pg, grandkids, None, False)
+
self.recreateChildren(pnl, grandkids, None, False)
elif isSplitter:
for pos, kid in enumerate(kids):
pnlClass =
dui.__dict__[kid["name"]]
@@ -1541,6 +1545,13 @@
pgf.PageCount += 1
obj = pgf.Pages[-1]
cleanup = "pgf.PageCount = %s" % pp
+ if issubclass(cls, dui.dSlidePanel) and
isinstance(srcObj.Parent,
+ dui.dSlidePanelControl):
+ spc = srcObj.Parent
+ pp = spc.PanelCount
+ spc.PanelCount += 1
+ obj = spc.Panels[-1]
+ cleanup = "spc.PanelCount = %s" % pp
elif issubclass(cls, dui.dColumn):
grd = srcObj.Parent
cc = grd.ColumnCount
@@ -1557,8 +1568,7 @@
self._classDefaultVals[cls] = ret
if cleanup:
exec cleanup in locals()
-
- if not issubclass(cls, dui.dPage):
+ if not issubclass(cls, (dui.dPage, dui.dSlidePanel)):
# Pages will be released by their parent.
obj.release()
if frm:
@@ -2594,8 +2604,6 @@
isSlidePanelControl = issubclass(cls, dui.dSlidePanelControl)
if isSlidePanelControl:
- dabo.ui.exclaim("NOT IMPLEMENTED YET")
- return
# Make sure it has some panels.
newPanels = None
cnt = props.get("PanelCount", 0)
@@ -2737,6 +2745,7 @@
pnl.Expanded = False
if useSizers:
sz = pnl.Sizer =
LayoutSizer("v")
+ sz.Parent = pnl
pnl0 = LayoutPanel(pnl)
if isinstance(obj, dui.dPage) and not isinstance(obj.Parent,
self.pagedControls):
@@ -3405,6 +3414,10 @@
except:
itm = None
if itm:
+ if isinstance(newSizer.Parent, dabo.ui.dSlidePanel):
+ #This is the main sizer
+ itm = None
+ if itm:
if sizerAtts:
if isSpacer:
sizerAtts["Proportion"] = 0
Modified: branches/Nate/ide/ClassDesignerControlMixin.py
===================================================================
--- branches/Nate/ide/ClassDesignerControlMixin.py 2008-08-21 21:03:58 UTC
(rev 4433)
+++ branches/Nate/ide/ClassDesignerControlMixin.py 2008-08-22 18:32:48 UTC
(rev 4434)
@@ -84,6 +84,8 @@
pass
elif isinstance(self, dabo.ui.dImage):
self.bindEvent(dEvents.Resize, self._onResize)
+ elif isinstance(self, (dabo.ui.dSlidePanelControl,
dabo.ui.dSlidePanel)):
+ pass
else:
# This removes all previously-defined bindings
self.unbindEvent(None)
@@ -112,6 +114,8 @@
self.defaultHt = 300
# Bind the active page to the current selection
self.bindEvent(dEvents.PageChanged, self.desSelectPage)
+ elif isinstance(self, dabo.ui.dSlidePanel):
+ self.bindEvent(dEvents.SlidePanelChange,
self.desSlidePanelChg)
elif isinstance(self, (dabo.ui.dPanel, dabo.ui.dImage,
dabo.ui.dBitmap,
dabo.ui.dBitmapButton, dabo.ui.dToggleButton)):
self.defaultWd = 60
@@ -132,8 +136,8 @@
if not self.UsingSizers:
self.Form.createControlHandles(self)
# self.bindKey("left", self.Form.keyMoveLeft)
-
-
+
+
def _insertPageOverride(self, pos, pgCls=None, caption="", imgKey=None,
makeActive=False, ignoreOverride=False):
if not isinstance(self, self.Controller.pagedControls):
@@ -465,8 +469,12 @@
def desSelectNode(self, evt):
"""Called when a node in a tree is selected"""
self.Form.selectControl(self.Selection, False)
-
-
+
+
+ def desSlidePanelChg(self, evt):
+ dabo.ui.callAfterInterval(100, self.Form.refresh)
+
+
def moveControl(self, pos, shft=False):
""" Wraps the Move command with the necessary
screen updating stuff.
Modified: branches/Nate/ide/ClassDesignerEditor.py
===================================================================
--- branches/Nate/ide/ClassDesignerEditor.py 2008-08-21 21:03:58 UTC (rev
4433)
+++ branches/Nate/ide/ClassDesignerEditor.py 2008-08-22 18:32:48 UTC (rev
4434)
@@ -272,7 +272,7 @@
def _getMethodBase(self, mthd, isEvt):
- cd = ("def %s(self):\n\t" % mthd, "def %s(self, evt):\n\t" %
mthd)
+ cd = ("def %s(self):" % mthd, "def %s(self, evt):" % mthd)
if isEvt is None:
return cd
else:
@@ -544,7 +544,8 @@
txt = ed.Value
mthd = ed.Method
mb = self._getMethodBase(mthd, None)
- isEmpty = (txt.strip() == "") or (txt in mb)
+ ts = txt.strip()
+ isEmpty = (ts == "") or (ts in mb)
obj = ed.Object
objCode = rep.get(obj)
if isEmpty:
Modified: branches/Nate/ide/ClassDesignerPropSheet.py
===================================================================
--- branches/Nate/ide/ClassDesignerPropSheet.py 2008-08-21 21:03:58 UTC (rev
4433)
+++ branches/Nate/ide/ClassDesignerPropSheet.py 2008-08-22 18:32:48 UTC (rev
4434)
@@ -568,7 +568,7 @@
Caption=_("Select the sides to
which the border will apply:"))
self.Sizer.append(lbl, halign="center")
choices = ["All", "Top", "Bottom", "Left",
"Right", "None"]
- self.editor = dabo.ui.dCheckListBox(self,
Choices=choices,
+ self.editor = dabo.ui.dCheckList(self,
Choices=choices,
ValueMode="String", Height=200)
self.editor.bindEvent(dEvents.Hit,
self.onSidesChanged)
self.editor.Value = self._currVal = val
@@ -708,7 +708,7 @@
if not prop:
return None
try:
- return self.propDict[prop]
+ return self.propDict[prop]
except KeyError, e:
print "PROP DICT ERROR: >%s<, row=%s" % (prop, row)
@@ -716,6 +716,8 @@
def fillGrid(self, force=False):
super(PropertyGrid, self).fillGrid(force)
# Set the renderers and editors manually by cell
+ if not self.Application.Selection:
+ return
valColumn = self.Columns[1]
for row in range(self.RowCount):
pd = self.getPropDictForRow(row)
@@ -751,11 +753,15 @@
if col == 0:
ret = typ in ("str", "string", "unicode", "u")
else:
+ if not self.Application.Selection:
+ return type(None)
pd = self.getPropDictForRow(row)
if not isinstance(pd, dict):
if pd is None:
- print _("None PROP DICT:, ROW="), row
+ if dabo.verboseLogging:
+ # Not technically logging, but
this is such a non-event...
+ print _("None PROP DICT:,
ROW="), row, col, typ
else:
print _("BAD PROP DICT:"), pd,
type(pd), _("ROW="), row
else:
@@ -809,6 +815,9 @@
row = self.CurrentRow
if col is None:
col = self.CurrentColumn
+ if not self.Application.Selection:
+ self.CurrentRow = self.CurrentColumn = 0
+ return
pd = self.getPropDictForRow(row)
if pd is None:
return
Modified: branches/Nate/ide/wizards/AppWizard/AppWizard.py
===================================================================
--- branches/Nate/ide/wizards/AppWizard/AppWizard.py 2008-08-21 21:03:58 UTC
(rev 4433)
+++ branches/Nate/ide/wizards/AppWizard/AppWizard.py 2008-08-22 18:32:48 UTC
(rev 4434)
@@ -335,7 +335,7 @@
Please check all tables you want included in
your application.""")
lbl = dLabel(self, Caption=txt)
- clb = self.addObject(dabo.ui.dCheckListBox,
Name="clbTableSelection")
+ clb = self.addObject(dabo.ui.dCheckList,
Name="clbTableSelection")
self.Sizer.append(lbl)
self.Sizer.append1x(clb)
hsz = dabo.ui.dSizer("h")
_______________________________________________
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]