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:
jesusr
2011-09-30 18:46:00 +00:00
parent da2c6fb1ee
commit 7af8b1a35c
2 changed files with 11 additions and 32 deletions

View File

@@ -60,7 +60,6 @@ type
TJDBGridControl = class(TDBGrid)
private
{ Private declarations }
usingControl: boolean;
stringDbGridControl: TJDbGridStringCtrl;
dateDbGridControl: TJDbGridDateCtrl;
timeDbGridControl: TJDbGridTimeCtrl;
@@ -157,7 +156,6 @@ var
aField: TField;
begin
Result := inherited GetDefaultEditor(Column);
usingControl := False;
if Result <> nil then
begin
C := ColumnFromGridColumn(Column);
@@ -167,41 +165,20 @@ begin
begin
case aField.DataType of
ftSmallint, ftInteger:
begin
usingControl := True;
Result := integerDbGridControl.Editor(Self);
end;
ftDate:
begin
usingControl := True;
Result := dateDbGridControl.Editor(Self);
end;
ftTime:
begin
usingControl := True;
Result := timeDbGridControl.Editor(Self);
end;
ftDateTime:
begin
usingControl := True;
Result := dateTimeDbGridControl.Editor(Self);
end;
ftCurrency, ftFloat:
begin
usingControl := True;
Result :=
doubleDbGridControl.Editor(Self, Columns.Items[Column - 1].Decimals);
end;
doubleDbGridControl.Editor(Self, Columns[Column - 1].Decimals);
ftBCD:
begin
usingControl := True;
Result := doubleDbGridControl.Editor(Self, aField.Size);
end;
ftString:
begin
usingControl:= True;
Result := stringDbGridControl.Editor(Self, Columns.Items[Column - 1].MaxLength);
end;
Result := stringDbGridControl.Editor(Self, Columns[Column - 1].MaxLength);
end;
end;
end;
@@ -209,7 +186,7 @@ end;
procedure TJDBGridControl.UpdateData;
begin
if not usingControl then
if Editor is TJStringCellEditor then
inherited UpdateData;
end;

View File

@@ -27,6 +27,8 @@ uses
type
TJStringCellEditor = class(TStringCellEditor);
{ TJDbGridStringCtrl }
TJDbGridStringCtrl = class(TObject)
@@ -233,7 +235,7 @@ end;
constructor TJDbGridStringCtrl.Create;
begin
inherited Create;
CellEditor := TStringCellEditor.Create(nil);
CellEditor := TJStringCellEditor.Create(nil);
CellEditor.OnEnter := @myEditEnter;
CellEditor.OnKeyDown := @OnKeyDown;
CellEditor.OnEditingDone := @myEditOnEditingDone;
@@ -375,7 +377,7 @@ end;
constructor TJDbGridDateTimeCtrl.Create;
begin
inherited Create;
CellEditor := TStringCellEditor.Create(nil);
CellEditor := TJStringCellEditor.Create(nil);
CellEditor.OnEnter := @myEditEnter;
CellEditor.OnKeyDown := @OnKeyDown;
CellEditor.OnEditingDone := @myEditOnEditingDone;
@@ -523,7 +525,7 @@ end;
constructor TJDbGridTimeCtrl.Create;
begin
inherited Create;
CellEditor := TStringCellEditor.Create(nil);
CellEditor := TJStringCellEditor.Create(nil);
CellEditor.OnEnter := @myEditEnter;
CellEditor.OnKeyDown := @OnKeyDown;
CellEditor.OnEditingDone := @myEditOnEditingDone;
@@ -666,7 +668,7 @@ end;
constructor TJDbGridDateCtrl.Create;
begin
inherited Create;
CellEditor := TStringCellEditor.Create(nil);
CellEditor := TJStringCellEditor.Create(nil);
CellEditor.OnEnter := @myEditEnter;
CellEditor.OnKeyDown := @OnKeyDown;
CellEditor.OnEditingDone := @myEditOnEditingDone;
@@ -806,7 +808,7 @@ end;
constructor TJDbGridDoubleCtrl.Create;
begin
inherited Create;
CellEditor := TStringCellEditor.Create(nil);
CellEditor := TJStringCellEditor.Create(nil);
CellEditor.OnEnter := @myEditOnEnter;
CellEditor.OnKeyDown := @OnKeyDown;
CellEditor.OnEditingDone := @myEditOnEditingDone;
@@ -917,7 +919,7 @@ end;
constructor TJDbGridIntegerCtrl.Create;
begin
inherited Create;
CellEditor := TStringCellEditor.Create(nil);
CellEditor := TJStringCellEditor.Create(nil);
CellEditor.OnEnter := @myEditOnEnter;
CellEditor.OnKeyDown := @OnKeyDown;
CellEditor.OnEditingDone := @myEditOnEditingDone;