This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
LuisLeon_FactuGES2/Source/Modulos/Informes base/Views/uFormPropiedadesInforme.pas

118 lines
3.2 KiB
ObjectPascal

unit uFormPropiedadesInforme;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxControls, cxContainer, cxEdit, cxTextEdit, cxMemo, StdCtrls,
JvExControls, JvComponent, JvgWizardHeader, ExtCtrls, ImgList,
PngImageList, JvExStdCtrls, JvButton, JvCtrls, Menus, JvMenus, ActnList;
type
TfrPropiedadesInforme = class(TForm)
edtNombre: TcxTextEdit;
Label1: TLabel;
Label2: TLabel;
bAceptar: TButton;
memDescripcion: TcxMemo;
JvgWizardHeader1: TJvgWizardHeader;
cbModificable: TCheckBox;
Label3: TLabel;
Bevel1: TBevel;
btnIcono: TJvImgBtn;
ReportImages: TPngImageList;
JvPopupMenu1: TJvPopupMenu;
N11: TMenuItem;
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure JvPopupMenu1Popup(Sender: TObject);
private
procedure SetDescripcion(const Value: String);
procedure SetNombre(const Value: String);
function GetDescripcion: String;
function GetNombre: String;
function GetModificable: Boolean;
procedure SetModificable(const Value: Boolean);
function GetIcono: Integer;
procedure SetIcono(const Value: Integer);
procedure OnMenuItemClick(Sender: TObject);
public
property Nombre : String read GetNombre write SetNombre;
property Descripcion : String read GetDescripcion write SetDescripcion;
property Modificable : Boolean read GetModificable write SetModificable;
property Icono : Integer read GetIcono write SetIcono;
end;
implementation
{$R *.dfm}
procedure TfrPropiedadesInforme.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose := Length(edtNombre.Text) > 0;
if not CanClose then
ShowMessage('Debe indicar al menos el nombre de este informe.');
end;
function TfrPropiedadesInforme.GetDescripcion: String;
begin
Result := memDescripcion.Lines.Text;
end;
function TfrPropiedadesInforme.GetIcono: Integer;
begin
Result := btnIcono.ImageIndex;
end;
function TfrPropiedadesInforme.GetModificable: Boolean;
begin
Result := not cbModificable.Checked;
end;
function TfrPropiedadesInforme.GetNombre: String;
begin
Result := edtNombre.Text;
end;
procedure TfrPropiedadesInforme.SetDescripcion(const Value: String);
begin
memDescripcion.Lines.Text := Value;
end;
procedure TfrPropiedadesInforme.SetIcono(const Value: Integer);
begin
btnIcono.ImageIndex := Value;
end;
procedure TfrPropiedadesInforme.SetModificable(const Value: Boolean);
begin
cbModificable.Checked := not Value;
end;
procedure TfrPropiedadesInforme.SetNombre(const Value: String);
begin
edtNombre.Text := Value;
end;
procedure TfrPropiedadesInforme.JvPopupMenu1Popup(Sender: TObject);
var
AItem : TMenuItem;
i : integer;
begin
JvPopupMenu1.Items.Clear;
for i := 0 to ReportImages.Count - 1 do
begin
AItem := TMenuItem.Create(JvPopupMenu1);
AItem.OnClick := OnMenuItemClick;
AItem.ImageIndex := i;
JvPopupMenu1.Items.Add(AItem);
end;
end;
procedure TfrPropiedadesInforme.OnMenuItemClick(Sender: TObject);
begin
btnIcono.ImageIndex := (Sender as TMenuItem).ImageIndex;
end;
end.