ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/lookupcombobox/Unit1.lfm
Revision: 263
Committed: Thu Dec 6 15:55:01 2018 UTC (5 years, 4 months ago) by tony
File size: 16704 byte(s)
Log Message:
Release 2.3.2 committed

File Contents

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