ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/lookupcombobox/Unit1.lfm
Revision: 33
Committed: Sat Jul 18 12:30:52 2015 UTC (8 years, 9 months ago) by tony
File size: 16247 byte(s)
Log Message:
Committing updates for Release R1-3-1

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 33 LCLVersion = '1.4.2.0'
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     Connected = False
306     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     left = 328
316     top = 24
317     end
318     object IBTransaction1: TIBTransaction
319     Active = False
320     DefaultDatabase = IBDatabase1
321     left = 296
322     top = 24
323     end
324     object Employees: TIBDataSet
325     Database = IBDatabase1
326     Transaction = IBTransaction1
327     AfterDelete = EmployeesAfterDelete
328     AfterEdit = EmployeesAfterDelete
329     AfterInsert = EmployeesAfterInsert
330     AfterPost = EmployeesAfterPost
331     BufferChunks = 1000
332     CachedUpdates = False
333     DeleteSQL.Strings = (
334     'Execute Procedure DELETE_EMPLOYEE :EMP_NO'
335     )
336     InsertSQL.Strings = (
337     'Insert Into EMPLOYEE(EMP_NO, FIRST_NAME, LAST_NAME, PHONE_EXT, HIRE_DATE, DEPT_NO, JOB_CODE, JOB_GRADE, JOB_COUNTRY, SALARY)'
338     'Values(:EMP_NO, :FIRST_NAME, :LAST_NAME, :PHONE_EXT, :HIRE_DATE, :DEPT_NO, :JOB_CODE, :JOB_GRADE, :JOB_COUNTRY, :SALARY)'
339     )
340     RefreshSQL.Strings = (
341     'with recursive Depts As ('
342     'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, cast(DEPARTMENT as VarChar(256)) as DEPT_PATH,'
343     'cast(DEPT_NO as VarChar(64)) as DEPT_KEY_PATH'
344     'From DEPARTMENT Where HEAD_DEPT is NULL '
345     'UNION ALL'
346     'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, Depts.DEPT_PATH || '' / '' || DEPARTMENT as DEPT_PATH,'
347     'Depts.DEPT_KEY_PATH || '';'' || DEPT_NO as DEPT_KEY_PATH'
348     'From DEPARTMENT '
349     'JOIN Depts On HEAD_DEPT = Depts.DEPT_NO'
350     ')'
351     ''
352     'Select A.EMP_NO, A.FIRST_NAME, A.LAST_NAME, A.PHONE_EXT, A.HIRE_DATE, A.DEPT_NO, A.JOB_CODE, '
353     'A.JOB_GRADE, A.JOB_COUNTRY, A.SALARY, A.FULL_NAME, D.DEPT_PATH, D.DEPT_KEY_PATH'
354     'From EMPLOYEE A'
355     'JOIN Depts D On D.DEPT_NO = A.DEPT_NO'
356     'Where A.EMP_NO = :EMP_NO'
357     )
358     SelectSQL.Strings = (
359     'with recursive Depts As ('
360     'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, cast(DEPARTMENT as VarChar(256)) as DEPT_PATH,'
361     'cast(DEPT_NO as VarChar(64)) as DEPT_KEY_PATH'
362     'From DEPARTMENT Where HEAD_DEPT is NULL '
363     'UNION ALL'
364     'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, Depts.DEPT_PATH || '' / '' || DEPARTMENT as DEPT_PATH,'
365     'Depts.DEPT_KEY_PATH || '';'' || DEPT_NO as DEPT_KEY_PATH'
366     'From DEPARTMENT '
367     'JOIN Depts On HEAD_DEPT = Depts.DEPT_NO'
368     ')'
369     ''
370     'Select A.EMP_NO, A.FIRST_NAME, A.LAST_NAME, A.PHONE_EXT, A.HIRE_DATE, A.DEPT_NO, A.JOB_CODE, '
371     'A.JOB_GRADE, A.JOB_COUNTRY, A.SALARY, A.FULL_NAME, D.DEPT_PATH, D.DEPT_KEY_PATH'
372     'From EMPLOYEE A'
373     'JOIN Depts D On D.DEPT_NO = A.DEPT_NO'
374     )
375     ModifySQL.Strings = (
376     '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'
377     'Where A.EMP_NO = :OLD_EMP_NO'
378     )
379     GeneratorField.Generator = 'EMP_NO_GEN'
380     GeneratorField.Field = 'EMP_NO'
381     GeneratorField.ApplyOnEvent = gaeOnNewRecord
382     GenerateParamNames = False
383 tony 27 DataSetCloseAction = dcSaveChanges
384 tony 21 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 tony 27 DataSetCloseAction = dcDiscardChanges
572 tony 21 left = 425
573     top = 56
574     ParamData = <
575     item
576     DataType = ftUnknown
577     Name = 'JOB_CODE'
578     ParamType = ptInput
579     end
580     item
581     DataType = ftUnknown
582     Name = 'JOB_GRADE'
583     ParamType = ptInput
584     end>
585     end
586     object CountriesSource: TDataSource
587     DataSet = Countries
588     left = 392
589     top = 58
590     end
591     object JobCodes: TIBQuery
592     Database = IBDatabase1
593     Transaction = IBTransaction1
594     BeforeOpen = JobCodesBeforeOpen
595     BufferChunks = 1000
596     CachedUpdates = False
597     GenerateParamNames = False
598     GeneratorField.ApplyOnEvent = gaeOnNewRecord
599     SQL.Strings = (
600     'Select distinct A.JOB_CODE, A.JOB_TITLE From JOB A'
601     'Where JOB_GRADE = :JOB_GRADE'
602     'order by 2'
603     )
604     Params = <
605     item
606     DataType = ftUnknown
607     Name = 'JOB_GRADE'
608     ParamType = ptInput
609     end>
610 tony 27 DataSetCloseAction = dcDiscardChanges
611 tony 21 left = 425
612     top = 18
613     ParamData = <
614     item
615     DataType = ftUnknown
616     Name = 'JOB_GRADE'
617     ParamType = ptInput
618     end>
619     end
620     object JobCodeSource: TDataSource
621     DataSet = JobCodes
622     left = 392
623     top = 18
624     end
625     end