You've already forked lazarus-ccr
jujiboutils: remove usingControl field
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2047 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -60,7 +60,6 @@ type
|
|||||||
TJDBGridControl = class(TDBGrid)
|
TJDBGridControl = class(TDBGrid)
|
||||||
private
|
private
|
||||||
{ Private declarations }
|
{ Private declarations }
|
||||||
usingControl: boolean;
|
|
||||||
stringDbGridControl: TJDbGridStringCtrl;
|
stringDbGridControl: TJDbGridStringCtrl;
|
||||||
dateDbGridControl: TJDbGridDateCtrl;
|
dateDbGridControl: TJDbGridDateCtrl;
|
||||||
timeDbGridControl: TJDbGridTimeCtrl;
|
timeDbGridControl: TJDbGridTimeCtrl;
|
||||||
@@ -157,7 +156,6 @@ var
|
|||||||
aField: TField;
|
aField: TField;
|
||||||
begin
|
begin
|
||||||
Result := inherited GetDefaultEditor(Column);
|
Result := inherited GetDefaultEditor(Column);
|
||||||
usingControl := False;
|
|
||||||
if Result <> nil then
|
if Result <> nil then
|
||||||
begin
|
begin
|
||||||
C := ColumnFromGridColumn(Column);
|
C := ColumnFromGridColumn(Column);
|
||||||
@@ -167,41 +165,20 @@ begin
|
|||||||
begin
|
begin
|
||||||
case aField.DataType of
|
case aField.DataType of
|
||||||
ftSmallint, ftInteger:
|
ftSmallint, ftInteger:
|
||||||
begin
|
|
||||||
usingControl := True;
|
|
||||||
Result := integerDbGridControl.Editor(Self);
|
Result := integerDbGridControl.Editor(Self);
|
||||||
end;
|
|
||||||
ftDate:
|
ftDate:
|
||||||
begin
|
|
||||||
usingControl := True;
|
|
||||||
Result := dateDbGridControl.Editor(Self);
|
Result := dateDbGridControl.Editor(Self);
|
||||||
end;
|
|
||||||
ftTime:
|
ftTime:
|
||||||
begin
|
|
||||||
usingControl := True;
|
|
||||||
Result := timeDbGridControl.Editor(Self);
|
Result := timeDbGridControl.Editor(Self);
|
||||||
end;
|
|
||||||
ftDateTime:
|
ftDateTime:
|
||||||
begin
|
|
||||||
usingControl := True;
|
|
||||||
Result := dateTimeDbGridControl.Editor(Self);
|
Result := dateTimeDbGridControl.Editor(Self);
|
||||||
end;
|
|
||||||
ftCurrency, ftFloat:
|
ftCurrency, ftFloat:
|
||||||
begin
|
|
||||||
usingControl := True;
|
|
||||||
Result :=
|
Result :=
|
||||||
doubleDbGridControl.Editor(Self, Columns.Items[Column - 1].Decimals);
|
doubleDbGridControl.Editor(Self, Columns[Column - 1].Decimals);
|
||||||
end;
|
|
||||||
ftBCD:
|
ftBCD:
|
||||||
begin
|
|
||||||
usingControl := True;
|
|
||||||
Result := doubleDbGridControl.Editor(Self, aField.Size);
|
Result := doubleDbGridControl.Editor(Self, aField.Size);
|
||||||
end;
|
|
||||||
ftString:
|
ftString:
|
||||||
begin
|
Result := stringDbGridControl.Editor(Self, Columns[Column - 1].MaxLength);
|
||||||
usingControl:= True;
|
|
||||||
Result := stringDbGridControl.Editor(Self, Columns.Items[Column - 1].MaxLength);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -209,7 +186,7 @@ end;
|
|||||||
|
|
||||||
procedure TJDBGridControl.UpdateData;
|
procedure TJDBGridControl.UpdateData;
|
||||||
begin
|
begin
|
||||||
if not usingControl then
|
if Editor is TJStringCellEditor then
|
||||||
inherited UpdateData;
|
inherited UpdateData;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@@ -27,6 +27,8 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
TJStringCellEditor = class(TStringCellEditor);
|
||||||
|
|
||||||
{ TJDbGridStringCtrl }
|
{ TJDbGridStringCtrl }
|
||||||
|
|
||||||
TJDbGridStringCtrl = class(TObject)
|
TJDbGridStringCtrl = class(TObject)
|
||||||
@@ -233,7 +235,7 @@ end;
|
|||||||
constructor TJDbGridStringCtrl.Create;
|
constructor TJDbGridStringCtrl.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
CellEditor := TStringCellEditor.Create(nil);
|
CellEditor := TJStringCellEditor.Create(nil);
|
||||||
CellEditor.OnEnter := @myEditEnter;
|
CellEditor.OnEnter := @myEditEnter;
|
||||||
CellEditor.OnKeyDown := @OnKeyDown;
|
CellEditor.OnKeyDown := @OnKeyDown;
|
||||||
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
||||||
@@ -375,7 +377,7 @@ end;
|
|||||||
constructor TJDbGridDateTimeCtrl.Create;
|
constructor TJDbGridDateTimeCtrl.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
CellEditor := TStringCellEditor.Create(nil);
|
CellEditor := TJStringCellEditor.Create(nil);
|
||||||
CellEditor.OnEnter := @myEditEnter;
|
CellEditor.OnEnter := @myEditEnter;
|
||||||
CellEditor.OnKeyDown := @OnKeyDown;
|
CellEditor.OnKeyDown := @OnKeyDown;
|
||||||
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
||||||
@@ -523,7 +525,7 @@ end;
|
|||||||
constructor TJDbGridTimeCtrl.Create;
|
constructor TJDbGridTimeCtrl.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
CellEditor := TStringCellEditor.Create(nil);
|
CellEditor := TJStringCellEditor.Create(nil);
|
||||||
CellEditor.OnEnter := @myEditEnter;
|
CellEditor.OnEnter := @myEditEnter;
|
||||||
CellEditor.OnKeyDown := @OnKeyDown;
|
CellEditor.OnKeyDown := @OnKeyDown;
|
||||||
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
||||||
@@ -666,7 +668,7 @@ end;
|
|||||||
constructor TJDbGridDateCtrl.Create;
|
constructor TJDbGridDateCtrl.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
CellEditor := TStringCellEditor.Create(nil);
|
CellEditor := TJStringCellEditor.Create(nil);
|
||||||
CellEditor.OnEnter := @myEditEnter;
|
CellEditor.OnEnter := @myEditEnter;
|
||||||
CellEditor.OnKeyDown := @OnKeyDown;
|
CellEditor.OnKeyDown := @OnKeyDown;
|
||||||
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
||||||
@@ -806,7 +808,7 @@ end;
|
|||||||
constructor TJDbGridDoubleCtrl.Create;
|
constructor TJDbGridDoubleCtrl.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
CellEditor := TStringCellEditor.Create(nil);
|
CellEditor := TJStringCellEditor.Create(nil);
|
||||||
CellEditor.OnEnter := @myEditOnEnter;
|
CellEditor.OnEnter := @myEditOnEnter;
|
||||||
CellEditor.OnKeyDown := @OnKeyDown;
|
CellEditor.OnKeyDown := @OnKeyDown;
|
||||||
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
||||||
@@ -917,7 +919,7 @@ end;
|
|||||||
constructor TJDbGridIntegerCtrl.Create;
|
constructor TJDbGridIntegerCtrl.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
CellEditor := TStringCellEditor.Create(nil);
|
CellEditor := TJStringCellEditor.Create(nil);
|
||||||
CellEditor.OnEnter := @myEditOnEnter;
|
CellEditor.OnEnter := @myEditOnEnter;
|
||||||
CellEditor.OnKeyDown := @OnKeyDown;
|
CellEditor.OnKeyDown := @OnKeyDown;
|
||||||
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
CellEditor.OnEditingDone := @myEditOnEditingDone;
|
||||||
|
Reference in New Issue
Block a user