source: cprs/trunk/VA/VA508Accessibility/VA508AccessibilityPE.pas@ 837

Last change on this file since 837 was 829, checked in by Kevin Toppenberg, 14 years ago

Upgrade to version 27

File size: 22.1 KB
Line 
1unit VA508AccessibilityPE;
2
3interface
4
5uses
6 Windows, SysUtils, DesignIntf, DesignEditors, DesignConst, TypInfo, Controls, StdCtrls,
7 Classes, Forms, VA508AccessibilityManager, Dialogs, ColnEdit, RTLConsts;
8
9type
10 TVA508AccessibilityManager4PE = class(TVA508AccessibilityManager);
11
12 TVA508AccessibilityPropertyMapper = class(TStringProperty)
13 public
14 function GetAttributes: TPropertyAttributes; override;
15 procedure GetProperties(Proc: TGetPropProc); override;
16 end;
17
18 TVA508NestedPropertyType = (ptText, ptLabel, ptProperty, ptDefault); //, ptEvent);
19
20 TVA508NestedPropertyEditor = class(TNestedProperty)
21 strict private
22 FName: String;
23 FType: TVA508NestedPropertyType;
24 FManager: TVA508AccessibilityManager4PE;
25 protected
26 property Manager: TVA508AccessibilityManager4PE read FManager;
27 public
28 constructor Create(AParent: TVA508AccessibilityPropertyMapper;
29 AName: String; PType: TVA508NestedPropertyType);
30 function AllEqual: Boolean; override;
31 procedure Edit; override;
32 function GetEditLimit: Integer; override;
33 function GetAttributes: TPropertyAttributes; override;
34 function GetName: string; override;
35 function GetValue: string; override;
36 procedure GetValues(Proc: TGetStrProc); override;
37 procedure SetValue(const Value: string); override;
38 end;
39
40 {
41 TVA508AccessibilityEventPropertyEditor = class(TVA508NestedPropertyEditor, IMethodProperty)
42 protected
43 function GetMethodValue(Index: Integer): TMethod;
44 public
45 function AllNamed: Boolean; virtual;
46 procedure Edit; override;
47 function GetValue: string; override;
48 procedure GetValues(Proc: TGetStrProc); override;
49 procedure SetValue(const AValue: string); override;
50 function GetFormMethodName: string; virtual;
51 function GetTrimmedEventName: string;
52 end;
53 }
54
55 TVA508CollectionPropertyEditor = class(TCollectionProperty)
56 public
57 function GetColOptions: TColOptions; override;
58 end;
59
60 TVA508AccessibilityLabelPropertyEditor = class(TComponentProperty)
61 private
62 FManager: TVA508AccessibilityManager4PE;
63 function GetManager: TVA508AccessibilityManager4PE;
64 public
65 function GetAttributes: TPropertyAttributes; override;
66 procedure GetProperties(Proc: TGetPropProc); override;
67 function GetValue: string; override;
68 procedure GetValues(Proc: TGetStrProc); override;
69 procedure SetValue(const Value: string); override;
70 end;
71
72 TVA508AccessibilityPropertyPropertyEditor = class(TStringProperty)
73 private
74 FManager: TVA508AccessibilityManager4PE;
75 function GetManager: TVA508AccessibilityManager4PE;
76 function GetRootComponent(index: integer): TWinControl;
77 public
78 function AllEqual: Boolean; override;
79 function GetAttributes: TPropertyAttributes; override;
80 function GetEditLimit: Integer; override;
81 function GetValue: string; override;
82 procedure GetValues(Proc: TGetStrProc); override;
83 procedure SetValue(const Value: string); override;
84 end;
85
86 TVA508AccessibilityComponentPropertyEditor = class(TComponentProperty)
87 public
88 function GetAttributes: TPropertyAttributes; override;
89 end;
90
91const
92 WinControlPropertyToMap = 'Hint';
93
94procedure Register;
95
96implementation
97
98function GetAccessibilityManager(Editor: TPropertyEditor; Index: integer): TVA508AccessibilityManager4PE;
99var
100 Control, Root: TComponent;
101 i: integer;
102
103begin
104 Result := nil;
105 if assigned(Editor.GetComponent(Index)) and (Editor.GetComponent(Index) is TComponent) then
106 begin
107 Control := TComponent(Editor.GetComponent(Index));
108 Root := Control;
109 while (assigned(Root) and (not (Root is TCustomForm))) do
110 Root := Root.Owner;
111 if assigned(Root) and (Root is TCustomForm) then
112 begin
113 for i := 0 to Root.ComponentCount-1 do
114 begin
115 if Root.Components[i] is TVA508AccessibilityManager then
116 begin
117 Result := TVA508AccessibilityManager4PE(Root.Components[i]);
118 exit;
119 end;
120 end;
121 end;
122 end;
123end;
124
125function AllComponentsHaveSameManager(Editor: TPropertyEditor): boolean;
126var
127 i: integer;
128 manager: TVA508AccessibilityManager4PE;
129begin
130 manager := GetAccessibilityManager(Editor, 0);
131 Result := assigned(manager);
132 if (not result) or (Editor.PropCount < 2) then exit;
133 for i := 1 to Editor.PropCount-1 do
134 begin
135 if (GetAccessibilityManager(Editor, i) <> manager) then
136 begin
137 Result := FALSE;
138 exit;
139 end;
140 end;
141end;
142
143procedure GetStringPropertyNames(Manager: TVA508AccessibilityManager4PE;
144 Component: TWinControl; List: TStringList; Add: boolean);
145var
146 i: Integer;
147 current: TStringList;
148
149begin
150 current := TStringList.Create;
151 try
152 Manager.GetProperties(Component, current);
153 if Add then
154 list.Assign(current)
155 else
156 begin
157 for I := List.Count - 1 downto 0 do
158 begin
159 if current.IndexOf(list[i]) < 0 then
160 List.Delete(i);
161 end;
162 end;
163 finally
164 current.Free;
165 end;
166end;
167
168function QVal(txt: string): string;
169begin
170 Result := '="' + txt + '"';
171end;
172
173function StripQVal(text: string): string;
174var
175 i: integer;
176begin
177 i := pos('=', text);
178 if (i > 0) then
179 Result := copy(text,1,i-1)
180 else
181 Result := text;
182end;
183
184{ TVA508AccessibilityPropertyMapper }
185
186const
187 DelphiPaletteName = 'VA 508';
188
189
190function TVA508AccessibilityPropertyMapper.GetAttributes: TPropertyAttributes;
191begin
192 if AllComponentsHaveSameManager(Self) then
193 Result := [paMultiSelect, paRevertable, paSubProperties]
194 else
195 Result := inherited GetAttributes;
196end;
197
198procedure TVA508AccessibilityPropertyMapper.GetProperties(
199 Proc: TGetPropProc);
200begin
201 if not AllComponentsHaveSameManager(Self) then exit;
202 Proc(TVA508NestedPropertyEditor.Create(Self, AccessibilityLabelPropertyName, ptLabel));
203 Proc(TVA508NestedPropertyEditor.Create(Self, AccessibilityPropertyPropertyName, ptProperty));
204 Proc(TVA508NestedPropertyEditor.Create(Self, AccessibilityTextPropertyName, ptText));
205 Proc(TVA508NestedPropertyEditor.Create(Self, AccessibilityUseDefaultPropertyName, ptDefault));
206// Proc(TVA508AccessibilityEventPropertyEditor.Create(Self, AccessibilityEventPropertyName, ptEvent));
207end;
208
209{ TVA508NestedStringProperty }
210
211function TVA508NestedPropertyEditor.AllEqual: Boolean;
212var
213 i: Integer;
214 txt, prop: string;
215 lbl: TLabel;
216// V, T: TMethod;
217 default: boolean;
218
219begin
220 if PropCount > 1 then
221 begin
222 Result := False;
223 if not (GetComponent(0) is TWinControl) then exit;
224 case FType of
225 ptText:
226 begin
227 txt := FManager.AccessText[TWinControl(GetComponent(0))];
228 for i := 1 to PropCount - 1 do
229 if txt <> FManager.AccessText[TWinControl(GetComponent(i))] then exit;
230 end;
231
232 ptLabel:
233 begin
234 lbl := FManager.AccessLabel[TWinControl(GetComponent(0))];
235 for i := 1 to PropCount - 1 do
236 if lbl <> FManager.AccessLabel[TWinControl(GetComponent(i))] then exit;
237 end;
238
239 ptProperty:
240 begin
241 prop := FManager.AccessProperty[TWinControl(GetComponent(0))];
242 for i := 1 to PropCount - 1 do
243 if prop <> FManager.AccessProperty[TWinControl(GetComponent(i))] then exit;
244 end;
245
246 ptDefault:
247 begin
248 default := FManager.UseDefault[TWinControl(GetComponent(0))];
249 for i := 1 to PropCount - 1 do
250 if default <> FManager.UseDefault[TWinControl(GetComponent(i))] then exit;
251 end;
252
253
254{ ptEvent:
255 begin
256 V := TMethod(FManager.OnComponentAccessRequest[TWinControl(GetComponent(0))]);
257 for i := 1 to PropCount - 1 do
258 begin
259 T := TMethod(FManager.OnComponentAccessRequest[TWinControl(GetComponent(i))]);
260 if (T.Code <> V.Code) or (T.Data <> V.Data) then Exit;
261 end;
262 end;}
263 end;
264 end;
265 Result := True;
266end;
267
268constructor TVA508NestedPropertyEditor.Create(AParent: TVA508AccessibilityPropertyMapper;
269 AName: String; PType: TVA508NestedPropertyType);
270begin
271 inherited Create(AParent);
272 FManager := GetAccessibilityManager(AParent, 0);
273 FName := AName;
274 FType := PType;
275end;
276
277procedure TVA508NestedPropertyEditor.Edit;
278var
279 lbl: TLabel;
280
281begin
282 if (FType = ptLabel) and
283 (Designer.GetShiftState * [ssCtrl, ssLeft] = [ssCtrl, ssLeft]) then
284 begin
285 lbl := FManager.AccessLabel[TWinControl(GetComponent(0))];
286 if assigned(lbl) then
287 Designer.SelectComponent(lbl)
288 else
289 inherited Edit;
290 end
291 else
292 inherited Edit;
293end;
294
295function TVA508NestedPropertyEditor.GetAttributes: TPropertyAttributes;
296begin
297 case FType of
298 ptText:
299 Result := [paMultiSelect, paRevertable, paAutoUpdate];
300 ptLabel, ptProperty:
301 Result := [paMultiSelect, paRevertable, paValueList, paSortList, paAutoUpdate];
302 ptDefault:
303 Result := [paMultiSelect, paValueList, paSortList, paRevertable];
304
305// ptEvent:
306// Result := [paMultiSelect, paValueList, paSortList, paRevertable];
307 else
308 Result := [];
309 end;
310
311end;
312
313function TVA508NestedPropertyEditor.GetEditLimit: Integer;
314begin
315 case FType of
316 ptText: Result := 32767;
317 ptDefault : Result := 63;
318// ptEvent: Result := MaxIdentLength;
319 else // ptLabel, ptProperty:
320 Result := 127;
321 end;
322end;
323
324function TVA508NestedPropertyEditor.GetName: string;
325begin
326 Result := FName;
327end;
328
329function TVA508NestedPropertyEditor.GetValue: string;
330var
331 lbl: TLabel;
332 Default: boolean;
333begin
334 Result := '';
335 if not (GetComponent(0) is TWinControl) then exit;
336 case FType of
337 ptLabel:
338 begin
339 lbl := FManager.AccessLabel[TWinControl(GetComponent(0))];
340 if assigned(lbl) then
341 Result := FManager.GetComponentName(lbl) + QVal(lbl.Caption);
342 end;
343 ptText:
344 Result := FManager.AccessText[TWinControl(GetComponent(0))];
345 ptProperty:
346 begin
347 Result := FManager.AccessProperty[TWinControl(GetComponent(0))];
348 if Result <> '' then
349 Result := Result + QVal(GetPropValue(GetComponent(0), Result));
350 end;
351 ptDefault:
352 begin
353 Default := FManager.UseDefault[TWinControl(GetComponent(0))];
354 Result := GetEnumName(TypeInfo(Boolean), Ord(Default));
355 end;
356 end;
357end;
358
359procedure TVA508NestedPropertyEditor.GetValues(Proc: TGetStrProc);
360var
361 list: TStringList;
362 i: integer;
363 name: string;
364
365begin
366 list := TStringList.Create;
367 try
368 case FType of
369 ptLabel:
370 begin
371 FManager.GetLabelStrings(list);
372 for i := 0 to list.count-1 do
373 Proc(list[i]);
374 end;
375
376 ptProperty:
377 begin
378 GetStringPropertyNames(FManager, TWinControl(GetComponent(0)), list, TRUE);
379 if PropCount > 1 then
380 begin
381 for i := 1 to PropCount-1 do
382 begin
383 if GetComponent(i) is TWinControl then
384 GetStringPropertyNames(FManager, TWinControl(GetComponent(i)), list, FALSE);
385 end;
386 end;
387 list.Sort;
388 for i := 0 to list.count-1 do
389 begin
390 name := list[i];
391 if PropCount = 1 then
392 name := name + QVal(GetPropValue(GetComponent(0), name));
393 Proc(name);
394 end;
395 end;
396
397 ptDefault:
398 begin
399 Proc(GetEnumName(TypeInfo(Boolean), Ord(False)));
400 Proc(GetEnumName(TypeInfo(Boolean), Ord(True)));
401 end;
402
403 end;
404 finally
405 list.free;
406 end;
407end;
408
409procedure TVA508NestedPropertyEditor.SetValue(const Value: string);
410var
411 i, BVal: Integer;
412 lbl: TLabel;
413 cmp: TComponent;
414 Name: String;
415
416begin
417 BVal := Ord(FALSE);
418 lbl := nil;
419 case FType of
420
421 ptLabel:
422 begin
423 Name := StripQVal(Value);
424 cmp := Designer.GetComponent(Name);
425 if (cmp is TLabel) then
426 lbl := TLabel(cmp);
427 end;
428
429 ptProperty: Name := StripQVal(Value);
430
431 ptDefault:
432 begin
433 BVal := GetEnumValue(TypeInfo(Boolean), Value);
434 with GetTypeData(TypeInfo(Boolean))^ do
435 if (BVal < MinValue) or (BVal > MaxValue) then
436 raise EPropertyError.CreateRes(@SInvalidPropertyValue);
437 end;
438
439 end;
440 for i := 0 to PropCount - 1 do
441 begin
442 if GetComponent(i) is TWinControl then
443 begin
444 case FType of
445 ptText: FManager.AccessText[TWinControl(GetComponent(i))] := Value;
446 ptLabel: FManager.AccessLabel[TWinControl(GetComponent(i))] := lbl;
447 ptProperty: FManager.AccessProperty[TWinControl(GetComponent(i))] := Name;
448 ptDefault: FManager.UseDefault[TWinControl(GetComponent(i))] := Boolean(BVal);
449 end;
450 end;
451 end;
452 Modified;
453end;
454
455(*
456{ TVA508AccessibilityEventPropertyEditor }
457
458function TVA508AccessibilityEventPropertyEditor.AllNamed: Boolean;
459var
460 I: Integer;
461begin
462 Result := True;
463 for I := 0 to PropCount - 1 do
464 if GetComponent(I).GetNamePath = '' then
465 begin
466 Result := False;
467 Break;
468 end;
469end;
470
471procedure TVA508AccessibilityEventPropertyEditor.Edit;
472var
473 FormMethodName: string;
474 CurDesigner: IDesigner;
475begin
476 CurDesigner := Designer; { Local property so if designer is nil'ed out, no AV will happen }
477 if not AllNamed then
478 raise EPropertyError.CreateRes(@SCannotCreateName);
479 FormMethodName := GetValue;
480 if (FormMethodName = '') or
481 CurDesigner.MethodFromAncestor(GetMethodValue(0)) then
482 begin
483 if FormMethodName = '' then
484 FormMethodName := GetFormMethodName;
485 if FormMethodName = '' then
486 raise EPropertyError.CreateRes(@SCannotCreateName);
487 SetValue(FormMethodName);
488 end;
489 CurDesigner.ShowMethod(FormMethodName);
490end;
491
492function TVA508AccessibilityEventPropertyEditor.GetFormMethodName: string;
493var
494 I: Integer;
495begin
496 if GetComponent(0) = Designer.GetRoot then
497 begin
498 Result := Designer.GetRootClassName;
499 if (Result <> '') and (Result[1] = 'T') then
500 Delete(Result, 1, 1);
501 end
502 else
503 begin
504 Result := Designer.GetObjectName(GetComponent(0));
505 for I := Length(Result) downto 1 do
506 if Result[I] in ['.', '[', ']', '-', '>'] then
507 Delete(Result, I, 1);
508 end;
509 if Result = '' then
510 raise EPropertyError.CreateRes(@SCannotCreateName);
511 Result := Result + GetTrimmedEventName;
512end;
513
514function TVA508AccessibilityEventPropertyEditor.GetMethodValue(Index: Integer): TMethod;
515begin
516 if not (GetComponent(Index) is TWinControl) then
517 begin
518 Result.Code := nil;
519 Result.Data := nil;
520 end
521 else
522 Result := TMethod(Manager.OnComponentAccessRequest[TWinControl(GetComponent(Index))]);
523end;
524
525{ TVA508AccessibilityEventPropertyEditor }
526
527function TVA508AccessibilityEventPropertyEditor.GetTrimmedEventName: string;
528begin
529 Result := GetName;
530 if (Length(Result) >= 2) and
531 (Result[1] in ['O', 'o']) and (Result[2] in ['N', 'n']) then
532 Delete(Result,1,2);
533end;
534
535function TVA508AccessibilityEventPropertyEditor.GetValue: string;
536begin
537 Result := Designer.GetMethodName(GetMethodValue(0));
538end;
539
540procedure TVA508AccessibilityEventPropertyEditor.GetValues(Proc: TGetStrProc);
541begin
542 Designer.GetMethods(GetTypeData(TypeInfo(TVA508ComponentScreenReaderEvent)), Proc);
543end;
544
545procedure TVA508AccessibilityEventPropertyEditor.SetValue(const AValue: string);
546
547var
548 CurDesigner: IDesigner;
549
550 procedure CheckChainCall(const MethodName: string; Method: TMethod);
551 var
552 Persistent: TPersistent;
553 Component: TComponent;
554 InstanceMethod: string;
555 Instance: TComponent;
556 begin
557 Persistent := GetComponent(0);
558 if Persistent is TComponent then
559 begin
560 Component := TComponent(Persistent);
561 if (Component.Name <> '') and (Method.Data <> CurDesigner.GetRoot) and
562 (TObject(Method.Data) is TComponent) then
563 begin
564 Instance := TComponent(Method.Data);
565 InstanceMethod := Instance.MethodName(Method.Code);
566 if InstanceMethod <> '' then
567 CurDesigner.ChainCall(MethodName, Instance.Name, InstanceMethod,
568 GetTypeData(TypeInfo(TVA508ComponentScreenReaderEvent)));
569 end;
570 end;
571 end;
572
573var
574 NewMethod: Boolean;
575 CurValue: string;
576 OldMethod: TMethod;
577 i: integer;
578 event: TVA508ComponentScreenReaderEvent;
579begin
580 CurDesigner := Designer;
581 if not AllNamed then
582 raise EPropertyError.CreateRes(@SCannotCreateName);
583 CurValue:= GetValue;
584 if (CurValue <> '') and (AValue <> '') and (SameText(CurValue, AValue) or
585 not CurDesigner.MethodExists(AValue)) and
586 not CurDesigner.MethodFromAncestor(GetMethodValue(0)) then
587 CurDesigner.RenameMethod(CurValue, AValue)
588 else
589 begin
590 NewMethod := (AValue <> '') and not CurDesigner.MethodExists(AValue);
591 OldMethod := GetMethodValue(0);
592 event := TVA508ComponentScreenReaderEvent(CurDesigner.CreateMethod(AValue, GetTypeData(TypeInfo(TVA508ComponentScreenReaderEvent))));
593 for i := 0 to PropCount - 1 do
594 begin
595 if (GetComponent(i) is TWinControl) then
596 Manager.OnComponentAccessRequest[TWinControl(GetComponent(i))] := event;
597 end;
598 if NewMethod then
599 begin
600 { Designer may have been nil'ed out this point when the code editor
601 recieved focus. This fixes an AV by using a local variable which
602 keeps a reference to the designer }
603 if (PropCount = 1) and (OldMethod.Data <> nil) and (OldMethod.Code <> nil) then
604 CheckChainCall(AValue, OldMethod);
605 CurDesigner.ShowMethod(AValue);
606 end;
607 end;
608 Modified;
609end;
610
611*)
612
613{ TVA508CollectionProperty }
614
615function TVA508CollectionPropertyEditor.GetColOptions: TColOptions;
616begin
617 Result := [coMove];
618end;
619
620
621{ TVA508AccessibilityLabelPropertyEditor }
622
623function TVA508AccessibilityLabelPropertyEditor.GetAttributes: TPropertyAttributes;
624begin
625 Result := [paMultiSelect, paRevertable, paValueList, paSortList, paAutoUpdate];
626end;
627
628function TVA508AccessibilityLabelPropertyEditor.GetManager: TVA508AccessibilityManager4PE;
629begin
630 if not assigned(FManager) then
631 FManager := TVA508AccessibilityManager4PE(TVA508AccessibilityItem(GetComponent(0)).Manager);
632 Result := FManager;
633end;
634
635procedure TVA508AccessibilityLabelPropertyEditor.GetProperties(
636 Proc: TGetPropProc);
637begin
638 exit;
639end;
640
641function TVA508AccessibilityLabelPropertyEditor.GetValue: string;
642var
643 lbl: TLabel;
644begin
645 lbl := TVA508AccessibilityItem(GetComponent(0)).AccessLabel;
646 if assigned(lbl) then
647 Result := GetManager.GetComponentName(lbl) + QVal(lbl.Caption);
648end;
649
650procedure TVA508AccessibilityLabelPropertyEditor.GetValues(Proc: TGetStrProc);
651var
652 i: integer;
653 list: TStringList;
654begin
655 list := TStringList.Create;
656 try
657 GetManager.GetLabelStrings(list);
658 for i := 0 to list.count-1 do
659 Proc(list[i]);
660 finally
661 list.Free;
662 end;
663end;
664
665procedure TVA508AccessibilityLabelPropertyEditor.SetValue(const Value: string);
666begin
667 inherited SetValue(StripQVal(Value));
668end;
669
670{ TVA508AccessibilityPropertyPropertyEditor }
671
672function TVA508AccessibilityPropertyPropertyEditor.AllEqual: Boolean;
673var
674 i: integer;
675 prop: string;
676begin
677 if PropCount > 1 then
678 begin
679 Result := FALSE;
680 prop := GetManager.AccessProperty[TWinControl(GetComponent(0))];
681 for i := 1 to PropCount - 1 do
682 if prop <> FManager.AccessProperty[TWinControl(GetComponent(i))] then exit;
683 end;
684 Result := TRUE;
685end;
686
687function TVA508AccessibilityPropertyPropertyEditor.GetAttributes: TPropertyAttributes;
688begin
689 Result := [paMultiSelect, paRevertable, paValueList, paSortList, paAutoUpdate];
690end;
691
692function TVA508AccessibilityPropertyPropertyEditor.GetEditLimit: Integer;
693begin
694 Result := 127;
695end;
696
697function TVA508AccessibilityPropertyPropertyEditor.GetManager: TVA508AccessibilityManager4PE;
698begin
699 if not assigned(FManager) then
700 FManager := TVA508AccessibilityManager4PE(TVA508AccessibilityItem(GetComponent(0)).Manager);
701 Result := FManager;
702end;
703
704function TVA508AccessibilityPropertyPropertyEditor.GetRootComponent(
705 index: integer): TWinControl;
706begin
707 Result := TVA508AccessibilityItem(GetComponent(index)).Component;
708end;
709
710function TVA508AccessibilityPropertyPropertyEditor.GetValue: string;
711begin
712 Result := inherited GetValue;
713 if Result <> '' then
714 Result := Result + QVal(GetPropValue(GetRootComponent(0), Result));
715end;
716
717procedure TVA508AccessibilityPropertyPropertyEditor.GetValues(
718 Proc: TGetStrProc);
719var
720 list: TStringList;
721 i: integer;
722 name: string;
723
724begin
725 list := TStringList.Create;
726 try
727 GetStringPropertyNames(GetManager, GetRootComponent(0), list, TRUE);
728 if PropCount > 1 then
729 begin
730 for i := 1 to PropCount-1 do
731 GetStringPropertyNames(FManager, GetRootComponent(i), list, FALSE);
732 end;
733 list.Sort;
734 for i := 0 to list.count-1 do
735 begin
736 name := list[i];
737 if PropCount = 1 then
738 name := name + QVal(GetPropValue(GetRootComponent(0), name));
739 Proc(name);
740 end;
741 finally
742 list.free;
743 end;
744end;
745
746procedure TVA508AccessibilityPropertyPropertyEditor.SetValue(
747 const Value: string);
748begin
749 inherited SetValue(StripQVal(Value));
750end;
751
752{ TVA508AccessibilityClassPropertyEditor }
753
754function TVA508AccessibilityComponentPropertyEditor.GetAttributes: TPropertyAttributes;
755begin
756 Result := [paDisplayReadOnly];
757end;
758
759procedure Register;
760begin
761 RegisterComponents(DelphiPaletteName, [TVA508AccessibilityManager, TVA508ComponentAccessibility,
762 TVA508StaticText]);
763 RegisterPropertyEditor(TypeInfo(TVA508AccessibilityCollection),
764 TVA508AccessibilityManager, VA508DataPropertyName, TVA508CollectionPropertyEditor);
765 RegisterPropertyEditor(TypeInfo(String), TWinControl, WinControlPropertyToMap,
766 TVA508AccessibilityPropertyMapper);
767 RegisterPropertyEditor(TypeInfo(TLabel), TVA508AccessibilityItem, AccessibilityLabelPropertyName,
768 TVA508AccessibilityLabelPropertyEditor);
769 RegisterPropertyEditor(TypeInfo(String), TVA508AccessibilityItem, AccessibilityPropertyPropertyName,
770 TVA508AccessibilityPropertyPropertyEditor);
771 RegisterPropertyEditor(TypeInfo(TComponent), TVA508AccessibilityItem, AccessDataComponentText,
772 TVA508AccessibilityComponentPropertyEditor);
773end;
774
775end.
776
Note: See TracBrowser for help on using the repository browser.