diff options
author | Xisco Fauli <anistenis@gmail.com> | 2011-07-29 16:53:09 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-08-18 02:57:44 +0200 |
commit | a1fd3a904f4daaeec7598891e77ac66949df4207 (patch) | |
tree | 74dcc3b4431111c8b00b5bd24609a233866a6e4d /wizards | |
parent | 98318dd2b7113f6c89ad0050befaedfeca2d4e63 (diff) |
Make agenda items editable
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/agenda/TopicsControl.py | 8 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/ControlScroller.py | 15 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/PeerConfig.py | 42 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/UnoDialog.py | 8 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/event/CommonListener.py | 14 |
5 files changed, 68 insertions, 19 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.py b/wizards/com/sun/star/wizards/agenda/TopicsControl.py index 548968c96e2f..7a48802371fb 100644 --- a/wizards/com/sun/star/wizards/agenda/TopicsControl.py +++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.py @@ -1,12 +1,8 @@ -from ui.ControlScroller import ControlScroller -from common.PropertyNames import PropertyNames from threading import RLock +from CGTopic import CGTopic +from ui.ControlScroller import * from AgendaWizardDialogConst import LAST_HID from common.Properties import Properties -import traceback -import inspect -from common.HelpIds import HelpIds -from CGTopic import CGTopic ''' @author rpiterman diff --git a/wizards/com/sun/star/wizards/ui/ControlScroller.py b/wizards/com/sun/star/wizards/ui/ControlScroller.py index 2a718c8eb497..4a21193c5923 100644 --- a/wizards/com/sun/star/wizards/ui/ControlScroller.py +++ b/wizards/com/sun/star/wizards/ui/ControlScroller.py @@ -1,12 +1,13 @@ +import uno +import traceback from common.Desktop import Desktop from common.PropertyNames import PropertyNames from common.HelpIds import HelpIds -from com.sun.star.awt.ScrollBarOrientation import HORIZONTAL, VERTICAL -import uno from common.Helper import Helper -import traceback from ui.UnoDialog import UnoDialog +from com.sun.star.awt.ScrollBarOrientation import HORIZONTAL, VERTICAL + class ControlScroller(object): SORELFIRSTPOSY = 3 @@ -44,7 +45,7 @@ class ControlScroller(object): PropertyNames.PROPERTY_POSITION_Y, PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_WIDTH), - (uno.Any("short", "1"),self.iCompHeight, self.iCompPosX, + (1, self.iCompHeight, self.iCompPosX, self.iCompPosY, ControlScroller.iStep, self.iCompWidth)) self.oImgControl = ControlScroller.CurUnoDialog.xUnoDialog.getControl( "imgBackground" + self.sincSuffix) @@ -72,10 +73,8 @@ class ControlScroller(object): ypos += self.linedistance def setComponentMouseTransparent(self): - pass - #COMMENTED - #ControlScroller.CurUnoDialog.getPeerConfiguration(). - #setPeerProperties(self.oImgControl, ["MouseTransparent"], [True]) + ControlScroller.CurUnoDialog.getPeerConfiguration().\ + setPeerProperties(self.oImgControl, "MouseTransparent", True) def setScrollBarOrientationHorizontal(self): Helper.setUnoPropertyValue(self.xScrollBar, "Orientation",HORIZONTAL) diff --git a/wizards/com/sun/star/wizards/ui/PeerConfig.py b/wizards/com/sun/star/wizards/ui/PeerConfig.py new file mode 100644 index 000000000000..9026debc73c0 --- /dev/null +++ b/wizards/com/sun/star/wizards/ui/PeerConfig.py @@ -0,0 +1,42 @@ +from event.CommonListener import WindowListenerProcAdapter + +''' +@author rpiterman +To change the template for this generated type comment go to +Window>Preferences>Java>Code Generation>Code and Comments +''' + +class PeerConfig(object): + + def __init__(self, _oUnoDialog): + self.oUnoDialog = _oUnoDialog + self.oUnoDialog.xUnoDialog.addWindowListener( + WindowListenerProcAdapter(self.windowShown)) + self.m_aPeerTasks = [] + + class PeerTask(object): + + def __init__(self, _xControl,propNames_,propValues_): + self.propnames = propNames_ + self.propvalues = propValues_ + self.xControl = _xControl + + def windowShown(self): + try: + for i in self.m_aPeerTasks: + xVclWindowPeer = i.xControl.Peer + xVclWindowPeer.setProperty(i.propnames, i.propvalues) + + except Exception: + traceback.print_exc() + + ''' + @param oAPIControl an API control that the interface + XControl can be derived from + @param _propnames + @param _propvalues + ''' + + def setPeerProperties(self, _xControl, propnames, propvalues): + oPeerTask = self.PeerTask(_xControl, propnames, propvalues) + self.m_aPeerTasks.append(oPeerTask) diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog.py b/wizards/com/sun/star/wizards/ui/UnoDialog.py index d9e320a0cdbf..8568d88d5aa2 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog.py +++ b/wizards/com/sun/star/wizards/ui/UnoDialog.py @@ -1,11 +1,13 @@ import uno import traceback +import UIConsts from common.PropertyNames import PropertyNames -from com.sun.star.awt import Rectangle from common.Helper import Helper +from ui.PeerConfig import PeerConfig + +from com.sun.star.awt import Rectangle from com.sun.star.awt import Rectangle from com.sun.star.awt.PosSize import POS -import UIConsts class UnoDialog(object): @@ -40,7 +42,7 @@ class UnoDialog(object): return iKey def getPeerConfiguration(self): - if self.m_oPeerConfig == None: + if self.m_oPeerConfig is None: self.m_oPeerConfig = PeerConfig(self) return self.m_oPeerConfig diff --git a/wizards/com/sun/star/wizards/ui/event/CommonListener.py b/wizards/com/sun/star/wizards/ui/event/CommonListener.py index 1a1c02cce091..3745d6e7690a 100644 --- a/wizards/com/sun/star/wizards/ui/event/CommonListener.py +++ b/wizards/com/sun/star/wizards/ui/event/CommonListener.py @@ -74,13 +74,23 @@ class TextListenerProcAdapter( unohelper.Base, XTextListener ): apply( self.oProcToCall ) from com.sun.star.frame import XTerminateListener -class TerminateListenerProcAdapter( unohelper.Base, XTerminateListener ): +class TerminateListenerProcAdapter( unohelper.Base, XTerminateListener ): def __init__( self, oProcToCall, tParams=() ): self.oProcToCall = oProcToCall # a python procedure self.tParams = tParams # a tuple - # oTextEvent is a com.sun.star.awt.TextEvent struct. def queryTermination(self, TerminateEvent): self.oProcToCall = getattr(self.oProcToCall,"queryTermination") if callable( self.oProcToCall ): apply( self.oProcToCall ) + +from com.sun.star.awt import XWindowListener +class WindowListenerProcAdapter( unohelper.Base, XWindowListener ): + def __init__( self, oProcToCall, tParams=() ): + self.oProcToCall = oProcToCall # a python procedure + self.tParams = tParams # a tuple + + # oTextEvent is a com.sun.star.awt.TextEvent struct. + def windowShown(self, TerminateEvent): + if callable( self.oProcToCall ): + apply( self.oProcToCall ) |