Einzelnen Beitrag anzeigen

Delphi.Narium

Registriert seit: 27. Nov 2017
2.508 Beiträge
 
Delphi 7 Professional
 
#8

AW: Verständnisfrage Vorwärtsdeklaration

  Alt 6. Dez 2017, 17:02
(ungetestet) eher so:
Delphi-Quellcode:
type
  // One point is 1/72 inch (around 0.3528 mm).
  TPointsSize = record
    cx : Double;
    cy : Double;
  end;

  TRectD = record
    Left : Double;
    Top : Double;
    Right : Double;
    Bottom : Double;
  end;

  TPDFPage = class
    Index : Integer;
    Handle : HPDFPage;
    Top : Double;
    Rect : TRect;
    Text : HPDFTextPage;
    NoText : Boolean;
    Visible : Integer;
    SelStart : Integer;
    SelStop : Integer;
    Selection: TArray<TRectD>;
    destructor Destroy; override;
    function HasText: Boolean;
    function CharIndex(x, y, distance: Integer): Integer;
    function CharCount: Integer;
    function Select(Start: Integer): Boolean;
    function SelectTo(Stop: Integer): Boolean;
    function ClearSelection: Boolean;
    procedure DrawSelection(DC, BMP: HDC; const Blend: TBlendFunction; const Client: TRect);
  end;

  TPDFiumFrame = class(TFrame)
  private
    FDocument : HPDFDocument;
    FError : Integer;
    FPageCount: Integer;
    FPageSize : TArray<TPointsSize>;
    FTotalSize: TPointsSize;
    FPages : TList;
    FReload : Boolean;
    FPageIndex: Integer;
    FCurPage : TPDFPage;
    FSelPage : TPDFPage;
    FSelStart : Integer;
    FSelBmp : TBitmap;
    FInvalide : Boolean;
    FReportList: TStringlist;
    FGetPageAt : Integer;
  {$IFDEF TRACK_CURSOR}
    FCharIndex: Integer;
    FCharBox : TRectD;
  {$ENDIF}
    procedure SetDocument(Value: HPDFDocument);
    procedure SetPageCount(Value: Integer);
...
    property _Document: HPDFDocument read FDocument write SetDocument;
    procedure ClearPages;
    function GetPage(PageIndex: Integer): TPDFPage;
    function GetPageAt(const p: TPoint): TPDFPage;
    procedure LoadVisiblePages; //<===
    procedure WMEraseBkGnd(var Msg: TMessage); message WM_ERASEBKGND;
    procedure WMPaint(var Msg: TWMPaint); message WM_PAINT;
    procedure WMHScroll(var Message: TWMHScroll); message WM_HSCROLL;
    procedure WMVScroll(var Message: TWMVScroll); message WM_VSCROLL;
  protected
    procedure PaintWindow(DC: HDC); override; //<===
    procedure Resize; override;
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
      X, Y: Integer); override;
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
      X, Y: Integer); override;
    function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer;
      MousePos: TPoint): Boolean; override;
    procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
    procedure SetPageIndex(Value : Integer);
  public
    { Déclarations publiques }
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
geht nicht:
Delphi-Quellcode:
type
  TForm1 = class(TForm)
  private
    { Private-Deklarationen }
    type
      tx = class
      private
      f : Integer;
    end;
    fx : tx;
  public
    { Public-Deklarationen }
  end;
muss so sein:
Delphi-Quellcode:
type
  tx = class
  private
  f : Integer;
end;

type
  TForm1 = class(TForm)
  private
    { Private-Deklarationen }
    fx : tx;
  public
    { Public-Deklarationen }
  end;
  Mit Zitat antworten Zitat