No, you are not doing anything wrong. I can see from this that I have some work to do but for now you can workaround the issue like this.ozzii wrote: ↑11 Oct 2021, 04:56The example with the tooltip works. Thank you for the help and the explanation.
Sorry to ask the question again (because I didn't see an answer from you message from the 9th), but did you see my question about testing the 'id/name' of the button instead of his vVal
About my issue:
I have thisThe win is cropped on the rightCode: Select all
args := {exW: 1, exH: 1, fillW: true, fillH: false} myGui := new GridGUI("CTM", "resize") myGui.GuiClose := GridGUI.ExitApp myGui.Color("4389A5") myGui.Font("bold s13") myGui.Add("1-2", 1, "Text", "cWhite", "● Relance CTM ●", , , , , "C") myGui.Font("normal s11") bt1 := myGui.Add(1, 2, "Button", , "bt1 -> Y", args) bt1.callback := Func("bt1") bt1_sans := myGui.Add(2, 2, "Button", , "bt1 -> N", args) bt1_sans.callback := Func("bt1_sans") bt2 := myGui.Add(1, 3, "Button", , "bt2", args) bt2.callback := Func("bt2") bt3 := myGui.Add(2, 3, "Button", , "bt3", args) bt3.callback := Func("bt3") bt4 := myGui.Add(1, 4, "Button", , "bt4 -> Y", args) bt4.callback := Func("bt4") bt4_sans := myGui.Add(2, 4, "Button", , "bt4 -> N", args) bt4_sans.callback := Func("bt4_sans") Demat := myGui.Add("1-2", 5, "Button", , "Démat factures", args) Demat.callback := Func("Demat") Fichier := myGui.Add(1, 6, "Button", , "Fichiers 1C/1V...", args) Fichier.callback := Func("Fichier") HR := myGui.Add(2, 6, "Button", , "Demandes DSN/HR", args) HR.callback := Func("HR") myGui.Add("1-2", 11, "Text", "cWhite", "", , , , , "C") btq := myGui.Add("1-2", 12, "Button", "Default", "Quitter", args) btq.callback := Func("Sortie") global SERVEUR, FOLDER, VARIABLE, DTE myGui.AutoSize() myGui.MinSize() myGui.Show() Return
But when I change Demandes DSN/HR with Demandes DSN it's OK.
Am I doing something wrong ?
Code: Select all
#Include %A_ScriptDir%\..\GridGUI.ahk
args := {exW: 1, exH: 1, fillW: true, fillH: false}
myGui := new GridGUI("CTM", "resize")
myGui.GuiClose := GridGUI.ExitApp
myGui.Color("4389A5")
myGui.Font("bold s13")
myGui.Add("1-2", 1, "Text", "cWhite", "● Relance CTM ●", , , , , "C")
myGui.Font("normal s11")
bt1 := myGui.Add(1, 2, "Button", , "bt1 -> Y", args)
bt1_sans := myGui.Add(2, 2, "Button", , "bt1 -> N", args)
bt2 := myGui.Add(1, 3, "Button", , "bt2", args)
bt3 := myGui.Add(2, 3, "Button", , "bt3", args)
bt4 := myGui.Add(1, 4, "Button", , "bt4 -> Y", args)
bt4_sans := myGui.Add(2, 4, "Button", , "bt4 -> N", args)
Demat := myGui.Add("1-2", 5, "Button", , "Démat factures", args)
Fichier := myGui.Add(1, 6, "Button", , "Fichiers 1C/1V...", args)
HR := myGui.Add(2, 6, "Button", , "Demandes DSN/HR", args)
myGui.Add("1-2", 11, "Text", "cWhite", "", , , , , "C")
btq := myGui.Add("1-2", 12, "Button", "Default", "Quitter", args)
myGui.AutoSize()
;MsgBox, % myGui.pos.ToStr() "`n`nW: " GridGUI.Util.Sum(myGui.grid.widths) "`nH: " GridGUI.Util.Sum(myGui.grid.heights)
myGui.pos.w := GridGUI.Util.Sum(myGui.grid.widths)
myGui.pos.h := GridGUI.Util.Sum(myGui.grid.heights)
myGui.MinSize()
myGui.Show("w" myGui.pos.w " h" myGui.pos.h)
Return
Edit: I forgot to explain how the workaround worked. It first draws the GUI using myGui.AutoSize() it then takes the combined width and height of the cells and put them in myGui.pos before applying myGui.MinSize() so that all the cells are fully visible. and then finally it calls myGui.Show("w" myGui.pos.w " h" myGui.pos.h) with the width and height that was put in myGui.pos.