daboide Commit
Revision 397
Date: 2006-01-27 10:38:07 -0800 (Fri, 27 Jan 2006)
Author: paul
Changed:
U trunk/ReportDesigner.py
Log:
I discovered that the Ctrl++, Ctrl+-, and Ctrl+/ menu accelerators weren't
working on Windows for the report designer. This is baffling, because the same
setup is working fine in dEditor on Windows. For now, I've added handlers for
those keypresses to the onKeyDown, so keyboard zooming works in Windows again.
Diff:
Modified: trunk/ReportDesigner.py
===================================================================
--- trunk/ReportDesigner.py 2006-01-27 15:48:57 UTC (rev 396)
+++ trunk/ReportDesigner.py 2006-01-27 18:38:07 UTC (rev 397)
@@ -631,6 +631,7 @@
typ = objs[0].__class__.__name__
self.lblType.Caption = typ
+
class PropSheetForm(DesignerControllerForm):
def initProperties(self):
PropSheetForm.doDefault()
@@ -891,7 +892,6 @@
selectedObjs = [mouseObj]
rdc.SelectedObjects = selectedObjs
-# self.Parent.SetFocusIgnoringChildren()
def getObjSizeAndPosition(self, obj):
@@ -1276,7 +1276,10 @@
dKeys.key_Right: "right",
dKeys.key_Left: "left",
dKeys.key_Return: "enter",
- dKeys.key_Tab: "tab"}
+ dKeys.key_Tab: "tab",
+ 396: "/",
+ 394: "-",
+ 392: "+"}
keyCode = evt.EventData["keyCode"]
if not keys.has_key(keyCode):
@@ -1306,7 +1309,7 @@
if key == "tab" and (not ctrlDown and not altDown):
evt.stop()
selObj = []
- if len(rdc.SelectedObjects) > 1:
+ if len(rdc.SelectedObjects) > 1 and firstDrawable:
# Multiple selected; don't tab traverse; select
the first drawable.
selObj = [firstDrawable,]
elif not firstDrawable:
@@ -1323,6 +1326,7 @@
selObj =
[getNextDrawableInBand(rdc.SelectedObjects[0])]
if not selObj:
selObj =
[getNextDrawableInBand(rdc.ReportForm["Detail"])]
+
else:
# One object selected; change selection to
next/prior drawable.
@@ -1330,12 +1334,30 @@
selObj =
[rdc.getPriorDrawable(firstDrawable)]
else:
selObj =
[rdc.getNextDrawable(firstDrawable)]
+ if selObj[0] is None:
+ selObj = [rdc.ReportForm]
rdc._selectedObjects = selObj
- rdc.getParentBand(selObj[0]).DesignerObject.refresh()
+ if selObj[0] != rdc.ReportForm:
+
rdc.getParentBand(selObj[0]).DesignerObject.refresh()
# delay the refreshing of the property grid/position:
dabo.ui.callAfterInterval(rdc.refreshProps, 200)
return
+
+
+ if ctrlDown and not altDown and not shiftDown and not metaDown:
+ ## On Windows, the accelerators set up for the zooming
aren't working.
+ ## I have no idea why, because in dEditor the same
setup is working fine.
+ ## Anyway, this code makes keyboard zooming work on
Windows.
+ accel = {"+": self.Form.onViewZoomIn,
+ "-": self.Form.onViewZoomOut,
+ "/": self.Form.onViewZoomNormal}
+ func = accel.get(key)
+ if func:
+ evt.stop()
+ func(None)
+ return
+
if not firstDrawable:
return
@@ -1411,7 +1433,7 @@
ReportDesigner.doDefault()
self.showPosition()
self.setCaption()
- self.SetFocusIgnoringChildren()
+# self.SetFocusIgnoringChildren()
def showPosition(self):
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev