ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/lookupcombobox/Unit1.lfm
Revision: 41
Committed: Sat Jul 16 12:25:48 2016 UTC (8 years, 4 months ago) by tony
File size: 16306 byte(s)
Log Message:
Committing updates for Release R1-4-2

File Contents

# User Rev Content
1 tony 21 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 tony 41 LCLVersion = '1.6.0.4'
12 tony 21 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 tony 27 TabOrder = 3
115 tony 21 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 tony 27 TabOrder = 4
142 tony 21 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 tony 23 Height = 29
162 tony 21 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 DBEdit5: TDBEdit
196     Left = 17
197     Height = 25
198     Top = 136
199     Width = 495
200     DataField = 'DEPT_PATH'
201     DataSource = EmployeeSource
202     ReadOnly = True
203     Anchors = [akTop, akLeft, akRight]
204     CharCase = ecNormal
205     MaxLength = 0
206 tony 27 TabOrder = 5
207 tony 21 end
208     object SpeedButton1: TSpeedButton
209     Left = 516
210     Height = 25
211     Top = 136
212     Width = 25
213     Anchors = [akTop, akRight]
214     Caption = '...'
215     OnClick = SpeedButton1Click
216     end
217     object IBLookupComboEditBox2: TIBLookupComboEditBox
218     Left = 392
219     Height = 25
220     Top = 32
221     Width = 203
222     Anchors = [akTop, akLeft, akRight]
223     AutoSize = False
224     DataField = 'JOB_COUNTRY'
225     DataSource = EmployeeSource
226     KeyField = 'COUNTRY'
227     ListField = 'COUNTRY'
228     ListFieldIndex = 0
229     ListSource = CountriesSource
230     LookupCache = False
231     Style = csDropDownList
232 tony 27 TabOrder = 6
233 tony 21 AutoInsert = False
234     AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchAscending]
235     ItemHeight = 0
236     end
237     object IBLookupComboEditBox3: TIBLookupComboEditBox
238     Left = 331
239     Height = 29
240     Top = 82
241     Width = 264
242     Anchors = [akTop, akLeft, akRight]
243     DataField = 'JOB_CODE'
244     DataSource = EmployeeSource
245     KeyField = 'JOB_CODE'
246     ListField = 'JOB_TITLE'
247     ListFieldIndex = 0
248     ListSource = JobCodeSource
249     LookupCache = False
250     Style = csDropDownList
251 tony 27 TabOrder = 7
252 tony 21 AutoInsert = False
253     AutoCompleteText = [cbactEnabled, cbactEndOfLineComplete, cbactSearchAscending]
254     ItemHeight = 0
255     end
256 tony 27 object IBDateEdit1: TDBDateEdit
257     Left = 17
258     Height = 25
259     Top = 82
260     Width = 112
261     CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames]
262     OKCaption = 'OK'
263     CancelCaption = 'Cancel'
264     DateOrder = doNone
265     ButtonWidth = 23
266     AutoSelect = False
267     NumGlyphs = 1
268     MaxLength = 0
269     TabOrder = 8
270     DataField = 'HIRE_DATE'
271     DataSource = EmployeeSource
272     end
273 tony 21 end
274     object CancelBtn: TButton
275     Left = 567
276     Height = 25
277     Top = 293
278     Width = 75
279     Anchors = [akRight, akBottom]
280     Caption = 'Cancel'
281     OnClick = CancelBtnClick
282     TabOrder = 2
283     end
284     object SaveBtn: TButton
285     Left = 481
286     Height = 25
287     Top = 293
288     Width = 75
289     Anchors = [akRight, akBottom]
290     Caption = 'Save'
291     OnClick = SaveBtnClick
292     TabOrder = 3
293     end
294     object DeleteBtn: TButton
295     Left = 18
296     Height = 25
297     Top = 294
298     Width = 75
299     Anchors = [akLeft, akBottom]
300     Caption = 'Delete'
301     OnClick = DeleteBtnClick
302     TabOrder = 4
303     end
304     object IBDatabase1: TIBDatabase
305 tony 41 Connected = True
306 tony 21 AllowStreamedConnected = False
307 tony 27 DatabaseName = 'localhost:employee'
308 tony 21 Params.Strings = (
309 tony 33 'lc_ctype=UTF8'
310 tony 21 'user_name=SYSDBA'
311     )
312     DefaultTransaction = IBTransaction1
313     IdleTimer = 0
314     TraceFlags = []
315 tony 41 UseDefaultSystemCodePage = False
316 tony 21 left = 328
317     top = 24
318     end
319     object IBTransaction1: TIBTransaction
320     Active = False
321     DefaultDatabase = IBDatabase1
322     left = 296
323     top = 24
324     end
325     object Employees: TIBDataSet
326     Database = IBDatabase1
327     Transaction = IBTransaction1
328     AfterDelete = EmployeesAfterDelete
329     AfterEdit = EmployeesAfterDelete
330     AfterInsert = EmployeesAfterInsert
331     AfterPost = EmployeesAfterPost
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 tony 41 'Order by 3 asc'
376 tony 21 )
377     ModifySQL.Strings = (
378     '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'
379     'Where A.EMP_NO = :OLD_EMP_NO'
380     )
381     GeneratorField.Generator = 'EMP_NO_GEN'
382     GeneratorField.Field = 'EMP_NO'
383     GeneratorField.ApplyOnEvent = gaeOnNewRecord
384     GenerateParamNames = False
385 tony 27 DataSetCloseAction = dcSaveChanges
386 tony 21 AfterTransactionEnd = EmployeesAfterTransactionEnd
387     left = 496
388     top = 16
389     object EmployeesEMP_NO: TSmallintField
390     DisplayWidth = 10
391     FieldKind = fkData
392     FieldName = 'EMP_NO'
393     Index = 0
394     LookupCache = False
395     ProviderFlags = [pfInUpdate, pfInWhere]
396     ReadOnly = False
397     Required = True
398     end
399     object EmployeesFIRST_NAME: TIBStringField
400     DisplayWidth = 15
401     FieldKind = fkData
402     FieldName = 'FIRST_NAME'
403     Index = 1
404     LookupCache = False
405     ProviderFlags = [pfInUpdate, pfInWhere]
406     ReadOnly = False
407     Required = True
408     Size = 15
409     end
410     object EmployeesLAST_NAME: TIBStringField
411     DisplayWidth = 20
412     FieldKind = fkData
413     FieldName = 'LAST_NAME'
414     Index = 2
415     LookupCache = False
416     ProviderFlags = [pfInUpdate, pfInWhere]
417     ReadOnly = False
418     Required = True
419     end
420     object EmployeesPHONE_EXT: TIBStringField
421     Alignment = taRightJustify
422     DisplayWidth = 4
423     FieldKind = fkData
424     FieldName = 'PHONE_EXT'
425     Index = 3
426     LookupCache = False
427     ProviderFlags = [pfInUpdate, pfInWhere]
428     ReadOnly = False
429     Required = False
430     Size = 4
431     end
432     object EmployeesHIRE_DATE: TDateTimeField
433     DisplayWidth = 10
434     FieldKind = fkData
435     FieldName = 'HIRE_DATE'
436     Index = 4
437     LookupCache = False
438     ProviderFlags = [pfInUpdate, pfInWhere]
439     ReadOnly = False
440     Required = True
441     end
442     object EmployeesDEPT_NO: TIBStringField
443     DisplayWidth = 3
444     FieldKind = fkData
445     FieldName = 'DEPT_NO'
446     Index = 5
447     LookupCache = False
448     ProviderFlags = [pfInUpdate, pfInWhere]
449     ReadOnly = False
450     Required = True
451     Size = 3
452     end
453     object EmployeesJOB_CODE: TIBStringField
454     DisplayWidth = 5
455     FieldKind = fkData
456     FieldName = 'JOB_CODE'
457     Index = 6
458     LookupCache = False
459     ProviderFlags = [pfInUpdate, pfInWhere]
460     ReadOnly = False
461     Required = True
462     OnChange = EmployeesJOB_CODEChange
463     Size = 5
464     end
465     object EmployeesJOB_GRADE: TSmallintField
466     DisplayWidth = 10
467     FieldKind = fkData
468     FieldName = 'JOB_GRADE'
469     Index = 7
470     LookupCache = False
471     ProviderFlags = [pfInUpdate, pfInWhere]
472     ReadOnly = False
473     Required = True
474     OnChange = EmployeesJOB_GRADEChange
475     end
476     object EmployeesJOB_COUNTRY: TIBStringField
477     DisplayWidth = 15
478     FieldKind = fkData
479     FieldName = 'JOB_COUNTRY'
480     Index = 8
481     LookupCache = False
482     ProviderFlags = [pfInUpdate, pfInWhere]
483     ReadOnly = False
484     Required = True
485     Size = 15
486     end
487     object EmployeesSALARY: TIBBCDField
488     DisplayWidth = 18
489     FieldKind = fkData
490     FieldName = 'SALARY'
491     Index = 9
492     LookupCache = False
493     ProviderFlags = [pfInUpdate, pfInWhere]
494     ReadOnly = False
495     Required = True
496     OnGetText = EmployeesSALARYGetText
497     Precision = 18
498     Currency = False
499     MaxValue = 0
500     MinValue = 0
501     Size = 2
502     end
503     object EmployeesFULL_NAME: TIBStringField
504     DisplayWidth = 37
505     FieldKind = fkData
506     FieldName = 'FULL_NAME'
507     Index = 10
508     LookupCache = False
509     ProviderFlags = [pfInUpdate, pfInWhere]
510     ReadOnly = False
511     Required = False
512     OnChange = EmployeesFULL_NAMEChange
513     Size = 37
514     end
515     object EmployeesDEPT_PATH: TIBStringField
516     DisplayWidth = 256
517     FieldKind = fkData
518     FieldName = 'DEPT_PATH'
519     Index = 11
520     LookupCache = False
521     ProviderFlags = [pfInUpdate, pfInWhere]
522     ReadOnly = False
523     Required = True
524     Size = 256
525     end
526     object EmployeesDEPT_KEY_PATH: TIBStringField
527     DisplayWidth = 64
528     FieldKind = fkData
529     FieldName = 'DEPT_KEY_PATH'
530     Index = 12
531     LookupCache = False
532     ProviderFlags = [pfInUpdate, pfInWhere]
533     ReadOnly = False
534     Required = True
535     Size = 64
536     end
537     end
538     object EmployeeSource: TDataSource
539     DataSet = Employees
540     OnDataChange = EmployeeSourceDataChange
541     left = 462
542     top = 16
543     end
544     object ApplicationProperties1: TApplicationProperties
545     OnIdle = ApplicationProperties1Idle
546     left = 328
547     top = 56
548     end
549     object Countries: TIBQuery
550     Database = IBDatabase1
551     Transaction = IBTransaction1
552     BeforeOpen = CountriesBeforeOpen
553     BufferChunks = 1000
554     CachedUpdates = False
555     GenerateParamNames = False
556     GeneratorField.ApplyOnEvent = gaeOnNewRecord
557     SQL.Strings = (
558     'Select A.COUNTRY, A.CURRENCY From COUNTRY A'
559     'JOIN JOB J On J.JOB_COUNTRY = A.COUNTRY'
560     'Where J.JOB_CODE = :JOB_CODE and J.JOB_GRADE = :JOB_GRADE'
561     )
562     Params = <
563     item
564     DataType = ftUnknown
565     Name = 'JOB_CODE'
566     ParamType = ptInput
567     end
568     item
569     DataType = ftUnknown
570     Name = 'JOB_GRADE'
571     ParamType = ptInput
572     end>
573 tony 27 DataSetCloseAction = dcDiscardChanges
574 tony 21 left = 425
575     top = 56
576     ParamData = <
577     item
578     DataType = ftUnknown
579     Name = 'JOB_CODE'
580     ParamType = ptInput
581     end
582     item
583     DataType = ftUnknown
584     Name = 'JOB_GRADE'
585     ParamType = ptInput
586     end>
587     end
588     object CountriesSource: TDataSource
589     DataSet = Countries
590     left = 392
591     top = 58
592     end
593     object JobCodes: TIBQuery
594     Database = IBDatabase1
595     Transaction = IBTransaction1
596     BeforeOpen = JobCodesBeforeOpen
597     BufferChunks = 1000
598     CachedUpdates = False
599     GenerateParamNames = False
600     GeneratorField.ApplyOnEvent = gaeOnNewRecord
601     SQL.Strings = (
602     'Select distinct A.JOB_CODE, A.JOB_TITLE From JOB A'
603     'Where JOB_GRADE = :JOB_GRADE'
604     'order by 2'
605     )
606     Params = <
607     item
608     DataType = ftUnknown
609     Name = 'JOB_GRADE'
610     ParamType = ptInput
611     end>
612 tony 27 DataSetCloseAction = dcDiscardChanges
613 tony 21 left = 425
614     top = 18
615     ParamData = <
616     item
617     DataType = ftUnknown
618     Name = 'JOB_GRADE'
619     ParamType = ptInput
620     end>
621     end
622     object JobCodeSource: TDataSource
623     DataSet = JobCodes
624     left = 392
625     top = 18
626     end
627     end