From c5ecd1b28f8e830ff60f2f7fbcef4182bf3b7a3b Mon Sep 17 00:00:00 2001 From: alexs75 Date: Wed, 14 May 2008 18:28:14 +0000 Subject: [PATCH] In PopUpFormOptions add editor for property Collumns[x].FieldName git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@451 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/docs/WhatsNew.eng.txt | 1 + components/rx/docs/WhatsNew.rus.txt | 2 ++ components/rx/registerrx.pas | 25 ++++++++++++++++++++++++- components/rx/rxlookup.pas | 1 + components/rx/rxpopupunit.pas | 8 +++++++- 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/components/rx/docs/WhatsNew.eng.txt b/components/rx/docs/WhatsNew.eng.txt index b006bbda1..6c47754c3 100644 --- a/components/rx/docs/WhatsNew.eng.txt +++ b/components/rx/docs/WhatsNew.eng.txt @@ -38,6 +38,7 @@ - Cleanup code in TRxDBLookupCombo.Paint + In TRxDBLookupCombo property DropDownCount now work - fix error in TRxDBLookupCombo after set value for DataField and LookupSourse.Active=false + + In PopUpFormOptions add editor for property Collumns[x].FieldName 29.08.2007 - 1.1.5.98 (svn revision 39) + In RxDBgrid - after close dataset list of SelectedRows is cleared + fix resaizing find form for RxDbGrd diff --git a/components/rx/docs/WhatsNew.rus.txt b/components/rx/docs/WhatsNew.rus.txt index c99ffbe49..3dfd36d59 100644 --- a/components/rx/docs/WhatsNew.rus.txt +++ b/components/rx/docs/WhatsNew.rus.txt @@ -45,6 +45,8 @@ - Улучшен код в отрисовке компоненты TRxDBLookupCombo + В TRxDBLookupCombo работает свойство DropDownCount - Исправлена ошибка TRxDBLookupCombo при LookupSourse.Active=false и установке значения для поля DataField + + В свойстве PopUpFormOptions компоненты TRxDBLookupCombo для элемента из списка Collumns добавлен редктор на FieldName + 29.08.2007 - версия 1.1.5.98 (svn revision 39) + В RxDBGrid После закрытия набора данных список помеченных строк (SelectedRows) очищается diff --git a/components/rx/registerrx.pas b/components/rx/registerrx.pas index e75cf4c40..7fec585b7 100644 --- a/components/rx/registerrx.pas +++ b/components/rx/registerrx.pas @@ -15,7 +15,7 @@ uses curredit, rxswitch, rxdice, rxdbcomb, rxtoolbar, rxxpman, PageMngr, RxAppIcon, Dialogs, ComponentEditors, seldsfrm, DBPropEdits, DB, rxctrls, RxLogin, RxCustomChartPanel, AutoPanel, pickdate, rxconst, tooledit, rxclock, - rxceEditLookupFields; + rxceEditLookupFields, rxpopupunit; type @@ -37,6 +37,27 @@ type procedure FillValues(const Values: TStringList); override; end; + { TPopUpColumnFieldProperty } + + TPopUpColumnFieldProperty = class(TFieldProperty) + public + procedure FillValues(const Values: TStringList); override; + end; + +{ TPopUpColumnFieldProperty } + +procedure TPopUpColumnFieldProperty.FillValues(const Values: TStringList); +var + Column: TPopUpColumn; + DataSource: TDataSource; +begin + Column:=TPopUpColumn(GetComponent(0)); + if not (Column is TPopUpColumn) then exit; + DataSource := TPopUpFormColumns(Column.Collection).PopUpFormOptions.DataSource; + if Assigned(DataSource) and Assigned(DataSource.DataSet) then + DataSource.DataSet.GetFieldNames(Values); +end; + { TRxDBGridFieldProperty } procedure TRxDBGridFieldProperty.FillValues(const Values: TStringList); @@ -285,6 +306,8 @@ begin RegisterPropertyEditor(TypeInfo(string), TRxColumn, 'FieldName', TRxDBGridFieldProperty); RegisterPropertyEditor(TypeInfo(string), TRxColumnFooter, 'FieldName', TRxDBGridFooterFieldProperty); + RegisterPropertyEditor(TypeInfo(string), TPopUpColumn, 'FieldName', TPopUpColumnFieldProperty); + RegisterCEEditLookupFields; end; diff --git a/components/rx/rxlookup.pas b/components/rx/rxlookup.pas index 28c7d1c76..584e1bad4 100644 --- a/components/rx/rxlookup.pas +++ b/components/rx/rxlookup.pas @@ -745,6 +745,7 @@ procedure TRxCustomDBLookupCombo.SetLookupSource(const AValue: TDataSource); begin FLookupDataLink.DataSource:=AValue; FLocateObject.DataSet:=FLookupDataLink.DataSet; + FPopUpFormOptions.DataSource:=AValue; end; procedure TRxCustomDBLookupCombo.SetNumGlyphs(const AValue: Integer); diff --git a/components/rx/rxpopupunit.pas b/components/rx/rxpopupunit.pas index f6447324d..9eed5f174 100644 --- a/components/rx/rxpopupunit.pas +++ b/components/rx/rxpopupunit.pas @@ -10,7 +10,8 @@ uses type TPopUpCloseEvent = procedure(AResult:boolean) of object; - + TPopUpFormOptions = class; + { TPopUpGrid } TPopUpGrid = class(TRxDBGrid) @@ -102,9 +103,11 @@ type TPopUpFormColumns = class(TCollection) private + FPopUpFormOptions: TPopUpFormOptions; function GetPopUpColumn(Index: Integer): TPopUpColumn; procedure SetPopUpColumn(Index: Integer; const AValue: TPopUpColumn); public + property PopUpFormOptions:TPopUpFormOptions read FPopUpFormOptions write FPopUpFormOptions; property Items[Index: Integer]: TPopUpColumn read GetPopUpColumn write SetPopUpColumn; default; end; @@ -116,6 +119,7 @@ type FAutoSort: boolean; FBorderStyle: TBorderStyle; FColumns: TPopUpFormColumns; + FDataSource: TDataSource; FDropDownCount: integer; FDropDownWidth: integer; FOnGetCellProps: TGetCellPropsEvent; @@ -137,6 +141,7 @@ type constructor Create; destructor Destroy; override; procedure Assign(Source: TPersistent); override; + property DataSource:TDataSource read FDataSource write FDataSource; published property AutoFillColumns:boolean read FAutoFillColumns write SetAutoFillColumns default false; property AutoSort:boolean read FAutoSort write SetAutoSort default false; @@ -567,6 +572,7 @@ begin FTitleStyle:=tsLazarus; FBorderStyle:=bsNone; FColumns:=TPopUpFormColumns.Create(TPopUpColumn); + FColumns.FPopUpFormOptions:=Self; end; destructor TPopUpFormOptions.Destroy;