Einzelnen Beitrag anzeigen

Benutzerbild von ATS3788
ATS3788

Registriert seit: 18. Mär 2004
Ort: Kriftel
646 Beiträge
 
Delphi XE Starter
 
#1

Understanding Class Defination

  Alt 12. Feb 2015, 09:18
Hallo Freunde
Was eine Klasse "class" das ist klar
Nur für was benutzt man s.u.
für eine Funktion den class Ausdruck.

Also
Result := 'APPLICATION';
wird überschrieben.
Aber geht dies nicht auch ohne class ?


Delphi-Quellcode:
type
  TFormMain = class(TUIRibbonForm)
    procedure FormContextPopup(Sender: TObject; MousePos: TPoint;
      var Handled: Boolean);
  private
    { Private declarations }
    FCurrentContext: Integer;
    FCommandContexts: array [0..3] of TUICommandBoolean;
  private
    procedure ContextToggle(const Args: TUICommandBooleanEventArgs);
  strict protected
    procedure RibbonLoaded; override;
  public
    { Public declarations }
    class function RibbonResourceName: String; override; //// Hier dies class meine ich

  end;

--------------------------------------------------------

    { Returns the name of the ribbon resource. By default, this is 'APPLICATION',
      which is the name the Ribbon Compiler uses when no name is specified.
      If you specified a name to the Ribbon Compiler (using then /name switch),
      then you need to override this function and return that name.
      Specifying an incorrect name will cause an exception on startup. }

    class function RibbonResourceName: String; virtual;

class function TUIRibbonForm.RibbonResourceName: String;
begin
  Result := 'APPLICATION';
end;
Martin MIchael
  Mit Zitat antworten Zitat