Changeset 77 for Include/Classes


Ignore:
Timestamp:
Jan 27, 2007, 12:04:09 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

Controlの追加とそれに伴う修正

Location:
Include/Classes/System
Files:
15 added
5 edited

Legend:

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

    r25 r77  
    5050
    5151    Function A() As Byte
    52         Return (Argb >> Color_AlphaShift) As Byte
     52        Return (argb >> ALPHA_SHIFT) As Byte
    5353    End Function
    5454
    5555    Function R() As Byte
    56         Return (Argb >> Color_RedShift) As Byte
     56        Return (argb >> RED_SHIFT) As Byte
    5757    End Function
    5858
    5959    Function G() As Byte
    60         Return (Argb >> Color_GreenShift) As Byte
     60        Return (argb >> GREEN_SHIFT) As Byte
    6161    End Function
    6262
    6363    Function B() As Byte
    64         GetBlue = (argb >> Color_BlueShift) As Byte
     64        Return (argb >> BLUE_SHIFT) As Byte
    6565    End Function
    6666
     
    306306*/
    307307    Static Function MakeARGB(a As Byte, r As Byte, g As Byte, b As Byte) As ARGB
    308         MakeARGB = (((b As ARGB) <<  Color_BlueShift) Or _
    309                     ((g As ARGB) << Color_GreenShift) Or _
    310                     ((r As ARGB) <<   Color_RedShift) Or _
    311                     ((a As ARGB) << Color_AlphaShift))
     308        MakeARGB = (((b As ARGB) <<  BLUE_SHIFT) Or _
     309                    ((g As ARGB) << GREEN_SHIFT) Or _
     310                    ((r As ARGB) <<   RED_SHIFT) Or _
     311                    ((a As ARGB) << ALPHA_SHIFT))
    312312    End Function
    313313
  • Include/Classes/System/Drawing/Imaging/misc.ab

    r12 r77  
    1414End Enum
    1515
    16 Const ALPHA_SHIFT = 24
    17 Const RED_SHIFT   = 16
    18 Const GREEN_SHIFT = 8
    19 Const BLUE_SHIFT  = 0
     16Const ALPHA_SHIFT = 24 As DWord
     17Const RED_SHIFT   = 16 As DWord
     18Const GREEN_SHIFT = 8 As DWord
     19Const BLUE_SHIFT  = 0 As DWord
    2020Const ALPHA_MASK  = ((&hff As ARGB) << ALPHA_SHIFT)
    2121
  • Include/Classes/System/Drawing/PointF.ab

    r27 r77  
    110110    End Function
    111111
    112     Static Function Substract((pt1 As PointF, pt2 As PointF) As PointF
     112    Static Function Substract(pt1 As PointF, pt2 As PointF) As PointF
    113113        Dim ret As PointF(pt1.x - pt2.x, pt1.y - pt2.y)
    114114        Return ret
  • Include/Classes/System/Drawing/Rectangle.ab

    r28 r77  
    1818    End Sub
    1919
    20     Sub Rectangle(x As Single, y As Single, width As Single, height As Single)
     20    Sub Rectangle(x As Long, y As Long, width As Long, height As Long)
    2121        x = x
    2222        y = y
     
    2525    End Sub
    2626
    27     Sub Rectangle(location As Point, size As Size)
    28         x = location.X
    29         y = location.Y
    30         width = size.Height
    31         height = size.Height
    32     End Sub
    33 
    34     Sub Rectangle(ByRef rc As Rectangle)
    35         x = rc.x
    36         y = rc.y
    37         width = rc.width
    38         height = rc.height
     27    Sub Rectangle(l As Point, s As Size)
     28        x = l.X
     29        y = l.Y
     30        width = s.Height
     31        height = s.Height
     32    End Sub
     33
     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
     41    Sub Rectangle(ByRef r As RECT)
     42        This = FromLTRB(r.left, r.top, r.right, r.bottom)
    3943    End Sub
    4044
     
    5862    End Sub
    5963
    60     Function X() As Single
     64    Function X() As Long
    6165        Return x
    6266    End Function
    6367
    64     Sub X(value As Single)
     68    Sub X(value As Long)
    6569        x = value
    6670    End Sub
    6771
    68     Function Y() As Single
     72    Function Y() As Long
    6973        Return y
    7074    End Function
    7175
    72     Sub Y(value As Single)
     76    Sub Y(value As Long)
    7377        y = value
    7478    End Sub
    7579
    76     Function Width() As Single
     80    Function Width() As Long
    7781        Return width
    7882    End Function
    7983
    80     Sub Width(value As Single)
     84    Sub Width(value As Long)
    8185        width = value
    8286    End Sub
    8387
    84     Function Height() As Single
     88    Function Height() As Long
    8589        Return height
    8690    End Function
    8791
    88     Sub Height(value As Single)
     92    Sub Height(value As Long)
    8993        height = value
    9094    End Sub
    9195
    92     Function Left() As Single
     96    Function Left() As Long
    9397        Return X
    9498    End Function
    9599
    96     Function Top() As Single
     100    Function Top() As Long
    97101        Return Y
    98102    End Function
    99103
    100     Function Right() As Single
     104    Function Right() As Long
    101105        Return X + Width
    102106    End Function
    103107
    104     Function Bottom() As Single
     108    Function Bottom() As Long
    105109        Return Y + Height
    106110    End Function
     
    144148    End Function
    145149
    146     Static Function FromLTRB(l As Single, t As Single, r As Single, b As Single) As Rectangle
     150    Static Function FromLTRB(l As Long, t As Long, r As Long, b As Long) As Rectangle
    147151        Dim rect As Rectangle(l, t, r - l, r - b)
    148152        return rect
    149153    End Function
    150154
    151     Function Contains(x As Single, y As Single) As BOOL
     155    Function Contains(x As Long, y As Long) As BOOL
    152156        If x >= X And x < X + Width And y >= Y And y < Y + Height Then
    153157            Contains = _System_TRUE
     
    169173    End Function
    170174
    171     Sub Inflate(dx As Single, dy As Single)
     175    Sub Inflate(dx As Long, dy As Long)
    172176        X -= dx
    173177        Y -= dy
     
    180184    End Sub
    181185
    182     Static Function Inflate(ByRef rc As Rectangle, x As Single, y As Single) As Rectangle
     186    Static Function Inflate(ByRef rc As Rectangle, x As Long, y As Long) As Rectangle
    183187        Inflate = rc
    184188        Inflate.Inflate(x, y)
     
    190194
    191195    Static Function Intersect(ByRef a As Rectangle, ByRef b As Rectangle) As Rectangle
    192         Dim right As Single, bottom As Single, left As Single, top As Single
     196        Dim right As Long, bottom As Long, left As Long, top As Long
    193197        right = Math.Min(a.Right, b.Right)
    194198        bottom = Math.Min(a.Bottom, b.Bottom)
     
    210214
    211215    Static Function Union(ByRef a As Rectangle, ByRef b As Rectangle) As Rectangle
    212         Dim right As Single, bottom As Single, left As Single, top As Single
     216        Dim right As Long, bottom As Long, left As Long, top As Long
    213217        right = Math.Max(a.Right(), b.Right())
    214218        bottom = Math.Max(a.Bottom(), b.Bottom())
     
    222226    End Sub
    223227
    224     Sub Offset(dx As Single, dy As Single)
     228    Sub Offset(dx As Long, dy As Long)
    225229        X += dx
    226230        Y += dy
     
    254258    End Function
    255259
     260    Function ToRECT() As RECT
     261        With ToRECT
     262            .left = x
     263            .top = y
     264            .right = x + width
     265            .bottom = y + height
     266        End With
     267    End Function
     268
    256269Public
    257     x As Single
    258     y As Single
    259     width As Single
    260     height As Single
     270    x As Long
     271    y As Long
     272    width As Long
     273    height As Long
    261274End Class
    262275
  • Include/Classes/System/Threading/WaitHandle.ab

    r58 r77  
    66Class WaitHandle
    77Public
    8     Virtual Sub ~WaitHandle()
    9         Close()
    10     End Sub
    11 
    12     ' Const Function SafeWaitHandle() As SafeWaitHandle
    13     ' Sub SafeWaitHandle(h As SafeWaitHandle)
     8    ' Properties
     9'   Const Function SafeWaitHandle() As SafeWaitHandle
     10'   Sub SafeWaitHandle(h As SafeWaitHandle)
    1411
    1512    Const Virtual Function Handle() As HANDLE
     
    1916    Virtual Sub Handle(newHandle As HANDLE)
    2017        h = newHandle
     18    End Sub
     19
     20    ' Methods
     21
     22    Virtual Sub ~WaitHandle()
     23        Close()
    2124    End Sub
    2225
Note: See TracChangeset for help on using the changeset viewer.