Kaydet (Commit) ee122cfd authored tarafından Xisco Fauli's avatar Xisco Fauli

pywizards: unify setDialogProperties

Change-Id: I20d701da56bf6c8aef573aea71a7629f6374814f
üst 5ae93216
...@@ -30,16 +30,8 @@ class AgendaWizardDialog(WizardDialog): ...@@ -30,16 +30,8 @@ class AgendaWizardDialog(WizardDialog):
self.resources = AgendaWizardDialogResources(self.oWizardResource) self.resources = AgendaWizardDialogResources(self.oWizardResource)
#set dialog properties... #set dialog properties...
uno.invoke(self.xDialogModel, "setPropertyValues", self.setDialogProperties(True, 210, True, 200, 52, 1, 1,
(("Closeable", self.resources.resAgendaWizardDialog_title, 310)
PropertyNames.PROPERTY_HEIGHT,
"Moveable", PropertyNames.PROPERTY_POSITION_X,
PropertyNames.PROPERTY_POSITION_Y,
PropertyNames.PROPERTY_STEP,
PropertyNames.PROPERTY_TABINDEX,
"Title", PropertyNames.PROPERTY_WIDTH),
(True, 210, True, 200, 52, 1, 1,
self.resources.resAgendaWizardDialog_title,310)))
self.PROPS_LIST = ("Dropdown", self.PROPS_LIST = ("Dropdown",
PropertyNames.PROPERTY_HEIGHT, PropertyNames.PROPERTY_HEIGHT,
......
...@@ -29,4 +29,6 @@ class PropertyNames: ...@@ -29,4 +29,6 @@ class PropertyNames:
PROPERTY_TABINDEX = "TabIndex" PROPERTY_TABINDEX = "TabIndex"
PROPERTY_STATE = "State" PROPERTY_STATE = "State"
PROPERTY_IMAGEURL = "ImageURL" PROPERTY_IMAGEURL = "ImageURL"
PROPERTY_TITLE = "Title"
PROPERTY_MOVEABLE = "Moveable"
PROPERTY_CLOSEABLE = "Closeable"
...@@ -30,14 +30,8 @@ class FaxWizardDialog(WizardDialog): ...@@ -30,14 +30,8 @@ class FaxWizardDialog(WizardDialog):
self.resources = FaxWizardDialogResources(self.oWizardResource) self.resources = FaxWizardDialogResources(self.oWizardResource)
#set dialog properties... #set dialog properties...
uno.invoke(self.xDialogModel, "setPropertyValues", self.setDialogProperties(True, 210, True, 104, 52, 1, 1,
(("Closeable", PropertyNames.PROPERTY_HEIGHT, "Moveable", self.resources.resFaxWizardDialog_title, 310)
PropertyNames.PROPERTY_POSITION_X,
PropertyNames.PROPERTY_POSITION_Y,
PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX,
"Title", PropertyNames.PROPERTY_WIDTH),
(True, 210, True, 104, 52, 1, 1,
self.resources.resFaxWizardDialog_title, 310)))
self.fontDescriptor1 = \ self.fontDescriptor1 = \
uno.createUnoStruct('com.sun.star.awt.FontDescriptor') uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
......
...@@ -27,21 +27,12 @@ class LetterWizardDialog(WizardDialog): ...@@ -27,21 +27,12 @@ class LetterWizardDialog(WizardDialog):
def __init__(self, xmsf): def __init__(self, xmsf):
super(LetterWizardDialog, self).__init__(xmsf, HIDMAIN ) super(LetterWizardDialog, self).__init__(xmsf, HIDMAIN )
#Load Resources
self.resources = LetterWizardDialogResources(self.oWizardResource) self.resources = LetterWizardDialogResources(self.oWizardResource)
uno.invoke(self.xDialogModel, "setPropertyValues",
(("Closeable", #set dialog properties...
PropertyNames.PROPERTY_HEIGHT, self.setDialogProperties(True, 210, True, 104, 52, 1, 1,
"Moveable", self.resources.resLetterWizardDialog_title, 310)
PropertyNames.PROPERTY_NAME,
PropertyNames.PROPERTY_POSITION_X,
PropertyNames.PROPERTY_POSITION_Y,
PropertyNames.PROPERTY_STEP,
PropertyNames.PROPERTY_TABINDEX,
"Title",
PropertyNames.PROPERTY_WIDTH),
(True, 210, True,
"LetterWizardDialog", 104, 52, 1, 1,
self.resources.resLetterWizardDialog_title, 310)))
self.fontDescriptor1 = \ self.fontDescriptor1 = \
uno.createUnoStruct('com.sun.star.awt.FontDescriptor') uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
......
...@@ -22,7 +22,6 @@ class UIConsts(): ...@@ -22,7 +22,6 @@ class UIConsts():
RID_FORM = 2200 RID_FORM = 2200
RID_QUERY = 2300 RID_QUERY = 2300
RID_REPORT = 2400 RID_REPORT = 2400
RID_TABLE = 2600
RID_IMG_REPORT = 1000 RID_IMG_REPORT = 1000
RID_IMG_FORM = 1100 RID_IMG_FORM = 1100
RID_IMG_WEB = 1200 RID_IMG_WEB = 1200
......
...@@ -38,7 +38,6 @@ class UnoDialog(object): ...@@ -38,7 +38,6 @@ class UnoDialog(object):
self.ControlList = {} self.ControlList = {}
self.xDialogModel = xMSF.createInstance( self.xDialogModel = xMSF.createInstance(
"com.sun.star.awt.UnoControlDialogModel") "com.sun.star.awt.UnoControlDialogModel")
self.xDialogModel.setPropertyValues(PropertyNames, PropertyValues)
self.xUnoDialog = xMSF.createInstance( self.xUnoDialog = xMSF.createInstance(
"com.sun.star.awt.UnoControlDialog") "com.sun.star.awt.UnoControlDialog")
self.xUnoDialog.setModel(self.xDialogModel) self.xUnoDialog.setModel(self.xDialogModel)
......
...@@ -80,6 +80,21 @@ class WizardDialog(UnoDialog2): ...@@ -80,6 +80,21 @@ class WizardDialog(UnoDialog2):
except Exception: except Exception:
traceback.print_exc() traceback.print_exc()
def setDialogProperties(self, closeable, height, moveable, position_x,
position_Y, step, tabIndex, title, width):
uno.invoke(self.xDialogModel, "setPropertyValues",
((PropertyNames.PROPERTY_CLOSEABLE,
PropertyNames.PROPERTY_HEIGHT,
PropertyNames.PROPERTY_MOVEABLE,
PropertyNames.PROPERTY_POSITION_X,
PropertyNames.PROPERTY_POSITION_Y,
PropertyNames.PROPERTY_STEP,
PropertyNames.PROPERTY_TABINDEX,
PropertyNames.PROPERTY_TITLE,
PropertyNames.PROPERTY_WIDTH),
(closeable, height, moveable, position_x, position_Y, step,
tabIndex, title, width)))
def setRoadmapInteractive(self, _bInteractive): def setRoadmapInteractive(self, _bInteractive):
self.oRoadmap.Activated = _bInteractive self.oRoadmap.Activated = _bInteractive
......
...@@ -113,24 +113,8 @@ class FTPDialog(UnoDialog2, UIConsts): ...@@ -113,24 +113,8 @@ class FTPDialog(UnoDialog2, UIConsts):
self.ucb = UCB(xmsf) self.ucb = UCB(xmsf)
# set dialog properties... # set dialog properties...
uno.invoke(self.xDialogModel, "setPropertyValues", self.setDialogProperties( True, 160, HelpIds.getHelpIdString(HID_FTP),
(("Closeable", True, "FTPDialog", 167, 82, self.resources.resFTPDialog_title, 222)
PropertyNames.PROPERTY_HEIGHT,
PropertyNames.PROPERTY_HELPURL, "Moveable",
PropertyNames.PROPERTY_NAME,
PropertyNames.PROPERTY_POSITION_X,
PropertyNames.PROPERTY_POSITION_Y,
"Title",
PropertyNames.PROPERTY_WIDTH),
(True,
160,
HelpIds.getHelpIdString(HID_FTP),
True,
"FTPDialog",
167,
82,
self.resources.resFTPDialog_title,
222)))
# add controls to dialog # add controls to dialog
self.build() self.build()
......
...@@ -89,19 +89,9 @@ class WebWizardDialog(WizardDialog): ...@@ -89,19 +89,9 @@ class WebWizardDialog(WizardDialog):
self.resources = WebWizardDialogResources(xmsf, self.oWizardResource) self.resources = WebWizardDialogResources(xmsf, self.oWizardResource)
#set dialog properties... #set dialog properties...
uno.invoke(self.xDialogModel, "setPropertyValues",( self.setDialogProperties( True, 210, True, 102, 52, 1, 6,
("Closeable", self.resources.resWebWizardDialog_title, 330)
PropertyNames.PROPERTY_HEIGHT,
PropertyNames.PROPERTY_HELPURL, "Moveable",
PropertyNames.PROPERTY_NAME,
PropertyNames.PROPERTY_POSITION_X,
PropertyNames.PROPERTY_POSITION_Y,
PropertyNames.PROPERTY_STEP,
PropertyNames.PROPERTY_TABINDEX, "Title",
PropertyNames.PROPERTY_WIDTH),
(True, 210, HelpIds.getHelpIdString(HID0_WEBWIZARD), True,
"WebWizardDialog", 102, 52, 1, 6,
self.resources.resWebWizardDialog_title, 330)))
self.fontDescriptor0 = \ self.fontDescriptor0 = \
uno.createUnoStruct('com.sun.star.awt.FontDescriptor') uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
self.fontDescriptor1 = \ self.fontDescriptor1 = \
...@@ -114,6 +104,7 @@ class WebWizardDialog(WizardDialog): ...@@ -114,6 +104,7 @@ class WebWizardDialog(WizardDialog):
uno.createUnoStruct('com.sun.star.awt.FontDescriptor') uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
self.fontDescriptor7 = \ self.fontDescriptor7 = \
uno.createUnoStruct('com.sun.star.awt.FontDescriptor') uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
self.imgIconsPrev = range(8) self.imgIconsPrev = range(8)
#Set member- self.fontDescriptors... #Set member- self.fontDescriptors...
self.fontDescriptor0.Weight = 100 self.fontDescriptor0.Weight = 100
...@@ -136,7 +127,6 @@ class WebWizardDialog(WizardDialog): ...@@ -136,7 +127,6 @@ class WebWizardDialog(WizardDialog):
self.fontDescriptor7.Weight = 100 self.fontDescriptor7.Weight = 100
#build components #build components
def buildStep1(self): def buildStep1(self):
tabIndex = 100 tabIndex = 100
self.insertLabel("lbIntroTitle", WebWizardDialog.PROPNAMES_TITLE, self.insertLabel("lbIntroTitle", WebWizardDialog.PROPNAMES_TITLE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment