- Timestamp:
- Jul 21, 2008, 6:31:41 PM (16 years ago)
- 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移植版 4 http://www.activebasic.com/help_center/articles/win32/step05/ 3 5 4 '2008/07/20 Egtra 6 @date 2008/07/20 7 @auther Egtra 8 */ 5 9 6 10 #require <Classes/ActiveBasic/Windows/UI/Form.ab> 7 11 #require <Classes/ActiveBasic/Windows/UI/Application.ab> 8 12 #require <Classes/ActiveBasic/Windows/UI/Button.ab> 13 #require <Classes/ActiveBasic/Windows/UI/TaskMsg.ab> 9 14 10 15 Imports ActiveBasic.Windows.UI 11 16 Imports System 17 18 #resource "UI_Sample.rc" 12 19 13 20 Class DayTimeCheckForm … … 51 58 52 59 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) 54 61 End Sub 55 62 56 63 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) 58 65 End Sub 59 66 -
trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Button.ab
r551 r561 19 19 .lpszClass = "BUTTON" 20 20 .style Or= BS_PUSHBUTTON 21 .x = 022 .y = 023 .cx = 024 .cy = 025 21 End With 26 22 End Sub 27 23 Public 28 24 Sub RaiseClick() 29 OutputDebugString(Ex"RaiseClick\r\n")30 25 OnClick(Args.Empty) 31 26 End Sub -
trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab
r559 r561 65 65 .lpszName = 0 66 66 .style = style Or WS_CHILD Or WS_VISIBLE 67 .x = CW_USEDEFAULT68 .y = CW_USEDEFAULT69 .cx = CW_USEDEFAULT70 .cy = CW_USEDEFAULT67 .x = 0 68 .y = 0 69 .cx = 0 70 .cy = 0 71 71 If IsNothing(parent) Then 72 72 .hwndParent = 0 … … 101 101 102 102 With cs 103 'よその クラスの場合、WndProcFirst内のhwndの代入が行われないため、ここでも行っておく。103 'よそのウィンドウクラスの場合、WndProcFirst内のhwndの代入が行われないため、ここでも行っておく。 104 104 hwnd = CreateWindowEx(.dwExStyle, .lpszClass, .lpszName, .style, 105 105 .x, .y, .cx, .cy, .hwndParent, .hMenu, .hInstance, .lpCreateParams) … … 187 187 AddMessageEvent(WM_CHAR, AddressOf(OnChar)) 188 188 AddMessageEvent(WM_CREATE, AddressOf(OnCreateBase)) 189 AddMessageEvent(WM_SIZE, AddressOf(OnSize)) 189 190 End Sub 190 191 … … 202 203 Dim me = makeMouseEventFromMsg(e) 203 204 If doubleClickFired = False Then 204 ' OnClick(System.Args.Empty)205 OnClick(Args.Empty) 205 206 OnMouseClick(me) 206 207 doubleClickFired = False … … 213 214 doubleClickFired = True 214 215 OnMouseDown(me) 215 ' OnDoubleClick(System.Args.Empty)216 OnDoubleClick(Args.Empty) 216 217 OnMouseDoubleClick(me) 217 218 End Sub … … 257 258 Sub OnCreateBase(sender As Object, e As MessageArgs) 258 259 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)) 259 264 End Sub 260 265 -
trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ControlEvent.sbp
r559 r561 88 88 89 89 Public 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 102 Protected 103 Sub OnResize(e As ResizeArgs) 104 If Not IsNothing(resize) Then 105 resize(This, e) 106 End If 107 End Sub 108 Private 109 resize As ResizeHandler 110 111 Public 90 112 Sub AddMouseEnter(h As MouseHandler) 91 113 If IsNothing(mouseEnter) Then -
trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/ControlEventList.txt
r551 r561 4 4 'EnableChanged 有効状態が変化したときに呼び出されます。 5 5 Move ウィンドウが移動したときに呼び出されます。 6 'Resizeウィンドウの大きさが変化したときに呼び出されます。6 Resize Resize ウィンドウの大きさが変化したときに呼び出されます。 7 7 'VisibleChanged ウィンドウの表示状態が変化したときに呼び出されます。 8 8 'SetFocus フォーカスを得たときに呼び出されます。 -
trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab
r551 r561 23 23 End Sub 24 24 25 Function Msg() As DWord25 Const Function Msg() As DWord 26 26 Msg = msg 27 27 End Function 28 28 29 ' Function HWnd() As HWND29 ' Const Function HWnd() As HWND 30 30 ' HWnd = hwnd 31 31 ' End Function 32 32 33 Function WParam() As WPARAM33 Const Function WParam() As WPARAM 34 34 WParam = wp 35 35 End Function 36 36 37 Function LParam() As LPARAM37 Const Function LParam() As LPARAM 38 38 LParam = lp 39 39 End Function 40 40 41 Function LResult() As LRESULT41 Const Function LResult() As LRESULT 42 42 LResult = lr 43 43 End Function … … 64 64 End Sub 65 65 66 Function Handle() As HDC66 Const Function Handle() As HDC 67 67 Handle = hdc 68 68 End Function 69 69 70 Function ClipRect() As RECT70 Const Function ClipRect() As RECT 71 71 ClipRect = rc 72 72 End Function … … 86 86 End Sub 87 87 88 Function Handled() As Boolean88 Const Function Handled() As Boolean 89 89 Handled = h 90 90 End Function … … 386 386 End Sub 387 387 388 Function Alt() As Boolean388 Const Function Alt() As Boolean 389 389 Alt = key And Keys.Menu 390 390 End Function 391 391 392 Function Control() As Boolean392 Const Function Control() As Boolean 393 393 Control = key And Keys.Control 394 394 End Function 395 395 396 Function Shift() As Boolean396 Const Function Shift() As Boolean 397 397 Shift = key And Keys.Shift 398 398 End Function 399 399 400 Function KeyCode() As Keys400 Const Function KeyCode() As Keys 401 401 Dim k = key As DWord 402 402 Dim mask = Keys.KeyCode As DWord … … 404 404 End Function 405 405 406 Function KeyData() As Keys406 Const Function KeyData() As Keys 407 407 KeyData = key 408 408 End Function 409 409 410 Function Modifiers() As Keys410 Const Function Modifiers() As Keys 411 411 Dim k = key As DWord 412 412 Dim mask = Keys.Modifiers As DWord … … 414 414 End Function 415 415 416 Function KeyValue() As Long416 Const Function KeyValue() As Long 417 417 KeyValue = key As Long 418 418 End Function … … 422 422 End Sub 423 423 424 Function Handled() As Boolean424 Const Function Handled() As Boolean 425 425 Handled = h 426 426 End Function … … 498 498 End Sub 499 499 500 Function Cancel() As Boolean500 Const Function Cancel() As Boolean 501 501 Cancel = c 502 502 End Function … … 510 510 511 511 Delegate Sub FormClosingHandler(sender As Object, e As FormClosingArgs) 512 513 Class ResizeArgs 514 Inherits Args 515 Public 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 539 Private 540 rt As Long 541 x As Long 542 y As Long 543 End Class 544 545 Delegate Sub ResizeHandler(sender As Object, e As ResizeArgs) 512 546 513 547 End Namespace 'UI -
trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab
r559 r561 23 23 Protected 24 24 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 26 32 End Sub 27 33 -
trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/Windows.ab
r559 r561 128 128 hrが成功値 (FAILED(hr) = False) の場合、この関数は何も行わない。 129 129 */ 130 Sub Throw ByHResult(hr As HRESULT)130 Sub ThrowIfFailed(hr As HRESULT) 131 131 If FAILED(hr) Then 132 132 Throw New WindowsException(hr) -
trunk/ab5.0/ablib/src/api_commctrl.sbp
r457 r561 999 999 Declare Function _TrackMouseEvent Lib "comctl32" (ByRef EventTrack As TRACKMOUSEEVENT) As BOOL 1000 1000 1001 Const TD_WARNING_ICON = MAKEINTRESOURCEW(&hffff /*-1*/) 1002 Const TD_ERROR_ICON = MAKEINTRESOURCEW(&hfffe /*-2*/) 1003 Const TD_INFORMATION_ICON = MAKEINTRESOURCEW(&hfffd /*-3*/) 1004 Const TD_SHIELD_ICON = MAKEINTRESOURCEW(&hfffc /*-4*/) 1005 1006 Const 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 1013 End Enum 1014 1015 TypeDef TASKDIALOG_COMMON_BUTTON_FLAGS = Long 1016 1001 1017 #endif '_INC_COMMCTRL -
trunk/ab5.0/theme/User Setting/design.ini
r187 r561 4 4 rgbString=1414a0 5 5 rgbCursorBack=ebf0ff 6 rgbBackground=ffffff 6 rgbBackground=f2f7f5 7 BackgroundImagePath=
Note:
See TracChangeset
for help on using the changeset viewer.