From: <ah...@us...> - 2007-12-10 17:25:09
|
Revision: 11597 http://jvcl.svn.sourceforge.net/jvcl/?rev=11597&view=rev Author: ahuser Date: 2007-12-10 09:25:04 -0800 (Mon, 10 Dec 2007) Log Message: ----------- New events OnBeforePaint, OnAfterPaint, OnAfterSort Modified Paths: -------------- trunk/jvcl/run/JvDBGrid.pas trunk/jvcl/run/JvDBUltimGrid.pas Modified: trunk/jvcl/run/JvDBGrid.pas =================================================================== --- trunk/jvcl/run/JvDBGrid.pas 2007-12-05 19:16:09 UTC (rev 11596) +++ trunk/jvcl/run/JvDBGrid.pas 2007-12-10 17:25:04 UTC (rev 11597) @@ -301,6 +301,8 @@ FReadOnlyCellColor: TColor; FOnCanEditCell: TJvDBCanEditCellEvent; FOnSelectColumns: TJvDBSelectColumnsEvent; + FOnBeforePaint: TNotifyEvent; + FOnAfterPaint: TNotifyEvent; procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; @@ -588,6 +590,11 @@ property OnCanEditCell: TJvDBCanEditCellEvent read FOnCanEditCell write FOnCanEditCell; { OnSelectColumns: event is triggered when the user clicks on the TitleArrow button. } property OnSelectColumns: TJvDBSelectColumnsEvent read FOnSelectColumns write FOnSelectColumns; + + { OnBeforePaint: event triggered before the grid is painted. } + property OnBeforePaint: TNotifyEvent read FOnBeforePaint write FOnBeforePaint; + { OnBeforePaint: event triggered after the grid was painted. } + property OnAfterPaint: TNotifyEvent read FOnAfterPaint write FOnAfterPaint; end; {$IFDEF UNITVERSIONING} @@ -1807,6 +1814,8 @@ {$ENDIF JVCLThemesEnabled} {$ENDIF CLR} begin + if Assigned(FOnBeforePaint) then + FOnBeforePaint(Self); {$IFDEF JVCLThemesEnabled} if UseXPThemes and ThemeServices.ThemesEnabled then begin @@ -1831,6 +1840,8 @@ with Selection do DrawFocusRect(Canvas.Handle, BoxRect(Left, Top, Right, Bottom)); end; + if Assigned(FOnAfterPaint) then + FOnAfterPaint(Self); end; procedure TJvDBGrid.SetTitleButtons(Value: Boolean); Modified: trunk/jvcl/run/JvDBUltimGrid.pas =================================================================== --- trunk/jvcl/run/JvDBUltimGrid.pas 2007-12-05 19:16:09 UTC (rev 11596) +++ trunk/jvcl/run/JvDBUltimGrid.pas 2007-12-10 17:25:04 UTC (rev 11597) @@ -166,6 +166,7 @@ FValueToSearch: Variant; FSearchFields: TStringList; FOnGetSortFieldName: TGetSortFieldNameEvent; + FOnAfterSort: TNotifyEvent; procedure SetMultiColSort(const Value: Boolean); function PrivateSearch(var ResultCol: Integer; var ResultField: TField; const CaseSensitive, WholeFieldOnly, Next: Boolean): Boolean; @@ -215,6 +216,9 @@ { OnGetSortFieldName: allows to override the sort marker field } property OnGetSortFieldName: TGetSortFieldNameEvent read FOnGetSortFieldName Write FOnGetSortFieldName; + + { OnAfterSort: fired after the table was sorted. } + property OnAfterSort: TNotifyEvent read FOnAfterSort write FOnAfterSort; end; {$IFDEF UNITVERSIONING} @@ -464,6 +468,8 @@ end; end; end; + if FSortOK and Assigned(FOnAfterSort) then + FOnAfterSort(Self); finally DSet.EnableControls; Screen.Cursor := crDefault; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |