 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
twhyman
Joined: 07 Dec 2005 Posts: 256
|
Posted: Wed Jan 18, 2006 11:15 am Post subject: create an "About" window |
|
|
Hi,
i want to create a button on the GUI that by clicking it a new window
will popup with a button to link to my site and display some text and an
OK button, to close it.
all this by keeping the main window in the background and disabled until the about window is closed.
i tried to make this work and i went over the GUI commands and i cant figure it out....
Thanks
Twhyman |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Wed Jan 18, 2006 11:42 am Post subject: |
|
|
Please post your code, then we can take a look. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
twhyman
Joined: 07 Dec 2005 Posts: 256
|
Posted: Wed Jan 18, 2006 11:53 am Post subject: |
|
|
i want to implent the about button in couple of little applications that i made
so here is the most basic start code:
| Code: |
Gui, Add, Button, x36 y227 w390 h40 gTest,About
Gui, Show, x416 y352 h281 w446 ,
Return
Test:
? ; What Goes here?
Return
GuiClose:
ExitApp
|
iam posting it cause its just a buton that i want to add and i wish to know the starter code for this kind of function.
thanks
Twhyman |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Wed Jan 18, 2006 12:02 pm Post subject: |
|
|
You need to create a new GUI if you want to have a link to your website showing.
Since the GUI ID has to be different to the IDs used in the main script, I suggest to use a high ID, e.g. 99 or 77.
I would name the g-lable of the AboutButton BtnOpenAboutWindow, so it doesn't conflict with any other subroutine.
The subroutine BtnOpenAboutWindow and all the code of the about window should be placed in a separate file that is only included into the main script with #Include, so you can include the about into several other scripts as well.
Since you want to have an interaction between the calling GUI and the About window, e.g. disable the calling GUI, you have to have a variable in the calling script that holds the GUI ID, so you know which ID you have to set inactive.
The link you can represent with a text control that has blue text color and is underlined. With OnMessage() and GetMousePos you can find out if the text control is clicked, and act acoordingly.
Or you can search the forum, I can remeber that several people have posted examples for an about window with a link. Good luck. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
neyon
Joined: 29 May 2005 Posts: 34 Location: The Netherlands
|
Posted: Wed Jan 18, 2006 12:39 pm Post subject: |
|
|
Okay, this is a very basic piece of code:
| Code: |
; Gui 1, Main Gui
Gui, Add, Button, x+20 gInfo,&Info
Gui, Add, Button, x+40 gExit,&Exit
; Gui 2, About Gui
Gui, 2:Add, Text,, `n(c)2005`nVersion : 1.0`nAuthor : Autohotkey`nDate : 2006-01-01
; When needed: Insert a logo -> Gui, 2:Add, Picture,x+20,logo.jpg
Gui, 2:Add, Text,cBlue gWebsite, www.autohotkey.com`n
Gui, 2:Add, Button, xm gOk, &Ok
Gui, Show,,Main Screen
return
Info:
Gui, 2:Show,,About
Return
Website:
run www.autohotkey.com
return
Ok:
Gui, 2:Submit
Return
Exit:
GuiClose:
ExitApp
|
_________________ Greetz,
Neyon
Last edited by neyon on Wed Jan 18, 2006 12:53 pm; edited 1 time in total |
|
| Back to top |
|
 |
AGU Guest
|
Posted: Wed Jan 18, 2006 12:48 pm Post subject: |
|
|
I've made s.th like this in my BBCodeWriter script.
Just in case you're willing to study some code, take a look at http://www.autohotkey.com/forum/viewtopic.php?t=6161
Open '?' in the menu bar and click "About..."
The code passage can be found in BBCodeEditor.ahk and is named "About GUI".
Cheers
AGU |
|
| Back to top |
|
 |
twhyman
Joined: 07 Dec 2005 Posts: 256
|
Posted: Wed Jan 18, 2006 1:18 pm Post subject: |
|
|
thanks alot guys especially neyon you rock!
Twhyman |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|