Sign in to follow this  
Followers 0
t0ddie

im new to au3 gui

20 posts in this topic

i have been looking through the help file, and i figured alot out on my own.. so bear with me please because i still need help.

question 1:

i have made 8 "input boxes" like this

$a = GUICtrlCreateInput ( "xxxx", 70,  200, 30, 20)
$b = GUICtrlCreateInput ( "xxxx", 105,  200, 30, 20)
$c = GUICtrlCreateInput ( "xxxx", 140, 200, 30, 20)
$d = GUICtrlCreateInput ( "xxxx", 175,200, 30, 20)

$e = GUICtrlCreateInput ( "oooo", 70, 230, 30, 20)
$f = GUICtrlCreateInput ( "oooo", 105, 230, 30, 20)
$g = GUICtrlCreateInput ( "oooo", 140,  230, 30, 20)
$h = GUICtrlCreateInput ( "oooo", 175,  230, 30, 20)

they are sized, so that you can fit only 4 chracters into each box.

i would like to "grey out" the button that is used to enter the users input

into a listbox until all 8 fields are completely filled out.

and i would like to automatically "tab" to the next box when the user fills

the previous box. how to do this?

question 2.

how do you store the info into a variable? i have a listbox... and i want to store

the values in this fashion.

to explain better, lets assume that 4 fields, which can contain 4 characters each

for a total of 16 characters, makes up a "key"

ie:

happy:xxxx-xxxx-xxxx-xxxx
sad:oooo-oooo-oooo-oooo

this is what i will call a "set" for reference purposes

happy is a key, and sad is a key. together they make a set

of course the values will not be "x" and "o" after the user enters a different value.

but i want the values to be "arranged" like this

i would like to create a space in the list after each "set" so the list would look like this if the user entered 3 sets.

happy:xxxx-xxxx-xxxx-xxxx
sad:oooo-oooo-oooo-oooo

happy:xxxx-xxxx-xxxx-xxxx
sad:oooo-oooo-oooo-oooo

happy:xxxx-xxxx-xxxx-xxxx
sad:oooo-oooo-oooo-oooo

and at the top of the list i have 2 labels it looks like this

SETS ENTERED:

and just to the right of that label

 

i would like the "0" to count, and display incrementally each set as it is loaded into the list.

again, please show me heh....

also, i would like to use a clear button, but not clear the entire list. only clear one set at a time.

i will probably have further questions, as i am just beginning to learn the gui part of autoit. i know this is alot of questions in one post lol.

your help is appreciated


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites



I'm about to eat, but I can help you a little.

Look at styles for the 'graying out', and look at while loops to wait until GuiCtrlRead can read every input box.

Something like this:

While GuiCtrlRead($Input1) = "" AND GuiCtrlRead($Input2) = "" AND GuiCtrlRead($Input3) = ""

etc.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites

ok

While $msg <> $GUI_EVENT_CLOSE
    If GuiCtrlRead($d1) = "" AND GuiCtrlRead($d2) = "" AND GuiCtrlRead($d3) = "" AND GuiCtrlRead($d4) = ""_
    AND GuiCtrlRead($x1) = "" AND GuiCtrlRead($x2) = "" AND GuiCtrlRead($x3) = "" AND GuiCtrlRead($x4) = "" Then
    
Else
    
EndIf

thats what im gunna work with it looks like... but i dont see any command or anything to add as a parameter in the help file to accomplish this.


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

Accomplish what?

Can you paste the WHOLE thing?


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites

#include <GUIConstants.au3>

GUICreate("somename",560,440)

GUICtrlCreateLabel ("ENTER a key ", 10, 195, 130, 40)

GUICtrlCreateLabel ("right HERE:", 10, 210, 130, 40)

$d1 = GUICtrlCreateInput ( "", 140, 200, 30, 20)

$d2 = GUICtrlCreateInput ( "", 175, 200, 30, 20)

$d3 = GUICtrlCreateInput ( "", 210, 200, 30, 20)

$d4 = GUICtrlCreateInput ( "", 245,200, 30, 20)

$x1 = GUICtrlCreateInput ( "", 140, 240, 30, 20)

$x2 = GUICtrlCreateInput ( "", 175, 240, 30, 20)

$x3 = GUICtrlCreateInput ( "", 210, 240, 30, 20)

$x4 = GUICtrlCreateInput ( "", 245, 240, 30, 20)

GUICtrlCreateLabel ("ENTER another", 10, 235, 130, 40)

GUICtrlCreateLabel ("KEY HERE:", 10, 250, 130, 40)

GUICtrlCreateLabel ("SETS LOADED:", 333, 170, 120)

GUICtrlCreateLabel ("0", 460, 170, 20)

$add=GUICtrlCreateButton ("Add Set To List", 165, 275, 85)

$mylist=GUICtrlCreateList ("", 333,200,200,200)

GUICtrlSetLimit(-1,200)

$clear=GUICtrlCreateButton ("Clear Last Set", 333, 400, 75)

$install=GUICtrlCreateButton ("Install Keys", 464,400,70)

GUISetState ()

$msg = 0

While $msg <> $GUI_EVENT_CLOSE

;If GuiCtrlRead($d1) = "" AND GuiCtrlRead($d2) = "" AND GuiCtrlRead($d3) = "" AND GuiCtrlRead($d4) = ""_

;AND GuiCtrlRead($x1) = "" AND GuiCtrlRead($x2) = "" AND GuiCtrlRead($x3) = "" AND GuiCtrlRead($x4) = "" Then

;Else

;EndIf

$msg = GUIGetMsg()

Select

case $msg = $add

GUICtrlSetData($mylist,"D2 KEY:" & $d1 & "-" & $d2 & "-" & $d3 & "-" & $d4 &_

@crlf & "EXP KEY:" & $x1 & "-" & $x2 & "-" & $x3 & "-" & $x4 )

case $msg = $clear

GUICtrlSetData($mylist,"")

Case $msg = $install

MsgBox(0,"", "heres where i will add the installation process and a loading bar",2)

Exit

EndSelect

Wend


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

Next time please put it inside the

tags.

Anyway, just do what you want to do inside If statement WHEN the INPUT BOXES are BLANK. Do inside the ELSE statement what you want to do when EACH contains a value.

Do not steal keys, please... if that is your intent it will come back to haunt you.


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

that is not my intent. its for installing your own purchased copies to play multiple copies simultaniously for a popular online game.

now, what you have told me does not further my progress in understanding exactly what i need to accomplish this task.

if you run the script.. you can see the cursor is on the first field. now.. press any key more than 4 times.. and the text does not continue onto the next field. this is what im trying to do.

and the button right underneath should be greyed out until all fields are filled.

then the clear button, should not clear the entire list, just the last set entered.

and i would like to add a counter for the sets... can you guess where? lol

so, can you help? or are you unable to comprehend my explanation.

*smirk

EDIT: why use code tags when you dont comment??? theres nothing to sort out.... its not any harder to copy and paste.. unless you are drunk or something and cant copy in the lines SCRIBBLE SCRIBBLE

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

EDIT: why use code tags when you dont comment??? theres nothing to sort out.... its not any harder to copy and paste.. unless you are drunk or something and cant copy in the lines SCRIBBLE SCRIBBLE

<{POST_SNAPBACK}>

Maybe when you advance above uber-novice you'll realize that nobody wants to read code that isn't properly formatted, let alone somebody else's code. What comments have to do with using code tags is beyond me. All I know is you show off a great deal of stupidity when somebody tries to give you a piece of advice which will improve your chances of getting help and you respond with drivel that doesn't even make sense.

Although I'm sure you can't possibly come up with the code for this on your own, you currently can't trap the number of characters typed into the edit in a conventional sense. You'll have to have a background Adlib function running and poll the characters in the various fields and write the necessary logic to change focus. Said logic will also be used to enable the control when it detects all the input is in place. Its not a very hard thing to do, but it just might be above the level of somebody who doesn't even understand the basic concept of proper code formatting and the extreme usefullness of code tags.

Share this post


Link to post
Share on other sites

EDIT: why use code tags when you dont comment??? theres nothing to sort out.... its not any harder to copy and paste.. unless you are drunk or something and cant copy in the lines SCRIBBLE SCRIBBLE

Please put your code in code tags.

If you did not know:

code tags make it easier for people to read code on a white background.

code tags are not solely for commented code.

code tags retains the indenting of your pasted code.

code tags separate code from the rest of the content.

This is code tag, displays definition, away from the rest of the post.

Unless you are willing to abide by members requests, then help may be little.

Share this post


Link to post
Share on other sites

I think he's got the point. Maybe someone should block this topic before three certain members reach 10k posts.


-I am the giver of life and the bringer of death.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

makes sence

ok, i just figured since i didnt comment in that post,, it was ALL CODE that the code tags were'nt neccissary.

although you will notice prior postings did include the code tag.

i understand what you mean valik, about the method of detecting text in the fields but i am just a beginner like i said.

i am not currently advanced enough to implement any code to meet my goals at this time, but i would like to further understand examples of code so i might be more self sufficient.

however the things that i learn, i do well.

i think i did pretty good with no help, i made that "decent for a beginner" gui face

i was just making a joke on the other point... and i was unsure if he understood what i meant.

to clarify, i know im not stupid, and i can comprehend most advice given, i am grateful and appreciative for all replies.

thank you

but, even though i understand the concept of what you say, i dont know how to put it into a usable form.

enough of the chit chat, sorry if you took my post the wrong way. im here to learn, and i would like to hear your contributions to my project if you are interested.

again, thanks

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

after trial and error, i came up with this half ass solution.

While $msg <> $GUI_EVENT_CLOSE
$one = StringLen(GuiCtrlRead($d1))
$two = StringLen(GuiCtrlRead($d2))
$three = StringLen(GuiCtrlRead($d3))
$four = StringLen(GuiCtrlRead($d4))
$five = StringLen(GuiCtrlRead($x1))
$six = StringLen(GuiCtrlRead($x2))
$seven = StringLen(GuiCtrlRead($x3))
$eight = StringLen(GuiCtrlRead($x4))

  
If $one = 4 And $two = 4 And $three = 4 And $four = 4 And $five = 4 And $six = 4 And $seven = 4 And $eight = 4 Then
    $add=GUICtrlCreateButton ("Add Set To List",  165, 275, 85)
    EndIf

this will make the button appear after the fields are filled (undisirable, but functional)

i would rather the button be viewable, and just not do anything until the fields are filled.

but hey, i figured this out on my own. good advice though. got me thinking.

i dont like how the button flickers either, since its recreating itself constantly in the while loop, but i dont know how to grey a button out. i looked at styles.. alas to no avail.

im going to bed, i hope to learn more tomorrow.

EDIT. also.. im going to try to add a tab into the code tomorrow to make it jump input fields after the text reaches 4 characters in length.

thanks for the ideas. later

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

All I know is you show off a great deal of stupidity when somebody tries to give you a piece of advice which will improve your chances of getting help and you respond with drivel that doesn't even make sense.

<{POST_SNAPBACK}>

That's similar to what Donald Trump said on The Apprentice tonight :lmao:

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

drivel that doesn't even make sense

driv·el : Stupid or senseless talk.

Translation:

Stupid or senseless talk that doesn't even make sense

Simultaneously at the same time. Edited by this-is-me

Who else would I be?

Share this post


Link to post
Share on other sites

I suggest you check both meanings to the word in the future and select the one that applies best in the sentence. That is in fact, not the definition I had in mind. Rather, this one was:

n 1: a worthless message [syn: garbage]

Therefore, what I said wasn't redundant.

Share this post


Link to post
Share on other sites

so

can you be more specific on how to grey out a button using styles?

i have looked through the help file of course, and maybe i overlooked something, but nevertheless, i would like an example please.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

so

can you be more specific on how to grey out a button using styles?

i have looked through the help file of course, and maybe i overlooked something, but nevertheless, i would like an example please.

<{POST_SNAPBACK}>

Being an ass will only earn you ... well, a whole fat lot of NOTHING.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

why do people take my comments as a crack against people?

im just trying to lighten the situation, and add comic relief

im being cocky, thats a rooster.. not a donkey (ass)

anyways...

repeat reading the post, with the code tags ommited

seriously, it was a joke since the whole code tag thing was brought up earlier.

ok, can someone show me a specific example of greying out a button until a field has text entered into it?

thank you


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#include <GuiConstants.au3>
$GUI = GuiCreate("Example")

$input = GuiCtrlCreateInput("", 10,10, 100, 20)
$button = GuiCtrlCreateButton("done", 100, 100, 100, 100)
    GuiCtrlSetState(-1, $GUI_DISABLE)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        
    If GuiCtrlRead($input) <> "" And Not ControlCommand($GUI,"",$button,"IsEnabled") Then
        GuiCtrlSetState($button, $GUI_ENABLE)
    ElseIf GuiCtrlRead($input) = "" And ControlCommand($GUI,"",$button,"IsEnabled") Then
        GuiCtrlSetState($button, $GUI_DISABLE)
    EndIf
WEnd


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

btw, sorry so late

THANK YOU!!!


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0