mmikeww / AHK-v2-script-converter

AHK v1 -> v2 script converter
https://autohotkey.com/boards/viewtopic.php?f=6&t=25100
The Unlicense
558 stars 43 forks source link

Gui conversion issues #281

Open andymbody opened 2 months ago

andymbody commented 2 months ago

https://www.autohotkey.com/boards/viewtopic.php?p=581354#p581354

Will fill in details later

V1:

Gui, ClipGui: New, +hwndClGui

Gui, ClipGui: Add, Text, % "Center x" . Margin . " y" . Margin .  " w" . Margin*2 . " h" . 20 . " vCH" . A_Index . " hwndBot" . A_Index, % StrLen(this.clips[A_Index]) . " characters"

cmd=%1%

V2 (Converted):

ClipGui. New("+hwndClGui")

ClipGui. Add("Text", "Center x" . Margin . " y" . Margin .  " w" . Margin*2 . " h" . 20 . " vCH" . A_Index . " . A_Index, StrLen(this.clips[A_Index]) . " characters")
Bot" := ogcTextCH.hwnd

cmd := 1

V2 (Expected):

Banaanae commented 2 months ago

V2 (Expected):

ClipGui := Gui(), ClGui := ClipGui.Hwnd

; Not really possible - see below

cmd:=_1

Issue 1: Easy fix

Issue 2: It looks like this control is created in a loop, so "+hwndVar" . A_Index could create Var1, Var2 etc afaik there isn't anyway to do this outside of cases like this, and because now you can't make a hwnd var inside the command (you use hwndVar := GuiCtrl.hwnd, and hwndVar%A_Index% is invalid)

Issue 3: Another variable issue, valid in v1 not in v2