AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Alternative zu Typecast => IInterface?

Ein Thema von bytecook · begonnen am 17. Nov 2016 · letzter Beitrag vom 17. Nov 2016
 
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
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:48 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz