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