V2GuiCreator is based heavy on the script of Auto-Gui of Adventure, but written for V2.
This is a beta release but a lot of functions are already working great.
- Import Gui is working very great (press the button and activate another window and press F12)
- Placing, moving controls and resizing them
- Adding events
It is not as great as AutoGui, but it is a good start.
V2GuiCreator
[V2] V2GuiCreator
Re: [V2] V2GuiCreator
This will be very helpful in the V2 Migration. Thank you.
Re: [V2] V2GuiCreator
Thanks for the compliment.
I was also starting experimenting with using a Scintilla control, but this it still in testing fase and gives some errors when running the code.
- oldbrother
- Posts: 275
- Joined: 23 Oct 2013, 05:08
Re: [V2] V2GuiCreator
Thank you! It will be perfect if Autoxywh for V2 can be integrated.
Re: [V2] V2GuiCreator
Is there a V2 version of Autoxywh yet?
Re: [V2] V2GuiCreator
Here is some code that can help you, this function automatically resizes gui controls, just add properties like
GuiObject.LeftMargin := 10
You can also hook them to other controls by telling the reference object GuiCtrlObj.PosRef and the x and y offset.
Code: Select all
; Automatically change size of controls based on properties
Gui_Size(thisGui, MinMax:=1, Width:="", Height:= "") {
if MinMax = -1 ; The window has been minimized. No action needed.
return
;DllCall("LockWindowUpdate", "Uint", thisGui.Hwnd)
(Width="" && WinGetPos(, , &Width, &Height, thisGui)) ; autocollect missing parameters
For Hwnd, GuiCtrlObj in thisGui {
GuiCtrlObj.GetPos(&cX, &cY, &cWidth, &cHeight)
if (GuiCtrlObj.HasProp("LeftMargin") && GuiCtrlObj.LeftMargin!="") {
GuiCtrlObj.Move(, , Width - cX - GuiCtrlObj.LeftMargin, )
}
if (GuiCtrlObj.HasProp("LeftDistance") && GuiCtrlObj.LeftDistance!="") {
GuiCtrlObj.Move(Width - cWidth - GuiCtrlObj.LeftDistance, , , )
}
if (GuiCtrlObj.HasProp("BottomDistance") && GuiCtrlObj.BottomDistance!="") {
GuiCtrlObj.Move(, Height - cHeight - GuiCtrlObj.BottomDistance, , )
}
if (GuiCtrlObj.HasProp("BottomMargin") && GuiCtrlObj.BottomMargin!="") {
GuiCtrlObj.Move(, , , Height - cY - GuiCtrlObj.BottomMargin)
}
if (GuiCtrlObj.HasProp("PosRef") && GuiCtrlObj.PosRef!="") {
GuiCtrlPosRef := GuiCtrlObj.PosRef
loop{
if (GuiCtrlPosRef.Visible){
break
} else{
if (GuiCtrlPosRef.hasProp("PosRef")){
GuiCtrlPosRef := GuiCtrlPosRef.PosRef
} else{
Break
}
}
}
GuiCtrlPosRef.GetPos(&rX, &rY, &rW, &rH)
if (!GuiCtrlPosRef.Visible){
GuiCtrlObj.Move(, rY, , )
}
else{
GuiCtrlObj.Move(, rY+(GuiCtrlObj.HasProp("yOffset") ? GuiCtrlObj.yOffset : 0)+(GuiCtrlObj.HasProp("yMargin") ? rH+GuiCtrlObj.yMargin : 0), , )
}
}
}
}
Re: [V2] V2GuiCreator
I don't have time to try it out at the moment, but thanks for this.