What does a value other than 1 accomplish for expandwidth and fillwidth?
on line 18 in screenshot below, where you have “2.3” for both params, from the UCR example (from evilc).
GridGUI v1.1.11 - Simplify Control Placement and Resizing
- metacognition
- Posts: 117
- Joined: 22 Oct 2014, 05:57
- Location: Alaska
- Contact:
Re: GridGUI v1.1.4 - Simplify Control Placement and Resizing
The size of exW and exH change the relative width and height a control gets of the available size in a GUI after all the controls with fixed width and height have taken the parts they need.metacognition wrote: ↑02 Sep 2021, 00:31What does a value other than 1 accomplish for expandwidth and fillwidth?
on line 18 in screenshot below, where you have “2.3” for both params, from the UCR example (from evilc).
072A45D2-6318-4B29-97EC-65776342BE07.jpeg
fillW and fillH are Boolean values that determines if the control should fill the size of the cells the control occupies, the size of the cells are determined by other controls. I should probably not have used something other than 1 for fillW like I did.
Please excuse my spelling I am dyslexic.
- metacognition
- Posts: 117
- Joined: 22 Oct 2014, 05:57
- Location: Alaska
- Contact:
Re: GridGUI v1.1.4 - Simplify Control Placement and Resizing
Cool. Well I gotta say this is a blast converting my GUI to GridGUI and refactoring events to functions and methods. It makes everything uniform and look and behave great. But, another question!
I've noticed when I give a button a width somthing is adding padding or margin, and it doesn't seem to be affected by adjust margin parameters. When I remove the width option and use exW and fillW the padding goes away.
I've noticed when I give a button a width somthing is adding padding or margin, and it doesn't seem to be affected by adjust margin parameters. When I remove the width option and use exW and fillW the padding goes away.
Code: Select all
btn_add_reminder := gui_email_view_%email_id%.Add(6, 6, "Button", {text: "Add", options: "w" global_button_width})
Re: GridGUI v1.1.4 - Simplify Control Placement and Resizing
I will have a look at it in the evening this sounds like it might be a bug. But one thing that I have noticed some problems with is DPI can you try adding the -DPIScale option to the GUI, and see if it changes anything?metacognition wrote: ↑02 Sep 2021, 21:07Cool. Well I gotta say this is a blast converting my GUI to GridGUI and refactoring events to functions and methods. It makes everything uniform and look and behave great. But, another question!
I've noticed when I give a button a width somthing is adding padding or margin, and it doesn't seem to be affected by adjust margin parameters. When I remove the width option and use exW and fillW the padding goes away.
sc1 2021-09-02_18-08-41.pngCode: Select all
btn_add_reminder := gui_email_view_%email_id%.Add(6, 6, "Button", {text: "Add", options: "w" global_button_width})
Edit: can you share the source of the specific GUI with me so that I can get a better idea of what is happening?
Please excuse my spelling I am dyslexic.
Re: GridGUI v1.1.4 - Simplify Control Placement and Resizing
Long time no see @Capn Odin, nice to see you back .
Script looks nice, well done .
Cheers.
Script looks nice, well done .
Cheers.
Re: GridGUI v1.1.4 - Simplify Control Placement and Resizing
Thank you, I have been hiding in the Discord server.
Please excuse my spelling I am dyslexic.
Re: GridGUI v1.1.4 - Simplify Control Placement and Resizing
Alternatively you can share an image of the original GUI and I can see how well I can recreate it, I will probably run into the same problem you did this way.metacognition wrote: ↑02 Sep 2021, 21:07Cool. Well I gotta say this is a blast converting my GUI to GridGUI and refactoring events to functions and methods. It makes everything uniform and look and behave great. But, another question!
I've noticed when I give a button a width somthing is adding padding or margin, and it doesn't seem to be affected by adjust margin parameters. When I remove the width option and use exW and fillW the padding goes away.
sc1 2021-09-02_18-08-41.pngCode: Select all
btn_add_reminder := gui_email_view_%email_id%.Add(6, 6, "Button", {text: "Add", options: "w" global_button_width})
Please excuse my spelling I am dyslexic.
- metacognition
- Posts: 117
- Joined: 22 Oct 2014, 05:57
- Location: Alaska
- Contact:
Re: GridGUI v1.1.4 - Simplify Control Placement and Resizing
Here you go, should be easy to play with commented lines and reproduce, -dpiscale did fix it so you were correct in your suspicion. I still can't figure out where it is happening.
EDIT:
I think I found the problem, on line 787 of Grid.ahk, inside GetNeededWidth() in the final expression of the ternary sequence, this.cPos.w uses ControlGetPos() for the .w, which returns a DPI adjusted width, which creates the margin, and I think everything else here is dealing in pre-adjusted widths. Not sure how to fix yet... but maybe using this.ctrl.initialwidth, but that screws up other controls without a width that have no fillW.... I'll keep thinking.
Code: Select all
#Include %A_ScriptDir%\..\GridGui.ahk
global_button_width := "100"
; Capn Odin: adding -dpiscale DOES fix the issue, removing it creates the margin. Try with and without.
gui_email_view_%item_id% := new GridGUI("Title", "+dpiscale", true)
lv_list1_%item_id% := new GridGUI.ListviewControl(gui_email_view_%item_id%.hwnd, "AltSubmit", "list1")
lv_list2_%item_id% := new GridGUI.ListviewControl(gui_email_view_%item_id%.hwnd, "AltSubmit", "list2")
lv_list3_%item_id% := new GridGUI.ListviewControl(gui_email_view_%item_id%.hwnd, "AltSubmit", "list3")
text_subject_%item_id% := gui_email_view_%item_id%.Add(1, 1, "Text", , "subject", 1, , 1, false )
text_sender_%item_id% := gui_email_view_%item_id%.Add(1, 2, "Text", , "sender", 1, , 1, false )
text_sent_%item_id% := gui_email_view_%item_id%.Add(1, 3, "Text", , "sent", 1, , 1, false )
edit_msgbody_%item_id% := gui_email_view_%item_id%.Add("1-3", 4, "Edit", , "Edit1", 1, 1, 1, 1)
text_list3_%item_id% := gui_email_view_%item_id%.Add(1, 6, "Text", , "list2", 1, , 1, false)
; Capn Odin: below, using exW and fillH or not using those and leaving width out corrects the margin issue when dpiscale is active.
btn_add_2 := gui_email_view_%item_id%.Add(3, 6, "Button", {text: "Add", options: "w" global_button_width})
;btn_add_2 := gui_email_view_%item_id%.Add(3, 6, "Button", {text: "Add", exW: 1, fillW: 1})
gui_email_view_%item_id%.AddControl("1-3", 7, lv_list3_%item_id% , 1, 1, 1, 1)
text_list1_%item_id% := gui_email_view_%item_id%.Add(4, 1, "Text", , "list1", 1, , 1, false)
btn_add_1 := gui_email_view_%item_id%.Add(6, 1, "Button", {text: "Add", options: "w" global_button_width})
;btn_add_1 := gui_email_view_%item_id%.Add(6, 1, "Button", {text: "Add", exW: 1, fillW: 1})
gui_email_view_%item_id%.AddControl("4-6", "2-4", lv_list1_%item_id% , 1, 1, 1, 1)
text_list2_%item_id% := gui_email_view_%item_id%.Add(4, 6, "Text", , "list2", 1, , 1, false)
btn_add_3 := gui_email_view_%item_id%.Add(6, 6, "Button", {text: "Add", options: "w" global_button_width})
;btn_add_3 := gui_email_view_%item_id%.Add(6, 6, "Button", {text: "Add", exW: 1, fillW: 1})
gui_email_view_%item_id%.AddControl("4-6", 7, lv_list2_%item_id% , 1, 1, 1, 1)
btn_add_1.callback := Func("test_func").Bind(A_Gui, "action")
gui_email_view_%item_id%.Show("w1200 h700 xCenter yCenter")
I think I found the problem, on line 787 of Grid.ahk, inside GetNeededWidth() in the final expression of the ternary sequence, this.cPos.w uses ControlGetPos() for the .w, which returns a DPI adjusted width, which creates the margin, and I think everything else here is dealing in pre-adjusted widths. Not sure how to fix yet... but maybe using this.ctrl.initialwidth, but that screws up other controls without a width that have no fillW.... I'll keep thinking.
Re: GridGUI v1.1.4 - Simplify Control Placement and Resizing
@metacognition
I could dpi deajust it, this should not be too hard to fix.
Edit: I have made a fix but I do not have any way to try it out using a non-standard DPI until Monday.
Edit 2: I was informed how to change the DPI scale in the windows settings by @MiM so it has been tested now.
I could dpi deajust it, this should not be too hard to fix.
Edit: I have made a fix but I do not have any way to try it out using a non-standard DPI until Monday.
Edit 2: I was informed how to change the DPI scale in the windows settings by @MiM so it has been tested now.
Please excuse my spelling I am dyslexic.
- metacognition
- Posts: 117
- Joined: 22 Oct 2014, 05:57
- Location: Alaska
- Contact:
Re: GridGUI v1.1.4 - Simplify Control Placement and Resizing
That dpiscale is a real bugger isn't it. So with your fix it now works correctly with dpi scale on, but with dpi scale off "-dpiscale" in the gui... controls creep out of their grid.
Re: GridGUI v1.1.4 - Simplify Control Placement and Resizing
I see. Makes sense, I will have to get the setting from the GUI then.
Edit: @metacognition you can try it again now
Edit 2: you should also know that currently, it will not handle changes to the DPI after the GUI has been created properly.
Edit: @metacognition you can try it again now
Edit 2: you should also know that currently, it will not handle changes to the DPI after the GUI has been created properly.
Please excuse my spelling I am dyslexic.
- metacognition
- Posts: 117
- Joined: 22 Oct 2014, 05:57
- Location: Alaska
- Contact:
Re: GridGUI v1.1.4 - Simplify Control Placement and Resizing
@Capn Odin That's it. Beautiful.
Re: GridGUI v1.1.5 - Simplify Control Placement and Resizing
Here is a sneak peek at what I am adding next.
Edit: I have added Tabs as well here is a gif showing the example I made.
Edit: I have added Tabs as well here is a gif showing the example I made.
Please excuse my spelling I am dyslexic.
Re: GridGUI v1.1.8 - Simplify Control Placement and Resizing
I guess I forgot to add support for GuiEscape, I never really used it so I am not sure if it is really a useful event to support. If anyone has used it, can you tell me why you used it instead of a conditional hotkey?
Please excuse my spelling I am dyslexic.
Re: GridGUI v1.1.8 - Simplify Control Placement and Resizing
GuiEscape seems more native to me than a shortcut. I don't know the background.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
Hi,
Thank you for your script.
How can I apply below user input codes
viewtopic.php?f=6&t=93513#:~:text=true)-,user%20input,-When
to this https://github.com/CapnOdin/GridGUI/blob/master/Examples/Example%20Tabs.ahk
Thank you.
Thank you for your script.
How can I apply below user input codes
viewtopic.php?f=6&t=93513#:~:text=true)-,user%20input,-When
to this https://github.com/CapnOdin/GridGUI/blob/master/Examples/Example%20Tabs.ahk
Thank you.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
You can retrieve the control added to the tab the same way as in the user input example that you linked.pgeugene wrote: ↑23 Sep 2021, 05:14Hi,
Thank you for your script.
How can I apply below user input codes
viewtopic.php?f=6&t=93513#:~:text=true)-,user%20input,-When
to this https://github.com/CapnOdin/GridGUI/blob/master/Examples/Example%20Tabs.ahk
Thank you.
Code: Select all
bt := tab.tabs[1].Add(1, 1, "Button", args)
bt.callback := Func("ToolTip").Bind("You Pressed the Button")
Code: Select all
#Include <GridGUI>
args := {Options: "w0 h0", exW: 1, exH: 1, fillW: true, fillH: true}
count := 1
myGui := new GridGUI("Tab Example", "resize")
myGui.GuiClose := GridGUI.ExitApp
tab := new GridGUI.TabControl(myGui.hwnd, , "Name 1|Name 2|Name 3|Name 4")
myGui.AddControl(1, 1, tab, args)
bt := tab.tabs[1].Add(1, 1, "Button", args)
bt.callback := Func("ToolTip").Bind("You Pressed the Button " count++)
tab.tabs[2].Add(1, 1, "Button", args).callback := Func("ToolTip").Bind("You Pressed the Button " count++)
tab.tabs[2].Add(2, 2, "Button", args).callback := Func("ToolTip").Bind("You Pressed the Button " count++)
tab.tabs[3].Add(1, 1, "Button", args).callback := Func("ToolTip").Bind("You Pressed the Button " count++)
tab.tabs[3].Add(2, 2, "Button", args).callback := Func("ToolTip").Bind("You Pressed the Button " count++)
tab.tabs[3].Add(3, 3, "Button", args).callback := Func("ToolTip").Bind("You Pressed the Button " count++)
subgrid := new GridGUI.SubGrid(myGui.hwnd, GridGUI.Area(0, 0))
subgrid.Margin(0, 0)
tab.tabs[4].Add(1, 1, "Button", args).callback := Func("ToolTip").Bind("You Pressed the Button " count++)
tab.tabs[4].AddControl(2, 2, subgrid, args)
tab.tabs[4].Add(3, 3, "Button", args).callback := Func("ToolTip").Bind("You Pressed the Button " count++)
loop 10 {
newsubgrid := new GridGUI.SubGrid(myGui.hwnd, GridGUI.Area(0, 0))
newsubgrid.Margin(0, 0)
subgrid.Add(1, 1, "Button", args).callback := Func("ToolTip").Bind("You Pressed the Button " count++)
subgrid.AddControl(2, 2, newsubgrid, args)
subgrid.Add(3, 3, "Button", args).callback := Func("ToolTip").Bind("You Pressed the Button " count++)
subgrid.AutoSize()
subgrid := newsubgrid
}
subgrid.AutoSize()
myGui.AutoSize()
myGui.Show("w300 h300")
myGui.MinSize()
return
ToolTip(text) {
ToolTip, % text
}
Please excuse my spelling I am dyslexic.
-
- Posts: 502
- Joined: 03 Dec 2018, 20:02
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
Hi, it would be cool if you could release a bundled single file library for easier distribution.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
I do not want to maintain multiple release versions of the lib, so I opted to make a small script that you can find in /Examples/Utils/ called To Single File.ahk it generates a file that has all the lib files included.william_ahk wrote: ↑25 Sep 2021, 06:19Hi, it would be cool if you could release a bundled single file library for easier distribution.
Please excuse my spelling I am dyslexic.
-
- Posts: 502
- Joined: 03 Dec 2018, 20:02
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
@Capn Odin Thanks! Great idea.
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: Chunjee and 99 guests