Ignore:
Timestamp:
Apr 30, 2007, 1:56:57 PM (18 years ago)
Author:
イグトランス (egtra)
Message:

Controlがコンパイルできるように修正

Location:
Include/Classes/System/Drawing
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/Drawing/Point.ab

    r212 r223  
    44#define __SYSTEM_DRAWING_POINT_AB__
    55
    6 #include <Classes/System/Drawing/PointF.ab>
    7 #include <Classes/System/Drawing/Size.ab>
    8 #include <Classes/System/Drawing/SizeF.ab>
     6#require <Classes/System/Drawing/PointF.ab>
     7#require <Classes/System/Drawing/Size.ab>
     8#require <Classes/System/Drawing/SizeF.ab>
    99
    1010Class Point
     
    2020    End Sub
    2121
    22     Sub Point(pt As Point)
    23         x = pt.x
    24         y = pt.y
    25     End Sub
    26 
    27     Sub Point(ByRef sz As Size)
     22    Sub Point(sz As Size)
    2823        x = sz.Width
    2924        y = sz.Height
     
    5449        Return x = 0 And y = 0
    5550    End Function
    56 /*
    57     Sub Operator = (ByRef pt As Point)
    58         x = pt.x
    59         y = pt.y
    60     End Sub
    61 */
     51
    6252    Function Operator + (pt As Point) As Point
    6353        Return Add(This, pt)
  • Include/Classes/System/Drawing/Rectangle.ab

    r212 r223  
    44#define __SYSTEM_DRAWING_RECTANGLE_AB__
    55
    6 #include <Classes/System/Math.ab>
    7 #include <Classes/System/Drawing/RectangleF.ab>
    8 #include <Classes/System/Drawing/Point.ab>
    9 #include <Classes/System/Drawing/Size.ab>
     6#require <Classes/System/Math.ab>
     7#require <Classes/System/Drawing/RectangleF.ab>
     8#require <Classes/System/Drawing/Point.ab>
     9#require <Classes/System/Drawing/Size.ab>
    1010
    1111Class Rectangle
     
    3232    End Sub
    3333
    34     Sub Rectangle(ByRef r As Rectangle)
    35         x = r.x
    36         y = r.y
    37         width = r.width
    38         height = r.height
    39     End Sub
    40 
    4134    Sub Rectangle(ByRef r As RECT)
    42         This = FromLTRB(r.left, r.top, r.right, r.bottom)
     35        x = r.left
     36        y = r.top
     37        width = r.right - r.left
     38        height = r.top - r.bottom
    4339    End Sub
    4440
     
    111107
    112108    Function IsEmpty() As Boolean
    113         If Width <= 0 Or Height <= 0 Then
    114             IsEmpty = _System_TRUE
    115         Else
    116             IsEmpty = _System_FALSE
    117         End If
    118     End Function
    119 /*
    120     Function Operator = (rc As Rectangle)
    121         With rc
    122             x = .x
    123             y = .y
    124             width = .width
    125             height = .height
    126         End With
    127     End Function
    128 */
     109        Return Width <= 0 Or Height <= 0
     110    End Function
     111
    129112    Function Operator == (rc As Rectangle)
    130113        Return Equals(rc)
     
    140123
    141124    Function Equals(rc As Rectangle) As Boolean
    142         If X = rc.X And Y = rc.Y And Width = rc.Width And Height = rc.Height Then
    143             Return True
    144         Else
    145             Return False
    146         End If
     125        Return X = rc.X And Y = rc.Y And Width = rc.Width And Height = rc.Height
    147126    End Function
    148127
    149128    Override Function GetHashCode() As Long
    150         Return x Xor _System_BSwap(y) Xor width Xor _System_BSwap(height)
     129        Return x As DWord Xor _System_BSwap(y As DWord) Xor width As DWord Xor _System_BSwap(height As DWord)
    151130    End Function
    152131
    153132    Static Function FromLTRB(l As Long, t As Long, r As Long, b As Long) As Rectangle
    154         return New Rectangle(l, t, r - l, r - b)
     133        return New Rectangle(l, t, r - l, b - t)
    155134    End Function
    156135
    157136    Function Contains(x As Long, y As Long) As Boolean
    158         If x >= X And x < X + Width And y >= Y And y < Y + Height Then
    159             Return True
    160         Else
    161             Return False
    162         End If
     137        Return x >= X And x < X + Width And y >= Y And y < Y + Height
    163138    End Function
    164139
     
    168143
    169144    Function Contains(rc As Rectangle) As Boolean
    170         If X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom Then
    171             Return True
    172         Else
    173             Return False
    174         End If
     145        Return X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom
    175146    End Function
    176147
     
    205176
    206177    Function IntersectsWith(rc As Rectangle) As Boolean
    207         If Left < rc.Right And _
     178        Return Left < rc.Right And _
    208179            Top < rc.Bottom And _
    209180            Right > rc.Left And _
    210             Bottom > rc.Top Then
    211             Return True
    212         Else
    213             Return False
    214         End If
     181            Bottom > rc.Top
    215182    End Function
    216183
  • Include/Classes/System/Drawing/Size.ab

    r212 r223  
    7777
    7878    Override Function GetHashCode() As Long
    79         Return width Xor _System_BSwap(height)
     79        Return width As DWord Xor _System_BSwap(height As DWord)
    8080    End Function
    8181
  • Include/Classes/System/Drawing/SizeF.ab

    r212 r223  
    6464*/
    6565    Function Equals(sz As SizeF) As Boolean
    66         If width = sz.width And height = sz.height Then
    67             Equals = _System_TRUE
    68         Else
    69             Equals = _System_FALSE
    70         End If
     66        Return width = sz.width And height = sz.height
    7167    End Function
    7268
    7369    Override Function GetHashCode() As Long
    7470        Return VarPtr(GetDWord(width)) Xor _System_BSwap(VarPtr(GetDWord(height)))
     71    End Function
    7572
    7673    Function IsEmpty() As Boolean
    77         If width = 0 And height = 0 Then
    78             Empty = _System_TRUE
    79         Else
    80             Empty = _System_FALSE
    81         End If
     74        Return width = 0 And height = 0
    8275    End Function
    8376
Note: See TracChangeset for help on using the changeset viewer.