ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/lookupcombobox/Unit1.lfm
Revision: 291
Committed: Fri Apr 17 10:26:08 2020 UTC (4 years ago) by tony
File size: 16825 byte(s)
Log Message:
Changed for 2.3.4 merged into public release

File Contents

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