[ Class + ( Editor Tool ) ] Custom Gui Image Button
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
Wow, that a wonderful tool, thank you He llbent
-
- Posts: 6
- Joined: 13 Feb 2019, 18:07
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
Dear Hellbent(CivReborn)
I love all your tutorials on GUIs and all the other ones for Autohotkey. I think you are a genius at best. Love the
collaboration with Joe Glines as I watch all these tutorials as well. and they are jam packed with invaluable information
for us wanting to take our computer experience to the next level.
I have downloaded almost all of your work and have learned so much, but I am writing this message just to ask you
for some help regarding this new editor you have made which looks incredible. (Dark green, HB logo in the middle)!!!1
I copied all of the code but when it runs, it runs in the taskbar and I don't see the editor. I don't get any errors
because I am using the GDIP library within the same script (towards the bottom of the file).
Should I keep these separate and use an include statement at the beginning instead?
Any help regarding use of the new editor will be greatly appreciated as this looks like an awesome tool.
Thanks for all of your help,
Dwight
I love all your tutorials on GUIs and all the other ones for Autohotkey. I think you are a genius at best. Love the
collaboration with Joe Glines as I watch all these tutorials as well. and they are jam packed with invaluable information
for us wanting to take our computer experience to the next level.
I have downloaded almost all of your work and have learned so much, but I am writing this message just to ask you
for some help regarding this new editor you have made which looks incredible. (Dark green, HB logo in the middle)!!!1
I copied all of the code but when it runs, it runs in the taskbar and I don't see the editor. I don't get any errors
because I am using the GDIP library within the same script (towards the bottom of the file).
Should I keep these separate and use an include statement at the beginning instead?
Any help regarding use of the new editor will be greatly appreciated as this looks like an awesome tool.
Thanks for all of your help,
Dwight
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
I agree. Genius.
-
- Posts: 6
- Joined: 13 Feb 2019, 18:07
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
To any of you who have the editor working:
I believe that the code in the Editor box is the same as the button class box, which leads me
to believe that this might be the reason why the code I copied and pasted (from the Editor's box "show" button)
is not working - because it is the same as the code from the Button Class in the beginning of this thread.
Anyone with the actual Editor code please post or show me what I need to do.
Thank you.
Dwight
I believe that the code in the Editor box is the same as the button class box, which leads me
to believe that this might be the reason why the code I copied and pasted (from the Editor's box "show" button)
is not working - because it is the same as the code from the Button Class in the beginning of this thread.
Anyone with the actual Editor code please post or show me what I need to do.
Thank you.
Dwight
-
- Posts: 6
- Joined: 13 Feb 2019, 18:07
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
To AutoHotKey Forum Staff:
I checked again and I see that the Editor's CODE is the same as the Button Class CODE.
For whatever reason, this was either changed by someone or the error was unintentional.
Please fix as this would probably solve many issues regarding other users wanting to use this
amazing tool,.
Thank you
Dwight
I checked again and I see that the Editor's CODE is the same as the Button Class CODE.
For whatever reason, this was either changed by someone or the error was unintentional.
Please fix as this would probably solve many issues regarding other users wanting to use this
amazing tool,.
Thank you
Dwight
-
- Posts: 6
- Joined: 13 Feb 2019, 18:07
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
To all in the AutoHotKey forum:
re: Update to Button Class and Editor box "same code" issue.
I was able to navigate to Joe Glines' Automator website and on the introduction Joe
has provided links to the files he downloaded or copied as a zip file.
I was able to download the zip file and lo and behold, the Editor.ahk file was 113 thousand
bytes as opposed to the one that is on the Pastebin website which is far less in size simply
because it is the button class CODE NOT the Editor CODE.
Pastebin should fix this. But at least for those who might run into this same problem,
navigate over to Joe's Automator page:
https://www.the-automator.com/hellbent-button-theme-creator-class/
... and here you will see a link that says "tutorials here" which should allow you to download
the zip files with the proper CODE for the Editor.
I am now running the Editor with no problems whatsoever. This indeed is an awesome tool.
Thanks Hellbent for your awesomeness and love for Autohotkey, it certainly rubs off on
all of us. Genius, dude, Genius!
Shout out to Joe (my other AutoHotKey mentor) for being so thorough in what he does.
Certainly a top of the line professional in his field.
Dwight
re: Update to Button Class and Editor box "same code" issue.
I was able to navigate to Joe Glines' Automator website and on the introduction Joe
has provided links to the files he downloaded or copied as a zip file.
I was able to download the zip file and lo and behold, the Editor.ahk file was 113 thousand
bytes as opposed to the one that is on the Pastebin website which is far less in size simply
because it is the button class CODE NOT the Editor CODE.
Pastebin should fix this. But at least for those who might run into this same problem,
navigate over to Joe's Automator page:
https://www.the-automator.com/hellbent-button-theme-creator-class/
... and here you will see a link that says "tutorials here" which should allow you to download
the zip files with the proper CODE for the Editor.
I am now running the Editor with no problems whatsoever. This indeed is an awesome tool.
Thanks Hellbent for your awesomeness and love for Autohotkey, it certainly rubs off on
all of us. Genius, dude, Genius!
Shout out to Joe (my other AutoHotKey mentor) for being so thorough in what he does.
Certainly a top of the line professional in his field.
Dwight
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
Hi dideautomatedideautomate wrote: ↑25 Oct 2021, 17:59To AutoHotKey Forum Staff:
I checked again and I see that the Editor's CODE is the same as the Button Class CODE.
For whatever reason, this was either changed by someone or the error was unintentional.
Please fix as this would probably solve many issues regarding other users wanting to use this
amazing tool,.
Thank you
Dwight
The editor is a separate script to the button class and needs to be in it's own script to work correctly. The editor borrows some of the basic function of the button class in order for there to be a functioning example of the button. If you try to combine the editor and the button class in the same script you will get errors because they will have functions with the same names.
Keep the editor on its own. The button class can be used in another script though.
-
- Posts: 6
- Joined: 13 Feb 2019, 18:07
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
After further review, I found that the CODE provided by "jly" that changes the theme
of the Editor to "white" is indeed the CODE for the Editor (Button Maker v1.01).
The CODE underneath the screen capture of the Dark themed editor is still showing
the same CODE for the Button class (Gen 3 button class) and as a result does NOT work
to load the Editor.
Originally I had downloaded (copied and pasted) the CODE by itself (like the instructions
say to do) but since this is the same button class code (from the first CODE box) it does
not bring up the Editor, it is the button class CODE. (Gen 3).
I was able to get the original Editor CODE from Joe Gline's Automator website where he
provides all the files in a zip file. I immediately saw the difference in the file size of the
Editor as opposed to the button class confirming that Joe's files had the correct CODE for
the Editor.
Again, pastebin should find a way to rectify this for other users who will certainly be
left in the dark when they download this CODE and find that it does not work.
The link to Joe's website to download the zip file is:
https://www.the-automator.com/hellbent-button-theme-creator-class/
Towards the end of the first paragraph, there is a link called "tutorial here" -
where one can download the zip file with the correct Editor CODE mentioned above
and incorrect on the Pastebin page.
D
of the Editor to "white" is indeed the CODE for the Editor (Button Maker v1.01).
The CODE underneath the screen capture of the Dark themed editor is still showing
the same CODE for the Button class (Gen 3 button class) and as a result does NOT work
to load the Editor.
Originally I had downloaded (copied and pasted) the CODE by itself (like the instructions
say to do) but since this is the same button class code (from the first CODE box) it does
not bring up the Editor, it is the button class CODE. (Gen 3).
I was able to get the original Editor CODE from Joe Gline's Automator website where he
provides all the files in a zip file. I immediately saw the difference in the file size of the
Editor as opposed to the button class confirming that Joe's files had the correct CODE for
the Editor.
Again, pastebin should find a way to rectify this for other users who will certainly be
left in the dark when they download this CODE and find that it does not work.
The link to Joe's website to download the zip file is:
https://www.the-automator.com/hellbent-button-theme-creator-class/
Towards the end of the first paragraph, there is a link called "tutorial here" -
where one can download the zip file with the correct Editor CODE mentioned above
and incorrect on the Pastebin page.
D
-
- Posts: 6
- Joined: 13 Feb 2019, 18:07
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
Dear Hellbent:
I totally agree with what you mentioned regarding the CODE and keeping the script by itself.
The CODE however, underneath the Editor screen shot when one clicks on the SHOW button still
comes up with the same Button Class CODE from the first CODE box and is NOT the CODE for the
Editor itself.
It seems that at one time, this might have been working and the original CODE you pasted was
there but for whatever reason, now it is showing a duplicate of the Button class CODE and not
the Editor CODE and as a result will not work to load the Button Maker v1.01.
Nonetheless, I was able to get these files from Joe's website and am running the tool with no
problem whatsoever.
Lastly, I cannot say enough about your tutorials and teaching regarding Autohotkey and your
series on GUIs.
Thank you for all your expertise and tutorials.
Dwight
I totally agree with what you mentioned regarding the CODE and keeping the script by itself.
The CODE however, underneath the Editor screen shot when one clicks on the SHOW button still
comes up with the same Button Class CODE from the first CODE box and is NOT the CODE for the
Editor itself.
It seems that at one time, this might have been working and the original CODE you pasted was
there but for whatever reason, now it is showing a duplicate of the Button class CODE and not
the Editor CODE and as a result will not work to load the Button Maker v1.01.
Nonetheless, I was able to get these files from Joe's website and am running the tool with no
problem whatsoever.
Lastly, I cannot say enough about your tutorials and teaching regarding Autohotkey and your
series on GUIs.
Thank you for all your expertise and tutorials.
Dwight
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
@dideautomate Thank you. I must have changed the wrong thing the last time I did a edit.
The editor is back up again.
The editor is back up again.
- PENchanter
- Posts: 10
- Joined: 06 Sep 2021, 16:13
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
I got a new computer a few weeks ago which now gives me the option to use other DPI Scaling values.
With that I am finally able to play around with DPIScale
I took the code that is at the very end of the first post
i.e.
and edited it to use your screen dpi.
I also added in a few default gui controls to create a more functional example.
Tested at 100%, 150%, 200% and 300% DPI Scaling. ( not that it should matter, Tested on windows 10 )
.
100% DPI
. .
300% DPI
. .
Look away. You aren't going to want to see what I did to your buddy "Brush".
With that I am finally able to play around with DPIScale
I took the code that is at the very end of the first post
i.e.
Code: Select all
;***************************************************************************************************
#Include <My Altered Gdip Lib> ; <----------- GDIP LIB
#Include <Gen 3 Buttons> ; <---------- HButton class
;***************************************************************************************************
#SingleInstance, Force
Gdip_Startup()
Theme1 := HBCustomButton()
GuiButtonType1.SetSessionDefaults( Theme1.All , Theme1.Default , Theme1.Hover , Theme1.Pressed )
MyFirstButton := New HButton( { Owner: 1 , X: 10 , Y: 10 , W: 100 , H: 35 , Text: "OK" , Label: "TestFunction" } , { BackgroundColor: "0xFFF0F0F0" } )
Gui, 1:Show
return
GuiClose:
ExitApp
TestFunction(){
ToolTip, In the test function
SoundBeep, 500
}
HBCustomButton(){
local MyButtonDesign := {}
MyButtonDesign.All := {}
MyButtonDesign.Default := {}
MyButtonDesign.Hover := {}
MyButtonDesign.Pressed := {}
;********************************
;All
MyButtonDesign.All.W := 200 , MyButtonDesign.All.H := 65 , MyButtonDesign.All.Text := " Button " , MyButtonDesign.All.BackgroundColor := "0xFF22262A"
;********************************
;Default
MyButtonDesign.Default.W := 200 , MyButtonDesign.Default.H := 65 , MyButtonDesign.Default.Text := "Button" , MyButtonDesign.Default.Font := "Arial" , MyButtonDesign.Default.FontOptions := " Bold Center vCenter " , MyButtonDesign.Default.FontSize := "12" , MyButtonDesign.Default.H := "0x0002112F" , MyButtonDesign.Default.TextBottomColor2 := "0x0002112F" , MyButtonDesign.Default.TextTopColor1 := "0xFFFFFFFF" , MyButtonDesign.Default.TextTopColor2 := "0xFFFFFFFF" , MyButtonDesign.Default.TextOffsetX := "0" , MyButtonDesign.Default.TextOffsetY := "0" , MyButtonDesign.Default.TextOffsetW := "0" , MyButtonDesign.Default.TextOffsetH := "0" , MyButtonDesign.Default.BackgroundColor := "0xFF22262A" , MyButtonDesign.Default.ButtonOuterBorderColor := "0xFF161B1F" , MyButtonDesign.Default.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Default.ButtonInnerBorderColor1 := "0xFF3F444A" , MyButtonDesign.Default.ButtonInnerBorderColor2 := "0xFF24292D" , MyButtonDesign.Default.ButtonMainColor1 := "0xFF272C32" , MyButtonDesign.Default.ButtonMainColor2 := "0xFF272C32" , MyButtonDesign.Default.ButtonAddGlossy := "1" , MyButtonDesign.Default.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Default.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Default.GlossBottomColor := "33000000"
;********************************
;Hover
MyButtonDesign.Hover.W := 200 , MyButtonDesign.Hover.H := 65 , MyButtonDesign.Hover.Text := "Button" , MyButtonDesign.Hover.Font := "Arial" , MyButtonDesign.Hover.FontOptions := " Bold Center vCenter " , MyButtonDesign.Hover.FontSize := "12" , MyButtonDesign.Hover.H := "0x0002112F" , MyButtonDesign.Hover.TextBottomColor2 := "0x0002112F" , MyButtonDesign.Hover.TextTopColor1 := "0xFFFFFFFF" , MyButtonDesign.Hover.TextTopColor2 := "0xFFFFFFFF" , MyButtonDesign.Hover.TextOffsetX := "0" , MyButtonDesign.Hover.TextOffsetY := "0" , MyButtonDesign.Hover.TextOffsetW := "0" , MyButtonDesign.Hover.TextOffsetH := "0" , MyButtonDesign.Hover.BackgroundColor := "0xFF22262A" , MyButtonDesign.Hover.ButtonOuterBorderColor := "0xFF161B1F" , MyButtonDesign.Hover.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Hover.ButtonInnerBorderColor1 := "0xFF3F444A" , MyButtonDesign.Hover.ButtonInnerBorderColor2 := "0xFF24292D" , MyButtonDesign.Hover.ButtonMainColor1 := "0xFF122BE6" , MyButtonDesign.Hover.ButtonMainColor2 := "0xFF0006EE" , MyButtonDesign.Hover.ButtonAddGlossy := "1" , MyButtonDesign.Hover.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Hover.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Hover.GlossBottomColor := "33000000"
;********************************
;Pressed
MyButtonDesign.Pressed.W := 200 , MyButtonDesign.Pressed.H := 65 , MyButtonDesign.Pressed.Text := "Button" , MyButtonDesign.Pressed.Font := "Arial" , MyButtonDesign.Pressed.FontOptions := " Bold Center vCenter " , MyButtonDesign.Pressed.FontSize := "12" , MyButtonDesign.Pressed.H := "0x0002112F" , MyButtonDesign.Pressed.TextBottomColor2 := "0x0002112F" , MyButtonDesign.Pressed.TextTopColor1 := "0xFFFFFFFF" , MyButtonDesign.Pressed.TextTopColor2 := "0xFFFFFFFF" , MyButtonDesign.Pressed.TextOffsetX := "0" , MyButtonDesign.Pressed.TextOffsetY := "0" , MyButtonDesign.Pressed.TextOffsetW := "0" , MyButtonDesign.Pressed.TextOffsetH := "0" , MyButtonDesign.Pressed.BackgroundColor := "0xFF22262A" , MyButtonDesign.Pressed.ButtonOuterBorderColor := "0xFF62666a" , MyButtonDesign.Pressed.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Pressed.ButtonInnerBorderColor1 := "0xFF151A20" , MyButtonDesign.Pressed.ButtonInnerBorderColor2 := "0xFF151A20" , MyButtonDesign.Pressed.ButtonMainColor1 := "0xFF12161a" , MyButtonDesign.Pressed.ButtonMainColor2 := "0xFF33383E" , MyButtonDesign.Pressed.ButtonAddGlossy := "0" , MyButtonDesign.Pressed.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Pressed.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Pressed.GlossBottomColor := "33000000"
;********************************
return MyButtonDesign
}
I also added in a few default gui controls to create a more functional example.
Tested at 100%, 150%, 200% and 300% DPI Scaling. ( not that it should matter, Tested on windows 10 )
Code: Select all
;***************************************************************************************************
#Include <My Altered Gdip Lib> ; <----------- GDIP LIB
#Include <Gen 3 Buttons> ; <---------- HButton class
;***************************************************************************************************
#SingleInstance, Force
Gdip_Startup()
;***************************************************
Theme1 := HBCustomButton()
GuiButtonType1.SetSessionDefaults( Theme1.All , Theme1.Default , Theme1.Hover , Theme1.Pressed )
;***************************************************
Gui, 1:+AlwaysOnTop
Gui, 1:Font, s12 , Arial
Gui, 1:Margin, % m := 10 , 10
Gui, 1:Add, ListBox, xm ym w320 r10, Item 1||Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|
;***************************************************
Gui, 1:-DPIScale
Button1 := New HButton( { Owner: 1 , X: ( (A_ScreenDPI / 96 ) * m ) , Y: "+" ( (A_ScreenDPI / 96 ) * m ) , W: ( (A_ScreenDPI / 96 ) * 100 ) , H: ( (A_ScreenDPI / 96 ) * 35 ) , Text: "OK" , Label: "TestFunction" } , { BackgroundColor: "0xFFF0F0F0" , FontSize: ( 12 * ( A_ScreenDPI / 96 ) ) } )
Button2 := New HButton( { Owner: 1 , X: "+" ( (A_ScreenDPI / 96 ) * m ) , Y: "p" , W: ( (A_ScreenDPI / 96 ) * 100 ) , H: ( (A_ScreenDPI / 96 ) * 35 ) , Text: "OK" , Label: "TestFunction" } , { BackgroundColor: "0xFFF0F0F0" , FontSize: ( 12 * ( A_ScreenDPI / 96 ) ) } )
Button3 := New HButton( { Owner: 1 , X: "+" ( (A_ScreenDPI / 96 ) * m ) , Y: "p" , W: ( (A_ScreenDPI / 96 ) * 100 ) , H: ( (A_ScreenDPI / 96 ) * 35 ) , Text: "OK" , Label: "TestFunction" } , { BackgroundColor: "0xFFF0F0F0" , FontSize: ( 12 * ( A_ScreenDPI / 96 ) ) } )
Gui, 1:+DPIScale
;***************************************************
Gui, 1:Add, Checkbox, xm y+10 , Checkbox
Gui, 1:Add, Button, x+10 yp , Button
Gui, 1:Add, DDL, xm w320 r10, Item 1||Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|
;***************************************************
Gui, 1:-DPIScale
Button4 := New HButton( { Owner: 1 , X: ( (A_ScreenDPI / 96 ) * m ) , Y: "+" ( (A_ScreenDPI / 96 ) * m ) , W: ( (A_ScreenDPI / 96 ) * 100 ) , H: ( (A_ScreenDPI / 96 ) * 35 ) , Text: "OK" , Label: "TestFunction" } , { BackgroundColor: "0xFFF0F0F0" , FontSize: ( 12 * ( A_ScreenDPI / 96 ) ) } )
Button5 := New HButton( { Owner: 1 , X: "+" ( (A_ScreenDPI / 96 ) * m ) , Y: "p" , W: ( (A_ScreenDPI / 96 ) * 100 ) , H: ( (A_ScreenDPI / 96 ) * 35 ) , Text: "OK" , Label: "TestFunction" } , { BackgroundColor: "0xFFF0F0F0" , FontSize: ( 12 * ( A_ScreenDPI / 96 ) ) } )
Button6 := New HButton( { Owner: 1 , X: "+" ( (A_ScreenDPI / 96 ) * m ) , Y: "p" , W: ( (A_ScreenDPI / 96 ) * 100 ) , H: ( (A_ScreenDPI / 96 ) * 35 ) , Text: "OK" , Label: "TestFunction" } , { BackgroundColor: "0xFFF0F0F0" , FontSize: ( 12 * ( A_ScreenDPI / 96 ) ) } )
Gui, 1:+DPIScale
;***************************************************
Gui, 1:Add, Checkbox, xm y+10 , Checkbox
Gui, 1:Add, Button, x+10 yp , Button
Gui, 1:Add, DDL, xm w320 r10, Item 1||Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|Item 1|
;***************************************************
Gui, 1:Show
return
GuiClose:
ExitApp
TestFunction(){
ToolTip, In the test function
SoundBeep, 500
}
HBCustomButton(){
local MyButtonDesign := {}
MyButtonDesign.All := {}
MyButtonDesign.Default := {}
MyButtonDesign.Hover := {}
MyButtonDesign.Pressed := {}
;********************************
;All
MyButtonDesign.All.W := 200 , MyButtonDesign.All.H := 65 , MyButtonDesign.All.Text := " Button " , MyButtonDesign.All.BackgroundColor := "0xFF22262A"
;********************************
;Default
MyButtonDesign.Default.W := 200 , MyButtonDesign.Default.H := 65 , MyButtonDesign.Default.Text := "Button" , MyButtonDesign.Default.Font := "Arial" , MyButtonDesign.Default.FontOptions := " Bold Center vCenter " , MyButtonDesign.Default.FontSize := "12" , MyButtonDesign.Default.H := "0x0002112F" , MyButtonDesign.Default.TextBottomColor2 := "0x0002112F" , MyButtonDesign.Default.TextTopColor1 := "0xFFFFFFFF" , MyButtonDesign.Default.TextTopColor2 := "0xFFFFFFFF" , MyButtonDesign.Default.TextOffsetX := "0" , MyButtonDesign.Default.TextOffsetY := "0" , MyButtonDesign.Default.TextOffsetW := "0" , MyButtonDesign.Default.TextOffsetH := "0" , MyButtonDesign.Default.BackgroundColor := "0xFF22262A" , MyButtonDesign.Default.ButtonOuterBorderColor := "0xFF161B1F" , MyButtonDesign.Default.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Default.ButtonInnerBorderColor1 := "0xFF3F444A" , MyButtonDesign.Default.ButtonInnerBorderColor2 := "0xFF24292D" , MyButtonDesign.Default.ButtonMainColor1 := "0xFF272C32" , MyButtonDesign.Default.ButtonMainColor2 := "0xFF272C32" , MyButtonDesign.Default.ButtonAddGlossy := "1" , MyButtonDesign.Default.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Default.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Default.GlossBottomColor := "33000000"
;********************************
;Hover
MyButtonDesign.Hover.W := 200 , MyButtonDesign.Hover.H := 65 , MyButtonDesign.Hover.Text := "Button" , MyButtonDesign.Hover.Font := "Arial" , MyButtonDesign.Hover.FontOptions := " Bold Center vCenter " , MyButtonDesign.Hover.FontSize := "12" , MyButtonDesign.Hover.H := "0x0002112F" , MyButtonDesign.Hover.TextBottomColor2 := "0x0002112F" , MyButtonDesign.Hover.TextTopColor1 := "0xFFFFFFFF" , MyButtonDesign.Hover.TextTopColor2 := "0xFFFFFFFF" , MyButtonDesign.Hover.TextOffsetX := "0" , MyButtonDesign.Hover.TextOffsetY := "0" , MyButtonDesign.Hover.TextOffsetW := "0" , MyButtonDesign.Hover.TextOffsetH := "0" , MyButtonDesign.Hover.BackgroundColor := "0xFF22262A" , MyButtonDesign.Hover.ButtonOuterBorderColor := "0xFF161B1F" , MyButtonDesign.Hover.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Hover.ButtonInnerBorderColor1 := "0xFF3F444A" , MyButtonDesign.Hover.ButtonInnerBorderColor2 := "0xFF24292D" , MyButtonDesign.Hover.ButtonMainColor1 := "0xFF122BE6" , MyButtonDesign.Hover.ButtonMainColor2 := "0xFF0006EE" , MyButtonDesign.Hover.ButtonAddGlossy := "1" , MyButtonDesign.Hover.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Hover.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Hover.GlossBottomColor := "33000000"
;********************************
;Pressed
MyButtonDesign.Pressed.W := 200 , MyButtonDesign.Pressed.H := 65 , MyButtonDesign.Pressed.Text := "Button" , MyButtonDesign.Pressed.Font := "Arial" , MyButtonDesign.Pressed.FontOptions := " Bold Center vCenter " , MyButtonDesign.Pressed.FontSize := "12" , MyButtonDesign.Pressed.H := "0x0002112F" , MyButtonDesign.Pressed.TextBottomColor2 := "0x0002112F" , MyButtonDesign.Pressed.TextTopColor1 := "0xFFFFFFFF" , MyButtonDesign.Pressed.TextTopColor2 := "0xFFFFFFFF" , MyButtonDesign.Pressed.TextOffsetX := "0" , MyButtonDesign.Pressed.TextOffsetY := "0" , MyButtonDesign.Pressed.TextOffsetW := "0" , MyButtonDesign.Pressed.TextOffsetH := "0" , MyButtonDesign.Pressed.BackgroundColor := "0xFF22262A" , MyButtonDesign.Pressed.ButtonOuterBorderColor := "0xFF62666a" , MyButtonDesign.Pressed.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Pressed.ButtonInnerBorderColor1 := "0xFF151A20" , MyButtonDesign.Pressed.ButtonInnerBorderColor2 := "0xFF151A20" , MyButtonDesign.Pressed.ButtonMainColor1 := "0xFF12161a" , MyButtonDesign.Pressed.ButtonMainColor2 := "0xFF33383E" , MyButtonDesign.Pressed.ButtonAddGlossy := "0" , MyButtonDesign.Pressed.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Pressed.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Pressed.GlossBottomColor := "33000000"
;********************************
return MyButtonDesign
}
100% DPI
. .
300% DPI
. .
PENchanter wrote: ↑24 Dec 2021, 20:09WHAAAT?! Why am I being designated as "Old" and recommended for "Delete"[ion]?!?! *shudders* Why me?!?!?!
Look away. You aren't going to want to see what I did to your buddy "Brush".
- PENchanter
- Posts: 10
- Joined: 06 Sep 2021, 16:13
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
/me mourns buddy "Brush"...
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
Awesome work!
-
- Posts: 140
- Joined: 24 Jul 2019, 15:27
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
@Hellbent
Hi, nice work I found it today and start using
There is a problem for me. when I use "varGUI := Gdip_Startup()", show a gui do the things, destroy the gui, do the things every think okey untill now. script turn back to reshow the gui, but it cause crush with no error.
I search some and found I need to use "Gdip_Shutdown(varGUI)" but before this, I need to "Dispose" all items. I cant find how to do that. Is it possible, "Disposeall" ?
Hi, nice work I found it today and start using
There is a problem for me. when I use "varGUI := Gdip_Startup()", show a gui do the things, destroy the gui, do the things every think okey untill now. script turn back to reshow the gui, but it cause crush with no error.
I search some and found I need to use "Gdip_Shutdown(varGUI)" but before this, I need to "Dispose" all items. I cant find how to do that. Is it possible, "Disposeall" ?
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
I didn't see a way to utilize the GUI Context Menu and your Custom GUI Image Buttons, so I took the liberty of creating one. This method seems to work just fine and was pretty easily to implement, but if there already exists a way to utilize the Context Menu please let me know.
In your class file, you need to edit this section of code and add in the section in bold:
[/b]
After that, when you're calling/creating the buttons in your actual script you just need to make this adjustment:
This will allow it to have a Control name and can then be manipulated by anything that uses the A_GuiControl variable.
In your class file, you need to edit this section of code and add in the section in bold:
Code: Select all
_CreateControl( Input ){
local hwnd
Gui , % Input.Owner ":Add" , Pic , % "x" Input.X " y" Input.Y " w" Input.W " h" Input.H " v" Input.V " hwndhwnd 0xE"
; ^-----------^ *Add this in
return hwnd
}
After that, when you're calling/creating the buttons in your actual script you just need to make this adjustment:
Code: Select all
MyFirstButton := New HButton( { Owner: 1 , X: 10 , Y: 10 , W: 100 , H: 35 , V: "TestButton1" , Text: "Reload" , Label: "TestFunction" } , { BackgroundColor: "0xFFF0F0F0" } )
; ^----------------^ *Add this in
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
@Panaku
I'm not sure of your intent but I think I get what you are after.
When you create a new button it returns the handle to the control ( The Hwnd ).
With that you can use any of the normal GuiControl and GuiControlGet commands.
Compare:
You can also use mousegetpos instead of A_GuiControl like so
I'm not sure of your intent but I think I get what you are after.
When you create a new button it returns the handle to the control ( The Hwnd ).
With that you can use any of the normal GuiControl and GuiControlGet commands.
Compare:
Code: Select all
Gui, 1:Add , Text , hwndTextHwnd
GuiControl, 1: , % TextHwnd , Hello ;<---- Using the handle
Gui, 1:Add, Text , vTextVar
GuiControl, 1: , TextVar , Hello ;<---- Using the variable
Code: Select all
MouseGetPos,,,, ctrl , 2 ;<---- get the handle ( hwnd ) of the control under the cursor.
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
I wonder how can we do to make the buttons created by this amazing piece of software to remain pressed until we click on them again.
Probably it is there, but I haven't found nothing so far.
Probably it is there, but I haven't found nothing so far.
Re: [ Class + ( Editor Tool ) ] Custom Gui Image Button
@Maestr0:Maestr0 wrote: ↑29 May 2023, 13:29I couldn't find it in the manual, but I did a Bing.com chat (so AI)...
I've not tested it, though.
[...]Yes, you can make a button appear pressed in the GUI without pressing it. You can use the `GuiControl` command with the `+E` option to enable or disable a control. For example, if you have a button with the name `Button1`, you can use the following code to make it appear pressed:
[...]Code: Select all
GuiControl,, Button1, +E
Sounds unlikely, imho. This looks - at least - incomplete. Yes, there are extended styles which can be added or removed by using the options +E and -E, but a code specifying the style number should follow:
But this quote is actually about GUI styles, not styles of specific GUI elements.https://www.autohotkey.com/docs/v1/lib/Gui.htm#Options wrote:(Unnamed ExStyle): Specify a plus or minus sign followed immediately by the letter E and a decimal or hexadecimal extended style number. For example, +E0x40000 would add the WS_EX_APPWINDOW style, which provides a taskbar button for a window that would otherwise lack one. For other extended styles not documented here (since they are rarely used), see Extended Window Styles | Microsoft Docs for a complete list.
If you had tested it and confirmed that it works, it would be acceptable. But untested code like this goes against our current rule re AI-generated code: please compare https://www.autohotkey.com/forumrules/#inappropriate_content (4.).
Unfortunately, the AIs make stuff up too often or recommend incomplete solutions or suggest pure nonsense - with unjustified confidence nonetheless.
Please be careful with AI-generated code in the future, especially if you are unsure that it works. Also, you should be sure that the posted answer fits the question. Afaik, this topic is specifically about painting buttons with GDI+, and not standard control elements. This means that extended styles are probably not relevant at all for these buttons.
This class already seems to support pressed buttons - and rx65m just seems to look for a way to toggle between pressed and unpressed state easily.
That's why I decided to hide your AI-generated answer. Afaics, it is unrelated to topic and question - and there are general doubts that the code would work.