|
352 | 352 | ') |
353 | 353 | declare fun entry() Void |
354 | 354 |
|
| 355 | +// TODO move those things |
355 | 356 | enum ButtonStyles : Int { |
356 | 357 | // TODO Hexa: make it possible to use constants as tags like `BS_PUSHBUTTON = push_button` |
357 | 358 | BS_PUSH_BUTTON = 0x00000000 |
@@ -399,6 +400,12 @@ fun buttonWindowProcW(hWnd HWnd, uMsg Message, wParam WParam, lParam LParam) LRe |
399 | 400 | switch uMsg { |
400 | 401 | case WM_PAINT: |
401 | 402 | tofitaDebugLog("buttonWindowProcW called - WM_PAINT".utf16()) |
| 403 | + |
| 404 | + if isWindowVisible(hWnd) != Bool32.True { |
| 405 | + // TODO return what? |
| 406 | + // return null |
| 407 | + } |
| 408 | + |
402 | 409 | let ps ByValue<PaintStruct> = ByValue<PaintStruct>() |
403 | 410 | let hdc = beginPaint(hWnd, ps.ref) |
404 | 411 | // let color_window = 5 // TODO |
@@ -430,20 +437,26 @@ fun buttonWindowProcW(hWnd HWnd, uMsg Message, wParam WParam, lParam LParam) LRe |
430 | 437 | // (and strong black frame for default button) |
431 | 438 | let r = ByValue<Rect>() |
432 | 439 | getClientRect(hWnd, r.ref) |
433 | | - let fmt DrawTextFormat = DrawTextFormat.DT_CENTER // TODO | DrawTextFormat.DT_VCENTER |
| 440 | + let fmt DrawTextFormat = DrawTextFormat.DT_CENTER // TODO | DrawTextFormat.DT_V_CENTER |
434 | 441 |
|
435 | 442 | let color_window = 5 // TODO |
436 | 443 | // fillRect(hdc, ps.ref.rcPaint.ref, (color_window + 2) as! HBrush) |
437 | 444 | // fillRect(hdc, r.ref, (color_window + 2) as! HBrush) |
438 | | - |
439 | | - if (userdata & (ButtonStates.BST_PUSHED as! UInt16) /*TODO*/) == 0 { |
| 445 | + fillRect(hdc, r.ref, getStockObject(2) as! HBrush) |
| 446 | + drawEdge(hdc, r.ref, EdgeFlags.BDR_RAISED_INNER, BorderFlags.BF_MIDDLE /* TODO | BF_RECT*/) |
| 447 | + r.ref.left += 2 |
| 448 | + r.ref.top += 2 |
| 449 | + r.ref.right += 2 |
| 450 | + r.ref.bottom += 2 |
| 451 | + drawTextW(hdc, title, -1, r.ref, fmt) |
| 452 | + |
| 453 | + /*if (userdata & (ButtonStates.BST_PUSHED as! UInt16) /*TODO*/) == 0 { |
440 | 454 | drawEdge(hdc, r.ref, EdgeFlags.BDR_RAISED_INNER, BorderFlags.BF_MIDDLE /* TODO | BF_RECT*/) |
441 | 455 | if (style & (ButtonStyles.BS_MULTILINE as! UInt16) /*TODO*/) == 0 { |
442 | 456 | // TODO fmt |= DrawTextFormat.DT_SINGLE_LINE |
443 | 457 | drawTextW(hdc, title, -1, r.ref, fmt) |
444 | 458 | } |
445 | | - } |
446 | | - |
| 459 | + }*/ |
447 | 460 | // TODO |
448 | 461 | // if focus |
449 | 462 | // - drawEdge(hdc, &r, BDR_RAISEDINNER, BF_MIDDLE | BF_RECT); |
@@ -471,7 +484,7 @@ fun emptyWindowProcW(hWnd HWnd, uMsg Message, wParam WParam, lParam LParam) LRes |
471 | 484 | let hdc = beginPaint(hWnd, ps.ref) |
472 | 485 |
|
473 | 486 | let color_window = 5 // TODO |
474 | | - |
| 487 | + // fillRect(hdc, ps.ref.rcPaint.ref, (color_window + 1) as! HBrush) |
475 | 488 |
|
476 | 489 | endPaint(hWnd, ps.ref) |
477 | 490 |
|
|
0 commit comments