update dev300-m58
[ooovba.git] / wizards / source / formwizard / Language.xba
blob5a2dcb1c67fe9949c9779435fd1cafa0687b8e00
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
6 Global Const RID_COMMON = 1000
7 Global Const RID_FORM = 2200
9 Public Const SBCANCEL = 2
10 Public Const SBREPEAT = 4
11 Public LabelDiffHeight as Long
12 Public BasicLabelDiffHeight as Long
14 Public WizardTitle(1 To 3) as String
15 Public DlgFormDB as Object
16 Public DialogModel as Object
18 Dim sMsgWizardName as String
19 Dim sMsgErrMsg as String
20 Dim sMsgErrNoDatabase as String
21 Dim sMsgErrNoTableInDatabase as String
22 Dim sMsgErrTitleSuggestedExist as String
23 Dim sMsgErrTitleSyntaxError as String
24 Dim sMsgErrTitleAsTableExist as String
25 Dim sMsgProgressText as String
26 Dim sMsgCreatedForm as String
27 Dim sMsgErrCouldNotOpenObject as String
28 Dim sMsgErrNameToLong as String
29 Dim sTimeAppendix as String
30 Dim sDateAppendix as String
31 Public sGoOn as String
32 Public sReady as String
33 Public sMsgNoConnection as String
34 Public sWriterFilterName as String
35 Public XPixelFactor as Long
36 Public YPixelFactor as Long
37 Public sSelectDatasource as String
38 Public sSelectDBTable as String
42 Sub 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)
56 &apos; Internal Logic
57 sDateAppendix = GetResText(RID_FORM + 4)
58 sTimeAppendix = GetResText(RID_FORM + 5)
60 sReady = GetResText(RID_COMMON + 0)
61 End Sub
64 Sub SetDialogLanguage ()
65 Dim i as Integer
66 Dim ButtonHelpText as String
67 Dim CmdButton as Object
68 Dim IDArray as Variant
69 Dim FNameAddOn as String
70 Dim slblSelFields as String
71 Dim slblFields as String
73 DlgFormDB = LoadDialog(&quot;FormWizard&quot;, &quot;DlgFormDB&quot;)
74 DialogModel = DlgFormDB.Model
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)
84 slblFields = GetResText(RID_FORM + 12)
85 slblSelFields = GetResText(RID_FORM + 13)
86 .lblFields.Label = slblFields
87 .lblSelFields.Label = slblSelFields
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)
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)
98 .hlnBinaries.Label = GetResText(RID_FORM + 50)
99 .optIgnoreBinaries.Label = GetResText(RID_FORM + 51)
100 .optBinariesasGraphics.Label = GetResText(RID_FORM + 52)
102 .hlnBackground.Label = GetResText(RID_FORM + 55)
103 .optTiled.Label = GetResText(RID_FORM + 56)
104 .optArea.Label = GetResText(RID_FORM + 57)
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
111 .optAlign0.Label = GetResText(RID_FORM + 33)
112 .optAlign2.Label = GetResText(RID_FORM + 34)
113 .optAlign0.State = 1
115 FNameAddOn = &quot;&quot;
116 If isHighContrast(DlgFormDB.getPeer) Then FNameAddOn = &quot;_hc&quot;
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;))
149 sSelectDatasource = GetResText(RID_COMMON + 37)
150 sSelectDBTable = GetResText(RID_COMMON + 38)
151 End Sub
155 Sub InitializeWidthList()
157 If Ubound(WidthList(),1) &gt; 16 Then
158 ReDim WidthList(16,4)
159 End If
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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
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;
284 End Sub
285 </script:module>