You've already forked lazarus-ccr
+ new procedure in module dbutils - FillValueForField
+ editor for property TRxColumnFooter.FieldName git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@354 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -88,6 +88,7 @@ procedure ConfirmDataSetCancel(DataSet: TDataSet);
|
|||||||
procedure CheckRequiredField(Field: TField);
|
procedure CheckRequiredField(Field: TField);
|
||||||
procedure CheckRequiredFields(const Fields: array of TField);
|
procedure CheckRequiredFields(const Fields: array of TField);
|
||||||
function ExtractFieldName(const Fields: string; var Pos: Integer): string;
|
function ExtractFieldName(const Fields: string; var Pos: Integer): string;
|
||||||
|
procedure FillValueForField(const Field: TField; Value:Variant);
|
||||||
|
|
||||||
{ SQL expressions }
|
{ SQL expressions }
|
||||||
|
|
||||||
@ -565,7 +566,7 @@ var
|
|||||||
FieldArray: PFieldArray;
|
FieldArray: PFieldArray;
|
||||||
begin
|
begin
|
||||||
{ with DataSet do begin
|
{ with DataSet do begin
|
||||||
FieldArray := AllocMemo(FieldCount * SizeOf(TFieldInfo));
|
FieldArray := AllocMem(FieldCount * SizeOf(TFieldInfo));
|
||||||
try
|
try
|
||||||
for I := 0 to FieldCount - 1 do begin
|
for I := 0 to FieldCount - 1 do begin
|
||||||
S := IniReadString(IniFile, CheckSection(DataSet, Section),
|
S := IniReadString(IniFile, CheckSection(DataSet, Section),
|
||||||
@ -823,18 +824,10 @@ end;
|
|||||||
procedure CheckRequiredField(Field: TField);
|
procedure CheckRequiredField(Field: TField);
|
||||||
begin
|
begin
|
||||||
with Field do
|
with Field do
|
||||||
if not ReadOnly and not Calculated and IsNull then begin
|
if not ReadOnly and not Calculated and IsNull then
|
||||||
|
begin
|
||||||
FocusControl;
|
FocusControl;
|
||||||
DatabaseErrorFmt(SFieldRequired, [DisplayName]);
|
DatabaseErrorFmt(SFieldRequired, [DisplayName]);
|
||||||
(*{$IFDEF WIN32}
|
|
||||||
{$IFNDEF RX_D3}
|
|
||||||
DBErrorFmt(SFieldRequired, [DisplayName]);
|
|
||||||
{$ELSE}
|
|
||||||
DatabaseErrorFmt(SFieldRequired, [DisplayName]);
|
|
||||||
{$ENDIF}
|
|
||||||
{$ELSE}
|
|
||||||
DBErrorFmt(SFieldRequired, [DisplayName^]);
|
|
||||||
{$ENDIF WIN32}*)
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -887,4 +880,27 @@ begin
|
|||||||
Pos := I;
|
Pos := I;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure FillValueForField(const Field: TField; Value: Variant);
|
||||||
|
var
|
||||||
|
DS:TDataSet;
|
||||||
|
P:TBookmarkStr;
|
||||||
|
begin
|
||||||
|
DS:=Field.DataSet;
|
||||||
|
DS.DisableControls;
|
||||||
|
P:=DS.Bookmark;
|
||||||
|
try
|
||||||
|
DS.First;
|
||||||
|
while not DS.EOF do
|
||||||
|
begin
|
||||||
|
DS.Edit;
|
||||||
|
Field.Value:=Value;
|
||||||
|
DS.Post;
|
||||||
|
DS.Next;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
DS.Bookmark:=P;
|
||||||
|
DS.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
(see Demos/RxDBGrid)
|
(see Demos/RxDBGrid)
|
||||||
- minor fix in filter combobox in RxDBGrid for GTK and GTK2
|
- minor fix in filter combobox in RxDBGrid for GTK and GTK2
|
||||||
+ TRxSpeedButton and TRxClock
|
+ TRxSpeedButton and TRxClock
|
||||||
|
+ new procedure in module dbutils - FillValueForField
|
||||||
|
+ editor for property TRxColumnFooter.FieldName
|
||||||
|
|
||||||
29.08.2007 - ������ 1.1.5.98 (svn revision 39)
|
29.08.2007 - ������ 1.1.5.98 (svn revision 39)
|
||||||
+ In RxDBgrid - after close dataset list of SelectedRows is cleared
|
+ In RxDBgrid - after close dataset list of SelectedRows is cleared
|
||||||
+ fix resaizing find form for RxDbGrd
|
+ fix resaizing find form for RxDbGrd
|
||||||
|
@ -33,6 +33,8 @@
|
|||||||
(��. Demos/RxDBGrid)
|
(��. Demos/RxDBGrid)
|
||||||
+ ��������� ���������� � RxDBGrid ��� GTK � GTK2
|
+ ��������� ���������� � RxDBGrid ��� GTK � GTK2
|
||||||
+ ���������� ���������� TRxSpeedButton � TRxClock
|
+ ���������� ���������� TRxSpeedButton � TRxClock
|
||||||
|
+ ����� ������� � ������ dbutils - FillValueForField
|
||||||
|
+ ���������� �������� ��� RxColumnFooter.FieldName
|
||||||
29.08.2007 - ������ 1.1.5.98 (svn revision 39)
|
29.08.2007 - ������ 1.1.5.98 (svn revision 39)
|
||||||
+ � RxDBGrid ����� �������� ������ ������ ������ ���������� ����� (SelectedRows)
|
+ � RxDBGrid ����� �������� ������ ������ ������ ���������� ����� (SelectedRows)
|
||||||
���������
|
���������
|
||||||
|
@ -14,7 +14,7 @@ uses
|
|||||||
PropEdits, dbdateedit, rxlookup, folderlister, rxdbgrid, rxmemds, duallist,
|
PropEdits, dbdateedit, rxlookup, folderlister, rxdbgrid, rxmemds, duallist,
|
||||||
curredit, rxswitch, rxdice, rxdbcomb, rxtoolbar, rxxpman, PageMngr, RxAppIcon,
|
curredit, rxswitch, rxdice, rxdbcomb, rxtoolbar, rxxpman, PageMngr, RxAppIcon,
|
||||||
Dialogs, ComponentEditors, seldsfrm, DBPropEdits, DB, rxctrls, RxLogin,
|
Dialogs, ComponentEditors, seldsfrm, DBPropEdits, DB, rxctrls, RxLogin,
|
||||||
RxCustomChartPanel, AutoPanel, pickdate, rxconst, tooledit,
|
RxCustomChartPanel, AutoPanel, pickdate, rxconst, tooledit, rxclock,
|
||||||
rxceEditLookupFields;
|
rxceEditLookupFields;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -54,6 +54,28 @@ begin
|
|||||||
DataSource.DataSet.GetFieldNames(Values);
|
DataSource.DataSet.GetFieldNames(Values);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
type
|
||||||
|
{ TRxDBGridFooterFieldProperty }
|
||||||
|
TRxDBGridFooterFieldProperty = class(TFieldProperty)
|
||||||
|
public
|
||||||
|
procedure FillValues(const Values: TStringList); override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TRxDBGridFieldProperty }
|
||||||
|
|
||||||
|
procedure TRxDBGridFooterFieldProperty.FillValues(const Values: TStringList);
|
||||||
|
var
|
||||||
|
Footer: TRxColumnFooter;
|
||||||
|
Grid: TRxDBGrid;
|
||||||
|
DataSource: TDataSource;
|
||||||
|
begin
|
||||||
|
Footer:=TRxColumnFooter(GetComponent(0));
|
||||||
|
Grid:=TRxDBGrid(Footer.Owner.Grid);
|
||||||
|
if not (Grid is TRxDBGrid) then exit;
|
||||||
|
DataSource := Grid.DataSource;
|
||||||
|
if Assigned(DataSource) and Assigned(DataSource.DataSet) then
|
||||||
|
DataSource.DataSet.GetFieldNames(Values);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TRxAppIcon }
|
{ TRxAppIcon }
|
||||||
|
|
||||||
@ -195,7 +217,7 @@ end;
|
|||||||
|
|
||||||
procedure RegisterRxCtrls;
|
procedure RegisterRxCtrls;
|
||||||
begin
|
begin
|
||||||
RegisterComponents('RX',[TRxLabel, TSecretPanel]);
|
RegisterComponents('RX',[TRxLabel, TSecretPanel, TRxSpeedButton]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure RegisterRxLogin;
|
procedure RegisterRxLogin;
|
||||||
@ -223,6 +245,11 @@ begin
|
|||||||
RegisterComponents('RX',[TRxDateEdit]);
|
RegisterComponents('RX',[TRxDateEdit]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure RegisterRxClock;
|
||||||
|
begin
|
||||||
|
RegisterComponents('RX',[TRxClock]);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
begin
|
begin
|
||||||
//RX
|
//RX
|
||||||
@ -241,6 +268,7 @@ begin
|
|||||||
RegisterUnit('AutoPanel', @RegisterAutoPanel);
|
RegisterUnit('AutoPanel', @RegisterAutoPanel);
|
||||||
RegisterUnit('pickdate', @RegisterPickDate);
|
RegisterUnit('pickdate', @RegisterPickDate);
|
||||||
RegisterUnit('tooledit', @RegisterToolEdit);
|
RegisterUnit('tooledit', @RegisterToolEdit);
|
||||||
|
RegisterUnit('rxclock', @RegisterRxClock);
|
||||||
|
|
||||||
//RX DBAware
|
//RX DBAware
|
||||||
RegisterUnit('dbdateedit', @RegisterUnitDBDateEdit);
|
RegisterUnit('dbdateedit', @RegisterUnitDBDateEdit);
|
||||||
@ -255,6 +283,8 @@ begin
|
|||||||
RegisterComponentEditor(TRxMemoryData, TMemDataSetEditor);
|
RegisterComponentEditor(TRxMemoryData, TMemDataSetEditor);
|
||||||
//
|
//
|
||||||
RegisterPropertyEditor(TypeInfo(string), TRxColumn, 'FieldName', TRxDBGridFieldProperty);
|
RegisterPropertyEditor(TypeInfo(string), TRxColumn, 'FieldName', TRxDBGridFieldProperty);
|
||||||
|
RegisterPropertyEditor(TypeInfo(string), TRxColumnFooter, 'FieldName', TRxDBGridFooterFieldProperty);
|
||||||
|
|
||||||
RegisterCEEditLookupFields;
|
RegisterCEEditLookupFields;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -99,6 +99,7 @@ type
|
|||||||
procedure UpdateTestValue;
|
procedure UpdateTestValue;
|
||||||
public
|
public
|
||||||
constructor Create(Owner:TRxColumn);
|
constructor Create(Owner:TRxColumn);
|
||||||
|
property Owner:TRxColumn read FOwner;
|
||||||
published
|
published
|
||||||
property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
|
property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
|
||||||
property Layout:TTextLayout read FLayout write SetLayout default tlCenter;
|
property Layout:TTextLayout read FLayout write SetLayout default tlCenter;
|
||||||
|
Reference in New Issue
Block a user