Ignore:
Timestamp:
Mar 12, 2008, 9:54:46 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

実験として書いていたControlクラスを追加(せめてコミット前に既存のContorolに混ぜようとしたがコンパイルできなかった)。
ほかForms, Drawing及びGDI+の修正。

Location:
trunk/Include/Classes/System/Drawing
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/System/Drawing/CharacterRange.ab

    r166 r473  
    99        first = f
    1010        length = l
    11     End Sub
    12 
    13     Sub CharacterRange(ByRef c As CharacterRange)
    14         first = c.first
    15         length = c.length
    1611    End Sub
    1712
     
    3025
    3126    Function Length() As Long
    32         Return l
     27        Return length
    3328    End Function
    3429
     
    3732    End Sub
    3833
    39     Sub Operator = (ByRef c As CharacterRange)
    40         first  = c.first
    41         length = c.length
    42     End Sub
    43 
    44     Function Operator ==(c As CharacterRange)
     34    Function Operator ==(c As CharacterRange) As Boolean
    4535        Return Equals(c)
    4636    End Function
    4737
    48     Function Operator <>(c As CharacterRange)
     38    Function Operator <>(c As CharacterRange) As Boolean
    4939        Return Not Equals(c)
    5040    End Function
    5141
    52     Function Equals(c As CharacterRange)
     42    Function Equals(c As CharacterRange) As Boolean
    5343        Return first = c.first And length = c.length
    5444    End Function
  • trunk/Include/Classes/System/Drawing/Color.ab

    r370 r473  
    44#define __SYSTEM_DRAWING_COLOR_AB__
    55
    6 '#include <Classes/System/Math.ab>
    76#include <Classes/System/Drawing/Imaging/misc.ab>
    87
     
    2827        argb = newArgb
    2928    End Sub
    30 /*
    31     Sub Operator =(c As Color)
    32         argb = c.argb
    33     End Sub
    34 */
     29
    3530    Function Operator ==(c As Color) As Boolean
    3631        Return Equals(c)
     
    4237
    4338    Function A() As Byte
    44         Return (argb >> ALPHA_SHIFT) As Byte
     39        A = (argb >> ALPHA_SHIFT) As Byte
    4540    End Function
    4641
    4742    Function R() As Byte
    48         Return (argb >> RED_SHIFT) As Byte
     43        R = (argb >> RED_SHIFT) As Byte
    4944    End Function
    5045
    5146    Function G() As Byte
    52         Return (argb >> GREEN_SHIFT) As Byte
     47        G = (argb >> GREEN_SHIFT) As Byte
    5348    End Function
    5449
    5550    Function B() As Byte
    56         Return (argb >> BLUE_SHIFT) As Byte
     51        B = (argb >> BLUE_SHIFT) As Byte
    5752    End Function
    5853
    5954    Function Value() As ARGB
    60         Return argb
     55        Value = argb
    6156    End Function
    6257
  • trunk/Include/Classes/System/Drawing/Font.ab

    r212 r473  
    1 #ifndef _GDIPLUSFONT_H
    2 #define _GDIPLUSFONT_H
    3 
    4 #require <GdiPlus.ab>
    5 #require <Classes/System/Drawing/misc.ab>
     1/**
     2@file Classes/System/Drawing/Font.ab
     3@brief Fontクラスなどの実装。
     4*/
     5
    66#require <Classes/System/Drawing/Graphics.ab>
    77
     
    1010
    1111Class Font
     12    Implements System.IDisposable
    1213Public
    1314'    friend class Graphics
     
    130131        /*IN*/ style As Long, /*IN*/ unit As GraphicsUnit,
    131132        /*IN const*/ fontCollection As FontCollection)
    132 #ifdef __STRING_IS_NOT_UNICODE
    133         Dim oldAlloc = _System_AllocForConvertedString
    134         _System_AllocForConvertedString = AddressOf (_System_malloc)
    135         Dim name = ToWCStr(familyName)
    136         Font(name, emSize, style, unit, fontCollection)
    137         _System_free(name)
    138         _System_AllocForConvertedString = oldAlloc
    139 #else
    140         Font(familyName.Chars, emSize, style, unit, fontCollection)
    141 #endif
     133        Font(ToWCStr(familyName), emSize, style, unit, fontCollection)
    142134    End Sub
    143135
    144136    Const Function GetLogFontA(/*IN const*/ g As Graphics, /*OUT*/ ByRef lf As LOGFONTA) As Status
    145137        Dim nativeGraphics As *GpGraphics
    146         If VarPtr(g) <> 0 Then
     138        If Not ActiveBasic.IsNothing(g) Then
    147139            nativeGraphics = g.nativeGraphics
    148140        End If
     
    152144    Const Function GetLogFontW(/*IN const*/ g As Graphics, /*OUT*/ ByRef lf As LOGFONTW) As Status
    153145        Dim nativeGraphics As *GpGraphics
    154         If VarPtr(g) <> 0 Then
     146        If Not ActiveBasic.IsNothing(g) Then
    155147            nativeGraphics = g.nativeGraphics
    156148        End If
     
    160152    Const Function GetLogFont(/*IN const*/ g As Graphics, /*OUT*/ ByRef lf As LOGFONT) As Status
    161153        Dim nativeGraphics As *GpGraphics
    162         If VarPtr(g) <> 0 Then
     154        If Not ActiveBasic.IsNothing(g) Then
    163155            nativeGraphics = g.nativeGraphics
    164156        End If
     
    212204    Const Function GetHeight(/*IN const*/ g As Graphics) As Single
    213205        Dim nativeGraphics As *GpGraphics
    214         If VarPtr(g) <> 0 Then
     206        If Not ActiveBasic.IsNothing(g) Then
    215207            nativeGraphics = g.NativeGraphics
    216208        End If
     
    270262    'Const Function SizeInPoint() As Boolean
    271263
    272     Const Function NativeFont() As *GpFont
    273         Return nativeFont
    274     End Function
    275 
    276264    Const Function StrikeOut() As Boolean
    277265        Dim lf As LOGFONT
     
    341329    /*mutable*/ lastResult As Status
    342330End Class
    343 
    344 #endif
  • trunk/Include/Classes/System/Drawing/Graphics.ab

    r212 r473  
    1414Class CachedBitmap : End Class
    1515
    16 #include <GdiplusGpStubs.ab>
    17 #include <GdiPlusFlat.ab>
    18 #include <Classes/System/Drawing/misc.ab>
    19 #include <Classes/System/Drawing/Rectangle.ab>
    20 #include <Classes/System/Drawing/RectangleF.ab>
    21 #include <Classes/System/Drawing/Point.ab>
    22 #include <Classes/System/Drawing/PointF.ab>
    23 #include <Classes/System/Drawing/SizeF.ab>
    24 #include <Classes/System/Drawing/Font.ab>
    25 '#include <Classes/System/Drawing/Brush.ab>
    26 '#include <Classes/System/Drawing/Pen.ab>
    27 '#include <Classes/System/Drawing/Region.ab>
    28 '#include <Classes/System/Drawing/StringFormat.ab>
    29 '#include <Classes/System/Drawing/Image.ab>
    30 #include <Classes/System/Drawing/Drawing2D/misc.ab>
    31 #include <Classes/System/Drawing/Drawing2D/Matrix.ab>
    32 
    3316Class Graphics
    3417Public
  • trunk/Include/Classes/System/Drawing/Point.ab

    r303 r473  
    11' Classes/System/Drawing/Point.ab
    22
    3 #ifndef __SYSTEM_DRAWING_POINT_AB__
    4 #define __SYSTEM_DRAWING_POINT_AB__
    5 
    6 #require <Classes/System/Drawing/PointF.ab>
    7 #require <Classes/System/Drawing/Size.ab>
    8 #require <Classes/System/Drawing/SizeF.ab>
     3Namespace System
     4Namespace Drawing
    95
    106Class Point
     
    3127
    3228    Function X() As Long
    33         Return x
     29        X = x
    3430    End Function
    3531
     
    3935
    4036    Function Y() As Long
    41         Return y
     37        X = y
    4238    End Function
    4339
     
    5046    End Function
    5147
    52     Function Operator + (pt As Point) As Point
     48    Function Operator +(pt As Point) As Point
    5349        Return Add(This, pt)
    5450    End Function
    5551
    56     Function Operator + (sz As Size) As Point
     52    Function Operator +(sz As Size) As Point
    5753        Return Add(This, sz)
    5854    End Function
    5955
    60     Function Operator - (pt As Point) As Point
     56    Function Operator -(pt As Point) As Point
    6157        Return Substract(This, pt)
    6258    End Function
    6359
    64     Function Operator - (sz As Size) As Point
     60    Function Operator -(sz As Size) As Point
    6561        Return Substract(This, sz)
    6662    End Function
    6763
    68     Function Operator == (sz As Point) As Boolean
     64    Function Operator ==(sz As Point) As Boolean
    6965        Return Equals(sz)
    7066    End Function
    7167
    72     Function Operator <> (sz As Point) As Boolean
     68    Function Operator <>(sz As Point) As Boolean
    7369        Return Not Equals(sz)
    7470    End Function
     
    108104
    109105    Static Function Ceiling(ptf As PointF) As Point
    110         Return New Point(System.Math.Ceiling(ptf.X) As Long, System.Math.Ceiling(ptf.Y) As Long)
     106        Return New Point(Math.Ceiling(ptf.X) As Long, Math.Ceiling(ptf.Y) As Long)
    111107    End Function
    112108
    113109    Static Function Round(ptf As PointF) As Point
    114         Return New Point(System.Math.Round(ptf.X) As Long, System.Math.Round(ptf.Y) As Long)
     110        Return New Point(Math.Round(ptf.X) As Long, Math.Round(ptf.Y) As Long)
    115111    End Function
    116112
    117113    Static Function Truncate(ptf As PointF) As Point
    118         Return New Point(System.Math.Truncate(ptf.X) As Long, System.Math.Truncate(ptf.Y) As Long)
     114        Return New Point(Math.Truncate(ptf.X) As Long, Math.Truncate(ptf.Y) As Long)
    119115    End Function
    120116
     
    128124End Class
    129125
    130 #endif '__SYSTEM_DRAWING_POINT_AB__
     126End Namespace
     127End Namespace
  • trunk/Include/Classes/System/Drawing/PointF.ab

    r303 r473  
    11' Classes/System/Drawing/PointF.ab
    22
    3 #ifndef __SYSTEM_DRAWING_POINTF_AB__
    4 #define __SYSTEM_DRAWING_POINTF_AB__
    5 
    6 #include <Classes/System/Drawing/Size.ab>
    7 #include <Classes/System/Drawing/SizeF.ab>
     3Namespace System
     4Namespace Drawing
    85
    96Class PointF
     
    3027
    3128    Function X() As Single
    32         Return x
     29        X = x
    3330    End Function
    3431
     
    3835
    3936    Function Y() As Single
    40         Return y
     37        Y = y
    4138    End Function
    4239
     
    8279
    8380    Static Function Add(pt1 As PointF, pt2 As PointF) As PointF
    84         Dim ret As PointF(pt1.x + pt2.x, pt1.y + pt2.y)
    85         Return ret
     81        Return New PointF(pt1.x + pt2.x, pt1.y + pt2.y)
    8682    End Function
    8783
    8884    Static Function Add(pt As PointF, sz As Size) As PointF
    89         Dim ret As PointF(pt.x + sz.Width, pt.y + sz.Height)
    90         Return ret
     85        Return New PointF(pt.x + sz.Width, pt.y + sz.Height)
    9186    End Function
    9287
    9388    Static Function Add(pt As PointF, sz As SizeF) As PointF
    94         Dim ret As PointF(pt.x + sz.Width, pt.y + sz.Height)
    95         Return ret
     89        Return New PointF(pt.x + sz.Width, pt.y + sz.Height)
    9690    End Function
    9791
    9892    Static Function Substract(pt1 As PointF, pt2 As PointF) As PointF
    99         Dim ret As PointF(pt1.x - pt2.x, pt1.y - pt2.y)
    100         Return ret
     93        Return New PointF(pt1.x - pt2.x, pt1.y - pt2.y)
    10194    End Function
    10295
    10396    Static Function Substract(pt As PointF, sz As Size) As PointF
    104         Dim ret As PointF(pt.x - sz.Width, pt.y - sz.Height)
    105         Return ret
     97        Return New PointF(pt.x - sz.Width, pt.y - sz.Height)
    10698    End Function
    10799
    108100    Static Function Substract(pt As PointF, sz As SizeF) As PointF
    109         Dim ret As PointF(pt.x - sz.Width, pt.y - sz.Height)
    110         Return ret
     101        Return New PointF(pt.x - sz.Width, pt.y - sz.Height)
    111102    End Function
    112103
     
    124115End Class
    125116
    126 #endif '__SYSTEM_DRAWING_POINTF_AB__
     117End Namespace
     118End Namespace
  • trunk/Include/Classes/System/Drawing/Rectangle.ab

    r335 r473  
    11' Classes/System/Drawing/Rectangle.ab
    22
    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>
     3Namespace System
     4Namespace Drawing
    105
    116Class Rectangle
     
    4035
    4136    Function Location() As Point
    42         Dim pt As Point(x, y)
    43         Return pt
     37        Location = New Point(x, y)
    4438    End Function
    4539
     
    5044
    5145    Function Size() As Size
    52         Dim size As Size(width, height)
     46        Size = New Size(width, height)
    5347    End Function
    5448
     
    5953
    6054    Function X() As Long
    61         Return x
     55        X = x
    6256    End Function
    6357
     
    6761
    6862    Function Y() As Long
    69         Return y
     63        Y = y
    7064    End Function
    7165
     
    7569
    7670    Function Width() As Long
    77         Return width
     71        Width = width
    7872    End Function
    7973
     
    8377
    8478    Function Height() As Long
    85         Return height
     79        Height = height
    8680    End Function
    8781
     
    9185
    9286    Function Left() As Long
    93         Return X
     87        Left = X
    9488    End Function
    9589
    9690    Function Top() As Long
    97         Return Y
     91        Top = Y
    9892    End Function
    9993
    10094    Function Right() As Long
    101         Return X + Width
     95        Right = X + Width
    10296    End Function
    10397
    10498    Function Bottom() As Long
    105         Return Y + Height
     99        Bottom = Y + Height
    106100    End Function
    107101
     
    110104    End Function
    111105
    112     Function Operator == (rc As Rectangle) As Boolean
     106    Function Operator ==(rc As Rectangle) As Boolean
    113107        Return Equals(rc)
    114108    End Function
    115109
    116     Function Operator <> (rc As Rectangle) As Boolean
     110    Function Operator <>(rc As Rectangle) As Boolean
    117111        Return (Not Equals(rc))
    118112    End Function
     
    206200    Static Function Ceiling(rcf As RectangleF) As Rectangle
    207201        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)
    212206        Return r
    213207    End Function
     
    215209    Static Function Round(rcf As RectangleF) As Rectangle
    216210        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)
    221215        Return r
    222216    End Function
     
    224218    Static Function Truncate(rcf As RectangleF) As Rectangle
    225219        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)
    230224        Return r
    231225    End Function
     
    247241End Class
    248242
    249 #endif '__SYSTEM_DRAWING_RECTFANGLE_AB__
     243End Namespace
     244End Namespace
  • trunk/Include/Classes/System/Drawing/RectangleF.ab

    r335 r473  
    11' Classes/System/Drawing/RectangleF.ab
    22
    3 #ifndef __SYSTEM_DRAWING_RECTANGLEF_AB__
    4 #define __SYSTEM_DRAWING_RECTANGLEF_AB__
    5 
    6 '#include <Classes/System/Math.ab>
    7 #include <Classes/System/Drawing/PointF.ab>
    8 #include <Classes/System/Drawing/SizeF.ab>
     3Namespace System
     4Namespace Drawing
    95
    106Class RectangleF
     
    3935
    4036    Function Location() As PointF
    41         Dim pt As PointF(x, y)
    42         Return pt
     37        Location = New PointF(x, y)
    4338    End Function
    4439
     
    4944
    5045    Function Size() As SizeF
    51         Dim size As SizeF(width, height)
     46        Size = New SizeF(width, height)
    5247    End Function
    5348
     
    5853
    5954    Function X() As Single
    60         Return x
     55        X = x
    6156    End Function
    6257
     
    6661
    6762    Function Y() As Single
    68         Return y
     63        Y = y
    6964    End Function
    7065
     
    7469
    7570    Function Width() As Single
    76         Return width
     71        Width = width
    7772    End Function
    7873
     
    8277
    8378    Function Height() As Single
    84         Return height
     79        Height = height
    8580    End Function
    8681
     
    9085
    9186    Function Left() As Single
    92         Return X
     87        Left = X
    9388    End Function
    9489
    9590    Function Top() As Single
    96         Return Y
     91        Top = Y
    9792    End Function
    9893
    9994    Function Right() As Single
    100         Return X + Width
     95        Right = X + Width
    10196    End Function
    10297
    10398    Function Bottom() As Single
    104         Return Y + Height
     99        Bottom = Y + Height
    105100    End Function
    106101
     
    210205End Class
    211206
    212 #endif '__SYSTEM_DRAWING_RECTFANGLE_AB__
     207End Namespace
     208End Namespace
  • trunk/Include/Classes/System/Drawing/Size.ab

    r335 r473  
    11' Classes/System/Drawing/Size.ab
    22
    3 #ifndef __SYSTEM_DRAWING_SIZE_AB__
    4 #define __SYSTEM_DRAWING_SIZE_AB__
    5 
    6 '#include <Classes/System/Math.ab>
    7 #include <Classes/System/Drawing/SizeF.ab>
     3Namespace System
     4Namespace Drawing
    85
    96Class Size
     
    4138
    4239    Function Operator +(sz As Size) As Size
    43         Dim ret As Size(width + sz.width, height + sz.height)
    44         Return ret
     40        Return New Size(width + sz.width, height + sz.height)
    4541    End Function
    4642
    4743    Function Operator -(sz As Size) As Size
    48         Dim ret As Size(width - sz.width, height - sz.height)
    49         Return ret
     44        Return New Size(width - sz.width, height - sz.height)
    5045    End Function
    5146
    5247    Function Operator () As SizeF
    53         Dim szf As SizeF(width, height)
    54         Return szf
     48        Return New SizeF(width, height)
    5549    End Function
    5650
     
    6256        Return Not Equals(sz)
    6357    End Function
    64 /*
    65     Sub Operator =(ByRef sz As Size)
    66         width = sz.width
    67         height = sz.height
    68     End Sub
    69 */
     58
    7059    Function Equals(sz As Size) As Boolean
    7160        If width = sz.width And height = sz.height Then
     
    9382
    9483    Static Function Ceiling(szf As SizeF) As Size
    95         Dim sz As Size(System.Math.Ceiling(szf.Width) As Long, System.Math.Ceiling(szf.Height) As Long)
    96         Return sz
     84        Return New Size(System.Math.Ceiling(szf.Width) As Long, System.Math.Ceiling(szf.Height) As Long)
    9785    End Function
    9886
    9987    Static Function Round(szf As SizeF) As Size
    100         Dim sz As Size(System.Math.Round(szf.Width) As Long, System.Math.Round(szf.Height) As Long)
    101         Return sz
     88        Return New Size(System.Math.Round(szf.Width) As Long, System.Math.Round(szf.Height) As Long)
    10289    End Function
    10390
    10491    Static Function Truncate(szf As SizeF) As Size
    105         Dim sz As Size(System.Math.Truncate(szf.Width) As Long, System.Math.Truncate(szf.Height) As Long)
    106         Return sz
     92        Return New Size(System.Math.Truncate(szf.Width) As Long, System.Math.Truncate(szf.Height) As Long)
    10793    End Function
    10894
     
    11298End Class
    11399
    114 #endif '__SYSTEM_DRAWING_SIZE_AB__
     100End Namespace
     101End Namespace
  • trunk/Include/Classes/System/Drawing/SizeF.ab

    r303 r473  
    11' Classes/System/Drawing/SizeF.ab
    22
    3 #ifndef __SYSTEM_DRAWING_SIZEF_AB__
    4 #define __SYSTEM_DRAWING_SIZEF_AB__
    5 
    6 #include <Classes/System/Drawing/Size.ab>
    7 #include <Classes/System/Drawing/PointF.ab>
     3Namespace System
     4Namespace Drawing
    85
    96Class SizeF
     
    4138
    4239    Function Operator +(sz As SizeF) As SizeF
    43         Dim ret As SizeF(width + sz.width, height + sz.height)
    44         Return ret
     40        Return New SizeF(width + sz.width, height + sz.height)
    4541    End Function
    4642
    4743    Function Operator -(sz As SizeF) As SizeF
    48         Dim ret As SizeF(width - sz.width, height - sz.height)
    49         Return ret
     44        Return New SizeF(width - sz.width, height - sz.height)
    5045    End Function
    5146
     
    5752        Return Not Equals(sz)
    5853    End Function
    59 /*
    60     Sub Operator =(ByRef sz As SizeF)
    61         width = sz.width
    62         height = sz.height
    63     End Sub
    64 */
     54
    6555    Function Equals(sz As SizeF) As Boolean
    6656        Return width = sz.width And height = sz.height
     
    8878
    8979    Function ToPointF() As PointF
    90         Dim pt As PointF(width, height)
    91         Return pt
     80        Return New PointF(width, height)
    9281    End Function
    9382Private
     
    9685End Class
    9786
    98 #endif '__SYSTEM_DRAWING_SIZEF_AB__
     87End Namespace
     88End Namespace
  • trunk/Include/Classes/System/Drawing/misc.ab

    r137 r473  
    3737
    3838Enum FontStyle
     39/*
    3940    Regular = 0
    4041    Bold = 1
     
    4243    Strikeout = 4
    4344    Underline  = 8
     45*/
    4446End Enum
    4547
Note: See TracChangeset for help on using the changeset viewer.