AgendaWizardDialog.py 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. #
  2. # This file is part of the LibreOffice project.
  3. #
  4. # This Source Code Form is subject to the terms of the Mozilla Public
  5. # License, v. 2.0. If a copy of the MPL was not distributed with this
  6. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. #
  8. # This file incorporates work covered by the following license notice:
  9. #
  10. # Licensed to the Apache Software Foundation (ASF) under one or more
  11. # contributor license agreements. See the NOTICE file distributed
  12. # with this work for additional information regarding copyright
  13. # ownership. The ASF licenses this file to you under the Apache
  14. # License, Version 2.0 (the "License"); you may not use this file
  15. # except in compliance with the License. You may obtain a copy of
  16. # the License at http://www.apache.org/licenses/LICENSE-2.0 .
  17. #
  18. from ..ui.WizardDialog import WizardDialog, uno, UIConsts, PropertyNames
  19. from .AgendaWizardDialogConst import AgendaWizardDialogConst, HID
  20. from .AgendaWizardDialogResources import AgendaWizardDialogResources
  21. from com.sun.star.awt.FontUnderline import SINGLE
  22. class AgendaWizardDialog(WizardDialog):
  23. def __init__(self, xmsf):
  24. super(AgendaWizardDialog,self).__init__(xmsf, HID )
  25. #Load Resources
  26. self.resources = AgendaWizardDialogResources()
  27. #set dialog properties...
  28. self.setDialogProperties(True, 210, True, 200, 52, 1, 1,
  29. self.resources.resAgendaWizardDialog_title, 310)
  30. self.PROPS_LIST = ("Dropdown",
  31. PropertyNames.PROPERTY_HEIGHT,
  32. PropertyNames.PROPERTY_HELPURL,
  33. PropertyNames.PROPERTY_POSITION_X,
  34. PropertyNames.PROPERTY_POSITION_Y,
  35. PropertyNames.PROPERTY_STEP,
  36. PropertyNames.PROPERTY_TABINDEX,
  37. PropertyNames.PROPERTY_WIDTH)
  38. self.PROPS_LABEL_B = ("FontDescriptor",
  39. PropertyNames.PROPERTY_HEIGHT,
  40. PropertyNames.PROPERTY_LABEL,
  41. PropertyNames.PROPERTY_MULTILINE,
  42. PropertyNames.PROPERTY_POSITION_X,
  43. PropertyNames.PROPERTY_POSITION_Y,
  44. PropertyNames.PROPERTY_STEP,
  45. PropertyNames.PROPERTY_TABINDEX,
  46. PropertyNames.PROPERTY_WIDTH)
  47. self.PROPS_CHECK = (PropertyNames.PROPERTY_HEIGHT,
  48. PropertyNames.PROPERTY_HELPURL,
  49. PropertyNames.PROPERTY_LABEL,
  50. PropertyNames.PROPERTY_POSITION_X,
  51. PropertyNames.PROPERTY_POSITION_Y,
  52. PropertyNames.PROPERTY_STATE,
  53. PropertyNames.PROPERTY_STEP,
  54. PropertyNames.PROPERTY_TABINDEX,
  55. PropertyNames.PROPERTY_WIDTH)
  56. self.PROPS_BUTTON = (PropertyNames.PROPERTY_HEIGHT,
  57. PropertyNames.PROPERTY_HELPURL,
  58. PropertyNames.PROPERTY_LABEL,
  59. PropertyNames.PROPERTY_POSITION_X,
  60. PropertyNames.PROPERTY_POSITION_Y,
  61. PropertyNames.PROPERTY_STEP,
  62. PropertyNames.PROPERTY_TABINDEX,
  63. PropertyNames.PROPERTY_WIDTH)
  64. self.PROPS_X = (PropertyNames.PROPERTY_HEIGHT,
  65. PropertyNames.PROPERTY_HELPURL,
  66. PropertyNames.PROPERTY_POSITION_X,
  67. PropertyNames.PROPERTY_POSITION_Y,
  68. PropertyNames.PROPERTY_STEP,
  69. PropertyNames.PROPERTY_TABINDEX,
  70. PropertyNames.PROPERTY_WIDTH)
  71. self.PROPS_TEXTAREA = (PropertyNames.PROPERTY_HEIGHT,
  72. PropertyNames.PROPERTY_LABEL,
  73. PropertyNames.PROPERTY_MULTILINE,
  74. PropertyNames.PROPERTY_POSITION_X,
  75. PropertyNames.PROPERTY_POSITION_Y,
  76. PropertyNames.PROPERTY_STEP,
  77. PropertyNames.PROPERTY_TABINDEX,
  78. PropertyNames.PROPERTY_WIDTH)
  79. self.PROPS_TEXT = (PropertyNames.PROPERTY_HEIGHT,
  80. PropertyNames.PROPERTY_LABEL,
  81. PropertyNames.PROPERTY_POSITION_X,
  82. PropertyNames.PROPERTY_POSITION_Y,
  83. PropertyNames.PROPERTY_STEP,
  84. PropertyNames.PROPERTY_TABINDEX,
  85. PropertyNames.PROPERTY_WIDTH)
  86. self.PROPS_IMAGE = ("Border",
  87. PropertyNames.PROPERTY_HEIGHT,
  88. PropertyNames.PROPERTY_HELPURL,
  89. PropertyNames.PROPERTY_IMAGEURL,
  90. PropertyNames.PROPERTY_POSITION_X,
  91. PropertyNames.PROPERTY_POSITION_Y,
  92. "ScaleImage", PropertyNames.PROPERTY_STEP,
  93. PropertyNames.PROPERTY_TABINDEX,
  94. PropertyNames.PROPERTY_WIDTH)
  95. self.fontDescriptor4 = \
  96. uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
  97. self.fontDescriptor4.Weight = 150
  98. def buildStep1(self):
  99. self.insertLabel("lblTitle1", self.PROPS_LABEL_B,
  100. (self.fontDescriptor4, 16, self.resources.reslblTitle1_value,
  101. True, 91, 8, 1, 100,212))
  102. self.insertLabel("lblPageDesign", self.PROPS_TEXT,
  103. (8, self.resources.reslblPageDesign_value, 97, 32, 1, 101, 66))
  104. self.listPageDesign = self.insertListBox("listPageDesign",
  105. None, AgendaWizardDialogConst.LISTPAGEDESIGN_ACTION_PERFORMED,
  106. self.PROPS_LIST,
  107. (True, 12, AgendaWizardDialogConst.LISTPAGEDESIGN_HID,
  108. 166, 30, 1, 102, 70), self)
  109. self.chkMinutes = self.insertCheckBox("chkMinutes", None,
  110. self.PROPS_CHECK, (9, AgendaWizardDialogConst.CHKMINUTES_HID,
  111. self.resources.reschkMinutes_value, 97, 50, 0, 1, 103, 203), self)
  112. self.insertImage("imgHelp1", self.PROPS_IMAGE,
  113. (0, 10, "", UIConsts.INFOIMAGEURL, 92, 145, False, 1, 104, 10))
  114. self.insertLabel("lblHelp1", self.PROPS_TEXTAREA,
  115. (39, self.resources.reslblHelp1_value,
  116. True, 104, 145, 1, 105, 199))
  117. def buildStep2(self):
  118. self.insertLabel("lblTitle2", self.PROPS_LABEL_B,
  119. (self.fontDescriptor4, 16, self.resources.reslblTitle2_value,
  120. True, 91, 8, 2, 200, 212))
  121. self.insertLabel("lblDate", self.PROPS_TEXT,
  122. (8, self.resources.reslblDate_value, 97, 32, 2, 201,66))
  123. self.txtDate = self.insertDateField(
  124. "txtDate", AgendaWizardDialogConst.TXTDATE_TEXT_CHANGED,
  125. self.PROPS_LIST,
  126. (True, 12, AgendaWizardDialogConst.TXTDATE_HID,
  127. 166,30, 2, 202, 70), self)
  128. self.insertLabel("lblTime", self.PROPS_TEXT,
  129. (8, self.resources.reslblTime_value, 97, 50, 2, 203, 66))
  130. self.txtTime = self.insertTimeField("txtTime",
  131. AgendaWizardDialogConst.TXTTIME_TEXT_CHANGED,
  132. (PropertyNames.PROPERTY_HEIGHT,
  133. PropertyNames.PROPERTY_HELPURL,
  134. PropertyNames.PROPERTY_POSITION_X,
  135. PropertyNames.PROPERTY_POSITION_Y,
  136. PropertyNames.PROPERTY_STEP,
  137. "StrictFormat",
  138. PropertyNames.PROPERTY_TABINDEX,
  139. PropertyNames.PROPERTY_WIDTH),
  140. (12, AgendaWizardDialogConst.TXTTIME_HID,
  141. 166, 48, 2, True, 204, 70), self)
  142. self.insertLabel("lblTitle", self.PROPS_TEXT,
  143. (8, self.resources.reslblTitle_value, 97, 68, 2, 205, 66))
  144. self.txtTitle = self.insertTextField(
  145. "txtTitle", AgendaWizardDialogConst.TXTTITLE_TEXT_CHANGED,
  146. (PropertyNames.PROPERTY_HEIGHT,
  147. PropertyNames.PROPERTY_HELPURL,
  148. PropertyNames.PROPERTY_MULTILINE,
  149. PropertyNames.PROPERTY_POSITION_X,
  150. PropertyNames.PROPERTY_POSITION_Y,
  151. PropertyNames.PROPERTY_STEP,
  152. PropertyNames.PROPERTY_TABINDEX,
  153. PropertyNames.PROPERTY_WIDTH),
  154. (26, AgendaWizardDialogConst.TXTTITLE_HID,
  155. True, 166, 66, 2, 206, 138), self)
  156. self.insertLabel("lblLocation", self.PROPS_TEXT,
  157. (8, self.resources.reslblLocation_value, 97, 100, 2, 207, 66))
  158. self.cbLocation = self.insertTextField(
  159. "cbLocation", AgendaWizardDialogConst.TXTLOCATION_TEXT_CHANGED,
  160. (PropertyNames.PROPERTY_HEIGHT,
  161. PropertyNames.PROPERTY_HELPURL,
  162. PropertyNames.PROPERTY_MULTILINE,
  163. PropertyNames.PROPERTY_POSITION_X,
  164. PropertyNames.PROPERTY_POSITION_Y,
  165. PropertyNames.PROPERTY_STEP,
  166. PropertyNames.PROPERTY_TABINDEX,
  167. PropertyNames.PROPERTY_WIDTH),
  168. (34, AgendaWizardDialogConst.CBLOCATION_HID,
  169. True, 166,98, 2, 208, 138), self)
  170. self.insertImage("imgHelp2", self.PROPS_IMAGE,
  171. (0, 10, "", UIConsts.INFOIMAGEURL, 92, 145, False, 2, 209, 10))
  172. self.insertLabel("lblHelp2", self.PROPS_TEXTAREA,
  173. (39, self.resources.reslblHelp2_value,
  174. True, 104, 145, 2, 210, 199))
  175. def buildStep3(self):
  176. self.insertLabel("lblTitle3", self.PROPS_LABEL_B,
  177. (self.fontDescriptor4, 16, self.resources.reslblTitle3_value,
  178. True, 91, 8, 3, 300,212))
  179. self.chkMeetingTitle = self.insertCheckBox("chkMeetingTitle",
  180. AgendaWizardDialogConst.CHKUSEMEETINGTYPE_ITEM_CHANGED,
  181. self.PROPS_CHECK,
  182. (8, AgendaWizardDialogConst.CHKMEETINGTITLE_HID,
  183. self.resources.reschkMeetingTitle_value,
  184. 97, 32, 1, 3, 301, 69), self)
  185. self.chkRead = self.insertCheckBox("chkRead",
  186. AgendaWizardDialogConst.CHKUSEREAD_ITEM_CHANGED, self.PROPS_CHECK,
  187. (8, AgendaWizardDialogConst.CHKREAD_HID,
  188. self.resources.reschkRead_value, 97, 46, 0, 3, 302, 162), self)
  189. self.chkBring = self.insertCheckBox("chkBring",
  190. AgendaWizardDialogConst.CHKUSEBRING_ITEM_CHANGED, self.PROPS_CHECK,
  191. (8, AgendaWizardDialogConst.CHKBRING_HID,
  192. self.resources.reschkBring_value,
  193. 97, 60, 0, 3, 303, 162), self)
  194. self.chkNotes = self.insertCheckBox("chkNotes",
  195. AgendaWizardDialogConst.CHKUSENOTES_ITEM_CHANGED, self.PROPS_CHECK,
  196. (8, AgendaWizardDialogConst.CHKNOTES_HID,
  197. self.resources.reschkNotes_value,
  198. 97, 74, 1, 3, 304, 160), self)
  199. self.insertImage("imgHelp3", self.PROPS_IMAGE, (0, 10,
  200. "", UIConsts.INFOIMAGEURL, 92, 145, False, 3, 305, 10))
  201. self.insertLabel("lblHelp3", self.PROPS_TEXTAREA,
  202. (39, self.resources.reslblHelp3_value, True,104, 145, 3, 306, 199))
  203. def buildStep4(self):
  204. self.insertLabel("lblTitle5", self.PROPS_LABEL_B,
  205. (self.fontDescriptor4, 16, self.resources.reslblTitle5_value,
  206. True, 91, 8, 4, 400, 212))
  207. self.chkConvenedBy = self.insertCheckBox("chkConvenedBy",
  208. AgendaWizardDialogConst.CHKUSECALLEDBYNAME_ITEM_CHANGED,
  209. self.PROPS_CHECK,
  210. (8, AgendaWizardDialogConst.CHKCONVENEDBY_HID,
  211. self.resources.reschkConvenedBy_value,
  212. 97, 32, 1, 4, 401, 150), self)
  213. self.chkPresiding = self.insertCheckBox("chkPresiding",
  214. AgendaWizardDialogConst.CHKUSEFACILITATOR_ITEM_CHANGED,
  215. self.PROPS_CHECK,
  216. (8, AgendaWizardDialogConst.CHKPRESIDING_HID,
  217. self.resources.reschkPresiding_value,
  218. 97, 46, 0, 4, 402, 150), self)
  219. self.chkNoteTaker = self.insertCheckBox("chkNoteTaker",
  220. AgendaWizardDialogConst.CHKUSENOTETAKER_ITEM_CHANGED,
  221. self.PROPS_CHECK,
  222. (8, AgendaWizardDialogConst.CHKNOTETAKER_HID,
  223. self.resources.reschkNoteTaker_value,
  224. 97, 60, 0, 4, 403, 150), self)
  225. self.chkTimekeeper = self.insertCheckBox("chkTimekeeper",
  226. AgendaWizardDialogConst.CHKUSETIMEKEEPER_ITEM_CHANGED,
  227. self.PROPS_CHECK,
  228. (8, AgendaWizardDialogConst.CHKTIMEKEEPER_HID,
  229. self.resources.reschkTimekeeper_value,
  230. 97, 74, 0, 4, 404, 150), self)
  231. self.chkAttendees = self.insertCheckBox("chkAttendees",
  232. AgendaWizardDialogConst.CHKUSEATTENDEES_ITEM_CHANGED,
  233. self.PROPS_CHECK,
  234. (8, AgendaWizardDialogConst.CHKATTENDEES_HID,
  235. self.resources.reschkAttendees_value,
  236. 97, 88, 1, 4, 405, 150), self)
  237. self.chkObservers = self.insertCheckBox("chkObservers",
  238. AgendaWizardDialogConst.CHKUSEOBSERVERS_ITEM_CHANGED,
  239. self.PROPS_CHECK,
  240. (8, AgendaWizardDialogConst.CHKOBSERVERS_HID,
  241. self.resources.reschkObservers_value,
  242. 97, 102, 0, 4, 406, 150), self)
  243. self.chkResourcePersons = self.insertCheckBox("chkResourcePersons",
  244. AgendaWizardDialogConst.CHKUSERESOURCEPERSONS_ITEM_CHANGED,
  245. self.PROPS_CHECK,
  246. (8, AgendaWizardDialogConst.CHKRESOURCEPERSONS_HID,
  247. self.resources.reschkResourcePersons_value,
  248. 97, 116, 0, 4, 407, 150), self)
  249. self.insertImage("imgHelp4", self.PROPS_IMAGE,
  250. (0, 10, "", UIConsts.INFOIMAGEURL,
  251. 92, 145, False, 4, 408, 10))
  252. self.insertLabel("lblHelp4", self.PROPS_TEXTAREA,
  253. (39, self.resources.reslblHelp4_value, True, 104, 145, 4, 409, 199))
  254. def buildStep5(self):
  255. self.insertLabel("lblTitle4", self.PROPS_LABEL_B,
  256. (self.fontDescriptor4, 16, self.resources.reslblTitle4_value,
  257. True, 91, 8, 5, 500, 212))
  258. self.insertLabel("lblTopic", self.PROPS_TEXT,
  259. (8, self.resources.reslblTopic_value, 107, 28, 5, 71, 501))
  260. self.insertLabel("lblResponsible", self.PROPS_TEXT,
  261. (8, self.resources.reslblResponsible_value, 195, 28, 5, 72, 502))
  262. self.insertLabel("lblDuration", self.PROPS_TEXT,
  263. (8, self.resources.reslblDuration_value, 267, 28, 5, 73, 503))
  264. self.btnInsert = self.insertButton("btnInsert",
  265. AgendaWizardDialogConst.BTNINSERT_ACTION_PERFORMED,
  266. self.PROPS_BUTTON, (14, AgendaWizardDialogConst.BTNINSERT_HID,
  267. self.resources.resButtonInsert, 92, 136, 5, 580, 40), self)
  268. self.btnRemove = self.insertButton("btnRemove",
  269. AgendaWizardDialogConst.BTNREMOVE_ACTION_PERFORMED,
  270. self.PROPS_BUTTON, (14, AgendaWizardDialogConst.BTNREMOVE_HID,
  271. self.resources.resButtonRemove, 134, 136, 5, 581, 40), self)
  272. self.btnUp = self.insertButton("btnUp",
  273. AgendaWizardDialogConst.BTNUP_ACTION_PERFORMED,
  274. self.PROPS_BUTTON, (14, AgendaWizardDialogConst.BTNUP_HID,
  275. self.resources.resButtonUp, 180, 136, 5, 582, 60), self)
  276. self.btnDown = self.insertButton("btnDown",
  277. AgendaWizardDialogConst.BTNDOWN_ACTION_PERFORMED,
  278. self.PROPS_BUTTON, (14, AgendaWizardDialogConst.BTNDOWN_HID,
  279. self.resources.resButtonDown, 244, 136, 5, 583, 60), self)
  280. def buildStep6(self):
  281. self.insertLabel("lblTitle6", self.PROPS_LABEL_B,
  282. (self.fontDescriptor4, 16, self.resources.reslblTitle6_value,
  283. True, 91, 8, 6, 600, 212))
  284. self.insertLabel("lblHelpPg6", self.PROPS_TEXTAREA,
  285. (24, self.resources.reslblHelpPg6_value, True,
  286. 97, 32, 6, 601,204))
  287. self.insertLabel("lblTemplateName", self.PROPS_TEXT,
  288. (8, self.resources.reslblTemplateName_value,
  289. 97, 62, 6, 602, 101))
  290. self.txtTemplateName = self.insertTextField("txtTemplateName",
  291. None, self.PROPS_X,
  292. (12, AgendaWizardDialogConst.TXTTEMPLATENAME_HID,
  293. 202, 60, 6, 603, 100), self)
  294. self.insertLabel("lblProceed", self.PROPS_TEXT,
  295. (8, self.resources.reslblProceed_value, 97, 101, 6, 607,204))
  296. self.optCreateAgenda = self.insertRadioButton("optCreateAgenda", None,
  297. self.PROPS_CHECK, (8, AgendaWizardDialogConst.OPTCREATEAGENDA_HID,
  298. self.resources.resoptCreateAgenda_value,
  299. 103, 113, 1, 6, 608, 198), self)
  300. self.optMakeChanges = self.insertRadioButton("optMakeChanges", None,
  301. self.PROPS_BUTTON, (8, AgendaWizardDialogConst.OPTMAKECHANGES_HID,
  302. self.resources.resoptMakeChanges_value,
  303. 103, 125, 6, 609, 198), self)
  304. self.insertImage("imgHelp6", self.PROPS_IMAGE, (0, 10, "",
  305. UIConsts.INFOIMAGEURL, 92, 145, False, 6, 610, 10))
  306. self.insertLabel("lblHelp6", self.PROPS_TEXTAREA,
  307. (39, self.resources.reslblHelp6_value, True, 104, 145, 6, 611, 199))