Changeset 561


Ignore:
Timestamp:
Jul 21, 2008, 6:31:41 PM (16 years ago)
Author:
イグトランス (egtra)
Message:

EditBox, TaskMsgの追加。

Location:
trunk/ab5.0
Files:
5 added
10 edited

Legend:

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

    r559 r561  
    1 '「Win32プログラミング講座 ~ Step5. ボタン コントロールを使う ~」のAB5移植版
    2 'http://www.activebasic.com/help_center/articles/win32/step05/
     1/*!
     2@file
     3@brief 「Win32プログラミング講座 ~ Step5. ボタン コントロールを使う ~」のAB5移植版
     4http://www.activebasic.com/help_center/articles/win32/step05/
    35
    4 '2008/07/20 Egtra
     6@date 2008/07/20
     7@auther Egtra
     8*/
    59
    610#require <Classes/ActiveBasic/Windows/UI/Form.ab>
    711#require <Classes/ActiveBasic/Windows/UI/Application.ab>
    812#require <Classes/ActiveBasic/Windows/UI/Button.ab>
     13#require <Classes/ActiveBasic/Windows/UI/TaskMsg.ab>
    914
    1015Imports ActiveBasic.Windows.UI
    1116Imports System
     17
     18#resource "UI_Sample.rc"
    1219
    1320Class DayTimeCheckForm
     
    5158
    5259    Sub ButtonDate_Click(sender As Object, e As Args)
    53         MessageBox(This, ToTCStr(DateTime.Today.GetDateTimeFormats("yyyy/MM/dd")), "今日の日付", MB_OK)
     60        TaskMsg(This, "今日の日付", DateTime.Today.GetDateTimeFormats("yyyy/MM/dd"), Nothing, MB_OK)
    5461    End Sub
    5562
    5663    Sub ButtonTime_Click(sender As Object, e As Args)
    57         MessageBox(This, ToTCStr(DateTime.Now.GetDateTimeFormats("H:mm:ss")), "今日の日付", MB_OK)
     64        TaskMsg(This, "今日の日付", DateTime.Now.GetDateTimeFormats("H:mm:ss"), Nothing, MB_OK)
    5865    End Sub
    5966
  • trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Button.ab

    r551 r561  
    1919            .lpszClass = "BUTTON"
    2020            .style Or= BS_PUSHBUTTON
    21             .x = 0
    22             .y = 0
    23             .cx = 0
    24             .cy = 0
    2521        End With
    2622    End Sub
    2723Public
    2824    Sub RaiseClick()
    29         OutputDebugString(Ex"RaiseClick\r\n")
    3025        OnClick(Args.Empty)
    3126    End Sub
  • trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab

    r559 r561  
    6565            .lpszName = 0
    6666            .style = style Or WS_CHILD Or WS_VISIBLE
    67             .x = CW_USEDEFAULT
    68             .y = CW_USEDEFAULT
    69             .cx = CW_USEDEFAULT
    70             .cy = CW_USEDEFAULT
     67            .x = 0
     68            .y = 0
     69            .cx = 0
     70            .cy = 0
    7171            If IsNothing(parent) Then
    7272                .hwndParent = 0
     
    101101
    102102        With cs
    103             'よそのクラスの場合、WndProcFirst内のhwndの代入が行われないため、ここでも行っておく。
     103            'よそのウィンドウクラスの場合、WndProcFirst内のhwndの代入が行われないため、ここでも行っておく。
    104104            hwnd = CreateWindowEx(.dwExStyle, .lpszClass, .lpszName, .style,
    105105                .x, .y, .cx, .cy, .hwndParent, .hMenu, .hInstance, .lpCreateParams)
     
    187187        AddMessageEvent(WM_CHAR, AddressOf(OnChar))
    188188        AddMessageEvent(WM_CREATE, AddressOf(OnCreateBase))
     189        AddMessageEvent(WM_SIZE, AddressOf(OnSize))
    189190    End Sub
    190191
     
    202203        Dim me = makeMouseEventFromMsg(e)
    203204        If doubleClickFired = False Then
    204 '           OnClick(System.Args.Empty)
     205            OnClick(Args.Empty)
    205206            OnMouseClick(me)
    206207            doubleClickFired = False
     
    213214        doubleClickFired = True
    214215        OnMouseDown(me)
    215 '       OnDoubleClick(System.Args.Empty)
     216        OnDoubleClick(Args.Empty)
    216217        OnMouseDoubleClick(me)
    217218    End Sub
     
    257258    Sub OnCreateBase(sender As Object, e As MessageArgs)
    258259        OnCreate(New CreateArgs(e.LParam As *CREATESTRUCT))
     260    End Sub
     261
     262    Sub OnSize(sender As Object, e As MessageArgs)
     263        OnResize(New ResizeArgs(e.WParam, e.LParam))
    259264    End Sub
    260265
  • trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ControlEvent.sbp

    r559 r561  
    8888
    8989Public
     90    Sub AddResize(h As ResizeHandler)
     91        If IsNothing(resize) Then
     92            resize = h
     93        Else
     94            resize += h
     95        End If
     96    End Sub
     97    Sub RemoveResize(h As ResizeHandler)
     98        If Not IsNothing(resize) Then
     99            resize -= h
     100        End If
     101    End Sub
     102Protected
     103    Sub OnResize(e As ResizeArgs)
     104        If Not IsNothing(resize) Then
     105            resize(This, e)
     106        End If
     107    End Sub
     108Private
     109    resize As ResizeHandler
     110
     111Public
    90112    Sub AddMouseEnter(h As MouseHandler)
    91113        If IsNothing(mouseEnter) Then
  • trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ControlEventList.txt

    r551 r561  
    44'EnableChanged      有効状態が変化したときに呼び出されます。
    55Move        ウィンドウが移動したときに呼び出されます。
    6 'Resize     ウィンドウの大きさが変化したときに呼び出されます。
     6Resize  Resize  ウィンドウの大きさが変化したときに呼び出されます。
    77'VisibleChanged     ウィンドウの表示状態が変化したときに呼び出されます。
    88'SetFocus       フォーカスを得たときに呼び出されます。
  • trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab

    r551 r561  
    2323    End Sub
    2424
    25     Function Msg() As DWord
     25    Const Function Msg() As DWord
    2626        Msg = msg
    2727    End Function
    2828
    29 '   Function HWnd() As HWND
     29'   Const Function HWnd() As HWND
    3030'       HWnd = hwnd
    3131'   End Function
    3232
    33     Function WParam() As WPARAM
     33    Const Function WParam() As WPARAM
    3434        WParam = wp
    3535    End Function
    3636
    37     Function LParam() As LPARAM
     37    Const Function LParam() As LPARAM
    3838        LParam = lp
    3939    End Function
    4040
    41     Function LResult() As LRESULT
     41    Const Function LResult() As LRESULT
    4242        LResult = lr
    4343    End Function
     
    6464    End Sub
    6565
    66     Function Handle() As HDC
     66    Const Function Handle() As HDC
    6767        Handle = hdc
    6868    End Function
    6969
    70     Function ClipRect() As RECT
     70    Const Function ClipRect() As RECT
    7171        ClipRect = rc
    7272    End Function
     
    8686    End Sub
    8787
    88     Function Handled() As Boolean
     88    Const Function Handled() As Boolean
    8989        Handled = h
    9090    End Function
     
    386386    End Sub
    387387
    388     Function Alt() As Boolean
     388    Const Function Alt() As Boolean
    389389        Alt = key And Keys.Menu
    390390    End Function
    391391
    392     Function Control() As Boolean
     392    Const Function Control() As Boolean
    393393        Control = key And Keys.Control
    394394    End Function
    395395
    396     Function Shift() As Boolean
     396    Const Function Shift() As Boolean
    397397        Shift = key And Keys.Shift
    398398    End Function
    399399
    400     Function KeyCode() As Keys
     400    Const Function KeyCode() As Keys
    401401        Dim k = key As DWord
    402402        Dim mask = Keys.KeyCode As DWord
     
    404404    End Function
    405405
    406     Function KeyData() As Keys
     406    Const Function KeyData() As Keys
    407407        KeyData = key
    408408    End Function
    409409
    410     Function Modifiers() As Keys
     410    Const Function Modifiers() As Keys
    411411        Dim k = key As DWord
    412412        Dim mask = Keys.Modifiers As DWord
     
    414414    End Function
    415415
    416     Function KeyValue() As Long
     416    Const Function KeyValue() As Long
    417417        KeyValue = key As Long
    418418    End Function
     
    422422    End Sub
    423423
    424     Function Handled() As Boolean
     424    Const Function Handled() As Boolean
    425425        Handled = h
    426426    End Function
     
    498498    End Sub
    499499
    500     Function Cancel() As Boolean
     500    Const Function Cancel() As Boolean
    501501        Cancel = c
    502502    End Function
     
    510510
    511511Delegate Sub FormClosingHandler(sender As Object, e As FormClosingArgs)
     512
     513Class ResizeArgs
     514    Inherits Args
     515Public
     516    Sub ResizeArgs(resizeType As Long, X As Long, Y As Long)
     517        rt = resizeType
     518        x = X
     519        y = Y
     520    End Sub
     521
     522    Sub ResizeArgs(wp As WPARAM, lp As LPARAM)
     523        rt = wp As Long
     524        x = GET_X_LPARAM(lp)
     525        y = GET_Y_LPARAM(lp)
     526    End Sub
     527
     528    Function ResizeType() As Long
     529        ResizeType = rt
     530    End Function
     531
     532    Function X() As Long
     533        X = x
     534    End Function
     535
     536    Function Y() As Long
     537        Y = y
     538    End Function
     539Private
     540    rt As Long
     541    x As Long
     542    y As Long
     543End Class
     544
     545Delegate Sub ResizeHandler(sender As Object, e As ResizeArgs)
    512546
    513547End Namespace 'UI
  • trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab

    r559 r561  
    2323Protected
    2424    Override Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
    25         cs.style = WS_OVERLAPPEDWINDOW
     25        With cs
     26            .style = WS_OVERLAPPEDWINDOW
     27            .x = CW_USEDEFAULT
     28            .y = CW_USEDEFAULT
     29            .cx = CW_USEDEFAULT
     30            .cy = CW_USEDEFAULT
     31        End With
    2632    End Sub
    2733
  • trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/Windows.ab

    r559 r561  
    128128hrが成功値 (FAILED(hr) = False) の場合、この関数は何も行わない。
    129129*/
    130 Sub ThrowByHResult(hr As HRESULT)
     130Sub ThrowIfFailed(hr As HRESULT)
    131131    If FAILED(hr) Then
    132132        Throw New WindowsException(hr)
  • trunk/ab5.0/ablib/src/api_commctrl.sbp

    r457 r561  
    999999Declare Function _TrackMouseEvent Lib "comctl32" (ByRef EventTrack As TRACKMOUSEEVENT) As BOOL
    10001000
     1001Const TD_WARNING_ICON = MAKEINTRESOURCEW(&hffff /*-1*/)
     1002Const TD_ERROR_ICON = MAKEINTRESOURCEW(&hfffe /*-2*/)
     1003Const TD_INFORMATION_ICON = MAKEINTRESOURCEW(&hfffd /*-3*/)
     1004Const TD_SHIELD_ICON = MAKEINTRESOURCEW(&hfffc /*-4*/)
     1005
     1006Const Enum _TASKDIALOG_COMMON_BUTTON_FLAGS
     1007    TDCBF_OK_BUTTON = &h0001
     1008    TDCBF_YES_BUTTON = &h0002
     1009    TDCBF_NO_BUTTON = &h0004
     1010    TDCBF_CANCEL_BUTTON = &h0008
     1011    TDCBF_RETRY_BUTTON = &h0010
     1012    TDCBF_CLOSE_BUTTON = &h0020
     1013End Enum
     1014
     1015TypeDef TASKDIALOG_COMMON_BUTTON_FLAGS = Long
     1016
    10011017#endif '_INC_COMMCTRL
  • trunk/ab5.0/theme/User Setting/design.ini

    r187 r561  
    44rgbString=1414a0
    55rgbCursorBack=ebf0ff
    6 rgbBackground=ffffff
     6rgbBackground=f2f7f5
     7BackgroundImagePath=
Note: See TracChangeset for help on using the changeset viewer.