Classe TApplication

Unit

Declaração

type TApplication = class(TApplicationConsts)

Descrição

No description available, ancestor TApplicationConsts description follows
No description available, ancestor TApplication_type description follows

A class TApplication_type* é usada para capsular todas as variáveis globais do projeto e gerenciar o ciclo de vida do aplicativo

Hierarquia

Visão Geral

Métodos

Public function GetTypeApplication:TEnumApplication; Virtual;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public function FileOptions_CommandEnabled(aCommand: AnsiString): Boolean; Virtual;
Public procedure EnableCommands(aCommands: TCommandSet); virtual;
Public procedure DisableCommands(aCommands: TCommandSet); virtual;
Public procedure CreateForm(aMI_MsgBoxTypes_Class : TMI_MsgBoxTypes_Class; out Reference); Virtual; overload; abstract;

Descrição

Métodos

Public function GetTypeApplication:TEnumApplication; Virtual;
 
Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public function FileOptions_CommandEnabled(aCommand: AnsiString): Boolean; Virtual;

O método FileOptions_CommandEnabled deve ser redefinido na aplicações filhas para indicar se o comando a ser executado está habilitado no arquivo de opções.

Public procedure EnableCommands(aCommands: TCommandSet); virtual;
 
Public procedure DisableCommands(aCommands: TCommandSet); virtual;
 
Public procedure CreateForm(aMI_MsgBoxTypes_Class : TMI_MsgBoxTypes_Class; out Reference); Virtual; overload; abstract;

O Método CreateForm deve ser implementado para criar um diálogo com as caractestísticas do tipo de aplicação, podendo ser LCL, html, javascript etc...

  • EXEMPLO DE IMPLEMENTAÇÃO DE APP LCL

    
    procedure Tmi_lcl_application.CreateForm( aMI_MsgBoxTypes_Class: TMI_MsgBoxTypes_Class; out Reference);
      var
        Instance: TComponent;//Usado para saber o tipo da classe.
        Input  : TMi_lcl_inputbox;
        MsgBox : TMI_Lcl_MsgBox;
    begin
      // Allocate the instance, without calling the constructor
      Instance := TComponent(aMI_MsgBoxTypes_Class.NewInstance);
      TComponent(Reference) := Instance;
      Instance.Create(Self);
      if (Instance is TMI_UI_InputBox)
      then begin
             freeandnil(Reference);
             Input := TMi_lcl_inputbox.Create(nil);
             TMI_MsgBoxTypes(Reference) := Input.MI_UI_InputBox1;
           end
           else if (Instance is TMI_MsgBox)
                then begin
                       freeandnil(Reference);
                       MsgBox := TMI_Lcl_MsgBox.Create(nil);
                       TMI_MsgBoxTypes(Reference) := MsgBox.MI_MsgBox1;
                     end
                else TMI_MsgBoxTypes(Reference) := nil;
    
    end;


Gerado por PasDoc 0.16.0.