GridGUI v1.1.11 - Simplify Control Placement and Resizing
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
I made a side with documentation for the project it is still in its early stages but you can find it here https://capnodin.github.io/GridGUI/
Please excuse my spelling I am dyslexic.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
Thanks for the site.
This script is very useful.
I try something but can't manage to do it (sorry I am a little slow with this). But i have really tried.
Here are my questions (sorry for all of those) :
Is this the right way to do it?
I don't have my value in the LEnd(). I don't understand why.
How can I close the myGui2 when I click the OK button?
How can I assign the GuiClose when I use the ESC on the gui?
Thank you in advance for the help.
This script is very useful.
I try something but can't manage to do it (sorry I am a little slow with this). But i have really tried.
Code: Select all
#Include %A_ScriptDir%\GridGUI.ahk
myGui := new GridGUI("text", "resize")
myGui.GuiClose := GridGUI.ExitApp
myGui.Color("4389A5")
myGui.Font("bold s13")
myGui.Add(1, 1, "Text", "cWhite", "text", , , , , "C")
myGui.Font("normal s11")
bt := myGui.Add(1, 2, "Button", , "button", exW := 1, exH := 1, fillW := 1, fillH := 0)
bt.callback := Func("bt")
myGui.Add(1, 8, "Text", "cWhite", "", , , , , "C")
btq := myGui.Add(1, 9, "Button", "Default", "Exit", exW := 1, exH := 1, fillW := 1, fillH := 0)
btq.callback := Func("btq")
myGui.AutoSize()
myGui.MinSize()
myGui.Show()
Return
bt()
{
myGui2 := new GridGUI("Date", "resize")
myGui2.Add(1, 1, "Text", "cRed", "Date YYYYMM", , , , , "C")
ed := myGui2.Add(1, 2, "Edit", , , 1, , 1)
btv := myGui2.Add(1, 3, "Button", , "OK", exW := 1, exH := 1, fillW := 1, fillH := 0)
btv.callback := Func("Input").Bind(ed)
myGui2.AutoSize()
myGui2.MinSize()
myGui2.Show()
Return
}
Input(edit)
{
global edit2 := edit.vVar
msgbox % edit2
LEnd()
}
LEnd()
{
msgbox % edit2
}
btq()
{
exitapp
}
Is this the right way to do it?
I don't have my value in the LEnd(). I don't understand why.
How can I close the myGui2 when I click the OK button?
How can I assign the GuiClose when I use the ESC on the gui?
Thank you in advance for the help.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
@ozzii
I tried to keep the changes to a minimum but personally, I would probably not use globals as much as I did here.
Basically, I added the variable as a global in the LEnd function and bound the second GUI as an additional argument to the ok button so that the GUI could be destroyed since the button will make a new one when clicked. Another way to solve the issue with edit2 would be to make it superglobal, that is declare it as global at the top of the script. Currently GuiEscape is not supported but the same functionality can be created using a conditional hotkey.
Edit: Also don't worry about asking questions I am happy to see that someone is using my lib.
I tried to keep the changes to a minimum but personally, I would probably not use globals as much as I did here.
Basically, I added the variable as a global in the LEnd function and bound the second GUI as an additional argument to the ok button so that the GUI could be destroyed since the button will make a new one when clicked. Another way to solve the issue with edit2 would be to make it superglobal, that is declare it as global at the top of the script. Currently GuiEscape is not supported but the same functionality can be created using a conditional hotkey.
Code: Select all
#Include <GridGUI>
myGui := new GridGUI("text", "resize")
myGui.GuiClose := GridGUI.ExitApp
myGui.Color("4389A5")
myGui.Font("bold s13")
myGui.Add(1, 1, "Text", "cWhite", "text", , , , , "C")
myGui.Font("normal s11")
bt := myGui.Add(1, 2, "Button", , "button", exW := 1, exH := 1, fillW := 1, fillH := 0)
bt.callback := Func("bt")
myGui.Add(1, 8, "Text", "cWhite", "", , , , , "C")
btq := myGui.Add(1, 9, "Button", "Default", "Exit", exW := 1, exH := 1, fillW := 1, fillH := 0)
btq.callback := GridGUI.ExitApp
myGui.AutoSize()
myGui.MinSize()
myGui.Show()
Return
#If myGui.WinActive()
Esc::myGui.GuiClose.Call()
#If
bt() {
myGui2 := new GridGUI("Date", "resize")
myGui2.Add(1, 1, "Text", "cRed", "Date YYYYMM", , , , , "C")
ed := myGui2.Add(1, 2, "Edit", , , 1, , 1)
btv := myGui2.Add(1, 3, "Button", , "OK", exW := 1, exH := 1, fillW := 1, fillH := 0)
btv.callback := Func("Input").Bind(myGui2, ed)
myGui2.AutoSize()
myGui2.MinSize()
myGui2.Show()
}
Input(myGui, edit) {
global edit2 := edit.vVar
myGui.Destroy()
msgbox % edit2
LEnd()
}
LEnd() {
global edit2
msgbox % edit2
}
Please excuse my spelling I am dyslexic.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
I will read and digest this tomorrow and try to understand how to use it.
Big thanks for the help.
I will surely ask some more question (but I hope not).
P.S.: in you example, for me the input example didn't work. I have an error
Big thanks for the help.
I will surely ask some more question (but I hope not).
P.S.: in you example, for me the input example didn't work. I have an error
Code: Select all
Error in #include file "GridGUI-master\GridGUI-lib\Controls.ahk":
Target label does not exist.
Specifically: gGuiClose
Line#
150: {
151: Gosub,label
152: }
154: {
155: Return,indent "Hwnd :" this.hwnd "
" indent "Type:
" this.type
156: }
004: {
---> 006: Gui,guiHwnd ":Add",type,"+HwndHwnd " options,text
007: Base.__New(Hwnd, type, options)
008: }
012: {
014: Base.__New(guiHwnd, "ListView", options, text)
015: this.gui := new GridGUI.GUI(, , guiHwnd)
016: }
019: {
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
I try also to digest your tab example but couldn't.
Could you make and example with for example one text line, 3 buttons line and that they are not fill the height of the Gui. But that they have they're normal height.
I try just to change the background/font in the tab but without luck. And even the text is not showed ;(
My brain have difficulties with advanced class/function/uses....
Thank you in advance. And sorry again for the bother
Could you make and example with for example one text line, 3 buttons line and that they are not fill the height of the Gui. But that they have they're normal height.
I try just to change the background/font in the tab but without luck. And even the text is not showed ;(
Code: Select all
tab.tabs[1].Color("4389A5")
tab.tabs[1].Font("bold s13")
tab.tabs[1].Add(1, 1, "Text", "cWhite", "Text", , , , , "C")
tab.tabs[1].Font("normal s11")
Thank you in advance. And sorry again for the bother
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
I have pushed a fix for the error, in regards to the other message I will try to make an example tomorrow, I am writing on the documentation right now.
Please excuse my spelling I am dyslexic.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
Thanks for the input example. I will check this.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
I am not sure if this does what you wanted. The main thing is that the TabControl is not a GUI so you will have to call the GUI commands on the myGui variable. Also it seems that you have to apply the color change before the tab is added to the GUI which happens when it is created.ozzii wrote: ↑30 Sep 2021, 12:58I try also to digest your tab example but couldn't.
Could you make and example with for example one text line, 3 buttons line and that they are not fill the height of the Gui. But that they have they're normal height.
I try just to change the background/font in the tab but without luck. And even the text is not showed ;(
My brain have difficulties with advanced class/function/uses....Code: Select all
tab.tabs[1].Color("4389A5") tab.tabs[1].Font("bold s13") tab.tabs[1].Add(1, 1, "Text", "cWhite", "Text", , , , , "C") tab.tabs[1].Font("normal s11")
Thank you in advance. And sorry again for the bother
Code: Select all
#Include <GridGUI>
myGui := new GridGUI("Tab Example", "resize")
myGui.GuiClose := GridGUI.ExitApp
args := {Options: "w0 h0", exW: 1, exH: 1, fillW: true, fillH: true}
myGui.Color("4389A5")
tab := new GridGUI.TabControl(myGui.hwnd, , "Name 1|Name 2|Name 3|Name 4")
myGui.AddControl(1, 1, tab, args)
myGui.Font("bold s13")
tab.tabs[1].Add(1, 1, "Text", "cWhite", "Text")
myGui.Font("normal s11")
tab.tabs[1].Add(1, 2, "Button", , "Button One")
tab.tabs[1].Add(2, 2, "Button", , "Button Two")
tab.tabs[1].Add(3, 2, "Button", , "Button Tree")
myGui.AutoSize()
myGui.Show("w300 h300")
myGui.MinSize()
return
Please excuse my spelling I am dyslexic.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
One of the usefullst extensions of Autohotkey, Thank you @Capn Odin ! It makes life a little bit easier an dspeeding up working process!
Where can I donate to anything?
Where can I donate to anything?
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
@Ahk_fan You can donate here if you want to paypal.me/CapnOdin
Please excuse my spelling I am dyslexic.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
Thank you @Capn Odin
Thanks for the first explanation, it was really useful, I have managed to do what I want.
And thanks also for this one. I will also try to understand it and adapt to my needs.
Very useful script. The GUI in AHK is not the easiest thing. This help a lot (at least for me).
Thanks for the first explanation, it was really useful, I have managed to do what I want.
And thanks also for this one. I will also try to understand it and adapt to my needs.
Very useful script. The GUI in AHK is not the easiest thing. This help a lot (at least for me).
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
Instead of having several callback for each button
Is there any way to call the same Func and do a Switch depending of the used button?
The same question differently : How can I catch and test the value of the clicked button?
Code: Select all
1C:= myGui.Add(1, 2, "Button", , "1C", exW := 1, exH := 1, fillW := 1, fillH := 0)
1C.callback := Func("1C")
1CO := myGui.Add(2, 2, "Button", , "1CO (Omega)", exW := 1, exH := 1, fillW := 1, fillH := 0)
1CO.callback := Func("1CO")
1J := myGui.Add(1, 3, "Button", , "1J", exW := 1, exH := 1, fillW := 1, fillH := 0)
1J.callback := Func("1J")
The same question differently : How can I catch and test the value of the clicked button?
Code: Select all
1C:= myGui.Add(1, 2, "Button", , "1C", exW := 1, exH := 1, fillW := 1, fillH := 0)
1C.callback := Func("FuncNext")
1CO := myGui.Add(2, 2, "Button", , "1CO (Omega)", exW := 1, exH := 1, fillW := 1, fillH := 0)
1CO.callback := Func("FuncNext")
1J := myGui.Add(1, 3, "Button", , "1J", exW := 1, exH := 1, fillW := 1, fillH := 0)
1J.callback := Func("FuncNext")
FuncNext(){
switch ?????
{
case "1C":
MsgBox
return
case "1CO":
MsgBox
return
case "1J":
MsgBox
return
}
}
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
I think I found (even if I don't understand the way it works) with this 1C.callback := Func("FuncNext").Bind(1C) instead of 1C.callback := Func("1C")
Just tell me if it's the 'right' way to do it.
Just tell me if it's the 'right' way to do it.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
Yes, using Func(funName).Bind(args) is the way I intended to allow for using the same function for callbacks.
Please excuse my spelling I am dyslexic.
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
Thanks you for the feedback.
Now I can continue
Now I can continue
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
One more question.. Sorry ...
Is there any way/possibility to have a tooltip (different for each button) when a button is hovered?
If it's easier to do that I can put the Gui not resizable.
Because I need to put some information and put them in the button is not the best way (too messy/crowded/unreadable after that).
Regarding the previously .Bind
Instead of the label of the button (vvar) how can I test the 'id/name' of the button?
Here 1C and 1CO:
instead of 1C and "1CO (Omega)"
I have tested with bt.callback but no luck.
In general, it's easier for my case to test the id/name of the button than his value
Is there any way/possibility to have a tooltip (different for each button) when a button is hovered?
If it's easier to do that I can put the Gui not resizable.
Because I need to put some information and put them in the button is not the best way (too messy/crowded/unreadable after that).
Regarding the previously .Bind
Instead of the label of the button (vvar) how can I test the 'id/name' of the button?
Here 1C and 1CO:
Code: Select all
1C:= myGui.Add(1, 2, "Button", , "1C", exW := 1, exH := 1, fillW := 1, fillH := 0)
1C.callback := Func("FuncNext").Bind(1C)
1CO := myGui.Add(2, 2, "Button", , "1CO (Omega)", exW := 1, exH := 1, fillW := 1, fillH := 0)
1CO.callback := Func("FuncNext").Bind(1CO)
I have tested with bt.callback but no luck.
In general, it's easier for my case to test the id/name of the button than his value
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
@Capn Odin
Can I sent to you a PM?
I have something with an GUI but I don't really want to spam this post with my personal needs.
Or you prefer here?
Can I sent to you a PM?
I have something with an GUI but I don't really want to spam this post with my personal needs.
Or you prefer here?
Re: GridGUI v1.1.9 - Simplify Control Placement and Resizing
I have looked at how to add tooltips to the control, I may implement a build-in way to do it in the future but right now I suggest using another lib to handle the tooltips, like GuiControlTips - Tooltips for GUI controls. Here is an example using that lib, which adds tooltips to the buttons in one of my libs examples.ozzii wrote: ↑07 Oct 2021, 02:56One more question.. Sorry ...
Is there any way/possibility to have a tooltip (different for each button) when a button is hovered?
If it's easier to do that I can put the Gui not resizable.
Because I need to put some information and put them in the button is not the best way (too messy/crowded/unreadable after that).
Regarding the previously .Bind
Instead of the label of the button (vvar) how can I test the 'id/name' of the button?
Here 1C and 1CO:instead of 1C and "1CO (Omega)"Code: Select all
1C:= myGui.Add(1, 2, "Button", , "1C", exW := 1, exH := 1, fillW := 1, fillH := 0) 1C.callback := Func("FuncNext").Bind(1C) 1CO := myGui.Add(2, 2, "Button", , "1CO (Omega)", exW := 1, exH := 1, fillW := 1, fillH := 0) 1CO.callback := Func("FuncNext").Bind(1CO)
I have tested with bt.callback but no luck.
In general, it's easier for my case to test the id/name of the button than his value
Code: Select all
#Include <GridGUI>
myGui := new GridGUI("Grid Test", "resize")
TT := New GuiControlTips(myGui.hwnd)
myGui.GuiClose := GridGUI.ExitApp
ctrl1 := myGui.Add("1-3", 1, "Edit", , , 1, , 1)
ctrl2 := myGui.Add(1, 2, "Button", , "Button")
ctrl3 := myGui.Add(2, 2, "Edit", "w0", , 1, , 1)
ctrl4 := myGui.Add(3, "2-3", "ActiveX", "w113 h43", "shell explorer")
oWB := ctrl4.vVar
oWB.Navigate("about:<!DOCTYPE HTML><html><body style=""{margin:0;}""><img src=""https://i.imgur.com/FlGrIY3.gif""></body></html>")
oWB.document.body.style.overflow := "hidden"
ctrl5 := myGui.Add(1, 3, "Button", , "Button")
ctrl6 := myGui.Add(2, 3, "Button", , "Button Button")
ctrl7 := myGui.Add("1-3", 4, "Button", , "Button", 1, , 1)
TT.SetDelayTimes(1000, 2000, -1)
; Attach the controls
TT.Attach(ctrl1.hwnd, "Text control's centered Tooltip!", True)
TT.Attach(ctrl2.hwnd, "Edit control's Tooltip!")
TT.Attach(ctrl3.hwnd, "DDL control's Tooltip!")
TT.Attach(ctrl4.hwnd, "DDL control's Tooltip!")
TT.Attach(ctrl5.hwnd, "Edit control's Tooltip!")
TT.Attach(ctrl6.hwnd, "DDL control's Tooltip!")
TT.Attach(ctrl7.hwnd, "DDL control's Tooltip!")
myGui.AutoSize()
myGui.MinSize()
myGui.Show()
return
; ======================================================================================================================
; Namespace: GuiControlTips
; AHK version: AHK 1.1.14.03
; Function: Helper object to simply assign ToolTips for GUI controls
; Tested on: Win 7 (x64)
; Change history:
; 1.1.00.01/2020-06-03/just me - fixed missing Static WS_EX_TOPMOST
; 1.1.00.00/2014-03-06/just me - Added SetDelayTimes()
; 1.0.01.00/2012-07-29/just me
; ======================================================================================================================
; CLASS GuiControlTips
;
; The class provides four public methods to register (Attach), unregister (Detach), update (Update), and
; disable/enable (Suspend) common ToolTips for GUI controls.
;
; Usage:
; To assign ToolTips to GUI controls you have to create a new instance of GuiControlTips per GUI with
; MyToolTipObject := New GuiControlTips(HGUI)
; passing the HWND of the GUI.
;
; After this you may assign ToolTips to your GUI controls by calling
; MyToolTipObject.Attach(HCTRL, "ToolTip text")
; passing the HWND of the control and the ToolTip's text. Pass True/1 for the optional third parameter if you
; want the ToolTip to be shown centered below the control.
;
; To remove a ToolTip call
; MyToolTipObject.Detach(HCTRL)
; passing the HWND of the control.
;
; To update the ToolTip's text call
; MyToolTipObject.Update(HCTRL, "New text!")
; passing the HWND of the control and the new text.
;
; To deactivate the ToolTips call
; MyToolTipObject.Suspend(True),
; to activate them again afterwards call
; MyToolTipObject.Suspend(False).
;
; To adjust the ToolTips delay times call
; MyToolTipObject.SetDelayTimesd(),
; specifying the delay times in milliseconds.
;
; That's all you can / have to do!
; ======================================================================================================================
Class GuiControlTips {
; ===================================================================================================================
; INSTANCE variables
; ===================================================================================================================
HTIP := 0
HGUI := 0
CTRL := {}
; ===================================================================================================================
; CONSTRUCTOR __New()
; ===================================================================================================================
__New(HGUI) {
Static CLASS_TOOLTIP := "tooltips_class32"
Static CW_USEDEFAULT := 0x80000000
Static TTM_SETMAXTIPWIDTH := 0x0418
Static TTM_SETMARGIN := 0x041A
Static WS_EX_TOPMOST := 0x00000008
Static WS_STYLES := 0x80000002 ; WS_POPUP | TTS_NOPREFIX
; Create a Tooltip control ...
HTIP := DllCall("User32.dll\CreateWindowEx", "UInt", WS_EX_TOPMOST, "Str", CLASS_TOOLTIP, "Ptr", 0
, "UInt", WS_STYLES
, "Int", CW_USEDEFAULT, "Int", CW_USEDEFAULT, "Int", CW_USEDEFAULT, "Int", CW_USEDEFAULT
, "Ptr", HGUI, "Ptr", 0, "Ptr", 0, "Ptr", 0, "Ptr")
If ((ErrorLevel) || !(HTIP))
Return False
; ... prepare it to display multiple lines if required
DllCall("User32.dll\SendMessage", "Ptr", HTIP, "Int", TTM_SETMAXTIPWIDTH, "Ptr", 0, "Ptr", 0)
; ... set the instance variables
This.HTIP := HTIP
This.HGUI := HGUI
If (DllCall("Kernel32.dll\GetVersion", "UInt") & 0xFF) < 6 ; to avoid some XP issues ...
This.Attach(HGUI, "") ; ... register the GUI with an empty tiptext
}
; ===================================================================================================================
; DESTRUCTOR __Delete()
; ===================================================================================================================
__Delete() {
If (This.HTIP) {
DllCall("User32.dll\DestroyWindow", "Ptr", This.HTIP)
}
}
; ===================================================================================================================
; PRIVATE METHOD SetToolInfo - Create and fill a TOOLINFO structure
; ===================================================================================================================
SetToolInfo(ByRef TOOLINFO, HCTRL, TipTextAddr, CenterTip = 0) {
Static TTF_IDISHWND := 0x0001
Static TTF_CENTERTIP := 0x0002
Static TTF_SUBCLASS := 0x0010
Static OffsetSize := 0
Static OffsetFlags := 4
Static OffsetHwnd := 8
Static OffsetID := OffsetHwnd + A_PtrSize
Static OffsetRect := OffsetID + A_PtrSize
Static OffsetInst := OffsetRect + 16
Static OffsetText := OffsetInst + A_PtrSize
Static StructSize := (4 * 6) + (A_PtrSize * 6)
Flags := TTF_IDISHWND | TTF_SUBCLASS
If (CenterTip)
Flags |= TTF_CENTERTIP
VarSetCapacity(TOOLINFO, StructSize, 0)
NumPut(StructSize, TOOLINFO, OffsetSize, "UInt")
NumPut(Flags, TOOLINFO, OffsetFlags, "UInt")
NumPut(This.HGUI, TOOLINFO, OffsetHwnd, "Ptr")
NumPut(HCTRL, TOOLINFO, OffsetID, "Ptr")
NumPut(TipTextAddr, TOOLINFO, OffsetText, "Ptr")
Return True
}
; ===================================================================================================================
; PUBLIC METHOD Attach - Assign a ToolTip to a certain control
; Parameters: HWND - Control's HWND
; TipText - ToolTip's text
; Optional: ------------------------------------------------------------------------------
; CenterTip - Centers the tooltip window below the control
; Values: True/False
; Default: False
; Return values: On success: True
; On failure: False
; ===================================================================================================================
Attach(HCTRL, TipText, CenterTip = False) {
Static TTM_ADDTOOL := A_IsUnicode ? 0x0432 : 0x0404 ; TTM_ADDTOOLW : TTM_ADDTOOLA
If !(This.HTIP) {
Return False
}
If This.CTRL.HasKey(HCTRL)
Return False
TOOLINFO := ""
This.SetToolInfo(TOOLINFO, HCTRL, &TipText, CenterTip)
If DllCall("User32.dll\SendMessage", "Ptr", This.HTIP, "Int", TTM_ADDTOOL, "Ptr", 0, "Ptr", &TOOLINFO) {
This.CTRL[HCTRL] := 1
Return True
} Else {
Return False
}
}
; ===================================================================================================================
; PUBLIC METHOD Detach - Remove the ToolTip for a certain control
; Parameters: HWND - Control's HWND
; Return values: On success: True
; On failure: False
; ===================================================================================================================
Detach(HCTRL) {
Static TTM_DELTOOL := A_IsUnicode ? 0x0433 : 0x0405 ; TTM_DELTOOLW : TTM_DELTOOLA
If !This.CTRL.HasKey(HCTRL)
Return False
TOOLINFO := ""
This.SetToolInfo(TOOLINFO, HCTRL, 0)
DllCall("User32.dll\SendMessage", "Ptr", This.HTIP, "Int", TTM_DELTOOL, "Ptr", 0, "Ptr", &TOOLINFO)
This.CTRL.Remove(HCTRL, "")
Return True
}
; ===================================================================================================================
; PUBLIC METHOD Update - Update the ToolTip's text for a certain control
; Parameters: HWND - Control's HWND
; TipText - New text
; Return values: On success: True
; On failure: False
; ===================================================================================================================
Update(HCTRL, TipText) {
Static TTM_UPDATETIPTEXT := A_IsUnicode ? 0x0439 : 0x040C ; TTM_UPDATETIPTEXTW : TTM_UPDATETIPTEXTA
If !This.CTRL.HasKey(HCTRL)
Return False
TOOLINFO := ""
This.SetToolInfo(TOOLINFO, HCTRL, &TipText)
DllCall("SendMessage", "Ptr", This.HTIP, "Int", TTM_UPDATETIPTEXT, "Ptr", 0, "Ptr", &TOOLINFO)
Return True
}
; ===================================================================================================================
; PUBLIC METHOD Suspend - Disable/enable the ToolTip control (don't show / show ToolTips)
; Parameters: Mode - True/False (1/0)
; Default: True/1
; Return values: On success: True
; On failure: False
; Remarks: ToolTips are enabled automatically on creation.
; ===================================================================================================================
Suspend(Mode = True) {
Static TTM_ACTIVATE := 0x0401
If !(This.HTIP)
Return False
DllCall("SendMessage", "Ptr", This.HTIP, "Int", TTM_ACTIVATE, "Ptr", !Mode, "Ptr", 0)
Return True
}
; ===================================================================================================================
; PUBLIC METHOD SetDelayTimes - Set the initial, pop-up, and reshow durations for a tooltip control.
; Parameters: Init - Amount of time, in milliseconds, a pointer must remain stationary within
; a tool's bounding rectangle before the tooltip window appears.
; Default: -1 (system default time)
; PopUp - Amount of time, in milliseconds, a tooltip window remains visible if the
; pointer is stationary within a tool's bounding rectangle.
; Default: -1 (system default time)
; ReShow - Amount of time, in milliseconds, it takes for subsequent tooltip windows
; to appear as the pointer moves from one tool to another.
; Default: -1 (system default time)
; Return values: On success: True
; On failure: False
; Remarks: Times are set per ToolTip control and applied to all added tools.
; ===================================================================================================================
SetDelayTimes(Init = -1, PopUp = -1, ReShow = -1) {
Static TTM_SETDELAYTIME := 0x0403
Static TTDT_RESHOW := 1
Static TTDT_AUTOPOP := 2
Static TTDT_INITIAL := 3
DllCall("SendMessage", "Ptr", This.HTIP, "Int", TTM_SETDELAYTIME, "Ptr", TTDT_INITIAL, "Ptr", Init)
DllCall("SendMessage", "Ptr", This.HTIP, "Int", TTM_SETDELAYTIME, "Ptr", TTDT_AUTOPOP, "Ptr", PopUp)
DllCall("SendMessage", "Ptr", This.HTIP, "Int", TTM_SETDELAYTIME, "Ptr", TTDT_RESHOW , "Ptr", ReShow)
}
}
If it is about this lib then it is fine to talk about it here if it about something else then you can send a pm.ozzii wrote: @Capn Odin
Can I sent to you a PM?
I have something with an GUI but I don't really want to spam this post with my personal needs.
Or you prefer here?
Please excuse my spelling I am dyslexic.
Re: GridGUI v1.1.10 - Simplify Control Placement and Resizing
Thank you for the explanation for the tooltip and the example. I will look into this on Monday.
And yes, I think that a build-in could be really great.
But it's up to you if you have time for this.
For the second part, yes, it's about the lib.
I will post it also on Monday (on my work computer).
Regards and again thank you for this lib.
And yes, I think that a build-in could be really great.
But it's up to you if you have time for this.
For the second part, yes, it's about the lib.
I will post it also on Monday (on my work computer).
Regards and again thank you for this lib.
Re: GridGUI v1.1.10 - Simplify Control Placement and Resizing
The 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 this
The win is cropped on the right
But when I change Demandes DSN/HR with Demandes DSN it's OK.
Am I doing something wrong ?
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 this
Code: 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 ?
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 69 guests