Changeset 642 for trunk/ab5.0


Ignore:
Timestamp:
Oct 17, 2008, 12:45:59 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

CheckBoxとButtonBaseクラスを追加。

Location:
trunk/ab5.0/ablib
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/TestCase/UI_Sample/mouse_watcher.ab

    r611 r642  
    22#require <Classes/ActiveBasic/Windows/UI/ListBox.ab>
    33#require <Classes/ActiveBasic/Windows/UI/Application.ab>
     4#require <Classes/ActiveBasic/Windows/UI/CheckBox.ab>
    45
    56#resource "UI_Sample.rc"
     
    4344        End With
    4445
     46        checkBoxShowMoveEvent = New CheckBox
     47        With checkBoxShowMoveEvent
     48            .Create(This, 0, 0, 0)
     49            .Move(320, 60, 200, 20)
     50            .Text = "Moveイベントを表示する"
     51            .SendMessage(WM_SETFONT, wpFont, 0)
     52        End With
     53
    4554        Show(SW_SHOWDEFAULT)
    4655    End Sub
     
    5160        list.Items.Clear()
    5261        LockWindowUpdate(0)
     62        checkBoxShowMoveEvent.AutoCheck = False
    5363    End Sub
    5464
     
    6676
    6777    Sub OnMouseMove(sender As Object, e As MouseArgs)
    68         OnMouseEvent("Move", e)
     78        If checkBoxShowMoveEvent.Checked Then
     79            OnMouseEvent("Move", e)
     80        End If
    6981    End Sub
    7082
     
    98110    list As ListBox
    99111    buttonClear As Button
     112    checkBoxShowMoveEvent As CheckBox
    100113End Class
    101114
  • trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Button.ab

    r637 r642  
    11'Classes/ActiveBasic/Windows/UI/Button.ab
    22
    3 #require <Classes/ActiveBasic/Windows/UI/Control.ab>
     3#require <Classes/ActiveBasic/Windows/UI/ButtonBase.ab>
    44
    55Namespace ActiveBasic
     
    1313*/
    1414Class Button
    15     Inherits WmCommandControl
     15    Inherits ButtonBase
    1616Protected
    1717    Override Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
    18         With cs
    19             .lpszClass = "BUTTON"
    20             .style Or= BS_PUSHBUTTON
    21         End With
     18        Super.GetCreateStruct(cs)
     19        cs.style Or= BS_PUSHBUTTON
    2220    End Sub
    2321Public
    24     Sub RaiseClick()
    25         OnClick(Args.Empty)
    26     End Sub
    27 
    28     Override Function RaiseCommandEvent(notificationCode As Word) As Boolean
    29         Dim lr As LRESULT
    30         RaiseCommandEvent = False
    31         Select Case notificationCode
    32             Case BN_CLICKED
    33                 RaiseCommandEvent = OnClick(Args.Empty)
    34             Case BN_DBLCLK
    35                 RaiseCommandEvent = OnDoubleClick(Args.Empty)
    36             Case BN_SETFOCUS
    37                 RaiseCommandEvent = ProcessMessage(WM_SETFOCUS, 0, 0, lr)
    38             Case BN_KILLFOCUS
    39                 RaiseCommandEvent = ProcessMessage(WM_KILLFOCUS, 0, 0, lr)
    40             'ここに挙げられなかったBNメッセージは、16ビットWindowsとの互換性のためとされているもの。
    41         End Select
    42     End Function
    4322
    4423End Class
Note: See TracChangeset for help on using the changeset viewer.