Changeset 698 for trunk/ab5.0/ablib/src/Classes/ActiveBasic
- Timestamp:
- Mar 31, 2009, 2:09:07 PM (15 years ago)
- Location:
- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab
r679 r698 57 57 End Function 58 58 59 Function AddRef() As DWord 60 AddRef = comImpl.AddRef() 61 End Function 62 63 Function Release() As DWord 64 Release = comImpl.Release() 65 End Function 66 67 Function QueryInterface(ByRef riid As IID, ByRef pv As Any) As HRESULT 68 QueryInterface = comImpl.QueryInterface(riid, pv) 69 End Function 70 59 71 Private 60 72 Static Function FromHWndCore(hwnd As HWND) As Control … … 70 82 @date 2008/08/02 71 83 通常はCreateやCreateFormその他を使ってください。 84 ここで渡された引数は、GetCreateStructへ渡して修正の機会を与えた後に、 85 CreateWindowExへ渡される。 72 86 */ 73 87 Sub CreateEx(parent As Control, style As DWord, exStyle As DWord, hmenu As HMENU) … … 115 129 116 130 Protected 131 /*! 132 @brief ウィンドウ作成前の初期設定確認 133 派生クラスでオーバーライドして、csを書き換えてよい。 134 書き換えられたcsを基にCreateWindowExが呼ばれる。 135 */ 117 136 Virtual Sub GetCreateStruct(ByRef cs As CREATESTRUCT) 118 137 End Sub 119 138 139 Private 120 140 Sub createImpl(ByRef cs As CREATESTRUCT, parent As Control) 121 141 throwIfAlreadyCreated() … … 153 173 End Sub 154 174 */ 175 155 176 Sub BeginSubclass() 156 177 throwIfNotCreated() … … 207 228 Private 208 229 Static Function makeKeysFormMsg(e As MessageArgs) As Keys 209 Dim t As DWord 210 t = e.WParam And Keys.KeyCode 230 Dim t = (e.WParam As DWord) And Keys.KeyCode 211 231 t Or= (GetKeyState(VK_SHIFT) As Word And &h8000) << 1 212 232 t Or= (GetKeyState(VK_CONTROL) As Word And &h8000) << 2 … … 354 374 355 375 Sub OnCreateBase(sender As Object, e As MessageArgs) 356 e.Handled = e.Handled And OnCreate(New CreateArgs(e.LParam As *CREATESTRUCT)) 376 Dim c = New CreateArgs(e.LParam As *CREATESTRUCT) 377 If e.LResult = -1 Then 378 c.Cancel = True 379 End If 380 e.Handled = e.Handled And OnCreate(c) 381 If c.Cancel Then 382 e.LResult = -1 383 Else 384 e.LResult = 0 385 End If 357 386 End Sub 358 387 … … 579 608 .hIcon = 0 580 609 .hCursor = LoadImage(0, MAKEINTRESOURCE(IDC_ARROW), IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE Or LR_SHARED) As HCURSOR 581 .hbrBackground = 0610 .hbrBackground = (COLOR_3DFACE + 1) As HBRUSH 582 611 .lpszMenuName = 0 583 612 .lpszClassName = ToTCStr(WindowClassName) -
trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab
r615 r698 128 128 This.button = button 129 129 This.clicks = clicks 130 This.pt = New System.Drawing.Point(x, y) 130 This.pt.X = x 131 This.pt.Y = y 131 132 This.delta = delta 132 133 End Sub … … 145 146 146 147 Const Function Locale() As System.Drawing.Point 147 Locale = New System.Drawing.Point(pt.X, pt.Y)148 Locale = pt 148 149 End Function 149 150 … … 495 496 CreateStruct = pcs 496 497 End Function 498 499 Const Function Cancel() As Boolean 500 Cancel = cancel 501 End Function 502 503 Sub Cancel(c As Boolean) 504 cancel = c 505 End Sub 497 506 Private 498 507 pcs As *CREATESTRUCT 508 cancel As Boolean 499 509 End Class 500 510 -
trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab
r637 r698 19 19 Sub Form() 20 20 AddMessageEvent(WM_COMMAND, AddressOf(OnCommand)) 21 AddPaintBackground(AddressOf(OnPaintBackground))22 21 End Sub 23 22 … … 31 30 .cy = CW_USEDEFAULT 32 31 End With 33 End Sub34 35 Sub OnPaintBackground(sender As Object, e As PaintBackgroundArgs)36 Dim rc = ClientRect37 FillRect(e.Handle, rc, (COLOR_3DFACE + 1) As HBRUSH)38 32 End Sub 39 33
Note:
See TracChangeset
for help on using the changeset viewer.