From: <jfu...@us...> - 2010-10-23 20:07:55
|
Revision: 12874 http://jvcl.svn.sourceforge.net/jvcl/?rev=12874&view=rev Author: jfudickar Date: 2010-10-23 20:07:48 +0000 (Sat, 23 Oct 2010) Log Message: ----------- ParameterList Dialog now shows Hints Modified Paths: -------------- trunk/jvcl/run/JvParameterList.pas Modified: trunk/jvcl/run/JvParameterList.pas =================================================================== --- trunk/jvcl/run/JvParameterList.pas 2010-10-22 06:34:08 UTC (rev 12873) +++ trunk/jvcl/run/JvParameterList.pas 2010-10-23 20:07:48 UTC (rev 12874) @@ -47,8 +47,7 @@ TJvBaseParameterClass = class of TJvBaseParameter; TJvParameterListClass = class of TJvParameterList; - TJvParameterListEvent = procedure(const ParameterList: TJvParameterList; const Parameter: - TJvBaseParameter) of object; + TJvParameterListEvent = procedure(const ParameterList: TJvParameterList; const Parameter: TJvBaseParameter) of object; TJvParameterOnValidateData = procedure (const Data : Variant; var Msg : String; var Valid : Boolean) of Object; @@ -217,8 +216,7 @@ this value must be defined before inserting into the parameterlist } property SearchName: string read FSearchName write SetSearchName; {should this value be saved by the parameterlist } - property StoreValueToAppStorage: Boolean read FStoreValueToAppStorage write - FStoreValueToAppStorage; + property StoreValueToAppStorage: Boolean read FStoreValueToAppStorage write FStoreValueToAppStorage; {should this value be crypted before save } property StoreValueCrypted: Boolean read FStoreValueCrypted write FStoreValueCrypted; {the searchname of the parentparameter. The parentparameter must be a @@ -242,10 +240,8 @@ property DisableReasons: TJvParameterListEnableDisableReasonList read FDisableReasons; property EnableReasons: TJvParameterListEnableDisableReasonList read FEnableReasons; /// Use this event to implement a custom logic to validate the parameter contents - property OnValidateData: TJvParameterOnValidateData read FOnValidateData write - FOnValidateData; - property OnEnterParameter: TJvParameterListEvent read FOnEnterParameter write - FOnEnterParameter; + property OnValidateData: TJvParameterOnValidateData read FOnValidateData write FOnValidateData; + property OnEnterParameter: TJvParameterListEvent read FOnEnterParameter write FOnEnterParameter; property OnExitParameter: TJvParameterListEvent read FOnExitParameter write FOnExitParameter; end; @@ -316,8 +312,8 @@ HistoryPanel: TWinControl; BottomPanel: TWinControl; ButtonPanel: TWinControl; - OrgButtonPanelWidth, - OrgHistoryPanelWidth: Integer; + OrgButtonPanelWidth: Integer; + OrgHistoryPanelWidth: Integer; procedure SetArrangeSettings(Value: TJvArrangeSettings); procedure SetAppStoragePath(const Value: string); function GetAppStoragePath: string; @@ -340,8 +336,8 @@ procedure HistoryLoadClick(Sender: TObject); procedure HistorySaveClick(Sender: TObject); procedure HistoryClearClick(Sender: TObject); - function GetEnableDisableReasonState(ADisableReasons: TJvParameterListEnableDisableReasonList; - AEnableReasons: TJvParameterListEnableDisableReasonList): Integer; + function GetEnableDisableReasonState(ADisableReasons: TJvParameterListEnableDisableReasonList; AEnableReasons: + TJvParameterListEnableDisableReasonList): Integer; procedure DialogShow(Sender: TObject); {this procedure checks the autoscroll-property of the internal scrollbox. This function should only be called, after the size of @@ -398,12 +394,8 @@ { Property to get access to the parameters } property Parameters[Index: Integer]: TJvBaseParameter read GetParameters write SetParameters; // Enable/DisableReason for the OkButton - property OkButtonDisableReasons: TJvParameterListEnableDisableReasonList read - FOkButtonDisableReasons write - FOkButtonDisableReasons; - property OkButtonEnableReasons: TJvParameterListEnableDisableReasonList read - FOkButtonEnableReasons write - FOkButtonEnableReasons; + property OkButtonDisableReasons: TJvParameterListEnableDisableReasonList read FOkButtonDisableReasons write + FOkButtonDisableReasons; //1 Number of visible parameters property VisibleCount: Integer read GetVisibleCount; procedure AssignValues(iSourceList: TJvParameterList); @@ -440,26 +432,20 @@ property MaxWidth: Integer read FMaxWidth write FMaxWidth default 400; {Maximum ClientHeight of the Dialog} property MaxHeight: Integer read FMaxHeight write FMaxHeight default 600; - property DefaultParameterHeight: Integer read FDefaultParameterHeight write - FDefaultParameterHeight default 0; - property DefaultParameterWidth: Integer read FDefaultParameterWidth write FDefaultParameterWidth - default 0; - property DefaultParameterLabelWidth: Integer read FDefaultParameterLabelWidth write - FDefaultParameterLabelWidth default 0; + property DefaultParameterHeight: Integer read FDefaultParameterHeight write FDefaultParameterHeight default 0; + property DefaultParameterWidth: Integer read FDefaultParameterWidth write FDefaultParameterWidth default 0; + property DefaultParameterLabelWidth: Integer read FDefaultParameterLabelWidth write FDefaultParameterLabelWidth default + 0; property OkButtonVisible: Boolean read FOkButtonVisible write FOkButtonVisible; property CancelButtonVisible: Boolean read FCancelButtonVisible write FCancelButtonVisible; property HistoryEnabled: Boolean read FHistoryEnabled write FHistoryEnabled; property LastHistoryName: string read FLastHistoryName write FLastHistoryName; property AppStorage: TJvCustomAppStorage read GetAppStorage write SetAppStorage; /// Show the state of each invalid parameter by drawing the label italic - property ShowParameterValidState: Boolean read FShowParameterValidState write - FShowParameterValidState default False; - property OnChangeParameter: TNotifyEvent read FOnChangeParameter write - FOnChangeParameter; - property OnEnterParameter: TNotifyEvent read FOnEnterParameter write - FOnEnterParameter; - property OnExitParameter: TNotifyEvent read FOnExitParameter write - FOnExitParameter; + property ShowParameterValidState: Boolean read FShowParameterValidState write FShowParameterValidState default False; + property OnChangeParameter: TNotifyEvent read FOnChangeParameter write FOnChangeParameter; + property OnEnterParameter: TNotifyEvent read FOnEnterParameter write FOnEnterParameter; + property OnExitParameter: TNotifyEvent read FOnExitParameter write FOnExitParameter; end; TJvParameterListSelectList = class(TJvAppStorageSelectList) @@ -673,9 +659,7 @@ inherited Clear; end; -procedure TJvParameterListEnableDisableReasonList.AddReasonVariant(const RemoteParameterName: - string; - Value: Variant); +procedure TJvParameterListEnableDisableReasonList.AddReasonVariant(const RemoteParameterName: string; Value: Variant); var Reason: TJvParameterListEnableDisableReason; begin @@ -685,8 +669,7 @@ AddObject(RemoteParameterName, Reason); end; -procedure TJvParameterListEnableDisableReasonList.AddReason(const RemoteParameterName: string; - Value: Boolean); +procedure TJvParameterListEnableDisableReasonList.AddReason(const RemoteParameterName: string; Value: Boolean); var Reason: TJvParameterListEnableDisableReason; begin @@ -696,8 +679,7 @@ AddObject(RemoteParameterName, Reason); end; -procedure TJvParameterListEnableDisableReasonList.AddReason(const RemoteParameterName: string; - Value: Integer); +procedure TJvParameterListEnableDisableReasonList.AddReason(const RemoteParameterName: string; Value: Integer); var Reason: TJvParameterListEnableDisableReason; begin @@ -707,8 +689,7 @@ AddObject(RemoteParameterName, Reason); end; -procedure TJvParameterListEnableDisableReasonList.AddReason(const RemoteParameterName: string; - Value: Double); +procedure TJvParameterListEnableDisableReasonList.AddReason(const RemoteParameterName: string; Value: Double); var Reason: TJvParameterListEnableDisableReason; begin @@ -718,8 +699,7 @@ AddObject(RemoteParameterName, Reason); end; -procedure TJvParameterListEnableDisableReasonList.AddReason(const RemoteParameterName: string; - const Value: string); +procedure TJvParameterListEnableDisableReasonList.AddReason(const RemoteParameterName: string; const Value: string); var Reason: TJvParameterListEnableDisableReason; begin @@ -729,8 +709,7 @@ AddObject(RemoteParameterName, Reason); end; -procedure TJvParameterListEnableDisableReasonList.AddReason(const RemoteParameterName: string; - Value: TDateTime); +procedure TJvParameterListEnableDisableReasonList.AddReason(const RemoteParameterName: string; Value: TDateTime); var Reason: TJvParameterListEnableDisableReason; begin @@ -740,8 +719,7 @@ AddObject(RemoteParameterName, Reason); end; -procedure TJvParameterListEnableDisableReasonList.AddReasonIsEmpty(const RemoteParameterName: - string); +procedure TJvParameterListEnableDisableReasonList.AddReasonIsEmpty(const RemoteParameterName: string); var Reason: TJvParameterListEnableDisableReason; begin @@ -751,8 +729,7 @@ AddObject(RemoteParameterName, Reason); end; -procedure TJvParameterListEnableDisableReasonList.AddReasonIsNotEmpty(const RemoteParameterName: - string); +procedure TJvParameterListEnableDisableReasonList.AddReasonIsNotEmpty(const RemoteParameterName: string); var Reason: TJvParameterListEnableDisableReason; begin @@ -1138,8 +1115,7 @@ Result := IsDataValid(AData, Msg); end; -function TJvBaseParameter.IsDataValid(const AData: Variant; var vMsg: String): - Boolean; +function TJvBaseParameter.IsDataValid(const AData: Variant; var vMsg: String): Boolean; begin if not Required or not Enabled then Result := True @@ -1430,6 +1406,7 @@ TForm(ParameterDialog).BorderStyle := bsDialog; TForm(ParameterDialog).FormStyle := fsNormal; TForm(ParameterDialog).Position := poScreenCenter; + TForm(ParameterDialog).ShowHint := True; TForm(ParameterDialog).OnShow := DialogShow; if Height > 0 then @@ -1437,14 +1414,12 @@ if Width > 0 then ParameterDialog.Width := Width; - BottomPanel := DynControlEngine.CreatePanelControl(Self, ParameterDialog, 'BottomPanel', '', - alBottom); + BottomPanel := DynControlEngine.CreatePanelControl(Self, ParameterDialog, 'BottomPanel', '', alBottom); if not Supports(BottomPanel, IJvDynControlPanel, ITmpPanel) then raise EIntfCastError.CreateRes(@RsEIntfCastError); ITmpPanel.ControlSetBorder(bvNone, bvRaised, 1, bsNone, 0); - MainPanel := DynControlEngine.CreatePanelControl(Self, ParameterDialog, 'MainPanel', '', - alClient); + MainPanel := DynControlEngine.CreatePanelControl(Self, ParameterDialog, 'MainPanel', '', alClient); if not Supports(MainPanel, IJvDynControlPanel, ITmpPanel) then raise EIntfCastError.CreateRes(@RsEIntfCastError); ITmpPanel.ControlSetBorder(bvNone, bvRaised, 1, bsNone, 3); @@ -1532,8 +1507,7 @@ ResizeDialogAfterArrange(nil, MainPanel.Left, MainPanel.Top, MainPanel.Width, MainPanel.Height); end; -procedure TJvParameterList.ResizeDialogAfterArrange(Sender: TObject; nLeft, nTop, nWidth, nHeight: - Integer); +procedure TJvParameterList.ResizeDialogAfterArrange(Sender: TObject; nLeft, nTop, nWidth, nHeight: Integer); begin if Assigned(ParameterDialog) then begin @@ -1641,8 +1615,7 @@ end; end; -function TJvParameterList.GetParentByName(MainParent: TWinControl; const ASearchName: string): - TWinControl; +function TJvParameterList.GetParentByName(MainParent: TWinControl; const ASearchName: string): TWinControl; var Parameter: TJvBaseParameter; I: Integer; @@ -1702,9 +1675,8 @@ end; end; -function TJvParameterList.GetEnableDisableReasonState(ADisableReasons: - TJvParameterListEnableDisableReasonList; - AEnableReasons: TJvParameterListEnableDisableReasonList): Integer; +function TJvParameterList.GetEnableDisableReasonState(ADisableReasons: TJvParameterListEnableDisableReasonList; + AEnableReasons: TJvParameterListEnableDisableReasonList): Integer; var J: Integer; IEnable: Integer; @@ -1840,8 +1812,7 @@ CreateWinControlsOnWinControl(ArrangePanel); end; -procedure TJvParameterList.CreateWinControlsOnWinControl(ParameterParent: - TWinControl); +procedure TJvParameterList.CreateWinControlsOnWinControl(ParameterParent: TWinControl); var I: Integer; BeforeAfterParameterNames : TStringList; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |