Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Examples of nice GUIs?


  • Please log in to reply
21 replies to this topic
futureTom
  • Members
  • 4 posts
  • Last active: Jan 24 2012 05:31 PM
  • Joined: 24 Jan 2012
Hi,

I wondered if anyone can point me to some examples of nice GUIs created with ahk, or which work with ahk?

Many thanks

CodeKiller
  • Members
  • 2067 posts
  • Last active: Feb 26 2016 09:30 AM
  • Joined: 10 Jul 2008
Your question is meaningless.
A GUI is created to do stuff related to a script (script which in a pure code way should work without a gui), a gui alone is useless if you don't know what you want...

So asking for a "nice GUI" is not really interesting...

By the way, with AHK these is no real "nice" gui, you "can't" (easily) do things like Office 10 with AHK.

An example of "medium" complexity GUI :

Gui 1:Add, CheckBox, w115 y10 vOptDM, Dialog Model
Gui 1:Add, CheckBox, w115 vOptBS, Subroutine Set
Gui 1:Add, CheckBox, w115 vOptDS Checked, Data Section
Gui 1:Add, CheckBox, w115 vOptDX, Dialog Box
Gui 1:Add, CheckBox, w115 y10 x+5 vOptFD, Buffer
Gui 1:Add, CheckBox, w115 y+6 vOptRUS, Standard Text
Gui 1:Add, CheckBox, w115 y+6 vOptAll, Tout sauf StdTxt
Gui 1:Add, CheckBox, w115 y+6 vOptAllRUS, Tout

Gui 1:Add, Button, w90 y10 vStartSearch Default, Rechercher
Gui 1:Add, Button, w90 y+10, Construire index
Gui 1:Add, Button, w90 y+10, Afficher l'index
Gui 1:Add, Button, w90 y+10, Extracteur
Gui 1:Add, Text, x10 yp-15,Recherche dans un répertoire spécifique :

Gui 1:Add, DropDownList, vDirSpec w75, C:\|D:\||E:\
Gui 1:Add, Text, ,Texte recherché (mot complet, exemple : test ne ramènera pas tests) :
Gui 1:Add, Edit, vSearch w335, Texte
Gui 1:Add, CheckBox, x10 vReBuild, Remplacer fichiers déjà indexés
Gui 1:Add, CheckBox, x10 vNoCache Checked, Ne pas utiliser de cache
Gui 1:Add, Button, x+150 yp-10 w50 gQuitter, Quitter

Gui 1:Show

Return

GuiEscape:
GuiClose:
Quitter:
ExitApp

Ok, the text is French but you can see the use of edit (pre-filed), checkbox (pre-checked), combobox (pre-filed and selected) and button.

answer
  • Guests
  • Last active:
  • Joined: --
if it's just examples of good gui design or solutions, just google any. Most "utility" apps style of window are doable in AHK, except for a few modern controls like split button. The documentation has some example code like a listview/treeview explorer.

Some examples from the scripts & functions forum:

http://www.autohotke...topic81600.html
http://www.autohotke...ic74673-75.html
http://www.autohotke...topic59079.html
http://www.autohotke...topic71046.html
http://www.autohotke...topic53317.html (additions)
http://www.autohotke...topic75317.html
http://www.autohotke...topic71992.html (creator)
http://www.autohotke...topic18378.html

or Google image search: gui site:autohotkey.com/forum

tank
  • Administrators
  • 4345 posts
  • AutoHotkey Foundation
  • Last active: May 02 2019 09:16 PM
  • Joined: 21 Dec 2007
wonders why everyone writes gui's in global space instead of function
Never lose.
WIN or LEARN.

  • Guests
  • Last active:
  • Joined: --
I agree entirely.

tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009
What do you mean tank by 'writing gui in function' ?

tank
  • Administrators
  • 4345 posts
  • AutoHotkey Foundation
  • Last active: May 02 2019 09:16 PM
  • Joined: 21 Dec 2007

myGui()



myGui()

	{

	static thisVar, thatVar

	gui, SomeGuiName: new

	gui,Default

	gui,+LastFound

	gui, add, groupbox, w250 h130,example

	gui, add, text, xm12 ym30 section, this Label

	gui, add, text, xm12 yp+30, that label

	gui, add, button, yp+30 gDone, Ok

	gui, add, edit, ys ym30 vthisVar,

	gui, add, edit, yp+30  vthatVar,

	gui, add, button, yp+30  gguiclose, cancel

	gui, show,, gui in a function

	return winexist()

	

	Done:

		{

		gui,submit,nohide

		ListVars

		msgbox your values `nthisVar :%thisVar%`nthatVar :%thatVar%

		return

		}

	

	guiclose:

		{

		gui,destroy

		ExitApp

		return

		}

	}


Never lose.
WIN or LEARN.

  • Guests
  • Last active:
  • Joined: --
I modified your code so that the Gui can be called multiple times while one is displayed.
myGui("x300 y200", "gui example 1")
myGui("x300 y400", "gui example 2")

myGui(position, title)
   {
   static thisVar, thatVar
   gui, new
   gui, Default
   gui, +LastFound +LabelMyGui
   gui, add, groupbox, w250 h130,example
   gui, add, text, xm12 ym30 section, this Label
   gui, add, text, xm12 yp+30, that label
   gui, add, button, yp+30 gDone, Ok
   gui, add, edit, ys ym30 vthisVar,
   gui, add, edit, yp+30  vthatVar,
   gui, add, button, yp+30  gmyguiclose, cancel
   gui, show, % position, % title
   return winexist()
   
   Done:
      {
      gui,submit,nohide
      ; ListVars
      msgbox your values `nthisVar :%thisVar%`nthatVar :%thatVar%
      return
      }
   
   myguiclose:
      {
      gui,destroy
      return
      }
   }


garvus
  • Members
  • 18 posts
  • Last active: May 17 2010 05:40 PM
  • Joined: 17 May 2010
HEELLLLLP!!!
I dont know why this is SO complicated! HOW do you write a script so that the checkbox guicontrolget doesnt start until submit button is pressed?????

tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009
Use a g-label

garvus
  • Members
  • 18 posts
  • Last active: May 17 2010 05:40 PM
  • Joined: 17 May 2010
Can you give me an example? If not I understand, but Ive been searching for days and Id love some help.

I need a two group gui two lists of checkboxes. When I press submit....I want the ahk to find all the checked boxes and run corresponding exe or msi . Essentially, a list of apps to be silently installed to make managing my pc lab easier.

I have written and rewritten....I have 19 student apps and 14 admin apps to install as needed in two groups of checkboxes using send keystrokes to automate the install....I just need to know the checkbox part.
This is my sample:

Gui, Add, CheckBox, x26 y20 w110 h60 vcomlife , Comic Life
Gui, Show, x131 y91 h172 w168, New GUI Window
Gui, Add, Button, defualt, Load Checked programs
Gui, Submit, nohide
Return

Comlife:
GuiControlGet,comlife1
runwait, D:\Install\comiclife-win.exe
   Return
}

Whats missing? Glabel? I looked it up, but not very clear how it is used. Sorry for being either blind or too noobly for all this.

Klark92
  • Members
  • 870 posts
  • Last active: Dec 29 2015 09:47 PM
  • Joined: 19 Feb 2012
@tank
what kind of syntax is that lol
sub or func
     {
     code
     }
very funny :lol:

I CAN PROTECT YOUR SCRIPT (ANTI-DECOMPILER by Klark92) (AHK_L*)(PM)
Klark92's Script2Exe Wizard
AHK_L / AHK COMPILED EXE / BIN ICON CHANGER


  • Guests
  • Last active:
  • Joined: --

HEELLLLLP!!!
I dont know why this is SO complicated! HOW do you write a script so that the checkbox guicontrolget doesnt start until submit button is pressed?????

It's complicated because you didnt read the documentation.

AHK is about reading and trying it out yourself, in my opinion.
And GUIs are, imho, one of the easiest things.

<!-- m -->http://www.autohotke...ommands/Gui.htm<!-- m -->
<!-- m -->http://www.autohotke.../GuiControl.htm<!-- m -->
<!-- m -->http://www.autohotke... ... rolGet.htm<!-- m -->

Gui, Add, CheckBox, x26 y20 vcomlife , FireFox
Gui, add, checkbox, x26 y45 vDunno, Chrome
Gui, Add, Button, default gOk, Load Checked programs ; contains gLabel (gOk) if the user presses the load checked programs button, then the Ok label will tirgger
Gui, Show, x131 y91 h172 w168, New GUI Window
Return 

Ok: ; label triggered by the button
{
Gui, submit, nohide ; hide or nohide depends on what you want
If comlife = 1
	Run, FireFox.exe

If dunno = 1
	Run, Chrome.exe
}
return

GuiClose:
ExitApp


garvus
  • Members
  • 18 posts
  • Last active: May 17 2010 05:40 PM
  • Joined: 17 May 2010
I havent read the entire docs start to finish. But I read it and read it...and spent three days trying before asking for help. The problem is that it just states what everything is and how to use it. The help file never shows you how to use different commands together to achieve something..,. other than "hello world" lol.
Parameters ...blah blah.
Thanks....thats great. But how do I USE them to achieve something?

I really appreciate the help.
I learn best by seeing how groups of commands work together. I cant make heads or tails of the help file. Especially when it tells me three ways I can write something ....that I still do know how to use.

Thanks again!

garvus
  • Members
  • 18 posts
  • Last active: May 17 2010 05:40 PM
  • Joined: 17 May 2010
Nice! NOW I get how to use a glabel!
Man you saved my bacon....