uViewDetallesBase: corregido un error con la fuente por defecto de la columna de concepto.

git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@280 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
David Arranz 2008-07-22 11:49:53 +00:00
parent 75501280f8
commit b9ba1dcb4c
2 changed files with 32 additions and 31 deletions

View File

@ -64,7 +64,7 @@ inherited frViewDetallesBase: TfrViewDetallesBase
DroppedDownWidth = 145
MaxMRUCount = 0
FontName = 'Tahoma'
ItemIndex = 34
ItemIndex = 35
Options = [foTrueTypeOnly, foNoOEMFonts, foScalableOnly, foWysiWyg]
Sorted = True
TabOrder = 2
@ -152,8 +152,6 @@ inherited frViewDetallesBase: TfrViewDetallesBase
Height = 232
Align = alClient
TabOrder = 1
LookAndFeel.Kind = lfStandard
LookAndFeel.NativeStyle = True
object cxGridView: TcxGridDBTableView
NavigatorButtons.ConfirmDelete = False
FilterBox.Visible = fvNever

View File

@ -127,9 +127,6 @@ type
procedure cxGridViewEditKeyDown(Sender: TcxCustomGridTableView;
AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit; var Key: Word;
Shift: TShiftState);
procedure cxGridViewInitEdit(Sender: TcxCustomGridTableView;
AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit);
procedure FontEdit1BeforeExecute(Sender: TObject);
procedure FontEdit1Accept(Sender: TObject);
@ -146,6 +143,8 @@ type
procedure TBXItem13Click(Sender: TObject);
procedure actAnchoAutomaticoExecute(Sender: TObject);
procedure actAnchoAutomaticoUpdate(Sender: TObject);
procedure cxGridViewInitEdit(Sender: TcxCustomGridTableView;
AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit);
private
FController : IControllerDetallesBase;
@ -427,30 +426,35 @@ procedure TfrViewDetallesBase.cxGridViewInitEdit(Sender: TcxCustomGridTableView;
var
FuentePorDefecto: TFont;
ARecord: TcxCustomGridRecord;
AEditValue : String;
begin
inherited;
if AEdit is TcxRichEdit then
begin
AEditValue := Trim(VarToStr(AItem.EditValue));
ARecord := AItem.FocusedCellViewInfo.GridRecord;
FuentePorDefecto := DarFuentePorDefecto(DarTipoConcepto(ARecord));
//La primera vez que accedemos al grid entra dos veces y perderiamos el editor
//dando un pete.
if not Assigned(CurEdit) then
begin
FontEdit1.Enabled := True;
// UpDown1.Enabled := True;
// FontSize.Enabled := True;
// FontName.Enabled := True;
try
//La primera vez que accedemos al grid entra dos veces y perderiamos el editor
//dando un pete.
if not Assigned(CurEdit) then
begin
FontEdit1.Enabled := True;
// UpDown1.Enabled := True;
// FontSize.Enabled := True;
// FontName.Enabled := True;
CurEdit := TcxRichEdit(AEdit);
if length(CurEdit.Text) = 0 then
CurEdit.DefAttributes.Assign(FuentePorDefecto)
end
else
if length(CurEdit.Text) = 0 then
CurEdit.DefAttributes.Assign(FuentePorDefecto);
FreeAndNil(FuentePorDefecto);
CurEdit := TcxRichEdit(AEdit);
if Length(AEditValue) = 0 then
CurEdit.DefAttributes.Assign(FuentePorDefecto)
end
else
if Length(AEditValue) = 0 then
CurEdit.DefAttributes.Assign(FuentePorDefecto);
finally
FreeAndNil(FuentePorDefecto);
end;
end
else
begin
@ -492,7 +496,7 @@ begin
begin
Result.Name := 'Tahoma';
Result.Size := 9;
Result.Style := [];
Result.Style := [];
end;
if ATipo = TIPO_DETALLE_TITULO then
@ -539,12 +543,12 @@ var
i: Integer;
begin
i:=0;
while ((cxGridView.Columns[i].DataBinding.FieldName <> Nombre)
and (i < cxGridView.ColumnCount)) do
while ((cxGridView.Columns[i].DataBinding.FieldName <> Nombre) and
(i < cxGridView.ColumnCount)) do
inc(i);
if (i = cxGridView.ColumnCount)
then raise Exception.Create('El campo ' + Nombre + ' no se ha encontrado en el grid (uViewDetallesBase)');
if (i = cxGridView.ColumnCount) then
raise Exception.Create('El campo ' + Nombre + ' no se ha encontrado en el grid (uViewDetallesBase)');
Result := i;
end;
@ -732,9 +736,8 @@ end;
procedure TfrViewDetallesBase.TBXItem13Click(Sender: TObject);
begin
inherited;
if cxGridView.Controller.EditingController.IsEditing then
cxGridView.Controller.EditingController.Edit.PostEditValue;
if cxGridView.Controller.EditingController.IsEditing then
cxGridView.Controller.EditingController.Edit.PostEditValue;
end;
procedure TfrViewDetallesBase.actAnadirUpdate(Sender: TObject);