Changeset 473 for trunk/Include/Classes/System/Drawing/Rectangle.ab
- Timestamp:
- Mar 12, 2008, 9:54:46 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/Drawing/Rectangle.ab
r335 r473 1 1 ' Classes/System/Drawing/Rectangle.ab 2 2 3 #ifndef __SYSTEM_DRAWING_RECTANGLE_AB__ 4 #define __SYSTEM_DRAWING_RECTANGLE_AB__ 5 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> 3 Namespace System 4 Namespace Drawing 10 5 11 6 Class Rectangle … … 40 35 41 36 Function Location() As Point 42 Dim pt As Point(x, y) 43 Return pt 37 Location = New Point(x, y) 44 38 End Function 45 39 … … 50 44 51 45 Function Size() As Size 52 Dim size AsSize(width, height)46 Size = New Size(width, height) 53 47 End Function 54 48 … … 59 53 60 54 Function X() As Long 61 Returnx55 X = x 62 56 End Function 63 57 … … 67 61 68 62 Function Y() As Long 69 Returny63 Y = y 70 64 End Function 71 65 … … 75 69 76 70 Function Width() As Long 77 Returnwidth71 Width = width 78 72 End Function 79 73 … … 83 77 84 78 Function Height() As Long 85 Returnheight79 Height = height 86 80 End Function 87 81 … … 91 85 92 86 Function Left() As Long 93 ReturnX87 Left = X 94 88 End Function 95 89 96 90 Function Top() As Long 97 ReturnY91 Top = Y 98 92 End Function 99 93 100 94 Function Right() As Long 101 R eturnX + Width95 Right = X + Width 102 96 End Function 103 97 104 98 Function Bottom() As Long 105 ReturnY + Height99 Bottom = Y + Height 106 100 End Function 107 101 … … 110 104 End Function 111 105 112 Function Operator == 106 Function Operator ==(rc As Rectangle) As Boolean 113 107 Return Equals(rc) 114 108 End Function 115 109 116 Function Operator <> 110 Function Operator <>(rc As Rectangle) As Boolean 117 111 Return (Not Equals(rc)) 118 112 End Function … … 206 200 Static Function Ceiling(rcf As RectangleF) As Rectangle 207 201 Dim r As Rectangle( 208 System.Math.Ceiling(rcf.X) As Long,209 System.Math.Ceiling(rcf.Y) As Long,210 System.Math.Ceiling(rcf.Width) As Long,211 System.Math.Ceiling(rcf.Height) As Long)202 Math.Ceiling(rcf.X) As Long, 203 Math.Ceiling(rcf.Y) As Long, 204 Math.Ceiling(rcf.Width) As Long, 205 Math.Ceiling(rcf.Height) As Long) 212 206 Return r 213 207 End Function … … 215 209 Static Function Round(rcf As RectangleF) As Rectangle 216 210 Dim r As Rectangle( 217 System.Math.Round(rcf.X) As Long,218 System.Math.Round(rcf.Y) As Long,219 System.Math.Round(rcf.Width) As Long,220 System.Math.Round(rcf.Height) As Long)211 Math.Round(rcf.X) As Long, 212 Math.Round(rcf.Y) As Long, 213 Math.Round(rcf.Width) As Long, 214 Math.Round(rcf.Height) As Long) 221 215 Return r 222 216 End Function … … 224 218 Static Function Truncate(rcf As RectangleF) As Rectangle 225 219 Dim r As Rectangle( 226 System.Math.Truncate(rcf.X) As Long,227 System.Math.Truncate(rcf.Y) As Long,228 System.Math.Truncate(rcf.Width) As Long,229 System.Math.Truncate(rcf.Height) As Long)220 Math.Truncate(rcf.X) As Long, 221 Math.Truncate(rcf.Y) As Long, 222 Math.Truncate(rcf.Width) As Long, 223 Math.Truncate(rcf.Height) As Long) 230 224 Return r 231 225 End Function … … 247 241 End Class 248 242 249 #endif '__SYSTEM_DRAWING_RECTFANGLE_AB__ 243 End Namespace 244 End Namespace
Note:
See TracChangeset
for help on using the changeset viewer.