ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/lookupcombobox/Unit1.lfm
Revision: 23
Committed: Fri Mar 13 10:26:52 2015 UTC (9 years ago) by tony
File size: 16171 byte(s)
Log Message:
Committing updates for Release R1-2-1

File Contents

# Content
1 object Form1: TForm1
2 Left = 711
3 Height = 329
4 Top = 256
5 Width = 658
6 Caption = 'IBLookup Combo Box Demo'
7 ClientHeight = 329
8 ClientWidth = 658
9 OnClose = FormClose
10 OnShow = FormShow
11 LCLVersion = '1.4.0.2'
12 object Label1: TLabel
13 Left = 16
14 Height = 15
15 Top = 16
16 Width = 98
17 Caption = 'Employee Name'
18 ParentColor = False
19 end
20 object IBLookupComboEditBox1: TIBLookupComboEditBox
21 Left = 16
22 Height = 27
23 Top = 32
24 Width = 224
25 KeyField = 'EMP_NO'
26 ListField = 'FULL_NAME'
27 ListFieldIndex = 0
28 ListSource = EmployeeSource
29 LookupCache = False
30 ScrollListDataset = True
31 TabOrder = 0
32 AutoInsert = True
33 AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactRetainPrefixCase, cbactSearchAscending]
34 ItemHeight = 0
35 KeyPressInterval = 600
36 OnCanAutoInsert = IBLookupComboEditBox1CanAutoInsert
37 end
38 object Label2: TLabel
39 Left = 16
40 Height = 15
41 Top = 79
42 Width = 103
43 Caption = 'Employee Details'
44 ParentColor = False
45 end
46 object Panel1: TPanel
47 Left = 19
48 Height = 185
49 Top = 97
50 Width = 623
51 Anchors = [akTop, akLeft, akRight, akBottom]
52 BevelInner = bvLowered
53 BevelOuter = bvLowered
54 ClientHeight = 185
55 ClientWidth = 623
56 TabOrder = 1
57 object Label3: TLabel
58 Left = 14
59 Height = 15
60 Top = 18
61 Width = 64
62 Caption = 'First Name'
63 ParentColor = False
64 end
65 object DBEdit1: TDBEdit
66 Left = 14
67 Height = 25
68 Top = 32
69 Width = 136
70 DataField = 'FIRST_NAME'
71 DataSource = EmployeeSource
72 CharCase = ecNormal
73 MaxLength = 0
74 TabOrder = 0
75 end
76 object Label4: TLabel
77 Left = 168
78 Height = 15
79 Top = 18
80 Width = 64
81 Caption = 'Last Name'
82 ParentColor = False
83 end
84 object DBEdit2: TDBEdit
85 Left = 168
86 Height = 25
87 Top = 32
88 Width = 144
89 DataField = 'LAST_NAME'
90 DataSource = EmployeeSource
91 CharCase = ecNormal
92 MaxLength = 0
93 TabOrder = 1
94 end
95 object Label5: TLabel
96 Left = 547
97 Height = 15
98 Top = 120
99 Width = 24
100 Anchors = [akTop, akRight]
101 Caption = 'Ext.'
102 ParentColor = False
103 end
104 object DBEdit3: TDBEdit
105 Left = 547
106 Height = 25
107 Top = 136
108 Width = 48
109 DataField = 'PHONE_EXT'
110 DataSource = EmployeeSource
111 Anchors = [akTop, akRight]
112 CharCase = ecNormal
113 MaxLength = 0
114 TabOrder = 4
115 end
116 object Label6: TLabel
117 Left = 16
118 Height = 15
119 Top = 65
120 Width = 56
121 Caption = 'Hire Date'
122 ParentColor = False
123 end
124 object Label7: TLabel
125 Left = 172
126 Height = 15
127 Top = 65
128 Width = 37
129 Caption = 'Salary'
130 ParentColor = False
131 end
132 object DBEdit4: TDBEdit
133 Left = 168
134 Height = 25
135 Top = 80
136 Width = 144
137 DataField = 'SALARY'
138 DataSource = EmployeeSource
139 CharCase = ecNormal
140 MaxLength = 0
141 TabOrder = 5
142 end
143 object Label8: TLabel
144 Left = 392
145 Height = 15
146 Top = 16
147 Width = 51
148 Caption = 'Location'
149 ParentColor = False
150 end
151 object Label9: TLabel
152 Left = 331
153 Height = 15
154 Top = 16
155 Width = 36
156 Caption = 'Grade'
157 ParentColor = False
158 end
159 object DBComboBox1: TDBComboBox
160 Left = 331
161 Height = 29
162 Top = 32
163 Width = 53
164 DataField = 'JOB_GRADE'
165 DataSource = EmployeeSource
166 ItemHeight = 0
167 Items.Strings = (
168 '1'
169 '2'
170 '3'
171 '4'
172 '5'
173 )
174 MaxLength = 0
175 OnCloseUp = DBComboBox1CloseUp
176 Style = csDropDownList
177 TabOrder = 2
178 end
179 object Label10: TLabel
180 Left = 333
181 Height = 15
182 Top = 65
183 Width = 48
184 Caption = 'Job Title'
185 ParentColor = False
186 end
187 object Label11: TLabel
188 Left = 17
189 Height = 15
190 Top = 122
191 Width = 73
192 Caption = 'Department'
193 ParentColor = False
194 end
195 object IBDateEdit1: TDBDateEdit
196 Left = 17
197 Height = 25
198 Top = 82
199 Width = 112
200 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames]
201 OKCaption = 'OK'
202 CancelCaption = 'Cancel'
203 DateOrder = doNone
204 ButtonWidth = 23
205 NumGlyphs = 1
206 MaxLength = 0
207 TabOrder = 3
208 DataField = 'HIRE_DATE'
209 DataSource = EmployeeSource
210 end
211 object DBEdit5: TDBEdit
212 Left = 17
213 Height = 25
214 Top = 136
215 Width = 495
216 DataField = 'DEPT_PATH'
217 DataSource = EmployeeSource
218 ReadOnly = True
219 Anchors = [akTop, akLeft, akRight]
220 CharCase = ecNormal
221 MaxLength = 0
222 TabOrder = 6
223 end
224 object SpeedButton1: TSpeedButton
225 Left = 516
226 Height = 25
227 Top = 136
228 Width = 25
229 Anchors = [akTop, akRight]
230 Caption = '...'
231 OnClick = SpeedButton1Click
232 end
233 object IBLookupComboEditBox2: TIBLookupComboEditBox
234 Left = 392
235 Height = 25
236 Top = 32
237 Width = 203
238 Anchors = [akTop, akLeft, akRight]
239 AutoSize = False
240 DataField = 'JOB_COUNTRY'
241 DataSource = EmployeeSource
242 KeyField = 'COUNTRY'
243 ListField = 'COUNTRY'
244 ListFieldIndex = 0
245 ListSource = CountriesSource
246 LookupCache = False
247 Style = csDropDownList
248 TabOrder = 7
249 AutoInsert = False
250 AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchAscending]
251 ItemHeight = 0
252 end
253 object IBLookupComboEditBox3: TIBLookupComboEditBox
254 Left = 331
255 Height = 29
256 Top = 82
257 Width = 264
258 Anchors = [akTop, akLeft, akRight]
259 DataField = 'JOB_CODE'
260 DataSource = EmployeeSource
261 KeyField = 'JOB_CODE'
262 ListField = 'JOB_TITLE'
263 ListFieldIndex = 0
264 ListSource = JobCodeSource
265 LookupCache = False
266 Style = csDropDownList
267 TabOrder = 8
268 AutoInsert = False
269 AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchAscending]
270 ItemHeight = 0
271 end
272 end
273 object CancelBtn: TButton
274 Left = 567
275 Height = 25
276 Top = 293
277 Width = 75
278 Anchors = [akRight, akBottom]
279 Caption = 'Cancel'
280 OnClick = CancelBtnClick
281 TabOrder = 2
282 end
283 object SaveBtn: TButton
284 Left = 481
285 Height = 25
286 Top = 293
287 Width = 75
288 Anchors = [akRight, akBottom]
289 Caption = 'Save'
290 OnClick = SaveBtnClick
291 TabOrder = 3
292 end
293 object DeleteBtn: TButton
294 Left = 18
295 Height = 25
296 Top = 294
297 Width = 75
298 Anchors = [akLeft, akBottom]
299 Caption = 'Delete'
300 OnClick = DeleteBtnClick
301 TabOrder = 4
302 end
303 object IBDatabase1: TIBDatabase
304 Connected = False
305 AllowStreamedConnected = False
306 DatabaseName = 'employee'
307 Params.Strings = (
308 'lc_ctype=UTF-8'
309 'user_name=SYSDBA'
310 )
311 DefaultTransaction = IBTransaction1
312 IdleTimer = 0
313 TraceFlags = []
314 left = 328
315 top = 24
316 end
317 object IBTransaction1: TIBTransaction
318 Active = False
319 DefaultDatabase = IBDatabase1
320 left = 296
321 top = 24
322 end
323 object Employees: TIBDataSet
324 Database = IBDatabase1
325 Transaction = IBTransaction1
326 AfterDelete = EmployeesAfterDelete
327 AfterEdit = EmployeesAfterDelete
328 AfterInsert = EmployeesAfterInsert
329 AfterPost = EmployeesAfterPost
330 BeforeClose = EmployeesBeforeScroll
331 BeforeScroll = EmployeesBeforeScroll
332 BufferChunks = 1000
333 CachedUpdates = False
334 DeleteSQL.Strings = (
335 'Execute Procedure DELETE_EMPLOYEE :EMP_NO'
336 )
337 InsertSQL.Strings = (
338 'Insert Into EMPLOYEE(EMP_NO, FIRST_NAME, LAST_NAME, PHONE_EXT, HIRE_DATE, DEPT_NO, JOB_CODE, JOB_GRADE, JOB_COUNTRY, SALARY)'
339 'Values(:EMP_NO, :FIRST_NAME, :LAST_NAME, :PHONE_EXT, :HIRE_DATE, :DEPT_NO, :JOB_CODE, :JOB_GRADE, :JOB_COUNTRY, :SALARY)'
340 )
341 RefreshSQL.Strings = (
342 'with recursive Depts As ('
343 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, cast(DEPARTMENT as VarChar(256)) as DEPT_PATH,'
344 'cast(DEPT_NO as VarChar(64)) as DEPT_KEY_PATH'
345 'From DEPARTMENT Where HEAD_DEPT is NULL '
346 'UNION ALL'
347 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, Depts.DEPT_PATH || '' / '' || DEPARTMENT as DEPT_PATH,'
348 'Depts.DEPT_KEY_PATH || '';'' || DEPT_NO as DEPT_KEY_PATH'
349 'From DEPARTMENT '
350 'JOIN Depts On HEAD_DEPT = Depts.DEPT_NO'
351 ')'
352 ''
353 'Select A.EMP_NO, A.FIRST_NAME, A.LAST_NAME, A.PHONE_EXT, A.HIRE_DATE, A.DEPT_NO, A.JOB_CODE, '
354 'A.JOB_GRADE, A.JOB_COUNTRY, A.SALARY, A.FULL_NAME, D.DEPT_PATH, D.DEPT_KEY_PATH'
355 'From EMPLOYEE A'
356 'JOIN Depts D On D.DEPT_NO = A.DEPT_NO'
357 'Where A.EMP_NO = :EMP_NO'
358 )
359 SelectSQL.Strings = (
360 'with recursive Depts As ('
361 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, cast(DEPARTMENT as VarChar(256)) as DEPT_PATH,'
362 'cast(DEPT_NO as VarChar(64)) as DEPT_KEY_PATH'
363 'From DEPARTMENT Where HEAD_DEPT is NULL '
364 'UNION ALL'
365 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, Depts.DEPT_PATH || '' / '' || DEPARTMENT as DEPT_PATH,'
366 'Depts.DEPT_KEY_PATH || '';'' || DEPT_NO as DEPT_KEY_PATH'
367 'From DEPARTMENT '
368 'JOIN Depts On HEAD_DEPT = Depts.DEPT_NO'
369 ')'
370 ''
371 'Select A.EMP_NO, A.FIRST_NAME, A.LAST_NAME, A.PHONE_EXT, A.HIRE_DATE, A.DEPT_NO, A.JOB_CODE, '
372 'A.JOB_GRADE, A.JOB_COUNTRY, A.SALARY, A.FULL_NAME, D.DEPT_PATH, D.DEPT_KEY_PATH'
373 'From EMPLOYEE A'
374 'JOIN Depts D On D.DEPT_NO = A.DEPT_NO'
375 )
376 ModifySQL.Strings = (
377 'Update EMPLOYEE A Set '#13#10' A.EMP_NO = :EMP_NO,'#13#10' A.FIRST_NAME = :FIRST_NAME,'#13#10' A.LAST_NAME = :LAST_NAME,'#13#10' A.PHONE_EXT = :PHONE_EXT,'#13#10' A.HIRE_DATE = :HIRE_DATE,'#13#10' A.DEPT_NO = :DEPT_NO,'#13#10' A.JOB_CODE = :JOB_CODE,'#13#10' A.JOB_GRADE = :JOB_GRADE,'#13#10' A.JOB_COUNTRY = :JOB_COUNTRY,'#13#10' A.SALARY = :SALARY'
378 'Where A.EMP_NO = :OLD_EMP_NO'
379 )
380 GeneratorField.Generator = 'EMP_NO_GEN'
381 GeneratorField.Field = 'EMP_NO'
382 GeneratorField.ApplyOnEvent = gaeOnNewRecord
383 GenerateParamNames = False
384 AfterTransactionEnd = EmployeesAfterTransactionEnd
385 left = 496
386 top = 16
387 object EmployeesEMP_NO: TSmallintField
388 DisplayWidth = 10
389 FieldKind = fkData
390 FieldName = 'EMP_NO'
391 Index = 0
392 LookupCache = False
393 ProviderFlags = [pfInUpdate, pfInWhere]
394 ReadOnly = False
395 Required = True
396 end
397 object EmployeesFIRST_NAME: TIBStringField
398 DisplayWidth = 15
399 FieldKind = fkData
400 FieldName = 'FIRST_NAME'
401 Index = 1
402 LookupCache = False
403 ProviderFlags = [pfInUpdate, pfInWhere]
404 ReadOnly = False
405 Required = True
406 Size = 15
407 end
408 object EmployeesLAST_NAME: TIBStringField
409 DisplayWidth = 20
410 FieldKind = fkData
411 FieldName = 'LAST_NAME'
412 Index = 2
413 LookupCache = False
414 ProviderFlags = [pfInUpdate, pfInWhere]
415 ReadOnly = False
416 Required = True
417 end
418 object EmployeesPHONE_EXT: TIBStringField
419 Alignment = taRightJustify
420 DisplayWidth = 4
421 FieldKind = fkData
422 FieldName = 'PHONE_EXT'
423 Index = 3
424 LookupCache = False
425 ProviderFlags = [pfInUpdate, pfInWhere]
426 ReadOnly = False
427 Required = False
428 Size = 4
429 end
430 object EmployeesHIRE_DATE: TDateTimeField
431 DisplayWidth = 10
432 FieldKind = fkData
433 FieldName = 'HIRE_DATE'
434 Index = 4
435 LookupCache = False
436 ProviderFlags = [pfInUpdate, pfInWhere]
437 ReadOnly = False
438 Required = True
439 end
440 object EmployeesDEPT_NO: TIBStringField
441 DisplayWidth = 3
442 FieldKind = fkData
443 FieldName = 'DEPT_NO'
444 Index = 5
445 LookupCache = False
446 ProviderFlags = [pfInUpdate, pfInWhere]
447 ReadOnly = False
448 Required = True
449 Size = 3
450 end
451 object EmployeesJOB_CODE: TIBStringField
452 DisplayWidth = 5
453 FieldKind = fkData
454 FieldName = 'JOB_CODE'
455 Index = 6
456 LookupCache = False
457 ProviderFlags = [pfInUpdate, pfInWhere]
458 ReadOnly = False
459 Required = True
460 OnChange = EmployeesJOB_CODEChange
461 Size = 5
462 end
463 object EmployeesJOB_GRADE: TSmallintField
464 DisplayWidth = 10
465 FieldKind = fkData
466 FieldName = 'JOB_GRADE'
467 Index = 7
468 LookupCache = False
469 ProviderFlags = [pfInUpdate, pfInWhere]
470 ReadOnly = False
471 Required = True
472 OnChange = EmployeesJOB_GRADEChange
473 end
474 object EmployeesJOB_COUNTRY: TIBStringField
475 DisplayWidth = 15
476 FieldKind = fkData
477 FieldName = 'JOB_COUNTRY'
478 Index = 8
479 LookupCache = False
480 ProviderFlags = [pfInUpdate, pfInWhere]
481 ReadOnly = False
482 Required = True
483 Size = 15
484 end
485 object EmployeesSALARY: TIBBCDField
486 DisplayWidth = 18
487 FieldKind = fkData
488 FieldName = 'SALARY'
489 Index = 9
490 LookupCache = False
491 ProviderFlags = [pfInUpdate, pfInWhere]
492 ReadOnly = False
493 Required = True
494 OnGetText = EmployeesSALARYGetText
495 Precision = 18
496 Currency = False
497 MaxValue = 0
498 MinValue = 0
499 Size = 2
500 end
501 object EmployeesFULL_NAME: TIBStringField
502 DisplayWidth = 37
503 FieldKind = fkData
504 FieldName = 'FULL_NAME'
505 Index = 10
506 LookupCache = False
507 ProviderFlags = [pfInUpdate, pfInWhere]
508 ReadOnly = False
509 Required = False
510 OnChange = EmployeesFULL_NAMEChange
511 Size = 37
512 end
513 object EmployeesDEPT_PATH: TIBStringField
514 DisplayWidth = 256
515 FieldKind = fkData
516 FieldName = 'DEPT_PATH'
517 Index = 11
518 LookupCache = False
519 ProviderFlags = [pfInUpdate, pfInWhere]
520 ReadOnly = False
521 Required = True
522 Size = 256
523 end
524 object EmployeesDEPT_KEY_PATH: TIBStringField
525 DisplayWidth = 64
526 FieldKind = fkData
527 FieldName = 'DEPT_KEY_PATH'
528 Index = 12
529 LookupCache = False
530 ProviderFlags = [pfInUpdate, pfInWhere]
531 ReadOnly = False
532 Required = True
533 Size = 64
534 end
535 end
536 object EmployeeSource: TDataSource
537 DataSet = Employees
538 OnDataChange = EmployeeSourceDataChange
539 left = 462
540 top = 16
541 end
542 object ApplicationProperties1: TApplicationProperties
543 OnIdle = ApplicationProperties1Idle
544 left = 328
545 top = 56
546 end
547 object Countries: TIBQuery
548 Database = IBDatabase1
549 Transaction = IBTransaction1
550 BeforeOpen = CountriesBeforeOpen
551 BufferChunks = 1000
552 CachedUpdates = False
553 GenerateParamNames = False
554 GeneratorField.ApplyOnEvent = gaeOnNewRecord
555 SQL.Strings = (
556 'Select A.COUNTRY, A.CURRENCY From COUNTRY A'
557 'JOIN JOB J On J.JOB_COUNTRY = A.COUNTRY'
558 'Where J.JOB_CODE = :JOB_CODE and J.JOB_GRADE = :JOB_GRADE'
559 )
560 Params = <
561 item
562 DataType = ftUnknown
563 Name = 'JOB_CODE'
564 ParamType = ptInput
565 end
566 item
567 DataType = ftUnknown
568 Name = 'JOB_GRADE'
569 ParamType = ptInput
570 end>
571 left = 425
572 top = 56
573 ParamData = <
574 item
575 DataType = ftUnknown
576 Name = 'JOB_CODE'
577 ParamType = ptInput
578 end
579 item
580 DataType = ftUnknown
581 Name = 'JOB_GRADE'
582 ParamType = ptInput
583 end>
584 end
585 object CountriesSource: TDataSource
586 DataSet = Countries
587 left = 392
588 top = 58
589 end
590 object JobCodes: TIBQuery
591 Database = IBDatabase1
592 Transaction = IBTransaction1
593 BeforeOpen = JobCodesBeforeOpen
594 BufferChunks = 1000
595 CachedUpdates = False
596 GenerateParamNames = False
597 GeneratorField.ApplyOnEvent = gaeOnNewRecord
598 SQL.Strings = (
599 'Select distinct A.JOB_CODE, A.JOB_TITLE From JOB A'
600 'Where JOB_GRADE = :JOB_GRADE'
601 'order by 2'
602 )
603 Params = <
604 item
605 DataType = ftUnknown
606 Name = 'JOB_GRADE'
607 ParamType = ptInput
608 end>
609 left = 425
610 top = 18
611 ParamData = <
612 item
613 DataType = ftUnknown
614 Name = 'JOB_GRADE'
615 ParamType = ptInput
616 end>
617 end
618 object JobCodeSource: TDataSource
619 DataSet = JobCodes
620 left = 392
621 top = 18
622 end
623 end