bump product version to 5.0.4.1
[LibreOffice.git] / wizards / source / formwizard / Language.xba
blob40a0e5893ac0ebf4811a5aa75bdb099ba161ca44
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3 <!--
4 * This file is part of the LibreOffice project.
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 * This file incorporates work covered by the following license notice:
12 * Licensed to the Apache Software Foundation (ASF) under one or more
13 * contributor license agreements. See the NOTICE file distributed
14 * with this work for additional information regarding copyright
15 * ownership. The ASF licenses this file to you under the Apache
16 * License, Version 2.0 (the "License"); you may not use this file
17 * except in compliance with the License. You may obtain a copy of
18 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 -->
20 <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Language" script:language="StarBasic">Option Explicit
23 Global Const RID_COMMON = 1000
24 Global Const RID_FORM = 2200
26 Public Const SBCANCEL = 2
27 Public Const SBREPEAT = 4
28 Public LabelDiffHeight as Long
29 Public BasicLabelDiffHeight as Long
31 Public WizardTitle(1 To 3) as String
32 Public DlgFormDB as Object
33 Public DialogModel as Object
35 Dim sMsgWizardName as String
36 Dim sMsgErrMsg as String
37 Dim sMsgErrNoDatabase as String
38 Dim sMsgErrNoTableInDatabase as String
39 Dim sMsgErrTitleSuggestedExist as String
40 Dim sMsgErrTitleSyntaxError as String
41 Dim sMsgErrTitleAsTableExist as String
42 Dim sMsgProgressText as String
43 Dim sMsgCreatedForm as String
44 Dim sMsgErrCouldNotOpenObject as String
45 Dim sMsgErrNameToLong as String
46 Dim sTimeAppendix as String
47 Dim sDateAppendix as String
48 Public sGoOn as String
49 Public sReady as String
50 Public sMsgNoConnection as String
51 Public sWriterFilterName as String
52 Public XPixelFactor as Long
53 Public YPixelFactor as Long
54 Public sSelectDatasource as String
55 Public sSelectDBTable as String
59 Sub LoadLanguage ()
60 sMsgWizardName = GetResText(RID_FORM + 0)
61 sMsgErrMsg = GetResText(RID_COMMON + 6)
62 sMsgErrNoDatabase = GetResText(RID_COMMON + 8)
63 sMsgErrNoTableInDatabase = GetResText(RID_COMMON + 9)
64 sMsgErrTitleSuggestedExist = GetResText(RID_COMMON + 10)
65 sMsgErrTitleAsTableExist = GetResText(RID_COMMON + 10)
66 sMsgErrTitleSyntaxError = GetResText(RID_COMMON + 11)
67 sMsgNoConnection = GetResText(RID_COMMON + 14
68 sMsgProgressText = GetResText(RID_FORM + 2)
69 sMsgCreatedForm = GetResText(RID_FORM + 26)
70 sMsgErrNameToLong = GetResText (RID_FORM + 27)
71 sMsgErrCouldNotOpenObject = GetResText (RID_COMMON + 13)
73 &apos; Internal Logic
74 sDateAppendix = GetResText(RID_FORM + 4)
75 sTimeAppendix = GetResText(RID_FORM + 5)
77 sReady = GetResText(RID_COMMON + 0)
78 End Sub
81 Sub SetDialogLanguage ()
82 Dim i as Integer
83 Dim ButtonHelpText as String
84 Dim CmdButton as Object
85 Dim IDArray as Variant
86 Dim FNameAddOn as String
87 Dim slblSelFields as String
88 Dim slblFields as String
90 DlgFormDB = LoadDialog(&quot;FormWizard&quot;, &quot;DlgFormDB&quot;)
91 DialogModel = DlgFormDB.Model
93 With DialogModel
94 .cmdCancel.Label = GetResText(RID_COMMON + 1)
95 .cmdBack.Label = GetResText(RID_COMMON + 2)
96 .cmdHelp.Label = GetResText(RID_COMMON + 20)
97 sGoOn = GetResText(RID_COMMON + 3)
98 .cmdGoOn.Label = sGoOn
99 .lblTables.Label = GetResText(RID_FORM + 6)
101 slblFields = GetResText(RID_FORM + 12)
102 slblSelFields = GetResText(RID_FORM + 13)
103 .lblFields.Label = slblFields
104 .lblSelFields.Label = slblSelFields
106 .lblStyles.Label = GetResText(RID_FORM + 21)
107 .hlnBorderLayout.Label = GetResText(RID_FORM + 28)
108 .hlnAlign.Label = GetResText(RID_FORM + 32)
109 .hlnArrangements.Label = GetResText(RID_FORM + 35)
111 WizardTitle(1) = sMsgWizardName &amp; &quot; - &quot; &amp; GetResText(RID_FORM + 45)
112 WizardTitle(2) = sMsgWizardName &amp; &quot; - &quot; &amp; GetResText(RID_FORM + 46)
113 WizardTitle(3) = sMsgWizardName &amp; &quot; - &quot; &amp; GetResText(RID_FORM + 47)
115 .hlnBinaries.Label = GetResText(RID_FORM + 50)
116 .optIgnoreBinaries.Label = GetResText(RID_FORM + 51)
117 .optBinariesasGraphics.Label = GetResText(RID_FORM + 52)
119 .hlnBackground.Label = GetResText(RID_FORM + 55)
120 .optTiled.Label = GetResText(RID_FORM + 56)
121 .optArea.Label = GetResText(RID_FORM + 57)
123 .optBorder0.Label = GetResText(RID_FORM + 29)
124 .optBorder1.Label = GetResText(RID_FORM + 30)
125 .optBorder2.Label = GetResText(RID_FORM + 31)
126 .optBorder1.State = 1
128 .optAlign0.Label = GetResText(RID_FORM + 33)
129 .optAlign2.Label = GetResText(RID_FORM + 34)
130 .optAlign0.State = 1
132 //FIXME: Remove this unused FNameAddOn through the file
133 FNameAddOn = &quot;&quot;
135 IDArray = Array(36, 37, 40, 38, 39)
136 For i = 1 To 5
137 ButtonHelpText = GetResText(RID_FORM + IDArray(i-1)
138 cmdButton = DlgFormDB.getControl(&quot;cmdArrange&quot; &amp; i)
139 cmdButton.Model.ImageURL = FormPath &amp; &quot;Arrange_&quot; &amp; i &amp; FNameAddOn &amp; &quot;.gif&quot;
140 cmdButton.Model.HelpText = ButtonHelpText
141 cmdButton.getPeer().setProperty(&quot;AccessibleName&quot;, ButtonHelpText)
142 Next i
143 &apos; .cmdArrange1.ImageURL = FormPath &amp; &quot;Arrange_1&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
144 &apos; .cmdArrange1.HelpText = GetResText(RID_FORM + 36)
145 &apos;
146 &apos; .cmdArrange2.ImageURL = FormPath &amp; &quot;Arrange_2&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
147 &apos; .cmdArrange2.HelpText = GetResText(RID_FORM + 37)
148 &apos;
149 &apos; .cmdArrange3.ImageURL = FormPath &amp; &quot;Arrange_3&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
150 &apos; .cmdArrange3.HelpText = GetResText(RID_FORM + 40)
151 &apos;
152 &apos; .cmdArrange4.ImageURL = FormPath &amp; &quot;Arrange_4&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
153 &apos; .cmdArrange4.HelpText = GetResText(RID_FORM + 38)
154 &apos;
155 &apos; .cmdArrange5.ImageURL = FormPath &amp; &quot;Arrange_5&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
156 &apos; .cmdArrange5.HelpText = GetResText(RID_FORM + 39)
157 sWriterFilterName = GetResText(RID_FORM + 70)
158 End With
159 DlgFormDB.GetControl(&quot;cmdMoveSelected&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(RID_COMMON + 39)
160 DlgFormDB.GetControl(&quot;cmdRemoveSelected&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(RID_COMMON + 40)
161 DlgFormDB.GetControl(&quot;cmdMoveAll&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(RID_COMMON + 41)
162 DlgFormDB.GetControl(&quot;cmdRemoveAll&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(RID_COMMON + 42)
163 DlgFormDB.getControl(&quot;lstFields&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, DeleteStr(slblFields, &quot;~&quot;))
164 DlgFormDB.getControl(&quot;lstSelFields&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, DeleteStr(slblSelFields, &quot;~&quot;))
166 sSelectDatasource = GetResText(RID_COMMON + 37)
167 sSelectDBTable = GetResText(RID_COMMON + 38)
168 End Sub
172 Sub InitializeWidthList()
174 If Ubound(WidthList(),1) &gt; 16 Then
175 ReDim WidthList(16,4)
176 End If
178 WidthList(0,0) = com.sun.star.sdbc.DataType.BIT &apos; = -7;
179 WidthList(0,1) = cCheckbox
180 WidthList(0,2) = False
181 WidthList(0,3) = &quot;CheckBox&quot;
183 WidthList(1,0) = com.sun.star.sdbc.DataType.TINYINT &apos; = -6;
184 WidthList(1,1) = cNumericBox
185 WidthList(1,2) = False
186 WidthList(1,3) = &quot;FormattedField&quot;
188 WidthList(2,0) = com.sun.star.sdbc.DataType.SMALLINT &apos; = 5;
189 WidthList(2,1) = cNumericBox
190 WidthList(2,2) = False
191 WidthList(2,3) = &quot;FormattedField&quot;
193 WidthList(3,0) = com.sun.star.sdbc.DataType.INTEGER &apos; = 4;
194 WidthList(3,1) = cNumericBox
195 WidthList(3,2) = False
196 WidthList(3,3) = &quot;FormattedField&quot;
198 WidthList(4,0) = com.sun.star.sdbc.DataType.BIGINT &apos; = -5;
199 WidthList(4,1) = cNumericBox
200 WidthList(4,2) = False
201 WidthList(4,3) = &quot;FormattedField&quot;
203 WidthList(5,0) = com.sun.star.sdbc.DataType.FLOAT &apos; = 6;
204 WidthList(5,1) = cNumericBox
205 WidthList(5,2) = False
206 WidthList(5,3) = &quot;FormattedField&quot;
208 WidthList(6,0) = com.sun.star.sdbc.DataType.REAL &apos; = 7;
209 WidthList(6,1) = cNumericBox
210 WidthList(6,2) = False
211 WidthList(6,3) = &quot;FormattedField&quot;
213 WidthList(7,0) = com.sun.star.sdbc.DataType.DOUBLE &apos; = 8;
214 WidthList(7,1) = cNumericBox
215 WidthList(7,2) = False
216 WidthList(7,3) = &quot;FormattedField&quot;
218 WidthList(8,0) = com.sun.star.sdbc.DataType.NUMERIC &apos; = 2;
219 WidthList(8,1) = cNumericBox
220 WidthList(8,2) = False
221 WidthList(8,3) = &quot;FormattedField&quot;
223 WidthList(9,0) = com.sun.star.sdbc.DataType.DECIMAL &apos; = 3; (including decimal places)
224 WidthList(9,1) = cNumericBox
225 WidthList(9,2) = False
226 WidthList(9,3) = &quot;FormattedField&quot;
228 WidthList(10,0) = com.sun.star.sdbc.DataType.CHAR &apos; = 1;
229 WidthList(10,1) = cTextBox
230 WidthList(10,2) = False
231 WidthList(10,3) = &quot;TextField&quot;
233 WidthList(11,0) = com.sun.star.sdbc.DataType.VARCHAR &apos; = 12;
234 WidthList(11,1) = cTextBox
235 WidthList(11,2) = True
236 WidthList(11,3) = &quot;TextField&quot;
238 WidthList(12,0) = com.sun.star.sdbc.DataType.LONGVARCHAR &apos; = -1;
239 WidthList(12,1) = cTextBox
240 WidthList(12,2) = True
241 WidthList(12,3) = &quot;TextField&quot;
243 WidthList(13,0) = com.sun.star.sdbc.DataType.DATE &apos; = 91;
244 WidthList(13,1) = cDateBox
245 WidthList(13,2) = False
246 WidthList(13,3) = &quot;DateField&quot;
248 WidthList(14,0) = com.sun.star.sdbc.DataType.TIME &apos; = 92;
249 WidthList(14,1) = cTimeBox
250 WidthList(14,2) = False
251 WidthList(14,3) = &quot;TimeField&quot;
253 WidthList(15,0) = com.sun.star.sdbc.DataType.TIMESTAMP &apos; = 93;
254 WidthList(15,1) = cDateBox
255 WidthList(15,2) = False
256 WidthList(15,3) = &quot;DateField&quot;
258 WidthList(16,0) = com.sun.star.sdbc.DataType.BOOLEAN &apos; = 16;
259 WidthList(16,1) = cCheckbox
260 WidthList(16,2) = False
261 WidthList(16,3) = &quot;CheckBox&quot;
263 ImgWidthList(0,0) = com.sun.star.sdbc.DataType.BINARY &apos; = -2;
264 ImgWidthList(0,1) = cImageControl
265 ImgWidthList(0,2) = False
266 ImgWidthList(0,3) = &quot;ImageControl&quot;
268 ImgWidthList(1,0) = com.sun.star.sdbc.DataType.VARBINARY &apos; = -3;
269 ImgWidthList(1,1) = cImageControl
270 ImgWidthList(1,2) = False
271 ImgWidthList(1,3) = &quot;ImageControl&quot;
273 ImgWidthList(2,0) = com.sun.star.sdbc.DataType.LONGVARBINARY &apos; = -4;
274 ImgWidthList(2,1) = cImageControl
275 ImgWidthList(2,2) = False
276 ImgWidthList(2,3) = &quot;ImageControl&quot;
278 ImgWidthList(3,0) = com.sun.star.sdbc.DataType.BLOB &apos; = 2004;
279 ImgWidthList(3,1) = cImageControl
280 ImgWidthList(3,2) = False
281 ImgWidthList(3,3) = &quot;ImageControl&quot;
283 &apos; Note: the following Fieldtypes are ignored
284 &apos;ExcludeList(0) = com.sun.star.sdbc.DataType.SQLNULL
285 &apos;ExcludeList(1) = com.sun.star.sdbc.DataType.OTHER
286 &apos;ExcludeList(2) = com.sun.star.sdbc.DataType.OBJECT
287 &apos;ExcludeList(3) = com.sun.star.sdbc.DataType.DISTINCT
288 &apos;ExcludeList(4) = com.sun.star.sdbc.DataType.STRUCT
289 &apos;ExcludeList(5) = com.sun.star.sdbc.DataType.ARRAY
290 &apos;ExcludeList(6) = com.sun.star.sdbc.DataType.CLOB
291 &apos;ExcludeList(7) = com.sun.star.sdbc.DataType.REF
293 oModelService(cLabel) = &quot;com.sun.star.form.component.FixedText&quot;
294 oModelService(cTextBox) = &quot;com.sun.star.form.component.TextField&quot;
295 oModelService(cCheckBox) = &quot;com.sun.star.form.component.CheckBox&quot;
296 oModelService(cDateBox) = &quot;com.sun.star.form.component.DateField&quot;
297 oModelService(cTimeBox) = &quot;com.sun.star.form.component.TimeField&quot;
298 oModelService(cNumericBox) = &quot;com.sun.star.form.component.FormattedField&quot;
299 oModelService(cGridControl) = &quot;com.sun.star.form.component.GridControl&quot;
300 oModelService(cImageControl) = &quot;com.sun.star.form.component.DatabaseImageControl&quot;
301 End Sub
302 </script:module>