tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / wizards / source / formwizard / Language.xba
blob6346f8bae97a697ac9f9f8c86608c8c75e9f555e
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 Public Const SBCANCEL = 2
24 Public Const SBREPEAT = 4
25 Public LabelDiffHeight as Long
26 Public BasicLabelDiffHeight as Long
28 Public WizardTitle(1 To 3) as String
29 Public DlgFormDB as Object
30 Public DialogModel as Object
32 Dim sMsgWizardName as String
33 Dim sMsgErrMsg as String
34 Dim sMsgErrNoDatabase as String
35 Dim sMsgErrNoTableInDatabase as String
36 Dim sMsgErrTitleSuggestedExist as String
37 Dim sMsgErrTitleSyntaxError as String
38 Dim sMsgErrTitleAsTableExist as String
39 Dim sMsgProgressText as String
40 Dim sMsgCreatedForm as String
41 Dim sMsgErrCouldNotOpenObject as String
42 Dim sMsgErrNameToLong as String
43 Dim sTimeAppendix as String
44 Dim sDateAppendix as String
45 Public sGoOn as String
46 Public sReady as String
47 Public sMsgNoConnection as String
48 Public XPixelFactor as Long
49 Public YPixelFactor as Long
50 Public sSelectDatasource as String
51 Public sSelectDBTable as String
55 Sub LoadLanguage ()
56 sMsgWizardName = GetResText(&quot;RID_FORM_0&quot;)
57 sMsgErrMsg = GetResText(&quot;RID_DB_COMMON_6&quot;)
58 sMsgErrNoDatabase = GetResText(&quot;RID_DB_COMMON_8&quot;)
59 sMsgErrNoTableInDatabase = GetResText(&quot;RID_DB_COMMON_9&quot;)
60 sMsgErrTitleSuggestedExist = GetResText(&quot;RID_DB_COMMON_10&quot;)
61 sMsgErrTitleAsTableExist = GetResText(&quot;RID_DB_COMMON_10&quot;)
62 sMsgErrTitleSyntaxError = GetResText(&quot;RID_DB_COMMON_11&quot;)
63 sMsgNoConnection = GetResText(&quot;RID_DB_COMMON_14&quot;)
64 sMsgProgressText = GetResText(&quot;RID_FORM_2&quot;)
65 sMsgCreatedForm = GetResText(&quot;RID_FORM_26&quot;)
66 sMsgErrNameToLong = GetResText(&quot;RID_FORM_27&quot;)
67 sMsgErrCouldNotOpenObject = GetResText(&quot;RID_DB_COMMON_13&quot;)
69 &apos; Internal Logic
70 sDateAppendix = GetResText(&quot;RID_FORM_4&quot;)
71 sTimeAppendix = GetResText(&quot;RID_FORM_5&quot;)
73 sReady = GetResText(&quot;RID_DB_COMMON_0&quot;)
74 End Sub
77 Sub SetDialogLanguage ()
78 Dim i as Integer
79 Dim ButtonHelpText as String
80 Dim CmdButton as Object
81 Dim IDArray as Variant
82 Dim FNameAddOn as String
83 Dim slblSelFields as String
84 Dim slblFields as String
86 DlgFormDB = LoadDialog(&quot;FormWizard&quot;, &quot;DlgFormDB&quot;)
87 DialogModel = DlgFormDB.Model
89 With DialogModel
90 .cmdCancel.Label = GetResText(&quot;RID_DB_COMMON_1&quot;)
91 .cmdBack.Label = GetResText(&quot;RID_DB_COMMON_2&quot;)
92 .cmdHelp.Label = GetResText(&quot;RID_DB_COMMON_20&quot;)
93 sGoOn = GetResText(&quot;RID_DB_COMMON_3&quot;)
94 .cmdGoOn.Label = sGoOn
95 .lblTables.Label = GetResText(&quot;RID_FORM_6&quot;)
97 slblFields = GetResText(&quot;RID_FORM_12&quot;)
98 slblSelFields = GetResText(&quot;RID_FORM_13&quot;)
99 .lblFields.Label = slblFields
100 .lblSelFields.Label = slblSelFields
102 .lblStyles.Label = GetResText(&quot;RID_FORM_21&quot;)
103 .hlnBorderLayout.Label = GetResText(&quot;RID_FORM_28&quot;)
104 .hlnAlign.Label = GetResText(&quot;RID_FORM_32&quot;)
105 .hlnArrangements.Label = GetResText(&quot;RID_FORM_35&quot;)
107 WizardTitle(1) = sMsgWizardName &amp; &quot; - &quot; &amp; GetResText(&quot;RID_FORM_45&quot;)
108 WizardTitle(2) = sMsgWizardName &amp; &quot; - &quot; &amp; GetResText(&quot;RID_FORM_46&quot;)
109 WizardTitle(3) = sMsgWizardName &amp; &quot; - &quot; &amp; GetResText(&quot;RID_FORM_47&quot;)
111 .hlnBinaries.Label = GetResText(&quot;RID_FORM_50&quot;)
112 .optIgnoreBinaries.Label = GetResText(&quot;RID_FORM_51&quot;)
113 .optBinariesasGraphics.Label = GetResText(&quot;RID_FORM_52&quot;)
115 .hlnBackground.Label = GetResText(&quot;RID_FORM_55&quot;)
116 .optTiled.Label = GetResText(&quot;RID_FORM_56&quot;)
117 .optArea.Label = GetResText(&quot;RID_FORM_57&quot;)
119 .optBorder0.Label = GetResText(&quot;RID_FORM_29&quot;)
120 .optBorder1.Label = GetResText(&quot;RID_FORM_30&quot;)
121 .optBorder2.Label = GetResText(&quot;RID_FORM_31&quot;)
122 .optBorder1.State = 1
124 .optAlign0.Label = GetResText(&quot;RID_FORM_33&quot;)
125 .optAlign2.Label = GetResText(&quot;RID_FORM_34&quot;)
126 .optAlign0.State = 1
128 REM//FIXME: Remove this unused FNameAddOn through the file
129 FNameAddOn = &quot;&quot;
131 IDArray = Array(&quot;RID_FORM_36&quot;, &quot;RID_FORM_37&quot;, &quot;RID_FORM_40&quot;, &quot;RID_FORM_38&quot;, &quot;RID_FORM_39&quot;)
132 For i = 1 To 5
133 ButtonHelpText = GetResText(IDArray(i-1))
134 cmdButton = DlgFormDB.getControl(&quot;cmdArrange&quot; &amp; i)
135 cmdButton.Model.ImageURL = FormPath &amp; &quot;Arrange_&quot; &amp; i &amp; FNameAddOn &amp; &quot;.gif&quot;
136 cmdButton.Model.HelpText = ButtonHelpText
137 cmdButton.getPeer().setProperty(&quot;AccessibleName&quot;, ButtonHelpText)
138 Next i
139 &apos; .cmdArrange1.ImageURL = FormPath &amp; &quot;Arrange_1&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
140 &apos; .cmdArrange1.HelpText = GetResText(&quot;RID_FORM_36&quot;)
141 &apos;
142 &apos; .cmdArrange2.ImageURL = FormPath &amp; &quot;Arrange_2&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
143 &apos; .cmdArrange2.HelpText = GetResText(&quot;RID_FORM_37&quot;)
144 &apos;
145 &apos; .cmdArrange3.ImageURL = FormPath &amp; &quot;Arrange_3&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
146 &apos; .cmdArrange3.HelpText = GetResText(&quot;RID_FORM_40&quot;)
147 &apos;
148 &apos; .cmdArrange4.ImageURL = FormPath &amp; &quot;Arrange_4&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
149 &apos; .cmdArrange4.HelpText = GetResText(&quot;RID_FORM_38&quot;)
150 &apos;
151 &apos; .cmdArrange5.ImageURL = FormPath &amp; &quot;Arrange_5&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
152 &apos; .cmdArrange5.HelpText = GetResText(&quot;RID_FORM_39&quot;)
153 End With
154 DlgFormDB.GetControl(&quot;cmdMoveSelected&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(&quot;RID_DB_COMMON_39&quot;))
155 DlgFormDB.GetControl(&quot;cmdRemoveSelected&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(&quot;RID_DB_COMMON_40&quot;))
156 DlgFormDB.GetControl(&quot;cmdMoveAll&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(&quot;RID_DB_COMMON_41&quot;))
157 DlgFormDB.GetControl(&quot;cmdRemoveAll&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(&quot;RID_DB_COMMON_42&quot;))
158 DlgFormDB.getControl(&quot;lstFields&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, DeleteStr(slblFields, &quot;~&quot;))
159 DlgFormDB.getControl(&quot;lstSelFields&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, DeleteStr(slblSelFields, &quot;~&quot;))
161 sSelectDatasource = GetResText(&quot;RID_DB_COMMON_37&quot;)
162 sSelectDBTable = GetResText(&quot;RID_DB_COMMON_38&quot;)
163 End Sub
167 Sub InitializeWidthList()
169 If Ubound(WidthList(),1) &gt; 16 Then
170 ReDim WidthList(16,4)
171 End If
173 WidthList(0,0) = com.sun.star.sdbc.DataType.BIT &apos; = -7;
174 WidthList(0,1) = cCheckbox
175 WidthList(0,2) = False
176 WidthList(0,3) = &quot;CheckBox&quot;
178 WidthList(1,0) = com.sun.star.sdbc.DataType.TINYINT &apos; = -6;
179 WidthList(1,1) = cNumericBox
180 WidthList(1,2) = False
181 WidthList(1,3) = &quot;FormattedField&quot;
183 WidthList(2,0) = com.sun.star.sdbc.DataType.SMALLINT &apos; = 5;
184 WidthList(2,1) = cNumericBox
185 WidthList(2,2) = False
186 WidthList(2,3) = &quot;FormattedField&quot;
188 WidthList(3,0) = com.sun.star.sdbc.DataType.INTEGER &apos; = 4;
189 WidthList(3,1) = cNumericBox
190 WidthList(3,2) = False
191 WidthList(3,3) = &quot;FormattedField&quot;
193 WidthList(4,0) = com.sun.star.sdbc.DataType.BIGINT &apos; = -5;
194 WidthList(4,1) = cNumericBox
195 WidthList(4,2) = False
196 WidthList(4,3) = &quot;FormattedField&quot;
198 WidthList(5,0) = com.sun.star.sdbc.DataType.FLOAT &apos; = 6;
199 WidthList(5,1) = cNumericBox
200 WidthList(5,2) = False
201 WidthList(5,3) = &quot;FormattedField&quot;
203 WidthList(6,0) = com.sun.star.sdbc.DataType.REAL &apos; = 7;
204 WidthList(6,1) = cNumericBox
205 WidthList(6,2) = False
206 WidthList(6,3) = &quot;FormattedField&quot;
208 WidthList(7,0) = com.sun.star.sdbc.DataType.DOUBLE &apos; = 8;
209 WidthList(7,1) = cNumericBox
210 WidthList(7,2) = False
211 WidthList(7,3) = &quot;FormattedField&quot;
213 WidthList(8,0) = com.sun.star.sdbc.DataType.NUMERIC &apos; = 2;
214 WidthList(8,1) = cNumericBox
215 WidthList(8,2) = False
216 WidthList(8,3) = &quot;FormattedField&quot;
218 WidthList(9,0) = com.sun.star.sdbc.DataType.DECIMAL &apos; = 3; (including decimal places)
219 WidthList(9,1) = cNumericBox
220 WidthList(9,2) = False
221 WidthList(9,3) = &quot;FormattedField&quot;
223 WidthList(10,0) = com.sun.star.sdbc.DataType.CHAR &apos; = 1;
224 WidthList(10,1) = cTextBox
225 WidthList(10,2) = False
226 WidthList(10,3) = &quot;TextField&quot;
228 WidthList(11,0) = com.sun.star.sdbc.DataType.VARCHAR &apos; = 12;
229 WidthList(11,1) = cTextBox
230 WidthList(11,2) = True
231 WidthList(11,3) = &quot;TextField&quot;
233 WidthList(12,0) = com.sun.star.sdbc.DataType.LONGVARCHAR &apos; = -1;
234 WidthList(12,1) = cTextBox
235 WidthList(12,2) = True
236 WidthList(12,3) = &quot;TextField&quot;
238 WidthList(13,0) = com.sun.star.sdbc.DataType.DATE &apos; = 91;
239 WidthList(13,1) = cDateBox
240 WidthList(13,2) = False
241 WidthList(13,3) = &quot;DateField&quot;
243 WidthList(14,0) = com.sun.star.sdbc.DataType.TIME &apos; = 92;
244 WidthList(14,1) = cTimeBox
245 WidthList(14,2) = False
246 WidthList(14,3) = &quot;TimeField&quot;
248 WidthList(15,0) = com.sun.star.sdbc.DataType.TIMESTAMP &apos; = 93;
249 WidthList(15,1) = cDateBox
250 WidthList(15,2) = False
251 WidthList(15,3) = &quot;DateField&quot;
253 WidthList(16,0) = com.sun.star.sdbc.DataType.BOOLEAN &apos; = 16;
254 WidthList(16,1) = cCheckbox
255 WidthList(16,2) = False
256 WidthList(16,3) = &quot;CheckBox&quot;
258 ImgWidthList(0,0) = com.sun.star.sdbc.DataType.BINARY &apos; = -2;
259 ImgWidthList(0,1) = cImageControl
260 ImgWidthList(0,2) = False
261 ImgWidthList(0,3) = &quot;ImageControl&quot;
263 ImgWidthList(1,0) = com.sun.star.sdbc.DataType.VARBINARY &apos; = -3;
264 ImgWidthList(1,1) = cImageControl
265 ImgWidthList(1,2) = False
266 ImgWidthList(1,3) = &quot;ImageControl&quot;
268 ImgWidthList(2,0) = com.sun.star.sdbc.DataType.LONGVARBINARY &apos; = -4;
269 ImgWidthList(2,1) = cImageControl
270 ImgWidthList(2,2) = False
271 ImgWidthList(2,3) = &quot;ImageControl&quot;
273 ImgWidthList(3,0) = com.sun.star.sdbc.DataType.BLOB &apos; = 2004;
274 ImgWidthList(3,1) = cImageControl
275 ImgWidthList(3,2) = False
276 ImgWidthList(3,3) = &quot;ImageControl&quot;
278 &apos; Note: the following Fieldtypes are ignored
279 &apos;ExcludeList(0) = com.sun.star.sdbc.DataType.SQLNULL
280 &apos;ExcludeList(1) = com.sun.star.sdbc.DataType.OTHER
281 &apos;ExcludeList(2) = com.sun.star.sdbc.DataType.OBJECT
282 &apos;ExcludeList(3) = com.sun.star.sdbc.DataType.DISTINCT
283 &apos;ExcludeList(4) = com.sun.star.sdbc.DataType.STRUCT
284 &apos;ExcludeList(5) = com.sun.star.sdbc.DataType.ARRAY
285 &apos;ExcludeList(6) = com.sun.star.sdbc.DataType.CLOB
286 &apos;ExcludeList(7) = com.sun.star.sdbc.DataType.REF
288 oModelService(cLabel) = &quot;com.sun.star.form.component.FixedText&quot;
289 oModelService(cTextBox) = &quot;com.sun.star.form.component.TextField&quot;
290 oModelService(cCheckBox) = &quot;com.sun.star.form.component.CheckBox&quot;
291 oModelService(cDateBox) = &quot;com.sun.star.form.component.DateField&quot;
292 oModelService(cTimeBox) = &quot;com.sun.star.form.component.TimeField&quot;
293 oModelService(cNumericBox) = &quot;com.sun.star.form.component.FormattedField&quot;
294 oModelService(cGridControl) = &quot;com.sun.star.form.component.GridControl&quot;
295 oModelService(cImageControl) = &quot;com.sun.star.form.component.DatabaseImageControl&quot;
296 End Sub
297 </script:module>