ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/dbcontrolgrid/unit1.lfm
Revision: 23
Committed: Fri Mar 13 10:26:52 2015 UTC (9 years ago) by tony
File size: 19790 byte(s)
Log Message:
Committing updates for Release R1-2-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.0.2'
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 DefaultRowHeight = 80
98 DefaultPositionAtEnd = False
99 DrawPanel = EmployeeEditorPanel
100 Options = [dgpIndicator]
101 TabOrder = 1
102 ColWidths = (
103 12
104 890
105 )
106 object EmployeeEditorPanel: TPanel
107 Left = 12
108 Height = 80
109 Top = 0
110 Width = 890
111 Anchors = []
112 BevelOuter = bvNone
113 BorderWidth = 2
114 BorderStyle = bsSingle
115 ClientHeight = 78
116 ClientWidth = 888
117 Color = clWhite
118 ParentColor = False
119 TabOrder = 0
120 Visible = False
121 object Label3: TLabel
122 Left = 0
123 Height = 15
124 Top = 7
125 Width = 83
126 Caption = 'Employee No.'
127 ParentColor = False
128 end
129 object DBEdit1: TDBEdit
130 Left = 90
131 Height = 25
132 Top = 2
133 Width = 120
134 DataField = 'EMP_NO'
135 DataSource = EmployeeSource
136 CharCase = ecNormal
137 MaxLength = 0
138 TabOrder = 0
139 end
140 object Label4: TLabel
141 Left = 12
142 Height = 15
143 Top = 32
144 Width = 64
145 Caption = 'First Name'
146 ParentColor = False
147 end
148 object DBEdit2: TDBEdit
149 Left = 90
150 Height = 25
151 Top = 24
152 Width = 120
153 DataField = 'FIRST_NAME'
154 DataSource = EmployeeSource
155 CharCase = ecNormal
156 MaxLength = 0
157 TabOrder = 1
158 end
159 object Label5: TLabel
160 Left = 12
161 Height = 15
162 Top = 56
163 Width = 64
164 Caption = 'Last Name'
165 ParentColor = False
166 end
167 object DBEdit3: TDBEdit
168 Left = 90
169 Height = 25
170 Top = 46
171 Width = 120
172 DataField = 'LAST_NAME'
173 DataSource = EmployeeSource
174 CharCase = ecNormal
175 MaxLength = 0
176 TabOrder = 2
177 end
178 object Label6: TLabel
179 Left = 216
180 Height = 15
181 Top = 7
182 Width = 77
183 Caption = 'Date Started'
184 ParentColor = False
185 end
186 object IBDateEdit1: TDBDateEdit
187 Left = 300
188 Height = 25
189 Top = 2
190 Width = 80
191 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames]
192 OKCaption = 'OK'
193 CancelCaption = 'Cancel'
194 DateOrder = doNone
195 ButtonWidth = 23
196 AutoSelect = False
197 NumGlyphs = 1
198 MaxLength = 0
199 TabOrder = 3
200 DataField = 'HIRE_DATE'
201 DataSource = EmployeeSource
202 end
203 object Label7: TLabel
204 Left = 252
205 Height = 15
206 Top = 32
207 Width = 37
208 Caption = 'Salary'
209 ParentColor = False
210 end
211 object DBEdit4: TDBEdit
212 Left = 300
213 Height = 25
214 Top = 24
215 Width = 104
216 DataField = 'SALARY'
217 DataSource = EmployeeSource
218 CharCase = ecNormal
219 MaxLength = 0
220 TabOrder = 5
221 end
222 object Label8: TLabel
223 Left = 814
224 Height = 15
225 Top = 54
226 Width = 24
227 Anchors = [akTop, akRight]
228 Caption = 'Ext.'
229 ParentColor = False
230 end
231 object DBEdit5: TDBEdit
232 Left = 838
233 Height = 25
234 Top = 48
235 Width = 40
236 DataField = 'PHONE_EXT'
237 DataSource = EmployeeSource
238 Anchors = [akTop, akRight]
239 CharCase = ecNormal
240 MaxLength = 0
241 TabOrder = 4
242 end
243 object Label9: TLabel
244 Left = 536
245 Height = 15
246 Top = 7
247 Width = 51
248 Caption = 'Location'
249 ParentColor = False
250 end
251 object Label10: TLabel
252 Left = 413
253 Height = 15
254 Top = 9
255 Width = 59
256 Caption = 'Job Grade'
257 ParentColor = False
258 end
259 object JobGradeDBComboBox: TDBComboBox
260 Left = 480
261 Height = 25
262 Top = 2
263 Width = 48
264 AutoSize = False
265 DataField = 'JOB_GRADE'
266 DataSource = EmployeeSource
267 ItemHeight = 0
268 Items.Strings = (
269 '1'
270 '2'
271 '3'
272 '4'
273 '5'
274 )
275 MaxLength = 0
276 OnCloseUp = JobGradeDBComboBoxCloseUp
277 Style = csDropDownList
278 TabOrder = 6
279 end
280 object Label11: TLabel
281 Left = 536
282 Height = 15
283 Top = 32
284 Width = 48
285 Caption = 'Job Title'
286 ParentColor = False
287 end
288 object Label12: TLabel
289 Left = 256
290 Height = 15
291 Top = 54
292 Width = 33
293 Caption = 'Dept.'
294 ParentColor = False
295 end
296 object SpeedButton1: TSpeedButton
297 Left = 786
298 Height = 25
299 Top = 48
300 Width = 23
301 Action = SelectDept
302 Anchors = [akTop, akRight]
303 end
304 object DBEdit6: TDBEdit
305 Left = 300
306 Height = 25
307 Top = 48
308 Width = 478
309 DataField = 'DEPT_PATH'
310 DataSource = EmployeeSource
311 ReadOnly = True
312 Anchors = [akTop, akLeft, akRight]
313 CharCase = ecNormal
314 MaxLength = 0
315 TabOrder = 7
316 end
317 object DBEdit7: TDBEdit
318 Left = 592
319 Height = 25
320 Top = 0
321 Width = 246
322 DataField = 'JOB_COUNTRY'
323 DataSource = EmployeeSource
324 ReadOnly = True
325 CharCase = ecNormal
326 MaxLength = 0
327 TabOrder = 8
328 end
329 object DBEdit8: TDBEdit
330 Left = 592
331 Height = 25
332 Top = 24
333 Width = 246
334 DataField = 'JOB_TITLE'
335 DataSource = EmployeeSource
336 CharCase = ecNormal
337 MaxLength = 0
338 TabOrder = 9
339 end
340 object SpeedButton2: TSpeedButton
341 Left = 847
342 Height = 22
343 Top = 0
344 Width = 23
345 Action = EditLocationAction
346 end
347 object SpeedButton3: TSpeedButton
348 Left = 847
349 Height = 22
350 Top = 24
351 Width = 23
352 Action = EditJobCodeAction
353 end
354 end
355 end
356 object Panel2: TPanel
357 Left = 0
358 Height = 50
359 Top = 477
360 Width = 904
361 Align = alBottom
362 BevelOuter = bvNone
363 ClientHeight = 50
364 ClientWidth = 904
365 ParentColor = False
366 TabOrder = 0
367 object Button5: TButton
368 Left = 80
369 Height = 25
370 Top = 16
371 Width = 75
372 Action = CancelChanges
373 Anchors = [akLeft, akBottom]
374 TabOrder = 0
375 end
376 object Button4: TButton
377 Left = 1
378 Height = 25
379 Top = 16
380 Width = 75
381 Action = SaveChanges
382 Anchors = [akLeft, akBottom]
383 TabOrder = 1
384 end
385 object DBText1: TDBText
386 Left = 832
387 Height = 27
388 Top = 16
389 Width = 49
390 Alignment = taRightJustify
391 Anchors = [akTop, akRight, akBottom]
392 DataField = 'TOTALSALARIES'
393 DataSource = TotalsSource
394 ParentColor = False
395 end
396 end
397 end
398 object Label13: TLabel
399 Left = 456
400 Height = 15
401 Top = 14
402 Width = 79
403 Caption = 'Salary Range'
404 ParentColor = False
405 end
406 object SalaryRange: TComboBox
407 Left = 544
408 Height = 25
409 Top = 8
410 Width = 272
411 ItemHeight = 0
412 ItemIndex = 0
413 Items.Strings = (
414 'None Specified'
415 'Below $40,000'
416 'Between $40,000 and $100,000'
417 'Above $100,000'
418 )
419 OnCloseUp = BeforeDateChange
420 Style = csDropDownList
421 TabOrder = 5
422 Text = 'None Specified'
423 end
424 object IBDatabase1: TIBDatabase
425 Connected = False
426 AllowStreamedConnected = False
427 DatabaseName = 'employee'
428 Params.Strings = (
429 'user_name=SYSDBA'
430 'lc_ctype=UTF-8'
431 )
432 DefaultTransaction = IBTransaction1
433 IdleTimer = 0
434 SQLHourGlass = False
435 TraceFlags = []
436 left = 832
437 top = 168
438 end
439 object IBTransaction1: TIBTransaction
440 Active = False
441 DefaultDatabase = IBDatabase1
442 Params.Strings = (
443 'read_committed'
444 'rec_version'
445 'nowait'
446 )
447 left = 872
448 top = 168
449 end
450 object EmployeeSource: TDataSource
451 DataSet = Employees
452 left = 832
453 top = 336
454 end
455 object ActionList1: TActionList
456 left = 832
457 top = 416
458 object AddEmployee: TAction
459 Caption = 'Add'
460 OnExecute = AddEmployeeExecute
461 end
462 object EditEmployee: TAction
463 Caption = 'Edit'
464 OnUpdate = EditEmployeeUpdate
465 end
466 object DeleteEmployee: TAction
467 Caption = 'Delete'
468 OnExecute = DeleteEmployeeExecute
469 OnUpdate = EditEmployeeUpdate
470 end
471 object SaveChanges: TAction
472 Caption = 'Save'
473 OnExecute = SaveChangesExecute
474 OnUpdate = SaveChangesUpdate
475 end
476 object CancelChanges: TAction
477 Caption = 'Cancel'
478 OnExecute = CancelChangesExecute
479 OnUpdate = SaveChangesUpdate
480 end
481 object SelectDept: TAction
482 Caption = '...'
483 OnExecute = SelectDeptExecute
484 end
485 object EditJobCodeAction: TAction
486 Caption = '...'
487 OnExecute = EditJobCodeActionExecute
488 OnUpdate = EditJobCodeActionUpdate
489 end
490 object EditLocationAction: TAction
491 Caption = '...'
492 OnExecute = EditLocationActionExecute
493 OnUpdate = EditJobCodeActionUpdate
494 end
495 end
496 object TotalsQuery: TIBQuery
497 Database = IBDatabase1
498 Transaction = IBTransaction1
499 BeforeOpen = EmployeesBeforeOpen
500 BufferChunks = 1000
501 CachedUpdates = False
502 GenerateParamNames = False
503 GeneratorField.ApplyOnEvent = gaeOnNewRecord
504 SQL.Strings = (
505 'Select sum(Salary) as TotalSalaries'
506 'From EMPLOYEE'
507 )
508 Params = <>
509 left = 872
510 top = 376
511 object TotalsQueryTOTALSALARIES: TIBBCDField
512 DisplayWidth = 18
513 FieldKind = fkData
514 FieldName = 'TOTALSALARIES'
515 Index = 0
516 LookupCache = False
517 ProviderFlags = [pfInUpdate, pfInWhere]
518 ReadOnly = False
519 Required = False
520 OnGetText = TotalsQueryTOTALSALARIESGetText
521 Precision = 18
522 Currency = False
523 MaxValue = 0
524 MinValue = 0
525 Size = 2
526 end
527 end
528 object TotalsSource: TDataSource
529 DataSet = TotalsQuery
530 left = 832
531 top = 376
532 end
533 object Employees: TIBDataSet
534 Database = IBDatabase1
535 Transaction = IBTransaction1
536 AfterDelete = EmployeesAfterDelete
537 AfterEdit = EmployeesAfterDelete
538 AfterInsert = EmployeesAfterInsert
539 AfterOpen = EmployeesAfterOpen
540 AfterPost = EmployeesAfterPost
541 BeforeClose = EmployeesBeforeClose
542 BeforeOpen = EmployeesBeforeOpen
543 BufferChunks = 1000
544 CachedUpdates = False
545 DeleteSQL.Strings = (
546 'Delete From EMPLOYEE A'
547 'Where A.EMP_NO = :EMP_NO'
548 )
549 InsertSQL.Strings = (
550 'Insert Into EMPLOYEE(EMP_NO, FIRST_NAME, LAST_NAME, PHONE_EXT, HIRE_DATE, DEPT_NO, JOB_CODE, JOB_GRADE, JOB_COUNTRY, SALARY)'
551 'Values(:EMP_NO, :FIRST_NAME, :LAST_NAME, :PHONE_EXT, :HIRE_DATE, :DEPT_NO, :JOB_CODE, :JOB_GRADE, :JOB_COUNTRY, :SALARY)'
552 )
553 RefreshSQL.Strings = (
554 'with recursive Depts As ('
555 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, cast(DEPARTMENT as VarChar(256)) as DEPT_PATH,'
556 'cast(DEPT_NO as VarChar(64)) as DEPT_KEY_PATH'
557 'From DEPARTMENT Where HEAD_DEPT is NULL '
558 'UNION ALL'
559 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, Depts.DEPT_PATH || '' / '' || DEPARTMENT as DEPT_PATH,'
560 'Depts.DEPT_KEY_PATH || '';'' || DEPT_NO as DEPT_KEY_PATH'
561 'From DEPARTMENT '
562 'JOIN Depts On HEAD_DEPT = Depts.DEPT_NO'
563 ')'
564 ''
565 'Select distinct A.EMP_NO, A.FIRST_NAME, A.LAST_NAME, A.PHONE_EXT, A.HIRE_DATE, A.DEPT_NO, A.JOB_CODE, '
566 'A.JOB_GRADE, A.JOB_COUNTRY, A.SALARY, A.FULL_NAME, D.DEPT_PATH, D.DEPT_KEY_PATH, J.JOB_TITLE'
567 'From EMPLOYEE A'
568 'JOIN Depts D On D.DEPT_NO = A.DEPT_NO'
569 'JOIN JOB J on J.JOB_CODE = A.JOB_CODE'
570 'Where A.EMP_NO = :EMP_NO'
571 )
572 SelectSQL.Strings = (
573 'with recursive Depts As ('
574 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, cast(DEPARTMENT as VarChar(256)) as DEPT_PATH,'
575 'cast(DEPT_NO as VarChar(64)) as DEPT_KEY_PATH'
576 'From DEPARTMENT Where HEAD_DEPT is NULL '
577 'UNION ALL'
578 'Select DEPT_NO, DEPARTMENT, HEAD_DEPT, Depts.DEPT_PATH || '' / '' || DEPARTMENT as DEPT_PATH,'
579 'Depts.DEPT_KEY_PATH || '';'' || DEPT_NO as DEPT_KEY_PATH'
580 'From DEPARTMENT '
581 'JOIN Depts On HEAD_DEPT = Depts.DEPT_NO'
582 ')'
583 ''
584 'Select distinct A.EMP_NO, A.FIRST_NAME, A.LAST_NAME, A.PHONE_EXT, A.HIRE_DATE, A.DEPT_NO, A.JOB_CODE, '
585 'A.JOB_GRADE, A.JOB_COUNTRY, A.SALARY, A.FULL_NAME, D.DEPT_PATH, D.DEPT_KEY_PATH, J.JOB_TITLE'
586 'From EMPLOYEE A'
587 'JOIN Depts D On D.DEPT_NO = A.DEPT_NO'
588 'JOIN JOB J on J.JOB_CODE = A.JOB_CODE'
589 'Order by A.LAST_NAME'
590 )
591 ModifySQL.Strings = (
592 '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'
593 'Where A.EMP_NO = :OLD_EMP_NO'
594 )
595 GeneratorField.Generator = 'EMP_NO_GEN'
596 GeneratorField.Field = 'EMP_NO'
597 GeneratorField.ApplyOnEvent = gaeOnNewRecord
598 GenerateParamNames = False
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