AutoHotkey Community

It is currently May 27th, 2012, 12:03 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Checkbox and remember.
PostPosted: October 6th, 2009, 12:07 pm 
Offline

Joined: July 8th, 2009, 11:07 am
Posts: 61
Hi!
I want to create a checkbox for remember username and remember password.
How can i make this.
My gui is now :
Code:
Login = LOGIN TO S-MINER
Gui, 2:Font,cFF0000,
Gui, 2:Color, 000000
Gui, 2:+ToolWindow
Gui, 2:Add, Edit,-Vscroll cBlack x80 y12 w80 h20 vUsrname
Gui, 2:Add, Edit,-Vscroll cBlack x80 y42 w80 h20 vpasswrd Password
Gui, 2:Add, Text, x12 y12 w70 h20, Username
Gui, 2:Add, Text, x12 y42 w70 h20, Password
Gui, 2:Add, Button, x170 y12 w70 h20 Default, Login
Gui, 2:Add, Button, x170 y42 w70 h20 , Cancel
Gui, 2:Add, Text, x12 y120 w70 h20, News
Gui, 2:Add, Edit, x10 y135 w230 h60 ReadOnly, %newsss%
Gui, 2:Show, x299 y200 h200 w250, %Login%

Thank you for helping!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 12:19 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
Just write your variables username and password to an ini-file.
Look for iniwrite, iniread in the help-file.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 12:31 pm 
Offline

Joined: July 8th, 2009, 11:07 am
Posts: 61
aaffe wrote:
Just write your variables username and password to an ini-file.
Look for iniwrite, iniread in the help-file.


i have looked for it for 2 weeks but i don't understood, if i get an example i will can do this :(


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 12:36 pm 
where did you look for it? did you check the help?
Code:
IniWrite, this is a new value, C:\Temp\myfile.ini, section2, key

Code:
IniRead, OutputVar, C:\Temp\myfile.ini, section2, key
MsgBox, The value is %OutputVar%.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 12:48 pm 
Offline

Joined: July 8th, 2009, 11:07 am
Posts: 61
two examples wrote:
where did you look for it? did you check the help?
Code:
IniWrite, this is a new value, C:\Temp\myfile.ini, section2, key

Code:
IniRead, OutputVar, C:\Temp\myfile.ini, section2, key
MsgBox, The value is %OutputVar%.


Thanks it's helped, but how does the checkbox work? :S sorry for my stupid answers i'm new in ahk :(


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 12:57 pm 
i don´t see any checkboxes in your script.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 1:08 pm 
Offline

Joined: July 8th, 2009, 11:07 am
Posts: 61
Two examples wrote:
i don´t see any checkboxes in your script.


because i don't know how they are work :(


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 1:10 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
From the help:
Checkbox
Description: A small box that can be checked or unchecked to represent On/Off, Yes/No, etc.

Example: Gui, Add, Checkbox, vShipToBillingAddress, Ship to billing address?
The last parameter is a label displayed next to the box, which is typically used as a prompt or description of what the checkbox does. It may include linefeeds (`n) to start new lines. If a width (W) is specified in Options but no rows (R) or height (H), the control's text will be word-wrapped as needed, and the control's height will be set automatically. The checkbox's associated output variable (if any) receives the number 1 for checked, 0 for unchecked, and -1 for gray/indeterminate.

Specify the word Check3 in Options to enable a third state that displays a gray checkmark instead of a black one (the gray state indicates that the checkbox is neither checked nor unchecked). Specify the word Checked or CheckedGray in Options to have the checkbox start off with a black or gray checkmark, respectively. The word Checked may optionally be followed immediately by a 0, 1, or -1 to indicate the starting state. In other words, "Checked" and "Checked%VarContainingOne%" are the same.

A g-label such as gMySubroutine may be listed in the control's options. This would cause the MySubroutine label to be launched automatically whenever the user clicks or changes the checkbox.

Known limitation: Certain desktop themes might not display a button's text properly. If this occurs, try including -Wrap (minus Wrap) in the button's options. However, this also prevents having more than one line of text.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 1:29 pm 
Offline

Joined: July 8th, 2009, 11:07 am
Posts: 61
aaffe wrote:
From the help:
Checkbox
Description: A small box that can be checked or unchecked to represent On/Off, Yes/No, etc.

Example: Gui, Add, Checkbox, vShipToBillingAddress, Ship to billing address?
The last parameter is a label displayed next to the box, which is typically used as a prompt or description of what the checkbox does. It may include linefeeds (`n) to start new lines. If a width (W) is specified in Options but no rows (R) or height (H), the control's text will be word-wrapped as needed, and the control's height will be set automatically. The checkbox's associated output variable (if any) receives the number 1 for checked, 0 for unchecked, and -1 for gray/indeterminate.

Specify the word Check3 in Options to enable a third state that displays a gray checkmark instead of a black one (the gray state indicates that the checkbox is neither checked nor unchecked). Specify the word Checked or CheckedGray in Options to have the checkbox start off with a black or gray checkmark, respectively. The word Checked may optionally be followed immediately by a 0, 1, or -1 to indicate the starting state. In other words, "Checked" and "Checked%VarContainingOne%" are the same.

A g-label such as gMySubroutine may be listed in the control's options. This would cause the MySubroutine label to be launched automatically whenever the user clicks or changes the checkbox.

Known limitation: Certain desktop themes might not display a button's text properly. If this occurs, try including -Wrap (minus Wrap) in the button's options. However, this also prevents having more than one line of text.


Code:
Gui, 2:Add, Checkbox, x12 y100 vrememberusrpas, Remember Username/Password
<- i made this but how can i if checked iniread and iniwrite,


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 1:33 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
You have to check rememberusrpas if it is 1 or 0.
1 is checked, 0 is unchecked.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 1:34 pm 
Offline

Joined: July 8th, 2009, 11:07 am
Posts: 61
aaffe wrote:
You have to check rememberusrpas if it is 1 or 0.
1 is checked, 0 is unchecked.

oh thanks, and my last answer, how can i make the checkbox text to align left?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 1:35 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
Code:
Gui, 2:Add, Checkbox, x12 y100 Left vrememberusrpas, Remember Username/Password

??
Btw: Youre asking questions, not answers :lol:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 6th, 2009, 2:13 pm 
Offline

Joined: July 8th, 2009, 11:07 am
Posts: 61
aaffe wrote:
Code:
Gui, 2:Add, Checkbox, x12 y100 Left vrememberusrpas, Remember Username/Password

??
Btw: Youre asking questions, not answers :lol:


sorry, i just phone when i wrote this question :P checkbox text is not on left :S


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Leef_me, Pulover, rbrtryn, XstatyK, Yahoo [Bot] and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group