This is a script I did when I started with AHK. So please forgive me if the script isn't nicely structured or commented. But since a lot of people asked for icon as buttons, I thought I post this, so maybe someone likes the approach and uses it.
This script was a try to convince Rajat to extend his SmartGui to a more elaborated IDE. Therefore I called it SGUIv4.
Here is the script and the icons/pictures:
https://ahknet.autoh..._v4/SGUI_v4.zip
The GUIs do not have much functions, but the icons on the "move" and the "add control" guis (gui 3 and 4 on the left side of the following image) give feedback when the user clicks on them. They get a border (a line around them). These buttons are actually picture controls.
On the "move" gui the icons only show the border for a short period of time.
On the "add control" gui only one icons at a time has the the border and keeps it until another icon in that gui gets selected.
I have created all icons/pictures myself, but of cause I have made them as close as possible to the well known one.
This is how it looks like: And if you want to know how they behave or how it is done, have a look at the script.
Small toolbar with icon-buttons.
Started by
toralf
, Jul 08 2005 02:07 PM
12 replies to this topic
#1
-
Posted 08 July 2005 - 02:07 PM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
as i said earlier, its very good looking toralf!
but the problem is that when i released SGUI 1.0, ahk's GUI was in its first alpha... my options were very limited and creating a creator with those limitations was some task in itself. later with the updates to ahk, sgui kept building up on the earlier foundations. now to shift to something like this, i'll have to do a complete rewrite, which is kind of scary to think...
but the problem is that when i released SGUI 1.0, ahk's GUI was in its first alpha... my options were very limited and creating a creator with those limitations was some task in itself. later with the updates to ahk, sgui kept building up on the earlier foundations. now to shift to something like this, i'll have to do a complete rewrite, which is kind of scary to think...
#2
-
Posted 08 July 2005 - 09:06 PM
CleanNews.in : Bite sized latest news headlines from India with zero bloat
I know, and I fully understand your point. I don't wanted or will ever try to insult you. I do not try to convince you to do it any more. I think SmartGUI is perfect.
To my shame I have to admit, that I don't use it anymore. I have a different way to script, so I found a different way to create my guis.
I only posted the script so people could see the possibilities in AHK.
I just create a full program suite to automate a process, with about 4000 lines of code, 8 GUIs (2 of them very complex). The possibilities with AHK are endless.
Sorry again Rajat, this wasn't meant to be against you.
To my shame I have to admit, that I don't use it anymore. I have a different way to script, so I found a different way to create my guis.
I only posted the script so people could see the possibilities in AHK.
I just create a full program suite to automate a process, with about 4000 lines of code, 8 GUIs (2 of them very complex). The possibilities with AHK are endless.
Sorry again Rajat, this wasn't meant to be against you.
#3
-
Posted 08 July 2005 - 09:18 PM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
u got me all wrong here buddy... i wasn't annoyed or anything! i just wanted to say that for applying this improved gui to sgui i'll need to almost write it again. please don't take it otherwise.Sorry again Rajat, this wasn't meant to be against you.
and by the way if u don't mind disclosing, i'm curious how do u create your guis.
#4
-
Posted 08 July 2005 - 10:43 PM
CleanNews.in : Bite sized latest news headlines from India with zero bloat
I just write it manually.
I always use relative positions for controls. If I would use SmartGUI I would have all the commands, but I would need to restructure them to get them into the right order, would have to delte the absolut coordinates and add the relative again. That process takes longer then the direct manual approach (with sometimes copy and paste). Plus I can right away give certain options to the control. Since I realized that a lot of my code is similar in different scripts I always wanted (but never done yet) to use your SnippetLibrary to ease and speed it up further.
Just my personal workflow.
I always use relative positions for controls. If I would use SmartGUI I would have all the commands, but I would need to restructure them to get them into the right order, would have to delte the absolut coordinates and add the relative again. That process takes longer then the direct manual approach (with sometimes copy and paste). Plus I can right away give certain options to the control. Since I realized that a lot of my code is similar in different scripts I always wanted (but never done yet) to use your SnippetLibrary to ease and speed it up further.
Just my personal workflow.
#5
-
Posted 09 July 2005 - 06:27 AM
It looks great. There is a plan to add a Toolbar control someday soon, which will hopefully make things like this easier.
Thanks for posting your work.
Thanks for posting your work.
#6
-
Posted 09 July 2005 - 03:11 PM
It looks great. There is a plan to add a Toolbar control someday soon, which will hopefully make things like this easier.
As a newcomer, may I suggest: In the meantime, if it will be a while before you make the new Toolbar control, maybe you could add "toolbar" to Help's index, leading to a page with a few tips. It took me a while to realise that to make a toolbar you use the gui functions - at first I imagined AHK does not include making toolbars.
BTW This newb is already amazed at what AHK can do and its excellent Help
#7
-
Posted 16 July 2005 - 06:06 AM
SGUIv4.
This should really be continued. It's definitely what is needed for AHK.
SmartGUI doesn't make sense and I've never been able to figure out how to make it work.
________
Silver Surfer Vaporizer
This should really be continued. It's definitely what is needed for AHK.
SmartGUI doesn't make sense and I've never been able to figure out how to make it work.
________
Silver Surfer Vaporizer
#8
-
Posted 07 September 2005 - 08:36 AM
The only thing I fear from this great work is when I plan on making a full screen gui, that has no intent of being used on another pc, I just maximize the window and start popping in controls. If I am limited to the window I am working in, will that mean the window size(the window I can add controls to) can only be as large as the windows workspace?
#10
-
Posted 07 September 2005 - 09:15 AM
my lame sig
Dear webber, Nemroth and Invalid
Thanks for the comments, but I have only done these GUIs for demonstration. There is no code behind them.
You are free to fill the gaps. I do not work on it.
As for Invalids comment. I haven't though on this, since I never did full screen Guis. Since the GUIs do not allow scrollbars yet, maybe a context menu could help to hide the toolbars, e.g like SmartGui.
Thanks for the comments, but I have only done these GUIs for demonstration. There is no code behind them.
You are free to fill the gaps. I do not work on it.
As for Invalids comment. I haven't though on this, since I never did full screen Guis. Since the GUIs do not allow scrollbars yet, maybe a context menu could help to hide the toolbars, e.g like SmartGui.
#11
-
Posted 07 September 2005 - 09:23 AM
Ciao
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
Perhaps a workaround could be used, its really bulky and buggy, but its a workaround until scroll bars around.
StaCtrlsList = msctls_trackbar321,msctls_trackbar322,msctls_Progress321,msctls_Progress322,Edit1,Edit2,Edit3,Edit4 ;Define Window WinX = 149 WinY = 118 WinH = 227 WinW = 506 WinTitle = InfiniView ;Define Mins and Maxes XViewMax := WinW XViewMin = 0 YViewMax := WinH YViewMin = 0 Gui, Add, GroupBox, vCtrl1 x26 y27 w100 h30, one Gui, Add, GroupBox, vCtrl2 x156 y57 w110 h70, two Gui, Add, GroupBox, vCtrl3 x316 y67 w110 h70, three Gui, Add, Slider, vXModVal Range-10-10 x46 y197 w360 h20, 0 Gui, Add, Progress, vXModDisp x6 y187 w440 h10, 25 Gui, Add, Slider, vYModVal Range-10-10 Vertical Invert x456 y27 w20 h140, 0 Gui, Add, Progress, vYModDisp Vertical x446 y7 w10 h180, 25 Gui, Add, Edit, vXViewMin x6 y197 w40 h20, %XViewMin% Gui, Add, Edit, vXViewMax x406 y197 w40 h20, %XViewMax% Gui, Add, Edit, vYViewMin x456 y7 w40 h20, %YViewMin% Gui, Add, Edit, vYViewMax x456 y167 w40 h20, %YViewMax% Gui, Show, x%Winx% y%WinY% h%WinH% w%WinW%, %WinTitle% SetTimer, MonitorMouse SetTimer, MonitorSlider, 200 SetTimer, MonitorSlider, Off Return ;-----Timers MonitorMouse: MouseGetPos, XPos, YPos, %WinTitle%, Ctrl ;MsgBox %Ctrl% If Ctrl Contains msctls_trackbar32 { SetTimer, MonitorMouse, Off SetTimer, MonitorSlider, On } Return MonitorSlider: MouseGetPos, ,, %WinTitle%, Ctrl If Ctrl Not Contains msctls_trackbar32 { SetTimer, MonitorSlider, Off SetTimer, MonitorMouse, On Return } StringRight, SModi, Ctrl, 1 If Smodi = 1 SMod = X If Smodi = 2 SMod = Y GetKeyState, Lbs, LButton, P If Lbs = D { Loop { GetKeyState, Lbs, LButton, P If Lbs = U { Gui, Submit, Nohide StringLeft, PosNeg, %SMod%ModVal, 1 I := %SMod%ModVal If PosNeg = - { StringTrimLeft, I, %SMod%ModVal, 1 PosNeg = 1 } I := Sqrt(I) I2 = %I% Loop, %I% { I2-- Sleep, 50 CVal := I2 * 2 If PosNeg = 1 ;it is negative GuiControl,, %SMod%ModVal, +%Cval% Else GuiControl,, %SMod%ModVal, +-%Cval% } ;GuiControl, , ChangeVal, 0 Break } ;Else ;Modify window view here { WinGet, CtrlList, ControlList, %WinTitle% Loop, Parse, CtrlList, `n { If A_LoopField Not In %StaCtrlsList% { ;MsgBox %A_LoopField% ControlGetPos, X, Y,,, %A_LoopField%, %WinTitle% Nxpos := X + XModVal Nypos := Y + YModVal ControlMove, %A_LoopField%, %Nxpos%, %Nypos%,,, %WinTitle% } } } } GuiControl, , %SMod%ModVal, 0 } Return F10::ListVars F9::Reload GuiClose: ExitApp
#12
-
Posted 07 September 2005 - 10:45 AM
my lame sig
I think this is a really good example for windows as a super-plug-in for autohotkey...
#13
-
Posted 06 July 2006 - 05:19 AM