Ignore:
Timestamp:
Aug 24, 2007, 11:14:46 AM (17 years ago)
Author:
イグトランス (egtra)
Message:

フルコンパイルでのミスあぶり出し。註:修正は全て@300や@301以前に行われた。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/System/Windows/Forms/Control.ab

    r285 r303  
    44#define __SYSTEM_WINDOWS_FORMS_CONTROL_AB__
    55
    6 #require <windows/WindowHandle.sbp>
    76#require <Classes/System/Windows/Forms/misc.ab>
    87#require <Classes/System/Windows/Forms/CreateParams.ab>
     
    1716#require <Classes/System/Drawing/Rectangle.ab>
    1817#require <Classes/System/Runtime/InteropServices/GCHandle.ab>
     18#require <Classes/ActiveBasic/Windows/WindowHandle.sbp>
    1919#require <Classes/ActiveBasic/Strings/Strings.ab>
    2020
     
    4444
    4545    Override Function CompletedSynchronously() As Boolean
    46         Return FALSE
     46        Return False
    4747    End Function
    4848
     
    7474
    7575Class Control
     76
    7677'   Inherits IWin32Window
    7778Public
     
    8081    Function AllowDrop() As Boolean
    8182    End Function
     83
     84    'Anchor
     85    'AutoScrollOffset
     86    'AutoSize
     87    'BackColor下
     88    'BackgroundImage
     89    'BackgroundImageLayout
     90    '-BindingContext
     91    'Bottom 下
     92    'Bounds 下
     93    'CanFocus
     94    'CanSelect
     95    'Capture
     96    '-CausesValidation
     97    'CheckForIllegalCrossThreadCalls
    8298
    8399    /*Override*/ Function Handle() As HWND
     
    201217        Return b.Top + b.Height
    202218    End Function
    203 
     219/*
    204220    Const Function PointToScreen(p As Point) As Point
    205221        PointToScreen = New Point
    206         ret.X = p.X
    207         ret.Y = p.Y
    208         wnd.ClientToScreen(ByVal VarPtr(PointToScreen) As *POINTAPI)
     222        PointToScreen.X = p.X
     223        PointToScreen.Y = p.Y
     224        wnd.ClientToScreen(ByVal ObjPtr(PointToScreen) As *POINTAPI)
    209225    End Function
    210226
    211227    Const Function PointToClient(p As Point) As Point
    212228        PointToScreen = New Point
    213         ret.X = p.X
    214         ret.Y = p.Y
    215         wnd.ScreenToClient(ByVal VarPtr(PointToScreen) As *POINTAPI)
    216     End Function
    217 
     229        PointToClient.X = p.X
     230        PointToClient.Y = p.Y
     231        wnd.ScreenToClient(ByVal ObjPtr(PointToClient) As *POINTAPI)
     232    End Function
     233*/
    218234    Const Function RectangleToScreen(r As Rectangle) As Rectangle
    219235        Dim rc = r.ToRECT
     
    223239
    224240    Const Function RectangleToClient(r As Rectangle) As Rectangle
    225         Dim rc As RECT
    226         rc = r.ToRECT()
     241        Dim rc = r.ToRECT()
    227242        wnd.ScreenToClient(rc)
    228243        Return New Rectangle(rc)
     
    230245
    231246    Const Function InvokeRequired() As Boolean
    232         Return wnd.ThreadID <> GetCurrentThreadId()
     247        Return wnd.ThreadId <> GetCurrentThreadId()
    233248    End Function
    234249
     
    239254    Virtual Sub BackColor(c As Color)
    240255        c = bkColor
    241         Dim e As EventArgs
    242         OnBackColorChanged(e)
     256        OnBackColorChanged(New EventArgs)
    243257    End Sub
    244258
     
    248262
    249263    Const Function IsHandleCreated() As Boolean
    250         Return wnd.HWnd <> 0
     264        Return wnd.HWnd <> 0 Or IsWindow(wnd.HWnd) <> FALSE
    251265    End Function
    252266
     
    259273
    260274    Sub Control()
     275        Debug
    261276        Dim sz = DefaultSize()
    262277        Control("", 100, 100, sz.Width, sz.Height)
     
    279294
    280295    Sub Control(parent As Control, text As String, left As Long, top As Long, width As Long, height As Long)
    281         This.parent = VarPtr(parent)
     296        This.parent = parent
    282297        Control(text, left, top, width, height)
    283298    End Sub
     
    296311    '---------------------------------------------------------------------------
    297312    ' Public Methods
    298 
     313/*
    299314    ' 同期関数呼出、Controlが作成されたスレッドで関数を実行する。
    300315    ' 関数は同期的に呼び出されるので、関数が終わるまでInvokeは制御を戻さない。
     
    317332        Dim gch = System.Runtime.InteropServices.GCHandle.Alloc(asyncInvokeData)
    318333        wnd.PostMessage(WM_CONTROL_BEGININVOKE, 0, System.Runtime.InteropServices.GCHandle.ToIntPtr(gch))
    319         Return pAsyncResult
     334        Return asyncResult
    320335    End Function
    321336
     
    327342        Return arInvoke.Result
    328343    End Function
    329 
     344*/
    330345    ' 与えられたウィンドウハンドルがControl(若しくはその派生クラス)の
    331346    ' インスタンスに対応するものであった場合、
     
    360375
    361376    Sub Show()
     377        Debug
    362378        wnd.Show(SW_SHOW)
    363379    End Sub
     
    396412    Virtual Sub CreateHandle()
    397413        Dim createParams = CreateParams()
    398         Dim gch = GCHandle.Alloc(This)
    399         TlsSetValue(tlsIndex, GCHandle.ToIntPtr(gch) As VoidPtr)
     414        Dim gch = System.Runtime.InteropServices.GCHandle.Alloc(This)
     415        TlsSetValue(tlsIndex, System.Runtime.InteropServices.GCHandle.ToIntPtr(gch) As VoidPtr)
    400416        With createParams
    401417            Dim hwndParent = 0 As HWND
     
    516532Private
    517533    ' Member variables
    518     wnd As WindowHandle
     534    wnd As ActiveBasic.Windows.WindowHandle
    519535    text As String
    520536    parent As Control
     
    590606                ExitThread(-1)
    591607            End If
    592             rThis.wnd = New WindowHandle(hwnd)
     608            rThis.wnd = New ActiveBasic.Windows.WindowHandle(hwnd)
    593609            SetWindowLongPtr(hwnd, GWLP_THIS, gchValue)
    594610        End If
Note: See TracChangeset for help on using the changeset viewer.