home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 September / Chip_2001-09_cd1.bin / zkuste / delphi / kolekce / d6 / RX275D6.ZIP / Units / RXTOOREG.PAS < prev    next >
Pascal/Delphi Source File  |  2001-06-24  |  7KB  |  198 lines

  1. {*******************************************************}
  2. {                                                       }
  3. {         Delphi VCL Extensions (RX)                    }
  4. {                                                       }
  5. {         Copyright (c) 1995, 1996 AO ROSNO             }
  6. {         Copyright (c) 1997, 1998 Master-Bank          }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. { Note:
  11.   - in Delphi 4.0 you must add DCLSTD40 to the requires page of the
  12.     package you install this components into.
  13.   - in Delphi 3.0 you must add DCLSTD30 to the requires page of the
  14.     package you install this components into.
  15.   - in C++Builder 3.0 you must add DCLSTD35 to the requires page of the
  16.     package you install this components into. }
  17.  
  18. unit RxTooReg;
  19.  
  20. {$I RX.INC}
  21. {$D-,L-,S-}
  22.  
  23. interface
  24.  
  25. procedure Register;
  26.  
  27. implementation
  28.  
  29. {$IFDEF WIN32}
  30. {$R *.D32}
  31. {$ELSE}
  32. {$R *.D16}
  33. {$ENDIF}
  34.  
  35. uses Classes, SysUtils, Controls, Graphics, TypInfo, RTLConsts, DesignIntf, DesignEditors, VCLEditors, Consts,
  36.   ExtCtrls, PictEdit, RxHook, PicClip, Placemnt, PresrDsn, MinMaxEd, DualList,
  37.   ClipView, Speedbar, SbEdit, DataConv, RXCalc, PageMngr, PgMngrEd, MrgMngr,
  38.   StrHlder, RXShell, AppEvent, VCLUtils, TimerLst, TimLstEd, IcoList, IcoLEdit,
  39.   {$IFDEF USE_RX_GIF} RxGIF, GIFCtrl, {$ENDIF} RXLConst, RXCtrls,
  40.   {$IFDEF RX_D3} RxResExp, {$ENDIF} RxMenus, MRUList,
  41.   {$IFDEF WIN32} RxNotify, RxGrdCpt, GradEdit, {$ENDIF} HintProp;
  42.  
  43. { TStringsEditor }
  44.  
  45. type
  46.   TStringsEditor = class(TDefaultEditor)
  47.   public
  48.     procedure EditProperty(const Prop: IProperty; var Continue: Boolean); override;
  49.   end;
  50.  
  51. procedure TStringsEditor.EditProperty(const Prop: IProperty; var Continue: Boolean);
  52. var
  53.   PropName: string;
  54. begin
  55.   PropName := Prop.GetName;
  56.   if (CompareText(PropName, 'STRINGS') = 0) then begin
  57.     Prop.Edit;
  58.     Continue := False;
  59.   end;
  60. end;
  61.  
  62. { TComponentFormProperty }
  63.  
  64. type
  65.   TComponentFormProperty = class(TComponentProperty)
  66.   public
  67.     procedure GetValues(Proc: TGetStrProc); override;
  68.     procedure SetValue(const Value: string); override;
  69.   end;
  70.  
  71. procedure TComponentFormProperty.GetValues(Proc: TGetStrProc);
  72. begin
  73.   inherited GetValues(Proc);
  74.   if (Designer.Root is GetTypeData(GetPropType)^.ClassType) and
  75.     (Designer.Root.Name <> '') then Proc(Designer.Root.Name);
  76. end;
  77.  
  78. procedure TComponentFormProperty.SetValue(const Value: string);
  79. var
  80.   Component: TComponent;
  81. begin
  82. {$IFDEF WIN32}
  83.   Component := Designer.GetComponent(Value);
  84. {$ELSE}
  85.   Component := Designer.Root.FindComponent(Value);
  86. {$ENDIF}
  87.   if ((Component = nil) or not (Component is GetTypeData(GetPropType)^.ClassType))
  88.     and (CompareText(Designer.Root.Name, Value) = 0) then
  89.   begin
  90.     if not (Designer.Root is GetTypeData(GetPropType)^.ClassType) then
  91.       raise EPropertyError.Create(ResStr(SInvalidPropertyValue));
  92.     SetOrdValue(Longint(Designer.Root));
  93.   end
  94.   else inherited SetValue(Value);
  95. end;
  96.  
  97. { Designer registration }
  98.  
  99. procedure Register;
  100. begin
  101. { Components }
  102.   RegisterComponents(LoadStr(srRXTools), [TPicClip, TFormStorage,
  103.     TFormPlacement, TRxWindowHook, TAppEvents, TSpeedbar, TRxCalculator,
  104.     TRxTimerList, TPageManager, TMergeManager, TMRUManager, TSecretPanel,
  105.     TStrHolder, TRxTrayIcon, TRxMainMenu, TRxPopupMenu,
  106.     {$IFDEF WIN32} TRxFolderMonitor, {$ENDIF} TClipboardViewer,
  107.     {$IFDEF WIN32} TRxGradientCaption, {$ENDIF} TDualListDialog
  108.     {$IFNDEF RX_D4}, TConverter {$ENDIF}]);
  109.  
  110. {$IFDEF RX_D3}
  111.   RegisterNonActiveX([TPicClip, TFormPlacement, TFormStorage, TRxWindowHook,
  112.     TDualListDialog, TSecretPanel, TSpeedbar, TClipboardViewer,
  113.     TPageManager, TMergeManager, TMRUManager, TAppEvents, TRxTimerList, 
  114.     TRxTrayIcon, TRxFolderMonitor, TRxGradientCaption], axrComponentOnly);
  115. {$ENDIF RX_D3}
  116.  
  117. { TPicClip }
  118.   RegisterComponentEditor(TPicClip, TGraphicsEditor);
  119.  
  120. { TStrHolder }
  121.   RegisterComponentEditor(TStrHolder, TStringsEditor);
  122.  
  123. { TFormPlacement }
  124.   RegisterPropertyEditor(TypeInfo(TWinMinMaxInfo), TFormPlacement,
  125.     'MinMaxInfo', TMinMaxProperty);
  126.  
  127. { TFormStorage }
  128.   RegisterComponentEditor(TFormStorage, TFormStorageEditor);
  129.   RegisterPropertyEditor(TypeInfo(TStrings), TFormStorage, 'StoredProps',
  130.     TStoredPropsProperty);
  131.  
  132. { TRxWindowHook }
  133.   RegisterPropertyEditor(TypeInfo(TWinControl), TRxWindowHook,
  134.     'WinControl', TComponentFormProperty);
  135.  
  136. { TSpeedbar }
  137.   RegisterNoIcon([TSpeedItem, TSpeedbarSection]);
  138.   RegisterComponentEditor(TSpeedbar, TSpeedbarCompEditor);
  139.   RegisterPropertyEditor(TypeInfo(TCaption), TSpeedItem, 'BtnCaption', THintProperty);
  140.  
  141. { TPageManager }
  142.   RegisterNoIcon([TPageProxy]);
  143.   RegisterComponentEditor(TPageManager, TPageManagerEditor);
  144.   RegisterPropertyEditor(TypeInfo(TList), TPageManager, 'PageProxies',
  145.     TProxyListProperty);
  146.   RegisterPropertyEditor(TypeInfo(string), TPageProxy, 'PageName',
  147.     TPageNameProperty);
  148.   RegisterPropertyEditor(TypeInfo(TControl), TPageManager, 'PriorBtn',
  149.     TPageBtnProperty);
  150.   RegisterPropertyEditor(TypeInfo(TControl), TPageManager, 'NextBtn',
  151.     TPageBtnProperty);
  152.  
  153. { TMergeManager }
  154.   RegisterPropertyEditor(TypeInfo(TWinControl), TMergeManager,
  155.     'MergeFrame', TComponentFormProperty);
  156.  
  157. { TRxTimerList }
  158.   RegisterNoIcon([TRxTimerEvent]);
  159.   RegisterComponentEditor(TRxTimerList, TTimersCollectionEditor);
  160.   RegisterPropertyEditor(TypeInfo(TList), TRxTimerList, 'Events',
  161.     TTimersItemListProperty);
  162.  
  163. { TRxTrayIcon }
  164.   RegisterPropertyEditor(TypeInfo(TIconList), nil, '', TIconListProperty);
  165.   RegisterPropertyEditor(TypeInfo(string), TRxTrayIcon, 'Hint',
  166.     TStringProperty);
  167. {$IFDEF RX_D4}
  168.  
  169. { RxMenus }
  170.   RegisterPropertyEditor(TypeInfo(Boolean), TRxMainMenu, 'OwnerDraw', nil);
  171.   RegisterPropertyEditor(TypeInfo(Boolean), TRxPopupMenu, 'OwnerDraw', nil);
  172. {$ENDIF}
  173.  
  174. {$IFDEF USE_RX_GIF}
  175. { TRxGIFAnimator }
  176.   RegisterComponentEditor(TRxGIFAnimator, TGraphicsEditor);
  177. {$ENDIF}
  178.  
  179.   RegisterPropertyEditor(TypeInfo(TPicture), nil, '', TPictProperty);
  180.   RegisterPropertyEditor(TypeInfo(TGraphic), nil, '', TGraphicPropertyEditor);
  181.   RegisterComponentEditor(TImage, TGraphicsEditor);
  182.  
  183. {$IFDEF WIN32}
  184. { TRxGradientCaption }
  185.   RegisterComponentEditor(TRxGradientCaption, TGradientCaptionEditor);
  186.  {$IFNDEF RX_D3}
  187.   RegisterPropertyEditor(TypeInfo(TRxCaptionList), TRxGradientCaption, '',
  188.     TGradientCaptionsProperty);
  189.  {$ENDIF}
  190. {$ENDIF}
  191.  
  192. {$IFDEF RX_D3}
  193. { Project Resource Expert }
  194.   RegisterResourceExpert;
  195. {$ENDIF}
  196. end;
  197.  
  198. end.