dabo Commit
Revision 6852
Date: 2011-09-26 07:10:48 -0700 (Mon, 26 Sep 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6852
Changed:
U trunk/dabo/dException.py
U trunk/dabo/db/dCursorMixin.py
U trunk/dabo/lib/SimpleCrypt.py
U trunk/dabo/ui/uiwx/dDatePicker.py
U trunk/dabo/ui/uiwx/dDateTextBox.py
U trunk/dabo/ui/uiwx/dDockForm.py
U trunk/dabo/ui/uiwx/dFormMixin.py
U trunk/dabo/ui/uiwx/dHyperLink.py
U trunk/dabo/ui/uiwx/dMenuItem.py
U trunk/dabo/ui/uiwx/dSlidePanelControl.py
U trunk/dabo/ui/uiwx/uiApp.py
Log:
Added translation of param placeholders for all many-to-many methods.
Diff:
Modified: trunk/dabo/dException.py
===================================================================
--- trunk/dabo/dException.py 2011-09-26 13:57:38 UTC (rev 6851)
+++ trunk/dabo/dException.py 2011-09-26 14:10:48 UTC (rev 6852)
@@ -28,12 +28,19 @@
class BusinessRuleViolation(dException):
pass
+
class BusinessRulePassed(dException):
pass
+
class RowNotFoundException(dException):
pass
+
+class DataSourceNotFoundException(dException):
+ pass
+
+
class FeatureNotImplementedException(dException):
pass
Modified: trunk/dabo/db/dCursorMixin.py
===================================================================
--- trunk/dabo/db/dCursorMixin.py 2011-09-26 13:57:38 UTC (rev 6851)
+++ trunk/dabo/db/dCursorMixin.py 2011-09-26 14:10:48 UTC (rev 6852)
@@ -1194,8 +1194,8 @@
for otherVal in listOfValues:
otherPK = self.lookupPKWithAdd(otherField, otherVal,
otherTable)
aux = self.AuxCursor
- sql = "delete from %s where %s = ? and %s = ?" %
(self._assocTable,
- self._assocPKColThis,
self._assocPKColOther)
+ sql = self._qMarkToParamPlaceholder("delete from %s
where %s = ? and %s = ?"
+ % (self._assocTable,
self._assocPKColThis, self._assocPKColOther))
try:
dabo.dbActivityLog.info("mmDisssociateValues()
SQL: %s, PARAMS: %s" % (
sql.decode(self.Encoding).replace("\n", " "), str((self._assocTable,
@@ -1218,7 +1218,8 @@
M-M table.
"""
aux = self.AuxCursor
- sql = "delete from %s where %s = ?" % (self._assocTable,
self._assocPKColThis)
+ sql = self._qMarkToParamPlaceholder("delete from %s where %s =
?"
+ % (self._assocTable, self._assocPKColThis))
try:
dabo.dbActivityLog.info("mmDisssociateAll() SQL: %s" % (
sql.decode(self.Encoding).replace("\n",
" ")))
@@ -1251,8 +1252,8 @@
thisPK = self.lookupPKWithAdd(thisField, thisVal, thisTable)
otherPK = self.lookupPKWithAdd(otherField, otherVal, otherTable)
aux = self.AuxCursor
- sql = "select * from %s where %s = ? and %s = ?" %
(self._assocTable,
- self._assocPKColThis, self._assocPKColOther)
+ sql = self._qMarkToParamPlaceholder("select * from %s where %s
= ? and %s = ?"
+ % (self._assocTable, self._assocPKColThis,
self._assocPKColOther))
try:
dabo.dbActivityLog.info("mmAddToBoth() SQL: %s, PARAMS:
%s" % (
sql.decode(self.Encoding).replace("\n",
" "), str((thisPK, otherPK))))
@@ -1264,8 +1265,8 @@
dabo.dbActivityLog.info("mmAddToBoth() (failed
to log SQL and PARAMS)")
aux.execute(sql, (thisPK, otherPK))
if not aux.RowCount:
- sql = "insert into %s (%s, %s) values (?, ?)" %
(self._assocTable,
- self._assocPKColThis,
self._assocPKColOther)
+ sql = self._qMarkToParamPlaceholder("insert into %s
(%s, %s) values (?, ?)"
+ % (self._assocTable,
self._assocPKColThis, self._assocPKColOther))
aux.execute(sql, (thisPK, otherPK))
@@ -1285,7 +1286,8 @@
self._assocPKColOther, self._mmOtherTable,
self._mmOtherPKCol)
aux.setJoinClause(join)
aux.setFieldClause(fldNames)
- aux.setWhereClause("%s.%s = ?" % (self._assocTable,
self._assocPKColThis))
+ aux.setWhereClause(self._qMarkToParamPlaceholder("%s.%s = ?"
+ % (self._assocTable, self._assocPKColThis)))
params = (self.getPK(),)
aux.requery(params)
return aux.getDataSet()
Modified: trunk/dabo/lib/SimpleCrypt.py
===================================================================
--- trunk/dabo/lib/SimpleCrypt.py 2011-09-26 13:57:38 UTC (rev 6851)
+++ trunk/dabo/lib/SimpleCrypt.py 2011-09-26 14:10:48 UTC (rev 6852)
@@ -38,16 +38,33 @@
self._cryptoProvider = None
# If the Crypto package is available, use it.
self._useDES3 = (self.__key is not None)
+ self._useAES = (self.__key is not None)
if self._useDES3:
try:
from Crypto.Cipher import DES3
except ImportError:
self._useDES3 = False
+
+ if self.__key:
+ self.__key = self.__key[:16].rjust(16, "@")
+
if self._useDES3:
- self.__key = self.__key[:16].rjust(16, "@")
self._cryptoProvider = DES3.new(self.__key,
DES3.MODE_CBC)
+ if self._useAES:
+ try:
+ from Crypto.Cipher import AES
+ except ImportError:
+ self._useAES = False
+ # TEMP!!!
+ self._useAES = False
+
+ if self._useAES:
+ print "KEY", self.__key, divmod(len(self.__key), 16)
+ self._cryptoProviderAES = AES.new(self.__key,
AES.MODE_CBC)
+
+
def showWarning(self):
warnings.warn("WARNING: SimpleCrypt is not secure. Please see
http://wiki.dabodev.com/SimpleCrypt for more information")
@@ -65,7 +82,21 @@
paddedText = "%s%s%s" % (initialPad, pad, aString)
enc = self._cryptoProvider.encrypt(paddedText)
retText = "%s%s" % (diffToEight, enc)
+
return base64.b64encode(retText)
+
+ if self._useAES:
+ # AES requires multiples of 16, not 8
+ initialPad =
"".join(random.sample(string.printable, 16))
+ strLen = len(aString)
+ diffTo16 = 16 - (strLen % 16)
+ pad = "@" * diffTo16
+ print "PADLEN", len(pad)
+ paddedText = "%s%s%s" % (initialPad, pad,
aString)
+ encAES =
self._cryptoProviderAES.encrypt(paddedText)
+ retTextAES = "%s%s" % (diffToEight, encAES)
+
+ return base64.b64encode(retTextAES)
else:
self.showWarning()
tmpKey = self.generateKey(aString)
@@ -81,6 +112,8 @@
return ""
if self._useDES3:
decString = base64.b64decode(aString)
+# print "FIRST", int(decString[0])
+# print "SEC", int(decString[1])
# We need to chop off any padding, along with the first
8 garbage bytes
padlen = int(decString[0]) + 8
decString = decString[1:]
@@ -117,3 +150,11 @@
raise ValueError(_("Incorrectly-encrypted password"))
return "".join(chunks)
+
+if __name__ == "__main__":
+ s = SimpleCrypt(key="What a long $trange trip it's been")
+ orig = "biteme"
+ enc = s.encrypt(orig)
+ dec = s.decrypt(enc)
+ print "Success=%s" % (dec == orig)
+
Modified: trunk/dabo/ui/uiwx/dDatePicker.py
===================================================================
--- trunk/dabo/ui/uiwx/dDatePicker.py 2011-09-26 13:57:38 UTC (rev 6851)
+++ trunk/dabo/ui/uiwx/dDatePicker.py 2011-09-26 14:10:48 UTC (rev 6852)
@@ -144,6 +144,7 @@
def _processKey(self, evt):
key = evt.EventData["keyCode"]
+ print "KEY", key
if key == 43: # +
self.dayInterval(1)
elif key == 45: # -
Modified: trunk/dabo/ui/uiwx/dDateTextBox.py
===================================================================
--- trunk/dabo/ui/uiwx/dDateTextBox.py 2011-09-26 13:57:38 UTC (rev 6851)
+++ trunk/dabo/ui/uiwx/dDateTextBox.py 2011-09-26 14:10:48 UTC (rev 6852)
@@ -95,10 +95,11 @@
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)
+ self.calButton.bindEvent(dEvents.Hit, _onCalButton)
# Tooltip help
self._defaultToolTipText = _("""Available Keys:
@@ -133,7 +134,7 @@
self.showCalendar()
- def __onBtnClick(self,evt):
+ def _onCalButton(self,evt):
"""Display a calendar to allow users to select dates."""
self.showCalendar()
@@ -468,5 +469,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/dDockForm.py
===================================================================
--- trunk/dabo/ui/uiwx/dDockForm.py 2011-09-26 13:57:38 UTC (rev 6851)
+++ trunk/dabo/ui/uiwx/dDockForm.py 2011-09-26 14:10:48 UTC (rev 6852)
@@ -87,10 +87,7 @@
self._toolbar = self._extractKey(kwargs, "Toolbar", False)
# Initialize attributes that underly properties
- self._bottomDockable = True
- self._leftDockable = True
- self._rightDockable = True
- self._topDockable = True
+ self._dockable = self._bottomDockable = self._leftDockable =
self._rightDockable = self._topDockable = True
self._floatable = True
self._floatingPosition = (0, 0)
self._floatingSize = (100, 100)
@@ -148,7 +145,9 @@
"""Float the panel if it isn't already floating."""
if self.Floating or not self.Floatable:
return
+ pos = self.FloatingPosition
self._PaneInfo.Float()
+# self.Position = pos
self._updateAUI()
@@ -216,10 +215,33 @@
return (nm, inf.replace("name=%s;" % nm, ""))
+ def _forceUpdate(self, mthd, val):
+ """Seems that some of the properties, when change, do not
manifest themselves
+ until the panel is docked; once docked, they retain the changes
even when re-floated.
+ This method forces a docking and restores floating state to
force visual update
+ of such properties.
+ """
+ self.Form.lockDisplay()
+ isFloating = self.Floating
+ self.dock()
+ pi = self._PaneInfo
+ mthd = getattr(pi, mthd)
+ mthd(val)
+ self._updateAUI()
+ if isFloating:
+ def refloat():
+ self.float()
+ self.Form.unlockDisplay()
+ dabo.ui.callAfterInterval(100, refloat)
+ else:
+ dabo.ui.callAfterInterval(100, self.Form.unlockDisplay)
+
+
def _updateAUI(self):
frm = self.Form
if frm is not None:
frm._refreshState()
+ print self.Caption, dabo.dBug.logPoint()
else:
try:
self._Manager.runUpdate()
@@ -263,6 +285,9 @@
def _setBottomDockable(self, val):
if self._constructed():
+ if self._bottomDockable == val:
+ return
+ self._bottomDockable = val
self._PaneInfo.BottomDockable(val)
self._updateAUI()
else:
@@ -297,15 +322,22 @@
def _getDockable(self):
- return self._bottomDockable or self._leftDockable or
self._rightDockable or self._topDockable
+ return self._dockable
def _setDockable(self, val):
if self._constructed():
- self._dockable = self._bottomDockable =
self._leftDockable = self._rightDockable = self._topDockable = val
+ if self._dockable == val:
+ return
+ td, bd, ld, rd = self._topDockable,
self._bottomDockable, self._leftDockable, self._rightDockable
+ self._dockable = val
self._PaneInfo.Dockable(val)
if self.Docked:
self.Docked = val
+ if not self._dockable and not self._floatable:
+ # One has to be true
+ self.Floatable = True
self._updateAUI()
+ self.TopDockable, self.BottomDockable,
self.LeftDockable, self.RightDockable = td, bd, ld, rd
else:
self._properties["Dockable"] = val
@@ -346,8 +378,15 @@
def _setFloatable(self, val):
if self._constructed():
+ if self._floatable == val:
+ return
self._floatable = val
self._PaneInfo.Floatable(val)
+ if self.Floating:
+ self.Floating = val
+ if not self._floatable and not self._dockable:
+ # One has to be true
+ self.Dockable = True
self._updateAUI()
else:
self._properties["Floatable"] = val
@@ -520,6 +559,9 @@
def _setLeftDockable(self, val):
if self._constructed():
+ if self._leftDockable == val:
+ return
+ self._leftDockable = val
self._PaneInfo.LeftDockable(val)
self._updateAUI()
else:
@@ -584,6 +626,9 @@
def _setRightDockable(self, val):
if self._constructed():
+ if self._rightDockable == val:
+ return
+ self._rightDockable = val
self._PaneInfo.RightDockable(val)
self._updateAUI()
else:
@@ -638,8 +683,9 @@
if val == self._showGripper:
return
self._showGripper = val
- self._PaneInfo.Gripper(val)
- self._updateAUI()
+ self._forceUpdate("Gripper", val)
+# self._PaneInfo.Gripper(val)
+# self._updateAUI()
else:
self._properties["ShowGripper"] = val
@@ -703,6 +749,9 @@
def _setTopDockable(self, val):
if self._constructed():
+ if self._topDockable == val:
+ return
+ self._topDockable = val
self._PaneInfo.TopDockable(val)
self._updateAUI()
else:
@@ -1007,62 +1056,121 @@
def afterInit(self):
self.fp = self.addPanel(Floating=True, BackColor="orange",
- Caption="Initially Floating", Top=70, Left=200,
Size=(144, 100))
+ Top=70, Left=200, Size=(144, 100),
DynamicCaption=self.capForOrange)
self.dp = self.addPanel(Floating=False, Caption="Initially
Docked", BackColor="slateblue",
ShowCaption=False, ShowPinButton=True,
ShowCloseButton=False,
ShowGripper=True, Size=(144, 100))
- btn = dabo.ui.dButton(self.CenterPanel, Caption="Test Orange",
OnHit=self.onTestFP)
- self.CenterPanel.Sizer.append(btn)
- btn = dabo.ui.dButton(self.CenterPanel, Caption="Test Blue",
OnHit=self.onTestDP)
- self.CenterPanel.Sizer.append(btn)
- chk = dabo.ui.dCheckBox(self.CenterPanel, Caption="Orange
Dockable", DataSource=self.fp,
+ cp = self.CenterPanel
+ self.ddPanel = dabo.ui.dDropdownList(cp, Choices=["Orange",
"Blue"], Keys=[self.fp, self.dp],
+ PositionValue=0)
+ sz = cp.Sizer
+ print "SZ", sz
+ sz.append(self.ddPanel, halign="center", border=33)
+ bsz = dabo.ui.dBorderSizer(cp, Caption="Properties")
+ sz.append(bsz, border=10, halign="center")
+ gsz = dabo.ui.dGridSizer(MaxRows=10)
+ bsz.append1x(gsz, border=4)
+ chk = dabo.ui.dCheckBox(cp, Caption="Dockable",
DataSource=self.getCurrentObject,
DataField="Dockable")
- self.CenterPanel.Sizer.append(chk)
- self.fp.DynamicCaption = self.capForOrange
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="TopDockable",
DataSource=self.getCurrentObject,
+ DataField="TopDockable")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="BottomDockable",
DataSource=self.getCurrentObject,
+ DataField="BottomDockable")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="RightDockable",
DataSource=self.getCurrentObject,
+ DataField="RightDockable")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="LeftDockable",
DataSource=self.getCurrentObject,
+ DataField="LeftDockable")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="Docked",
DataSource=self.getCurrentObject,
+ DataField="Docked")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="Floatable",
DataSource=self.getCurrentObject,
+ DataField="Floatable")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="Floating",
DataSource=self.getCurrentObject,
+ DataField="Floating")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="Movable",
DataSource=self.getCurrentObject,
+ DataField="Movable")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="Resizable",
DataSource=self.getCurrentObject,
+ DataField="Resizable")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="ShowBorder",
DataSource=self.getCurrentObject,
+ DataField="ShowBorder")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="ShowCaption",
DataSource=self.getCurrentObject,
+ DataField="ShowCaption")
+ gsz.append(chk)
+# chk = dabo.ui.dCheckBox(cp, Caption="ShowCloseButton",
DataSource=self.getCurrentObject,
+# DataField="ShowCloseButton")
+# gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="ShowGripper",
DataSource=self.getCurrentObject,
+ DataField="ShowGripper")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="ShowMaximizeButton",
DataSource=self.getCurrentObject,
+ DataField="ShowMaximizeButton")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="ShowMinimizeButton",
DataSource=self.getCurrentObject,
+ DataField="ShowMinimizeButton")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="ShowPinButton",
DataSource=self.getCurrentObject,
+ DataField="ShowPinButton")
+ gsz.append(chk)
+ chk = dabo.ui.dCheckBox(cp, Caption="Visible",
DataSource=self.getCurrentObject,
+ DataField="Visible")
+ gsz.append(chk)
+
+ self.layout()
+ def getCurrentObject(self):
+ return self.ddPanel.KeyValue
+
def capForOrange(self):
- print "ORNG CAP", self.fp.Docked
state = "Floating"
if self.fp.Docked:
state = "Docked"
- print "STATE", state
return "I'm %s!" % state
- def onTestFP(self, evt):
- self.printTest(self.fp)
- def onTestDP(self, evt):
- self.printTest(self.dp)
- def printTest(self, obj):
- nm = {self.fp: "OrangePanel", self.dp: "BluePanel"}[obj]
- print nm + ".BottomDockable:", obj.BottomDockable
- print nm + ".Caption:", obj.Caption
- print nm + ".DestroyOnClose:", obj.DestroyOnClose
- print nm + ".Dockable:", obj.Dockable
- print nm + ".Docked:", obj.Docked
- print nm + ".Floatable:", obj.Floatable
- print nm + ".Floating:", obj.Floating
- print nm + ".FloatingBottom:", obj.FloatingBottom
- print nm + ".FloatingHeight:", obj.FloatingHeight
- print nm + ".FloatingLeft:", obj.FloatingLeft
- print nm + ".FloatingPosition:", obj.FloatingPosition
- print nm + ".FloatingRight:", obj.FloatingRight
- print nm + ".FloatingSize:", obj.FloatingSize
- print nm + ".FloatingTop:", obj.FloatingTop
- print nm + ".FloatingWidth:", obj.FloatingWidth
- print nm + ".GripperPosition:", obj.GripperPosition
- print nm + ".LeftDockable:", obj.LeftDockable
- print nm + ".Movable:", obj.Movable
- print nm + ".Resizable:", obj.Resizable
- print nm + ".RightDockable:", obj.RightDockable
- print nm + ".ShowBorder:", obj.ShowBorder
- print nm + ".ShowCaption:", obj.ShowCaption
- print nm + ".ShowCloseButton:", obj.ShowCloseButton
- print nm + ".ShowGripper:", obj.ShowGripper
- print nm + ".ShowMaximizeButton:", obj.ShowMaximizeButton
- print nm + ".ShowMinimizeButton:", obj.ShowMinimizeButton
- print nm + ".ShowPinButton:", obj.ShowPinButton
- print nm + ".TopDockable:", obj.TopDockable
- print nm + ".Visible:", obj.Visible
+# def onTestFP(self, evt):
+# self.printTest(self.fp)
+# def onTestDP(self, evt):
+# self.printTest(self.dp)
+# def printTest(self, obj):
+# nm = {self.fp: "OrangePanel", self.dp: "BluePanel"}[obj]
+# print nm + ".BottomDockable:", obj.BottomDockable
+# print nm + ".Caption:", obj.Caption
+# print nm + ".DestroyOnClose:", obj.DestroyOnClose
+# print nm + ".Dockable:", obj.Dockable
+# print nm + ".Docked:", obj.Docked
+# print nm + ".Floatable:", obj.Floatable
+# print nm + ".Floating:", obj.Floating
+# print nm + ".FloatingBottom:", obj.FloatingBottom
+# print nm + ".FloatingHeight:", obj.FloatingHeight
+# print nm + ".FloatingLeft:", obj.FloatingLeft
+# print nm + ".FloatingPosition:", obj.FloatingPosition
+# print nm + ".FloatingRight:", obj.FloatingRight
+# print nm + ".FloatingSize:", obj.FloatingSize
+# print nm + ".FloatingTop:", obj.FloatingTop
+# print nm + ".FloatingWidth:", obj.FloatingWidth
+# print nm + ".GripperPosition:", obj.GripperPosition
+# print nm + ".LeftDockable:", obj.LeftDockable
+# print nm + ".Movable:", obj.Movable
+# print nm + ".Resizable:", obj.Resizable
+# print nm + ".RightDockable:", obj.RightDockable
+# print nm + ".ShowBorder:", obj.ShowBorder
+# print nm + ".ShowCaption:", obj.ShowCaption
+# print nm + ".ShowCloseButton:", obj.ShowCloseButton
+# print nm + ".ShowGripper:", obj.ShowGripper
+# print nm + ".ShowMaximizeButton:", obj.ShowMaximizeButton
+# print nm + ".ShowMinimizeButton:", obj.ShowMinimizeButton
+# print nm + ".ShowPinButton:", obj.ShowPinButton
+# print nm + ".TopDockable:", obj.TopDockable
+# print nm + ".Visible:", obj.Visible
Modified: trunk/dabo/ui/uiwx/dFormMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dFormMixin.py 2011-09-26 13:57:38 UTC (rev 6851)
+++ trunk/dabo/ui/uiwx/dFormMixin.py 2011-09-26 14:10:48 UTC (rev 6852)
@@ -300,6 +300,9 @@
refresh. In these cases, pass an interval of 0 to this method,
which
means don't wait; execute now.
"""
+
+ return
+
if interval is None:
interval = 100
if interval == 0:
Modified: trunk/dabo/ui/uiwx/dHyperLink.py
===================================================================
--- trunk/dabo/ui/uiwx/dHyperLink.py 2011-09-26 13:57:38 UTC (rev 6851)
+++ trunk/dabo/ui/uiwx/dHyperLink.py 2011-09-26 14:10:48 UTC (rev 6852)
@@ -34,6 +34,9 @@
def refresh(self):
+
+ return
+
super(dHyperLink, self).refresh()
self.UpdateLink(True)
@@ -192,7 +195,16 @@
ForeColor = LinkColor
+ DynamicHoverColor = makeDynamicProperty(HoverColor)
+ DynamicHoverUnderline = makeDynamicProperty(HoverUnderline)
+ DynamicLinkColor = makeDynamicProperty(LinkColor)
+ DynamicLinkUnderline = makeDynamicProperty(LinkUnderline)
+ DynamicURL = makeDynamicProperty(URL)
+ DynamicVisitedColor = makeDynamicProperty(VisitedColor)
+ DynamicVisitedUnderline = makeDynamicProperty(VisitedUnderline)
+
+
class _dHyperLink_test(dHyperLink):
def _onHit(self, evt):
print "hit"
Modified: trunk/dabo/ui/uiwx/dMenuItem.py
===================================================================
--- trunk/dabo/ui/uiwx/dMenuItem.py 2011-09-26 13:57:38 UTC (rev 6851)
+++ trunk/dabo/ui/uiwx/dMenuItem.py 2011-09-26 14:10:48 UTC (rev 6852)
@@ -5,6 +5,7 @@
import dIcons
import dabo
from dabo.dLocalize import _
+import dabo.dColors as dColors
import dabo.dEvents as dEvents
from dabo.ui import makeDynamicProperty
from dabo.lib.utils import ustr
@@ -107,6 +108,19 @@
self._properties["Enabled"] = val
+ def _getForeColor(self):
+ return self.GetTextColour().Get()
+
+ def _setForeColor(self, val):
+ if self._constructed():
+ if isinstance(val, basestring):
+ val = dColors.colorTupleFromName(val)
+ if val != self.GetTextColour().Get():
+ self.SetTextColour(val)
+ else:
+ self._properties["ForeColor"] = val
+
+
def _getForm(self):
return self.Parent.Form
@@ -182,6 +196,10 @@
Enabled = property(_getEnabled, _setEnabled, None,
_("Specifies whether the menu item can be interacted
with."))
+ ForeColor = property(_getForeColor, _setForeColor, None,
+ _("""Specifies the foreground color of the object.
+ Only available on Windows and Gtk. (str, 3-tuple, or
wx.Colour)"""))
+
Form = property(_getForm, None, None,
_("Specifies the containing form."))
Modified: trunk/dabo/ui/uiwx/dSlidePanelControl.py
===================================================================
--- trunk/dabo/ui/uiwx/dSlidePanelControl.py 2011-09-26 13:57:38 UTC (rev
6851)
+++ trunk/dabo/ui/uiwx/dSlidePanelControl.py 2011-09-26 14:10:48 UTC (rev
6852)
@@ -493,6 +493,9 @@
def refresh(self):
+
+ return
+
super(dSlidePanelControl, self).refresh()
if self.CollapseToBottom:
rect = self.RepositionCollapsedToBottom()
Modified: trunk/dabo/ui/uiwx/uiApp.py
===================================================================
--- trunk/dabo/ui/uiwx/uiApp.py 2011-09-26 13:57:38 UTC (rev 6851)
+++ trunk/dabo/ui/uiwx/uiApp.py 2011-09-26 14:10:48 UTC (rev 6852)
@@ -1028,6 +1028,13 @@
ret = None
win = self.findWindow
if win:
+ try:
+ return win.onFindOverride(action=action,
findString=findString,
+ replaceString=replaceString,
downwardSearch=downwardSearch,
+ wholeWord=wholeWord,
matchCase=matchCase)
+ except AttributeError:
+ # No override; process normally
+ pass
if isinstance(win, wx.stc.StyledTextCtrl):
# STC
if action == "Replace":
_______________________________________________
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]