AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

confusing gui button machine

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
geekdude



Joined: 23 Nov 2009
Posts: 64

PostPosted: Fri Jan 29, 2010 11:08 pm    Post subject: confusing gui button machine Reply with quote

i am making a confusing script
it is supposed to make a gui that will add buttons to itself.
because it uses a target label, i had to make it reproduce itself into another file
it should then reload the script and produce another gui and the process repeats
it is not functioning correctly
NOTE:DONT COMPILE

Code:
type = 1
;1
if type = 1
nxtype = 2
else
nxtype = 1
gui, add, text, cgreen, button name
gui, add, edit, vname
gui, add, text, cgreen, website name
gui, add, edit, vplace
gui, add, button, default, create
;1
gui, add, button,, exit
gui, show
return
;1
;1
buttonexit:
gui, destroy
return
buttoncreate:
gui, submit
fileread, file, %A_ScriptFullPath%
filedelete, file, %A_ScriptFullPath%
;1
stringsplit, part, file, `;1
;1
fileappend,
(
type = %nxtype%
;%nxtype%%part2%gui, add, button,, %name%
;%nxtype%%part3%;%nxtype%%part4%button%name%:
run, %place%
return%part5%stringsplit, part, file, `;%type%
;%nxtype%%part5%
), %A_ScriptFullPath%
reload


it seems that it isnt reading itself, and it isnt deleting itself.
i have not compiled to exe, so it should have no problems with these tasks.

please help, i have put a lot of brain power into it and dont want it to go to waste
please help, i would like to have one of these
_________________
  /\ /\ This is Kitty
(>';'<) Cut, copy, and paste kitty onto your sig.
((")(")) Help Kitty gain World Domination.

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message
kdoske



Joined: 17 Dec 2008
Posts: 80

PostPosted: Fri Jan 29, 2010 11:59 pm    Post subject: Reply with quote

Why are you trying to have the script re write itself just to add a button? I guess I don't know what you mean by target label. Either way here is how to add a button on the fly.

Example:
Code:
buttonnumber := 0
Gui, Add, Button, x5 y5 w60 h60 vbutton21 gtest, test
Gui, Show, w800 h100,
Return

test:
buttonnumber := buttonnumber + 1
xtemp := xtemp + 5
Gui, Add, Button, %xtemp% y5 w60 h60, #%buttonnumber%
return

guiclose:
ExitApp
Back to top
View user's profile Send private message
geekdude



Joined: 23 Nov 2009
Posts: 64

PostPosted: Sat Jan 30, 2010 12:26 am    Post subject: Reply with quote

i understand that now

but i still do not know how to make the button do anything

that was the reason i had the TARGET website, as i am going to use this to create internet shortcuts that i can pull up by opening the app.

andthese buttons are not permanent
_________________
  /\ /\ This is Kitty
(>';'<) Cut, copy, and paste kitty onto your sig.
((")(")) Help Kitty gain World Domination.

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message
Z_Gecko
Guest





PostPosted: Sat Jan 30, 2010 4:07 am    Post subject: Reply with quote

take this for example:
Code:
Gui, Show, w200 h400

loop, 4
{
   ButtonPosY := (A_Index - 1) * 100
   ButtonVar%A_Index% := A_Index
   Gui, Add, Button, vButtonVar%A_Index% gButtonHandler x0 y%ButtonPosY% w200 h100, Button Nr. %A_Index%
   MsgBox
}

return

ButtonHandler:
PressedButton := %A_GuiControl%
MsgBox, You pressed Button Nr. %PressedButton%
return
Back to top
geekdude



Joined: 23 Nov 2009
Posts: 64

PostPosted: Sat Jan 30, 2010 9:42 pm    Post subject: Reply with quote

you see, by target label i meant the assigned gosub label. the button makers you have supplied do not have makeable gosubs.
also, when i start the script up, it does not load the buttons that i made last time

finally, i just want it to read and delete itself propely. it should have no problem, should it?
_________________
  /\ /\ This is Kitty
(>';'<) Cut, copy, and paste kitty onto your sig.
((")(")) Help Kitty gain World Domination.

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group