Post by sordidfellow » 22 Jun 2016, 21:12
Fix #1:
In WinPos definition, add "Int" to the type since that's what the DLL puts in the rect object.
On my system, the default UPtr type for NumGet was giving me values in the 1e15 range for w
Code: [Select all]GeSHi © Codebox Plus
WinPos(x:="",y:=""){
ControlGetPos,xx,yy,ww,hh,,% hwnd([3])
VarSetCapacity(rect,16)
DllCall("GetClientRect",ptr,hwnd(3),ptr,&rect)
x-=xx+v.Border
y-=yy+v.Border+v.Caption
w:=NumGet(rect,8,"Int") ; Add "Int" parameter
h:=NumGet(rect,12,"Int") ; Add "Int" parameter
return {x:x,y:y,w:w,h:h}
}
Fix #2:
Additional options are being concatenated directly against the previous code, causing errors.
Adjust CompileItem definition:
Code: [Select all]GeSHi © Codebox Plus
CompileItem(node){
ea:=xml.ea(node),index:=0
item:="Gui,Add," ea.type ","
for a,b in StrSplit("x,y,w,h,g,v",",")
if(ea[b]!="")
item.=(index=0?"":" ") b ea[b],index++
if(ea.option)
item.=" " ea.option ; Add space before additional options
item.="," ea.value
return item
}
With those 2 fixes, the Export function could be modified to no longer quit early and actually run the GUI nicely.
Super handy tool!
Fix #1:
In WinPos definition, add "Int" to the type since that's what the DLL puts in the rect object.
On my system, the default UPtr type for NumGet was giving me values in the 1e15 range for w
[code]WinPos(x:="",y:=""){
ControlGetPos,xx,yy,ww,hh,,% hwnd([3])
VarSetCapacity(rect,16)
DllCall("GetClientRect",ptr,hwnd(3),ptr,&rect)
x-=xx+v.Border
y-=yy+v.Border+v.Caption
w:=NumGet(rect,8,"Int") ; Add "Int" parameter
h:=NumGet(rect,12,"Int") ; Add "Int" parameter
return {x:x,y:y,w:w,h:h}
}[/code]
Fix #2:
Additional options are being concatenated directly against the previous code, causing errors.
Adjust CompileItem definition:
[code]CompileItem(node){
ea:=xml.ea(node),index:=0
item:="Gui,Add," ea.type ","
for a,b in StrSplit("x,y,w,h,g,v",",")
if(ea[b]!="")
item.=(index=0?"":" ") b ea[b],index++
if(ea.option)
item.=" " ea.option ; Add space before additional options
item.="," ea.value
return item
}[/code]
With those 2 fixes, the Export function could be modified to no longer quit early and actually run the GUI nicely.
Super handy tool!