git-svn-id: https://192.168.0.254/svn/Proyectos.AlonsoYSal_FactuGES2/trunk@6 40301925-124e-1c4e-b97d-170ad7a8785b
129 lines
4.4 KiB
ObjectPascal
129 lines
4.4 KiB
ObjectPascal
unit uEditorElegirPresupuestosCliente;
|
||
|
||
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,
|
||
uViewPresupuestosCliente, ComCtrls, TB2ExtItems, TBXExtItems, TBX,
|
||
TB2Item, TB2Dock, TB2Toolbar, pngimage, ExtCtrls, JvExControls, JvComponent,
|
||
JvNavigationPane, uViewBarraSeleccion, JvgWizardHeader, StdCtrls,
|
||
uEditorPresupuestosCliente, uBizPresupuestosCliente, uIEditorElegirPresupuestosCliente,
|
||
JvExComCtrls, JvStatusBar, JSDialog, uDAInterfaces;
|
||
|
||
type
|
||
TfEditorElegirPresupuestosCliente = class(TfEditorPresupuestosCliente, IEditorElegirPresupuestosCliente)
|
||
frViewBarraSeleccion1: TfrViewBarraSeleccion;
|
||
JvgWizardHeader1: TJvgWizardHeader;
|
||
EditorSeleccionActionList: TActionList;
|
||
actBuscar2: TAction;
|
||
actQuitarFiltro2: TAction;
|
||
actAnchoAuto2: TAction;
|
||
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 GetPresupuestosClienteSeleccionados: IBizPresupuestoCliente;
|
||
procedure SetViewGrid(const Value: IViewGridBase); override;
|
||
procedure SetMensaje (const AValue: String);
|
||
function GetMensaje: String;
|
||
public
|
||
property Mensaje : String read GetMensaje write SetMensaje;
|
||
property PresupuestosClienteSeleccionados: IBizPresupuestoCliente read GetPresupuestosClienteSeleccionados;
|
||
property MultiSelect : Boolean read GetMultiSelect write SetMultiSelect;
|
||
end;
|
||
|
||
implementation
|
||
|
||
uses
|
||
uEditorGridBase, cxGridCustomTableView, uIntegerListUtils, uDBSelectionListUtils,
|
||
uGridUtils, uEditorBase, uPresupuestosClienteController,
|
||
cxGridLevel;
|
||
|
||
{$R *.dfm}
|
||
|
||
{ TfEditorElegirPresupuestosCliente }
|
||
|
||
procedure TfEditorElegirPresupuestosCliente.actAnchoAuto2Execute(Sender: TObject);
|
||
begin
|
||
inherited;
|
||
actAnchoAuto.Execute;
|
||
end;
|
||
|
||
procedure TfEditorElegirPresupuestosCliente.actQuitarFiltro2Execute(Sender: TObject);
|
||
begin
|
||
inherited;
|
||
actQuitarFiltro.Execute;
|
||
end;
|
||
|
||
procedure TfEditorElegirPresupuestosCliente.FormShow(Sender: TObject);
|
||
begin
|
||
inherited;
|
||
EditorActionList.State := asSuspended;
|
||
end;
|
||
|
||
procedure TfEditorElegirPresupuestosCliente.frViewBarraSeleccion1actCancelarExecute(
|
||
Sender: TObject);
|
||
begin
|
||
inherited;
|
||
Close;
|
||
end;
|
||
|
||
procedure TfEditorElegirPresupuestosCliente.frViewBarraSeleccion1actSeleccionarExecute(
|
||
Sender: TObject);
|
||
begin
|
||
inherited;
|
||
ModalResult := mrOk;
|
||
end;
|
||
|
||
procedure TfEditorElegirPresupuestosCliente.frViewBarraSeleccion1actSeleccionarUpdate(
|
||
Sender: TObject);
|
||
begin
|
||
inherited;
|
||
(Sender as TAction).Enabled := (ViewGrid._FocusedView.Controller.SelectedRowCount > 0)
|
||
end;
|
||
|
||
function TfEditorElegirPresupuestosCliente.GetPresupuestosClienteSeleccionados: IBizPresupuestoCliente;
|
||
begin
|
||
SeleccionarFilasDesdeGrid(ViewGrid._FocusedView, (Presupuestos as ISeleccionable).SelectedRecords);
|
||
// En SelectedRecords tengo los ID de las filas seleccionadas del grid
|
||
Result := (Controller as IPresupuestosClienteController).ExtraerSeleccionados(Presupuestos) as IBizPresupuestoCliente;
|
||
end;
|
||
|
||
function TfEditorElegirPresupuestosCliente.GetMensaje: String;
|
||
begin
|
||
Result := JvgWizardHeader1.Comments.Text;
|
||
end;
|
||
|
||
function TfEditorElegirPresupuestosCliente.GetMultiSelect: Boolean;
|
||
begin
|
||
Result := ViewGrid.MultiSelect;
|
||
end;
|
||
|
||
procedure TfEditorElegirPresupuestosCliente.SetMensaje(const AValue: String);
|
||
begin
|
||
JvgWizardHeader1.Comments.Text := AValue;
|
||
end;
|
||
|
||
procedure TfEditorElegirPresupuestosCliente.SetMultiSelect(AValue: Boolean);
|
||
begin
|
||
ViewGrid.MultiSelect := AValue;
|
||
end;
|
||
|
||
procedure TfEditorElegirPresupuestosCliente.SetViewGrid(const Value: IViewGridBase);
|
||
begin
|
||
inherited;
|
||
//Para que no salgan las pesta<74>as de filtrado
|
||
ViewGrid._Grid.RootLevelOptions.DetailTabsPosition := dtpNone;
|
||
ViewGrid.OnDblClick := frViewBarraSeleccion1.actSeleccionar.OnExecute;
|
||
end;
|
||
|
||
end.
|