From: Warren P. <wp...@us...> - 2003-10-03 20:54:40
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1:/tmp/cvs-serv2558/run Modified Files: JvInspector.pas Log Message: new simplified API, and a few comments to indicate why the overloaded New method was compiled out (the BCB compatibility thing), which tripped me up. Index: JvInspector.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvInspector.pas,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** JvInspector.pas 2 Oct 2003 08:45:51 -0000 1.12 --- JvInspector.pas 3 Oct 2003 20:54:28 -0000 1.13 *************** *** 351,354 **** --- 351,359 ---- function VisibleIndex(const AItem: TJvCustomInspectorItem): Integer; virtual; procedure RefreshValues; + + (* some easier to use methods added by WAP *) + procedure AddComponent(const aComponent: TComponent; DisplayName:String; expanded:Boolean); + procedure Clear; + published { Standard TCustomControl events - these are really events fired by *************** *** 1313,1317 **** --- 1318,1324 ---- class function ItemRegister: TJvInspectorRegister; override; class function New(const AParent: TJvCustomInspectorItem; const AName: string; const ATypeInfo: PTypeInfo; const AAddress: Pointer): TJvCustomInspectorItem; reintroduce; overload; + // REMOVED BECAUSE OF A BCB INCOMPATIBILITY: // class function New(const AParent: TJvCustomInspectorItem; const AName: string; const ATypeInfo: PTypeInfo; const AVar): TJvCustomInspectorItem; overload; + procedure SetAsSet(const Buf); override; property Address: Pointer read GetAddress write SetAddress; *************** *** 9205,9209 **** end; ! (*class function TJvInspectorVarData.New(const AParent: TJvCustomInspectorItem; const AName: string; const ATypeInfo: PTypeInfo; const AVar): TJvCustomInspectorItem; begin Result := New(AParent, AName, ATypeInfo, Addr(AVar)); --- 9212,9219 ---- end; ! ! (* **REMOVED BECAUSE IT CREATES AN OVERLOADED SITUATION THAT IS INCOMPATIBLE WITH BCB. ! **USE @Var instead when invoking the other method, if you get compilation errors. ! class function TJvInspectorVarData.New(const AParent: TJvCustomInspectorItem; const AName: string; const ATypeInfo: PTypeInfo; const AVar): TJvCustomInspectorItem; begin Result := New(AParent, AName, ATypeInfo, Addr(AVar)); *************** *** 9211,9214 **** --- 9221,9225 ---- *) + procedure TJvInspectorVarData.SetAsSet(const Buf); var *************** *** 10812,10815 **** --- 10823,10846 ---- TJvInspectorPropData.New(Root, Value); FInspectObject := Value; + end; + + (* some ease of use improvements:WAP *) + procedure TJvCustomInspector.AddComponent(const aComponent: TComponent; DisplayName:String; expanded:Boolean); + var + InspCat: TJvInspectorCustomCategoryItem; + begin + BeginUpdate; + InspCat := TJvInspectorCustomCategoryItem.Create( Self.Root, nil); + InspCat.DisplayName := DisplayName; + TJvInspectorPropData.New(InspCat, aComponent); + InspCat.Expanded := expanded; + EndUpdate; + end; + + procedure TJvCustomInspector.Clear; + begin + BeginUpdate; + Root.Clear; + EndUpdate; end; |