Einzelnen Beitrag anzeigen

Benutzerbild von bytecook
bytecook

Registriert seit: 6. Aug 2010
Ort: Dornbirn
151 Beiträge
 
Delphi 11 Alexandria
 
#10

AW: Alternative zu Typecast => IInterface?

  Alt 17. Nov 2016, 12:54
Aber Jünge!

Du müsstest doch eine Compiler-Warnung bekommen
Delphi-Quellcode:
type
   TBase = class
      public procedure stuff(); virtual;
   end;

   TSub = class(TBase)
      public procedure stuff(); virtual;
   end;
in Form von
Zitat:
[dcc32 Warnung] Project15.dpr(15): W1010 Methode 'stuff' verbirgt virtuelle Methode vom Basistyp 'TBase'

Oder?
es compilierte ...

Wie gesagt hatte ich mir die Warnungen nicht angesehen, dort stands ja drinnen...

[dcc32 Warnung] SVFXCommands.pas(189): W1010 Methode 'Process' verbirgt virtuelle Methode vom Basistyp 'TSVFXVisualCmd'

Code:
  (******************************************************************************)
  (******************************************************************************)
  (** TSVFXVisualCmd                                                          **)
  (******************************************************************************)
  (******************************************************************************)
  TSVFXVisualCmd = Class (TSVFXCustomCmd)
  private
    FGroupIndex                                              : UInt32;
    FConstraints                                             : TSVFXSizeConstraints;
    FShift                                                   : TFloatPoint;
    FConstraintValue                                         : TFloatPoint;

  protected
    procedure DoConstraintsChanged (Sender : TObject); Virtual;
    function GetConstrainedSize  (Const Value: TFloatPoint) : TFloatPoint; Virtual;
    function GetPoint            () : TPointInfo; Virtual; Abstract;
    function GetPreviousPoint    () : TPointInfo; Virtual;
    function GetSize : TFloatPoint; Virtual;
    function Process (APath : TFlattenedPath) : Boolean; Virtual; Abstract;

    property GroupIndex : UInt32
             read FGroupIndex
             write FGroupIndex;

    property Constraints : TSVFXSizeConstraints
             read fConstraints
             write fConstraints;
  public
    Constructor Create (AOwner : TSVFXCommands; Const ADescription : String); Override;
    Destructor Destroy; Override;

    procedure UpdateShift (Const Value : TFloatPoint); Virtual; Abstract;
    procedure UpdateValues; Virtual; Abstract;

    (** Der Befehl UpdateValues aktualisiert die "Arbeitsvariablen_", die u.a zur Pfadbildung   **)
    (** verwendet werden.                                                                       **)
    function ValuesAsText () : String; Virtual;

    property ConstraintValue : TFloatPoint
             read fConstraintValue;

    property Size : TFloatPoint
             read GetSize;

  end;


  (******************************************************************************)
  (******************************************************************************)
  (** TSVFXMoveTo - TSVFXCommand                                              **)
  (** Bewegt den Stift an die Position Startpoint                             **)
  (******************************************************************************)
  (******************************************************************************)
  TSVFXMoveTo = Class (TSVFXVisualCmd)
  private
    fPoint                                                   : TFloatPoint;
    fPoint_                                                   : TFloatPoint;
    FDirections                                              : TSVFXDirections;
    procedure SetPoint (Const Value : TFloatPoint);
  protected
    procedure AssignTo (Dest : TPersistent); Override;
    function Read1000 (AStream : TStream) : Integer; Override;
    function GetPoint : TPointInfo; Override;
    function GetPreviousPoint : TPointInfo; Override;
  public
    Constructor Create(AOwner : TSVFXCommands; Const ADescription : String); Override;

    function LoadFromStream (AStream : TStream) : Integer; Override;
    function SaveToStream  (AStream : TStream) : Integer; Override;
    function ValuesAsText  () : String; Override;
    procedure UpdateShift   (Const Value : TFloatPoint); Override;
    procedure UpdateValues  (); Override;
    function Process       (APath : TFlattenedPath) : Boolean; virtual;

    property Point : TFloatPoint
             read fPoint
             write SetPoint;

    property Directions : TSVFXDirections
             read FDirections
             write FDirections;

    property Flag;
    property GroupIndex;
  end;
Peter
Was mache ich, wenn ein Bär meine Frau angreift?
Nichts. Er hat sie angegriffen, soll er doch selber sehen, wie er sich verteidigt.
  Mit Zitat antworten Zitat