unit uEditorInstalador; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uEditorContacto, JvAppStorage, JvAppRegistryStorage, JvComponent, JvFormPlacement, DB, uDADataTable, ImgList, PngImageList, StdActns, ActnList, ComCtrls, TBX, TB2Item, TB2Dock, TB2Toolbar, JvExControls, JvNavigationPane, ExtCtrls, pngimage; type IEditorInstalador = interface(IEditorContacto) ['{0959F4A7-ADD2-4437-B91B-3CB483C77A5E}'] end; TfEditorInstalador = class(TfEditorContacto, IEditorInstalador) procedure actEliminarExecute(Sender: TObject); procedure dsDataTableDataChange(Sender: TObject; Field: TField); public constructor Create(AOwner: TComponent); override; end; var fEditorInstalador: TfEditorInstalador; implementation uses uEditorUtils, uBizContacto, uViewInstalador; {$R *.dfm} function ShowEditorInstalador (ABizObject : TDADataTableRules) : TModalResult; var AEditor: TfEditorInstalador; begin AEditor := TfEditorInstalador.Create(Application); try AEditor.Contacto := (ABizObject as IBizInstalador); Result := AEditor.ShowModal; finally AEditor.Release; end; end; { TfEditorInstalador } constructor TfEditorInstalador.Create(AOwner: TComponent); begin inherited; ViewContacto := CreateView(TfrViewInstalador) as IViewInstalador; end; procedure TfEditorInstalador.actEliminarExecute(Sender: TObject); begin if (Application.MessageBox('¿Desea borrar este instalador?', 'Atención', MB_YESNO) = IDYES) then inherited; end; procedure TfEditorInstalador.dsDataTableDataChange(Sender: TObject; Field: TField); begin inherited; if Assigned(Contacto) and (not (Contacto.DataTable.Fetching) or not (Contacto.DataTable.Opening) or not (Contacto.DataTable.Closing)) then begin if Length(Contacto.NOMBRE) = 0 then JvNavPanelHeader.Caption := 'Nuevo instalador' else JvNavPanelHeader.Caption := Contacto.NOMBRE; Self.Caption := JvNavPanelHeader.Caption; end; end; initialization RegisterEditor(IBizInstalador, ShowEditorInstalador, etItem); finalization end.