System.Types.TSize

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

  TSize = record
    cx: FixedInt;
    cy: FixedInt;
  public
    constructor Create(P : TSize); overload;
    constructor Create(const X, Y : Integer); overload;
    class operator Equal(const Lhs, Rhs : TSize) : Boolean;
    class operator NotEqual(const Lhs, Rhs : TSize): Boolean;
    class operator Add(const Lhs, Rhs : TSize): TSize;
    class operator Subtract(const Lhs, Rhs : TSize): TSize;
    function Add(const Point: TSize): TSize;
    function Distance(const P2 : TSize) : Double;
    function IsZero : Boolean;
    function Subtract(const Point: TSize): TSize;
    property Width: Integer read cx write cx;
    property Height: Integer read cy write cy;
  end;

C++

struct TSize: public tagSIZE {
  TSize() _ALWAYS_INLINE {
    this->cx = this->cy = 0;
  }
  TSize(const tagSIZE& ts) _ALWAYS_INLINE {
    this->cx = ts.cx;
    this->cy = ts.cy;
  }
  TSize(int32_t x, int32_t y) _ALWAYS_INLINE {
    this->cx = x;
    this->cy = y;
  }
  bool operator ==(const TSize& ts) const _ALWAYS_INLINE {
    return this->cx == ts.cx && this->cy == ts.cy;
  }
  bool operator !=(const TSize& ts) const _ALWAYS_INLINE {
    return !(*this == ts);
  }
  TSize operator +(const TSize& rhs) const _ALWAYS_INLINE {
    return TSize(this->cx + rhs.cx, this->cy + rhs.cy);
  }
  TSize operator -(const TSize& rhs) const _ALWAYS_INLINE {
    return TSize(this->cx - rhs.cx, this->cy - rhs.cy);
  }
  TSize& operator+= (const TSize& rhs) _ALWAYS_INLINE {
      this->cx += rhs.cx;
      this->cy += rhs.cy;
      return *this;
  }
  TSize& operator-= (const TSize& rhs) _ALWAYS_INLINE {
    this->cx -= rhs.cx;
    this->cy -= rhs.cy;
    return *this;
  }
  bool IsZero() const _ALWAYS_INLINE {
    return !cx && !cy;
  }
  __property LONG Width =  { read=cx,   write=cx  };
  __property LONG Height = { read=cy,   write=cy  };
};

プロパティ

種類 可視性 ソース ユニット
record
struct
public
System.Types.pas
SystemTypes.h
System.Types System.Types


説明

オブジェクトの幅と高さを示します。

TSize は、オブジェクトのサイズを示します。オブジェクトは、四角形、フォーム、ボタン、などです。大抵の場合、暗黙の測定単位はピクセルです。

cx は幅です。

cy は高さです。

関連項目