100 lines
2.9 KiB
ObjectPascal
100 lines
2.9 KiB
ObjectPascal
|
|
{
|
|||
|
|
===============================================================================
|
|||
|
|
Copyright (<EFBFBD>) 2001. Rodax Software.
|
|||
|
|
===============================================================================
|
|||
|
|
Los contenidos de este fichero son propiedad de Rodax Software titular del
|
|||
|
|
copyright. Este fichero s<EFBFBD>lo podr<EFBFBD> ser copiado, distribuido y utilizado,
|
|||
|
|
en su totalidad o en parte, con el permiso escrito de Rodax Software, o de
|
|||
|
|
acuerdo con los t<EFBFBD>rminos y condiciones establecidas en el acuerdo/contrato
|
|||
|
|
bajo el que se suministra.
|
|||
|
|
-----------------------------------------------------------------------------
|
|||
|
|
Web: www.rodax-software.com
|
|||
|
|
===============================================================================
|
|||
|
|
Fecha primera versi<EFBFBD>n: 14-09-2002
|
|||
|
|
Versi<EFBFBD>n actual: 1.0.0
|
|||
|
|
Fecha versi<EFBFBD>n actual: 14-09-2002
|
|||
|
|
===============================================================================
|
|||
|
|
Modificaciones:
|
|||
|
|
|
|||
|
|
Fecha Comentarios
|
|||
|
|
---------------------------------------------------------------------------
|
|||
|
|
===============================================================================
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
unit EditorDescripcion;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
|||
|
|
RdxFrame, RdxBotones, ExtCtrls, RdxPaneles, RdxBarras, StdCtrls, RdxRichEdit,
|
|||
|
|
ComCtrls, Tipos, RdxMemo;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrEditorDescripcion = class(TRdxFrame)
|
|||
|
|
brGuardar: TRdxBarraInferior;
|
|||
|
|
bGuardar: TRdxBoton;
|
|||
|
|
bCancelar: TRdxBoton;
|
|||
|
|
eInformacion: TLabel;
|
|||
|
|
Descripcion: TRdxRichEdit;
|
|||
|
|
procedure bGuardarClick(Sender: TObject);
|
|||
|
|
procedure bCancelarClick(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
TextoAnterior : String;
|
|||
|
|
procedure SetTexto(AValue : String);
|
|||
|
|
function GetTexto : String;
|
|||
|
|
procedure CambiarModo(ModoAnterior, Modo : TRdxModo);
|
|||
|
|
published
|
|||
|
|
property Texto : String read GetTexto write SetTexto;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frEditorDescripcion: TfrEditorDescripcion;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{$R *.DFM}
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
StrFunc;
|
|||
|
|
|
|||
|
|
{ TfrEditorDescripcion }
|
|||
|
|
|
|||
|
|
procedure TfrEditorDescripcion.bGuardarClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
CloseFrame;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrEditorDescripcion.bCancelarClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Texto := TextoAnterior;
|
|||
|
|
CloseFrame;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrEditorDescripcion.GetTexto: String;
|
|||
|
|
begin
|
|||
|
|
{ Le quito dos posiciones para eliminar el salto de l<EFBFBD>nea que aparece
|
|||
|
|
al siempre final de la cadena. }
|
|||
|
|
Result := Copy(Descripcion.Text, 0, Length(Descripcion.Text)-2);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrEditorDescripcion.SetTexto(AValue: String);
|
|||
|
|
begin
|
|||
|
|
Descripcion.Lines.Clear;
|
|||
|
|
if (not EsCadenaVacia(AValue)) then
|
|||
|
|
begin
|
|||
|
|
TextoAnterior := AValue;
|
|||
|
|
Descripcion.Lines.Add(AValue);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrEditorDescripcion.CambiarModo(ModoAnterior, Modo: TRdxModo);
|
|||
|
|
begin
|
|||
|
|
if Modo in [Eliminar, Consultar] then
|
|||
|
|
Descripcion.ReadOnly := True
|
|||
|
|
else
|
|||
|
|
Descripcion.ReadOnly := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|