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