AbetoDesign_FactuGES2/Source/Modulos/Contabilidad/Views/uEditorElegirSubCuentas.pas

129 lines
4.0 KiB
ObjectPascal

unit uEditorElegirSubCuentas;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, uDADataTable, Menus, JvAppStorage, JvAppRegistryStorage,
JvComponentBase, JvFormPlacement, ImgList, PngImageList, StdActns,
ActnList, uCustomView, uViewBase, uViewGridBase, uViewGrid,
ComCtrls, TB2ExtItems, TBXExtItems, TBX, TB2Item, TB2Dock, TB2Toolbar,
pngimage, ExtCtrls, JvExControls, JvComponent,
JvNavigationPane, uViewBarraSeleccion, StdCtrls,
uBizSubCuentas, uIEditorElegirSubCuentas,
JvExComCtrls, JvStatusBar, uEditorSubCuentas, uViewSubCuentas,
JSDialog, uDAInterfaces, dxGDIPlusClasses;
type
TfEditorElegirSubCuentas = class(TfEditorSubCuentas, IEditorElegirSubCuentas)
frViewBarraSeleccion1: TfrViewBarraSeleccion;
EditorSeleccionActionList: TActionList;
actBuscar2: TAction;
actQuitarFiltro2: TAction;
actAnchoAuto2: TAction;
pnlHeader: TPanel;
lblTitle: TLabel;
lblComments: TLabel;
procedure frViewBarraSeleccion1actSeleccionarUpdate(Sender: TObject);
procedure frViewBarraSeleccion1actCancelarExecute(Sender: TObject);
procedure frViewBarraSeleccion1actSeleccionarExecute(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure actAnchoAuto2Execute(Sender: TObject);
procedure actQuitarFiltro2Execute(Sender: TObject);
protected
procedure SetMultiSelect (AValue : Boolean);
function GetMultiSelect : Boolean;
function GetSubCuentasSeleccionados: IBizSubCuenta;
procedure SetViewGrid(const Value: IViewGridBase); override;
procedure SetMensaje (const AValue: String);
function GetMensaje: String;
public
property Mensaje : String read GetMensaje write SetMensaje;
property SubCuentasSeleccionados: IBizSubCuenta read GetSubCuentasSeleccionados;
property MultiSelect : Boolean read GetMultiSelect write SetMultiSelect;
end;
implementation
uses
uEditorGridBase, cxGridCustomTableView, uIntegerListUtils, uDBSelectionListUtils,
uGridUtils, uEditorBase, uSubCuentasController;
{$R *.dfm}
{ TfEditorElegirSubCuentas }
procedure TfEditorElegirSubCuentas.actAnchoAuto2Execute(Sender: TObject);
begin
inherited;
actAnchoAuto.Execute;
end;
procedure TfEditorElegirSubCuentas.actQuitarFiltro2Execute(Sender: TObject);
begin
inherited;
actQuitarFiltro.Execute;
end;
procedure TfEditorElegirSubCuentas.FormShow(Sender: TObject);
begin
inherited;
EditorActionList.State := asSuspended;
end;
procedure TfEditorElegirSubCuentas.frViewBarraSeleccion1actCancelarExecute(
Sender: TObject);
begin
inherited;
Close;
end;
procedure TfEditorElegirSubCuentas.frViewBarraSeleccion1actSeleccionarExecute(
Sender: TObject);
begin
inherited;
ModalResult := mrOk;
end;
procedure TfEditorElegirSubCuentas.frViewBarraSeleccion1actSeleccionarUpdate(
Sender: TObject);
begin
inherited;
(Sender as TAction).Enabled := (ViewGrid._FocusedView.Controller.SelectedRowCount > 0)
end;
function TfEditorElegirSubCuentas.GetSubCuentasSeleccionados: IBizSubCuenta;
begin
SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (SubCuentas as ISeleccionable).SelectedRecords);
// En SelectedRecords tengo los ID de las filas seleccionadas del grid
Result := (Controller as ISubCuentasController).ExtraerSeleccionados(SubCuentas) as IBizSubCuenta;
end;
function TfEditorElegirSubCuentas.GetMensaje: String;
begin
Result := lblComments.Caption;
end;
function TfEditorElegirSubCuentas.GetMultiSelect: Boolean;
begin
Result := ViewGrid.MultiSelect;
end;
procedure TfEditorElegirSubCuentas.SetMensaje(const AValue: String);
begin
lblComments.Caption := AValue;
end;
procedure TfEditorElegirSubCuentas.SetMultiSelect(AValue: Boolean);
begin
ViewGrid.MultiSelect := AValue;
end;
procedure TfEditorElegirSubCuentas.SetViewGrid(const Value: IViewGridBase);
begin
inherited;
ViewGrid.OnDblClick := frViewBarraSeleccion1.actSeleccionar.OnExecute;
end;
end.