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

File Contents

# Content
1 object Form1: TForm1
2 Left = 248
3 Height = 575
4 Top = 397
5 Width = 1026
6 Caption = 'Employee List'
7 ClientHeight = 575
8 ClientWidth = 1026
9 OnClose = FormClose
10 OnShow = FormShow
11 LCLVersion = '1.4.2.0'
12 object Button1: TButton
13 Left = 939
14 Height = 25
15 Top = 48
16 Width = 75
17 Action = AddEmployee
18 Anchors = [akTop, akRight]
19 TabOrder = 0
20 end
21 object Button3: TButton
22 Left = 939
23 Height = 25
24 Top = 80
25 Width = 75
26 Action = DeleteEmployee
27 Anchors = [akTop, akRight]
28 TabOrder = 1
29 end
30 object Label1: TLabel
31 Left = 17
32 Height = 15
33 Top = 14
34 Width = 87
35 Caption = 'Started Before'
36 ParentColor = False
37 end
38 object BeforeDate: TDateEdit
39 Left = 112
40 Height = 25
41 Top = 8
42 Width = 80
43 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames]
44 OKCaption = 'OK'
45 CancelCaption = 'Cancel'
46 DateOrder = doNone
47 ButtonWidth = 23
48 NumGlyphs = 1
49 MaxLength = 0
50 OnChange = BeforeDateChange
51 TabOrder = 2
52 end
53 object Label2: TLabel
54 Left = 241
55 Height = 15
56 Top = 14
57 Width = 78
58 Caption = 'Started After'
59 ParentColor = False
60 end
61 object AfterDate: TDateEdit
62 Left = 333
63 Height = 25
64 Top = 8
65 Width = 80
66 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames]
67 OKCaption = 'OK'
68 CancelCaption = 'Cancel'
69 DateOrder = doNone
70 ButtonWidth = 23
71 NumGlyphs = 1
72 MaxLength = 0
73 OnChange = BeforeDateChange
74 TabOrder = 3
75 end
76 object Panel1: TPanel
77 Left = 12
78 Height = 527
79 Top = 42
80 Width = 904
81 Anchors = [akTop, akLeft, akRight, akBottom]
82 BevelOuter = bvNone
83 ClientHeight = 527
84 ClientWidth = 904
85 ParentColor = False
86 TabOrder = 4
87 object DBControlGrid1: TDBControlGrid
88 Left = 0
89 Height = 477
90 Top = 0
91 Width = 904
92 Align = alClient
93 AlternateColor = clSkyBlue
94 AltColorStartNormal = True
95 Color = clWhite
96 DataSource = EmployeeSource
97 DefaultPositionAtEnd = False
98 DrawPanel = EmployeeEditorPanel
99 Options = [dgpIndicator]
100 TabOrder = 1
101 ColWidths = (
102 12
103 890
104 )
105 object EmployeeEditorPanel: TPanel
106 Left = 12
107 Height = 80
108 Top = 0
109 Width = 890
110 Anchors = []
111 BevelOuter = bvNone
112 BorderWidth = 2
113 BorderStyle = bsSingle
114 ClientHeight = 78
115 ClientWidth = 888
116 Color = clWhite
117 ParentColor = False
118 TabOrder = 0
119 Visible = False
120 object Label3: TLabel
121 Left = 0
122 Height = 15
123 Top = 7
124 Width = 83
125 Caption = 'Employee No.'
126 ParentColor = False
127 end
128 object DBEdit1: TDBEdit
129 Left = 90
130 Height = 25
131 Top = 2
132 Width = 120
133 DataField = 'EMP_NO'
134 DataSource = EmployeeSource
135 CharCase = ecNormal
136 MaxLength = 0
137 TabOrder = 0
138 end
139 object Label4: TLabel
140 Left = 12
141 Height = 15
142 Top = 32
143 Width = 64
144 Caption = 'First Name'
145 ParentColor = False
146 end
147 object DBEdit2: TDBEdit
148 Left = 90
149 Height = 25
150 Top = 24
151 Width = 120
152 DataField = 'FIRST_NAME'
153 DataSource = EmployeeSource
154 CharCase = ecNormal
155 MaxLength = 0
156 TabOrder = 1
157 end
158 object Label5: TLabel
159 Left = 12
160 Height = 15
161 Top = 56
162 Width = 64
163 Caption = 'Last Name'
164 ParentColor = False
165 end
166 object DBEdit3: TDBEdit
167 Left = 90
168 Height = 25
169 Top = 46
170 Width = 120
171 DataField = 'LAST_NAME'
172 DataSource = EmployeeSource
173 CharCase = ecNormal
174 MaxLength = 0
175 TabOrder = 2
176 end
177 object Label6: TLabel
178 Left = 216
179 Height = 15
180 Top = 7
181 Width = 77
182 Caption = 'Date Started'
183 ParentColor = False
184 end
185 object IBDateEdit1: TDBDateEdit
186 Left = 300
187 Height = 25
188 Top = 2
189 Width = 80
190 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames]
191 OKCaption = 'OK'
192 CancelCaption = 'Cancel'
193 DateOrder = doNone
194 ButtonWidth = 23
195 AutoSelect = False
196 NumGlyphs = 1
197 MaxLength = 0
198 TabOrder = 3
199 DataField = 'HIRE_DATE'
200 DataSource = EmployeeSource
201 end
202 object Label7: TLabel
203 Left = 252
204 Height = 15
205 Top = 32
206 Width = 37
207 Caption = 'Salary'
208 ParentColor = False
209 end
210 object DBEdit4: TDBEdit
211 Left = 300
212 Height = 25
213 Top = 24
214 Width = 104
215 DataField = 'SALARY'
216 DataSource = EmployeeSource
217 CharCase = ecNormal
218 MaxLength = 0
219 TabOrder = 5
220 end
221 object Label8: TLabel
222 Left = 814
223 Height = 15
224 Top = 54
225 Width = 24
226 Anchors = [akTop, akRight]
227 Caption = 'Ext.'
228 ParentColor = False
229 end
230 object DBEdit5: TDBEdit
231 Left = 838
232 Height = 25
233 Top = 48
234 Width = 40
235 DataField = 'PHONE_EXT'
236 DataSource = EmployeeSource
237 Anchors = [akTop, akRight]
238 CharCase = ecNormal
239 MaxLength = 0
240 TabOrder = 4
241 end
242 object Label9: TLabel
243 Left = 536
244 Height = 15
245 Top = 7
246 Width = 51
247 Caption = 'Location'
248 ParentColor = False
249 end
250 object Label10: TLabel
251 Left = 413
252 Height = 15
253 Top = 9
254 Width = 59
255 Caption = 'Job Grade'
256 ParentColor = False
257 end
258 object JobGradeDBComboBox: TDBComboBox
259 Left = 480
260 Height = 25
261 Top = 2
262 Width = 48
263 AutoSize = False
264 DataField = 'JOB_GRADE'
265 DataSource = EmployeeSource
266 ItemHeight = 0
267 Items.Strings = (
268 '1'
269 '2'
270 '3'
271 '4'
272 '5'
273 )
274 MaxLength = 0
275 OnCloseUp = JobGradeDBComboBoxCloseUp
276 Style = csDropDownList
277 TabOrder = 6
278 end
279 object Label11: TLabel
280 Left = 536
281 Height = 15
282 Top = 32
283 Width = 48
284 Caption = 'Job Title'
285 ParentColor = False
286 end
287 object Label12: TLabel
288 Left = 256
289 Height = 15
290 Top = 54
291 Width = 33
292 Caption = 'Dept.'
293 ParentColor = False
294 end
295 object SpeedButton1: TSpeedButton
296 Left = 786
297 Height = 25
298 Top = 48
299 Width = 23
300 Action = SelectDept
301 Anchors = [akTop, akRight]
302 end
303 object DBEdit6: TDBEdit
304 Left = 300
305 Height = 25
306 Top = 48
307 Width = 478
308 DataField = 'DEPT_PATH'
309 DataSource = EmployeeSource
310 ReadOnly = True
311 Anchors = [akTop, akLeft, akRight]
312 CharCase = ecNormal
313 MaxLength = 0
314 TabOrder = 7
315 end
316 object DBEdit7: TDBEdit
317 Left = 592
318 Height = 25
319 Top = 0
320 Width = 246
321 DataField = 'JOB_COUNTRY'
322 DataSource = EmployeeSource
323 ReadOnly = True
324 CharCase = ecNormal
325 MaxLength = 0
326 TabOrder = 8
327 end
328 object DBEdit8: TDBEdit
329 Left = 592
330 Height = 25
331 Top = 24
332 Width = 246
333 DataField = 'JOB_TITLE'
334 DataSource = EmployeeSource
335 CharCase = ecNormal
336 MaxLength = 0
337 TabOrder = 9
338 end
339 object SpeedButton2: TSpeedButton
340 Left = 847
341 Height = 22
342 Top = 0
343 Width = 23
344 Action = EditLocationAction
345 end
346 object SpeedButton3: TSpeedButton
347 Left = 847
348 Height = 22
349 Top = 24
350 Width = 23
351 Action = EditJobCodeAction
352 end
353 end
354 end
355 object Panel2: TPanel
356 Left = 0
357 Height = 50
358 Top = 477
359 Width = 904
360 Align = alBottom
361 BevelOuter = bvNone
362 ClientHeight = 50
363 ClientWidth = 904
364 ParentColor = False
365 TabOrder = 0
366 object Button5: TButton
367 Left = 80
368 Height = 25
369 Top = 16
370 Width = 75
371 Action = CancelChanges
372 Anchors = [akLeft, akBottom]
373 TabOrder = 0
374 end
375 object Button4: TButton
376 Left = 1
377 Height = 25
378 Top = 16
379 Width = 75
380 Action = SaveChanges
381 Anchors = [akLeft, akBottom]
382 TabOrder = 1
383 end
384 object DBText1: TDBText
385 Left = 832
386 Height = 27
387 Top = 16
388 Width = 49
389 Alignment = taRightJustify
390 Anchors = [akTop, akRight, akBottom]
391 DataField = 'TOTALSALARIES'
392 DataSource = TotalsSource
393 ParentColor = False
394 end
395 end
396 end
397 object Label13: TLabel
398 Left = 456
399 Height = 15
400 Top = 14
401 Width = 79
402 Caption = 'Salary Range'
403 ParentColor = False
404 end
405 object SalaryRange: TComboBox
406 Left = 544
407 Height = 25
408 Top = 8
409 Width = 272
410 ItemHeight = 0
411 ItemIndex = 0
412 Items.Strings = (
413 'None Specified'
414 'Below $40,000'
415 'Between $40,000 and $100,000'
416 'Above $100,000'
417 )
418 OnCloseUp = BeforeDateChange
419 Style = csDropDownList
420 TabOrder = 5
421 Text = 'None Specified'
422 end
423 object IBDatabase1: TIBDatabase
424 Connected = False
425 AllowStreamedConnected = False
426 DatabaseName = 'localhost:employee'
427 Params.Strings = (
428 'user_name=SYSDBA'
429 'lc_ctype=UTF8'
430 )
431 DefaultTransaction = IBTransaction1
432 IdleTimer = 0
433 TraceFlags = []
434 left = 832
435 top = 168
436 end
437 object IBTransaction1: TIBTransaction
438 Active = False
439 DefaultDatabase = IBDatabase1
440 Params.Strings = (
441 'read_committed'
442 'rec_version'
443 'nowait'
444 )
445 left = 872
446 top = 168
447 end
448 object EmployeeSource: TDataSource
449 DataSet = Employees
450 left = 832
451 top = 336
452 end
453 object ActionList1: TActionList
454 left = 832
455 top = 416
456 object AddEmployee: TAction
457 Caption = 'Add'
458 OnExecute = AddEmployeeExecute
459 end
460 object EditEmployee: TAction
461 Caption = 'Edit'
462 OnUpdate = EditEmployeeUpdate
463 end
464 object DeleteEmployee: TAction
465 Caption = 'Delete'
466 OnExecute = DeleteEmployeeExecute
467 OnUpdate = EditEmployeeUpdate
468 end
469 object SaveChanges: TAction
470 Caption = 'Save'
471 OnExecute = SaveChangesExecute
472 OnUpdate = SaveChangesUpdate
473 end
474 object CancelChanges: TAction
475 Caption = 'Cancel'
476 OnExecute = CancelChangesExecute
477 OnUpdate = SaveChangesUpdate
478 end
479 object SelectDept: TAction
480 Caption = '...'
481 OnExecute = SelectDeptExecute
482 end
483 object EditJobCodeAction: TAction
484 Caption = '...'
485 OnExecute = EditJobCodeActionExecute
486 OnUpdate = EditJobCodeActionUpdate
487 end
488 object EditLocationAction: TAction
489 Caption = '...'
490 OnExecute = EditLocationActionExecute
491 OnUpdate = EditJobCodeActionUpdate
492 end
493 end
494 object TotalsQuery: TIBQuery
495 Database = IBDatabase1
496 Transaction = IBTransaction1
497 BeforeOpen = EmployeesBeforeOpen
498 BufferChunks = 1000
499 CachedUpdates = False
500 GenerateParamNames = False
501 GeneratorField.ApplyOnEvent = gaeOnNewRecord
502 SQL.Strings = (
503 'Select sum(Salary) as TotalSalaries'
504 'From EMPLOYEE'
505 )
506 Params = <>
507 DataSetCloseAction = dcDiscardChanges
508 left = 872
509 top = 376
510 object TotalsQueryTOTALSALARIES: TIBBCDField
511 DisplayWidth = 18
512 FieldKind = fkData
513 FieldName = 'TOTALSALARIES'
514 Index = 0
515 LookupCache = False
516 ProviderFlags = [pfInUpdate, pfInWhere]
517 ReadOnly = False
518 Required = False
519 OnGetText = TotalsQueryTOTALSALARIESGetText
520 Precision = 18
521 Currency = False
522 MaxValue = 0
523 MinValue = 0
524 Size = 2
525 end
526 end
527 object TotalsSource: TDataSource
528 DataSet = TotalsQuery
529 left = 832
530 top = 376
531 end
532 object Employees: TIBDataSet
533 Database = IBDatabase1
534 Transaction = IBTransaction1
535 AfterDelete = EmployeesAfterDelete
536 AfterEdit = EmployeesAfterDelete
537 AfterInsert = EmployeesAfterInsert
538 AfterOpen = EmployeesAfterOpen
539 AfterPost = EmployeesAfterPost
540 BeforeClose = EmployeesBeforeClose
541 BeforeOpen = EmployeesBeforeOpen
542 BufferChunks = 1000
543 CachedUpdates = False
544 DeleteSQL.Strings = (
545 'Delete From EMPLOYEE A'
546 'Where A.EMP_NO = :EMP_NO'
547 )
548 InsertSQL.Strings = (
549 'Insert Into EMPLOYEE(EMP_NO, FIRST_NAME, LAST_NAME, PHONE_EXT, HIRE_DATE, DEPT_NO, JOB_CODE, JOB_GRADE, JOB_COUNTRY, SALARY)'
550 'Values(:EMP_NO, :FIRST_NAME, :LAST_NAME, :PHONE_EXT, :HIRE_DATE, :DEPT_NO, :JOB_CODE, :JOB_GRADE, :JOB_COUNTRY, :SALARY)'
551 )
552 RefreshSQL.Strings = (
553 'with recursive Depts As ('
554 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, cast(DEPARTMENT as VarChar(256)) as DEPT_PATH,'
555 'cast(DEPT_NO as VarChar(64)) as DEPT_KEY_PATH'
556 'From DEPARTMENT Where HEAD_DEPT is NULL '
557 'UNION ALL'
558 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, Depts.DEPT_PATH || '' / '' || DEPARTMENT as DEPT_PATH,'
559 'Depts.DEPT_KEY_PATH || '';'' || DEPT_NO as DEPT_KEY_PATH'
560 'From DEPARTMENT '
561 'JOIN Depts On HEAD_DEPT = Depts.DEPT_NO'
562 ')'
563 ''
564 'Select distinct A.EMP_NO, A.FIRST_NAME, A.LAST_NAME, A.PHONE_EXT, A.HIRE_DATE, A.DEPT_NO, A.JOB_CODE, '
565 'A.JOB_GRADE, A.JOB_COUNTRY, A.SALARY, A.FULL_NAME, D.DEPT_PATH, D.DEPT_KEY_PATH, J.JOB_TITLE'
566 'From EMPLOYEE A'
567 'JOIN Depts D On D.DEPT_NO = A.DEPT_NO'
568 'JOIN JOB J on J.JOB_CODE = A.JOB_CODE'
569 'Where A.EMP_NO = :EMP_NO'
570 )
571 SelectSQL.Strings = (
572 'with recursive Depts As ('
573 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, cast(DEPARTMENT as VarChar(256)) as DEPT_PATH,'
574 'cast(DEPT_NO as VarChar(64)) as DEPT_KEY_PATH'
575 'From DEPARTMENT Where HEAD_DEPT is NULL '
576 'UNION ALL'
577 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, Depts.DEPT_PATH || '' / '' || DEPARTMENT as DEPT_PATH,'
578 'Depts.DEPT_KEY_PATH || '';'' || DEPT_NO as DEPT_KEY_PATH'
579 'From DEPARTMENT '
580 'JOIN Depts On HEAD_DEPT = Depts.DEPT_NO'
581 ')'
582 ''
583 'Select distinct A.EMP_NO, A.FIRST_NAME, A.LAST_NAME, A.PHONE_EXT, A.HIRE_DATE, A.DEPT_NO, A.JOB_CODE, '
584 'A.JOB_GRADE, A.JOB_COUNTRY, A.SALARY, A.FULL_NAME, D.DEPT_PATH, D.DEPT_KEY_PATH, J.JOB_TITLE'
585 'From EMPLOYEE A'
586 'JOIN Depts D On D.DEPT_NO = A.DEPT_NO'
587 'JOIN JOB J on J.JOB_CODE = A.JOB_CODE'
588 'Order by A.LAST_NAME'
589 )
590 ModifySQL.Strings = (
591 'Update EMPLOYEE A Set '#13#10' A.DEPT_NO = :DEPT_NO,'#13#10' A.FIRST_NAME = :FIRST_NAME,'#13#10' A.HIRE_DATE = :HIRE_DATE,'#13#10' A.JOB_CODE = :JOB_CODE,'#13#10' A.JOB_COUNTRY = :JOB_COUNTRY,'#13#10' A.JOB_GRADE = :JOB_GRADE,'#13#10' A.LAST_NAME = :LAST_NAME,'#13#10' A.PHONE_EXT = :PHONE_EXT,'#13#10' A.SALARY = :SALARY'
592 'Where A.EMP_NO = :OLD_EMP_NO'
593 )
594 GeneratorField.Generator = 'EMP_NO_GEN'
595 GeneratorField.Field = 'EMP_NO'
596 GeneratorField.ApplyOnEvent = gaeOnNewRecord
597 GenerateParamNames = False
598 DataSetCloseAction = dcSaveChanges
599 AfterTransactionEnd = EmployeesAfterTransactionEnd
600 left = 872
601 top = 336
602 object EmployeesEMP_NO: TSmallintField
603 DisplayWidth = 10
604 FieldKind = fkData
605 FieldName = 'EMP_NO'
606 Index = 0
607 LookupCache = False
608 ProviderFlags = [pfInUpdate, pfInWhere]
609 ReadOnly = False
610 Required = True
611 end
612 object EmployeesFIRST_NAME: TIBStringField
613 DisplayWidth = 15
614 FieldKind = fkData
615 FieldName = 'FIRST_NAME'
616 Index = 1
617 LookupCache = False
618 ProviderFlags = [pfInUpdate, pfInWhere]
619 ReadOnly = False
620 Required = True
621 Size = 15
622 end
623 object EmployeesLAST_NAME: TIBStringField
624 DisplayWidth = 20
625 FieldKind = fkData
626 FieldName = 'LAST_NAME'
627 Index = 2
628 LookupCache = False
629 ProviderFlags = [pfInUpdate, pfInWhere]
630 ReadOnly = False
631 Required = True
632 end
633 object EmployeesPHONE_EXT: TIBStringField
634 Alignment = taRightJustify
635 DisplayWidth = 4
636 FieldKind = fkData
637 FieldName = 'PHONE_EXT'
638 Index = 3
639 LookupCache = False
640 ProviderFlags = [pfInUpdate, pfInWhere]
641 ReadOnly = False
642 Required = False
643 Size = 4
644 end
645 object EmployeesHIRE_DATE: TDateTimeField
646 DisplayWidth = 10
647 FieldKind = fkData
648 FieldName = 'HIRE_DATE'
649 Index = 4
650 LookupCache = False
651 ProviderFlags = [pfInUpdate, pfInWhere]
652 ReadOnly = False
653 Required = True
654 end
655 object EmployeesDEPT_NO: TIBStringField
656 DisplayWidth = 3
657 FieldKind = fkData
658 FieldName = 'DEPT_NO'
659 Index = 5
660 LookupCache = False
661 ProviderFlags = [pfInUpdate, pfInWhere]
662 ReadOnly = False
663 Required = True
664 Size = 3
665 end
666 object EmployeesJOB_CODE: TIBStringField
667 DisplayWidth = 5
668 FieldKind = fkData
669 FieldName = 'JOB_CODE'
670 Index = 6
671 LookupCache = False
672 ProviderFlags = [pfInUpdate, pfInWhere]
673 ReadOnly = False
674 Required = True
675 Size = 5
676 end
677 object EmployeesJOB_GRADE: TSmallintField
678 DisplayWidth = 10
679 FieldKind = fkData
680 FieldName = 'JOB_GRADE'
681 Index = 7
682 LookupCache = False
683 ProviderFlags = [pfInUpdate, pfInWhere]
684 ReadOnly = False
685 Required = True
686 end
687 object EmployeesJOB_COUNTRY: TIBStringField
688 DisplayWidth = 15
689 FieldKind = fkData
690 FieldName = 'JOB_COUNTRY'
691 Index = 8
692 LookupCache = False
693 ProviderFlags = [pfInUpdate, pfInWhere]
694 ReadOnly = False
695 Required = True
696 Size = 15
697 end
698 object EmployeesSALARY: TIBBCDField
699 DisplayWidth = 18
700 FieldKind = fkData
701 FieldName = 'SALARY'
702 Index = 9
703 LookupCache = False
704 ProviderFlags = [pfInUpdate, pfInWhere]
705 ReadOnly = False
706 Required = True
707 OnGetText = EmployeesSALARYGetText
708 Precision = 18
709 Currency = False
710 MaxValue = 0
711 MinValue = 0
712 Size = 2
713 end
714 object EmployeesFULL_NAME: TIBStringField
715 DisplayWidth = 37
716 FieldKind = fkData
717 FieldName = 'FULL_NAME'
718 Index = 10
719 LookupCache = False
720 ProviderFlags = [pfInUpdate, pfInWhere]
721 ReadOnly = True
722 Required = False
723 Size = 37
724 end
725 object EmployeesDEPT_PATH: TIBStringField
726 DisplayWidth = 256
727 FieldKind = fkData
728 FieldName = 'DEPT_PATH'
729 Index = 11
730 LookupCache = False
731 ProviderFlags = [pfInUpdate, pfInWhere]
732 ReadOnly = False
733 Required = True
734 Size = 256
735 end
736 object EmployeesDEPT_KEY_PATH: TIBStringField
737 DisplayWidth = 64
738 FieldKind = fkData
739 FieldName = 'DEPT_KEY_PATH'
740 Index = 12
741 LookupCache = False
742 ProviderFlags = [pfInUpdate, pfInWhere]
743 ReadOnly = False
744 Required = True
745 Size = 64
746 end
747 object EmployeesJOB_TITLE: TIBStringField
748 DisplayWidth = 25
749 FieldKind = fkData
750 FieldName = 'JOB_TITLE'
751 Index = 13
752 LookupCache = False
753 ProviderFlags = [pfInUpdate, pfInWhere]
754 ReadOnly = False
755 Required = True
756 Size = 25
757 end
758 end
759 end