git-svn-id: https://192.168.0.254/svn/Proyectos.AlonsoYSal_FactuGES2/trunk@6 40301925-124e-1c4e-b97d-170ad7a8785b
57 lines
1.1 KiB
ObjectPascal
57 lines
1.1 KiB
ObjectPascal
unit uViewBase;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, uGUIBase, uCustomView, JvComponent, JvFormAutoSize;
|
|
|
|
type
|
|
IViewBase = interface(ICustomView)
|
|
['{82FBDF28-9C5F-4922-952E-0E84D67FE4BB}']
|
|
procedure Refresh;
|
|
end;
|
|
|
|
TfrViewBase = class(TCustomView, IViewBase)
|
|
protected
|
|
procedure SetReadOnly(Value: Boolean); override;
|
|
|
|
public
|
|
procedure Refresh; virtual;
|
|
end;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
uses
|
|
cxDBEdit, cxControls, dxLayoutControl;
|
|
|
|
{ TfrViewBase }
|
|
|
|
procedure TfrViewBase.Refresh;
|
|
begin
|
|
//
|
|
end;
|
|
|
|
procedure TfrViewBase.SetReadOnly(Value: Boolean);
|
|
var
|
|
i: integer;
|
|
begin
|
|
inherited;
|
|
|
|
if ReadOnly then
|
|
for i:=0 to Self.ComponentCount-1 do
|
|
begin
|
|
If (Self.Components[i] Is TfrViewBase) then
|
|
(Self.Components[i] as TfrViewBase).ReadOnly := ReadOnly;
|
|
|
|
If (Self.Components[i] Is TcxControl)
|
|
and (not (Self.Components[i] Is TdxLayoutControl)) then
|
|
(Self.Components[i] as TcxControl).Enabled := not ReadOnly;
|
|
end;
|
|
end;
|
|
|
|
end.
|