From: <jfu...@us...> - 2009-02-08 20:34:32
|
Revision: 12205 http://jvcl.svn.sourceforge.net/jvcl/?rev=12205&view=rev Author: jfudickar Date: 2009-02-08 20:34:28 +0000 (Sun, 08 Feb 2009) Log Message: ----------- The PropertyStoreEditor now translates the property names Modified Paths: -------------- trunk/jvcl/examples/JvPropertyStoreEditor/JvProperyStoreEditorMain.pas trunk/jvcl/run/JvDynControlEngineDevExpCx.pas trunk/jvcl/run/JvDynControlEngineIntf.pas trunk/jvcl/run/JvDynControlEngineJVCLInspector.pas trunk/jvcl/run/JvPropertyStoreEditor.pas Modified: trunk/jvcl/examples/JvPropertyStoreEditor/JvProperyStoreEditorMain.pas =================================================================== --- trunk/jvcl/examples/JvPropertyStoreEditor/JvProperyStoreEditorMain.pas 2009-02-08 00:05:05 UTC (rev 12204) +++ trunk/jvcl/examples/JvPropertyStoreEditor/JvProperyStoreEditorMain.pas 2009-02-08 20:34:28 UTC (rev 12205) @@ -6,7 +6,7 @@ Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, JvProgramVersionCheck, JvComponent, JvAppStorage, JvAppIniStorage, StdCtrls, JvUrlListGrabber, JvUrlGrabbers, ImgList, JvPropertyStore,JvAppxmlStorage, - JvComponentBase, ExtCtrls, JvPropertyStoreEditor; + JvComponentBase, ExtCtrls, JvPropertyStoreEditor, JvExControls, JvInspector; type TForm1 = class(TForm) @@ -34,10 +34,16 @@ {$R *.dfm} +{.$DEFINE USE_DEVEXPRESS} + Uses JclFileUtils, + + {$IFDEF USE_DEVEXPRESS} + JvDynControlEngineDevExpCx, + {$ELSE} JvDynControlEngineJVCLInspector, - //JvDynControlEngineDevExpCx, JvDynControlEngineJVCL, + {$ENDIF} JvTypes; constructor TForm1.Create(AOwner: TComponent); @@ -68,5 +74,8 @@ end; begin + {$IFDEF USE_DEVEXPRESS} + {$ELSE} RegisterJvDynControlRTTIInspectorControl(DynControlEngineJVCL); + {$ENDIF} end. Modified: trunk/jvcl/run/JvDynControlEngineDevExpCx.pas =================================================================== --- trunk/jvcl/run/JvDynControlEngineDevExpCx.pas 2009-02-08 00:05:05 UTC (rev 12204) +++ trunk/jvcl/run/JvDynControlEngineDevExpCx.pas 2009-02-08 20:34:28 UTC (rev 12205) @@ -903,6 +903,8 @@ TJvDynControlInspectorControlOnDisplayPropertyEvent); overload; procedure ControlSetOnTranslatePropertyName(const Value: TJvDynControlInspectorControlOnTranslatePropertyNameEvent); + function GetControlDividerWidth: Integer; + procedure SetControlDividerWidth(const Value: Integer); public function ControlGetCurrentPropertyName: string; procedure ControlSetDefaultProperties; @@ -3925,6 +3927,11 @@ fOnTranslatePropertyName := Value; end; +function TJvDynControlCxRTTIInspectorControl.GetControlDividerWidth: Integer; +begin + Result := OptionsView.RowHeaderWidth; +end; + procedure TJvDynControlCxRTTIInspectorControl.InspectorOnItemChanged(Sender: TObject; AOldRow: TcxCustomRow; AOldCellIndex: Integer); var @@ -3951,6 +3958,12 @@ Accept := fOnDisplayProperty(PropertyName) and ControlIsPropertySupported(PropertyName); end; +procedure TJvDynControlCxRTTIInspectorControl.SetControlDividerWidth(const + Value: Integer); +begin + OptionsView.RowHeaderWidth := Value; +end; + procedure TJvDynControlCxRTTIInspectorControl.SetControlOnPropertyChange(const Value: TJvDynControlInspectorControlOnPropertyChangeEvent); begin Modified: trunk/jvcl/run/JvDynControlEngineIntf.pas =================================================================== --- trunk/jvcl/run/JvDynControlEngineIntf.pas 2009-02-08 00:05:05 UTC (rev 12204) +++ trunk/jvcl/run/JvDynControlEngineIntf.pas 2009-02-08 20:34:28 UTC (rev 12205) @@ -338,10 +338,14 @@ TJvDynControlInspectorControlOnDisplayPropertyEvent); procedure ControlSetOnTranslatePropertyName(const Value: TJvDynControlInspectorControlOnTranslatePropertyNameEvent); + function GetControlDividerWidth: Integer; function GetControlOnPropertyChange: TJvDynControlInspectorControlOnPropertyChangeEvent; + procedure SetControlDividerWidth(const Value: Integer); procedure SetControlOnPropertyChange(const Value: TJvDynControlInspectorControlOnPropertyChangeEvent); + property ControlDividerWidth: Integer read GetControlDividerWidth write + SetControlDividerWidth; property ControlInspectedObject: TObject read ControlGetInspectedObject write ControlSetInspectedObject; property ControlOnDisplayProperty: Modified: trunk/jvcl/run/JvDynControlEngineJVCLInspector.pas =================================================================== --- trunk/jvcl/run/JvDynControlEngineJVCLInspector.pas 2009-02-08 00:05:05 UTC (rev 12204) +++ trunk/jvcl/run/JvDynControlEngineJVCLInspector.pas 2009-02-08 20:34:28 UTC (rev 12205) @@ -61,6 +61,8 @@ TJvDynControlInspectorControlOnDisplayPropertyEvent); overload; procedure ControlSetOnTranslatePropertyName(const Value: TJvDynControlInspectorControlOnTranslatePropertyNameEvent); + function GetControlDividerWidth: Integer; + procedure SetControlDividerWidth(const Value: Integer); public constructor Create(AOwner: TComponent); override; procedure ControlSetDefaultProperties; @@ -240,6 +242,11 @@ fOnTranslatePropertyName := Value; end; +function TJvDynControlRTTIInspectorControl.GetControlDividerWidth: Integer; +begin + Result := Divider; +end; + function TJvDynControlRTTIInspectorControl.GetControlOnPropertyChange: TJvDynControlInspectorControlOnPropertyChangeEvent; begin @@ -257,6 +264,12 @@ OldPropertyName := NewPropertyName; end; +procedure TJvDynControlRTTIInspectorControl.SetControlDividerWidth(const Value: + Integer); +begin + Divider := Value; +end; + procedure TJvDynControlRTTIInspectorControl.SetControlOnPropertyChange(const Value: TJvDynControlInspectorControlOnPropertyChangeEvent); begin Modified: trunk/jvcl/run/JvPropertyStoreEditor.pas =================================================================== --- trunk/jvcl/run/JvPropertyStoreEditor.pas 2009-02-08 00:05:05 UTC (rev 12204) +++ trunk/jvcl/run/JvPropertyStoreEditor.pas 2009-02-08 20:34:28 UTC (rev 12205) @@ -97,6 +97,7 @@ aPropertyStore: TPersistent); procedure Notification(AComponent: TComponent; Operation: TOperation); override; function OnDisplayProperty(const aPropertyName : String): Boolean; + function OnInspectorTranslatePropertyName(const aPropertyName : String): string; procedure OnPropertyChange(var OldPropertyName, NewPropertyName : string); function OnTranslatePropertyName(const aPropertyName : String): string; procedure SetInformation(const iCaption, iInfo: string); @@ -367,8 +368,10 @@ 'Inspector', OnDisplayProperty, OnTranslatePropertyName); Supports (Inspector, IJvDynControlRTTIInspectorControl, RTTIInspectorControlIntf); RTTIInspectorControlIntf.ControlOnPropertyChange := OnPropertyChange; + RTTIInspectorControlIntf.ControlOnTranslatePropertyName := OnInspectorTranslatePropertyName; Inspector.Align := alClient; Supports(RTTIInspectorControlIntf, IJvDynControl, DynControl); + RTTIInspectorControlIntf.ControlDividerWidth := Round(Inspector.Width/3); DynControl.ControlSetOnEnter(RTTIInspectorEnter); Caption := RSPropertyStoreEditorDialogCaptionEditProperties; @@ -713,6 +716,15 @@ Result := False; end; +function TJvPropertyStoreEditorControl.OnInspectorTranslatePropertyName(const + aPropertyName : String): string; +begin + if Assigned(InspectedObjectEditorHandlerIntf) then + Result := InspectedObjectEditorHandlerIntf.EditIntf_TranslatePropertyName(aPropertyName) + else + Result := aPropertyName; +end; + procedure TJvPropertyStoreEditorControl.OnPropertyChange(var OldPropertyName, NewPropertyName : string); begin This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |