diff options
author | Xisco Fauli <anistenis@gmail.com> | 2013-02-05 22:54:33 +0100 |
---|---|---|
committer | Xisco Fauli <anistenis@gmail.com> | 2013-02-05 22:56:28 +0100 |
commit | 949facecdc0a1aed8f16c4c1e67e94e2e7f0c2e9 (patch) | |
tree | fbbfffbdaa28de107d7453079486eb7383012e1c /wizards | |
parent | 57954fdd9d0a4a363ab28142dcd9b103acfc5aa3 (diff) |
pyagenda: Update topics's gui when launching the wizard
Change-Id: Ifb38b49fb62d5fc85bcc6dfa7729bb87d3c7f8e0
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/agenda/TopicsControl.py | 6 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/ControlScroller.py | 32 |
2 files changed, 20 insertions, 18 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.py b/wizards/com/sun/star/wizards/agenda/TopicsControl.py index f25fb4d59687..f5798382382b 100644 --- a/wizards/com/sun/star/wizards/agenda/TopicsControl.py +++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.py @@ -103,7 +103,10 @@ class TopicsControl(ControlScroller): super(TopicsControl, self).__init__( dialog, xmsf, 5, 92, 38, 212, 5, 18, HID + 32) self.dialog = dialog + #fill preview's table self.initializeScrollFields(agenda) + #fill gui's table + self.fillupControls(True) self.nscrollvalue = 0 self.lastFocusRow = 0 self.lastFocusControl = None @@ -314,9 +317,6 @@ class TopicsControl(ControlScroller): Implementation of ControlScroller This is a UI method which inserts a new row to the control. It uses the child-class ControlRow. (see below). - @param _index - @param npos - @see ControlRow ''' def insertControlGroup(self, _index, npos): diff --git a/wizards/com/sun/star/wizards/ui/ControlScroller.py b/wizards/com/sun/star/wizards/ui/ControlScroller.py index 8afaff91b484..2f6d4a41f3e0 100644 --- a/wizards/com/sun/star/wizards/ui/ControlScroller.py +++ b/wizards/com/sun/star/wizards/ui/ControlScroller.py @@ -33,6 +33,7 @@ class ControlScroller(object): _iCompWidth, _nblockincrement, _nlinedistance, _firsthelpindex): self.xMSF = _xMSF self.scrollfields = [] + self.ControlGroupVector = [] ControlScroller.nblockincrement = _nblockincrement self.CurUnoDialog = _CurUnoDialog self.iStep = _iStep @@ -50,7 +51,7 @@ class ControlScroller(object): self.sincSuffix = Desktop.getIncrementSuffix( self.CurUnoDialog.xDialogModel, "imgBackground") - ControlScroller.xScrollBar = self.CurUnoDialog.insertScrollBar( + self.xScrollBar = self.CurUnoDialog.insertScrollBar( "TitleScrollBar" + self.sincSuffix, ("Border", PropertyNames.PROPERTY_ENABLED, PropertyNames.PROPERTY_HEIGHT, @@ -65,13 +66,12 @@ class ControlScroller(object): ControlScroller.iScrollBarWidth - 1, self.iCompPosY + 1, self.iStep, ControlScroller.iScrollBarWidth), 0, self) - ControlScroller.nscrollvalue = 0 - ControlScroller.ControlGroupVector = [] + self.nscrollvalue = 0 ypos = self.iStartPosY + ControlScroller.SORELFIRSTPOSY for i in range(ControlScroller.nblockincrement): self.insertControlGroup(i, ypos) ypos += self.linedistance - + def fillupControls(self, binitialize): for i in range(ControlScroller.nblockincrement): if i < self.ncurfieldcount: @@ -79,21 +79,23 @@ class ControlScroller(object): if binitialize: self.CurUnoDialog.repaintDialogStep() + def fillupControl(self, guiRow): nameProps = self.scrollfields[guiRow] - valueProps = self.scrollfields[guiRow + ControlScroller.nscrollvalue] + valueProps = self.scrollfields[guiRow + self.nscrollvalue] for index, item in enumerate(nameProps): if self.CurUnoDialog.xDialogModel.hasByName(item.Name): self.setControlData(item.Name, valueProps[index].Value) else: raise AttributeError("No such control !") + self.ControlGroupVector[guiRow].setEnabled(True) def setScrollValue(self, _nscrollvalue, _ntotfieldcount=None): if _ntotfieldcount is not None: self.setTotalFieldCount(_ntotfieldcount) if _nscrollvalue >= 0: - ControlScroller.xScrollBar.Model.ScrollValue = _nscrollvalue + self.xScrollBar.Model.ScrollValue = _nscrollvalue self.scrollControls() def setCurFieldCount(self): @@ -106,11 +108,11 @@ class ControlScroller(object): self.ntotfieldcount = _ntotfieldcount self.setCurFieldCount() if self.ntotfieldcount > ControlScroller.nblockincrement: - ControlScroller.xScrollBar.Model.Enabled = True - ControlScroller.xScrollBar.Model.ScrollValueMax = \ + self.xScrollBar.Model.Enabled = True + self.xScrollBar.Model.ScrollValueMax = \ self.ntotfieldcount - ControlScroller.nblockincrement else: - ControlScroller.xScrollBar.Model.Enabled = False + self.xScrollBar.Model.Enabled = False def toggleComponent(self, _bdoenable): bdoenable = _bdoenable and \ @@ -132,11 +134,11 @@ class ControlScroller(object): def scrollControls(self): try: - ControlScroller.nscrollvalue = \ - int(ControlScroller.xScrollBar.Model.ScrollValue) - if ControlScroller.nscrollvalue + ControlScroller.nblockincrement \ + self.nscrollvalue = \ + int(self.xScrollBar.Model.ScrollValue) + if self.nscrollvalue + ControlScroller.nblockincrement \ >= self.ntotfieldcount: - ControlScroller.nscrollvalue = \ + self.nscrollvalue = \ self.ntotfieldcount - ControlScroller.nblockincrement self.fillupControls(False) except Exception: @@ -152,8 +154,8 @@ class ControlScroller(object): ''' def fieldInfo(self, guiRow, column): - if guiRow + ControlScroller.nscrollvalue < len(self.scrollfields): - valueProp = (self.scrollfields[guiRow + ControlScroller.nscrollvalue])[column] + if guiRow + self.nscrollvalue < len(self.scrollfields): + valueProp = (self.scrollfields[guiRow + self.nscrollvalue])[column] nameProp = (self.scrollfields[guiRow])[column] if self.CurUnoDialog.xDialogModel.hasByName(nameProp.Name): valueProp.Value = self.getControlData(nameProp.Name) |