Skip to content

Commit fee663d

Browse files
committed
Update structure for v2.1-alpha.
1 parent 05a4ae0 commit fee663d

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

ColorButton.ahk

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@
4141
; idFrom : uptr
4242
; code : i32
4343
; }
44+
45+
; __New(ptr?) {
46+
; if (ptr??0) {
47+
; scc := StructFromPtr(NMCUSTOMDRAWINFO, ptr?)
48+
; for p, v in scc.Props() {
49+
; if IsObject(v) {
50+
; for p2, v2 in v.Props()
51+
; try this.%p%.%p2% := v2
52+
; } else
53+
; try this.%p% := v
54+
; }
55+
; }
56+
; }
57+
58+
; ptr => ObjGetDataPtr(this)
59+
; size => ObjGetDataSize(this)
4460
; }
4561
4662
; If you're NOT using v2.1-alpha.9 or later, delete the section ABOVE.
@@ -264,10 +280,7 @@ class _BtnColor extends Gui.Button
264280
static DC_BRUSH := GetStockObject(18)
265281
static DC_PEN := GetStockObject(19)
266282

267-
if IsSet(StructFromPtr)
268-
try lpnmCD := StructFromPtr(NMCUSTOMDRAWINFO, lParam)
269-
270-
lpnmCD := lpnmCD ?? NMCUSTOMDRAWINFO(lParam)
283+
lpnmCD := NMCUSTOMDRAWINFO(lParam)
271284

272285
if (lpnmCD.hdr.code != NM_CUSTOMDRAW ||lpnmCD.hdr.hwndFrom != gCtrl.hwnd)
273286
return CDRF_DODEFAULT

0 commit comments

Comments
 (0)