Page 1 of 1 1
Topic Options
#90066 - 2002-12-01 07:46 AM KIXForms and Loginscript
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
I have been using a KiXtart Loginscript for awhile now and it has worked pretty well. I wanted to try a GUI Interface (using KiXforms) instead of the plain DOS looking interface that I had written.

I used Chris S. loginscript example (written using KiXforms). I was 80% done when I ran into a problem. I want a window to popup and provide a field for the user to enter a password. I need to capture what is enter and set that to a variable.

This is what I have come up with and it does not work as I need it to. Given my newbie experience with KiXforms, I was hoping one of you experts should shed some light:

code:
$FORMPASS=CREATEOBJECT("KIXTART.FORM")
$FORMPASS.SIZE=200,100
$FORMPASS.SYSMENU=0
$FORMPASS.TEXT="Enter Network Password"
$FORMPASS.CENTER

$LABELPASSINPUT=$FORMPASS.TEXTBOX("",20,10,145,20)
$LABELPASSINPUT.PASSWORDCHAR="*"
$LABELPASSINPUTBUTTON=$FORMPASS.COMMANDBUTTON("OK")
$LABELPASSINPUTBUTTON.CENTER
$LABELPASSINPUTBUTTON.DEFAULT=TRUE
$LABELPASSINPUTBUTTON.ONCLICK="GETPASS($LABELPASSINPUT.VALUE)"
$PASS=$LABELPASSINPUT.VALUE

$FORMPASS.SHOW

2 problems with it. One it seems to continue on with the script (passing the area where the password would be used, so it fails). Two is finding out how to set the $PASS variable to the value of what the user enters.

The window is a simple window with a blank field and an OK button. When the user enters their password, a '*' is displayed for each character. It seems that the loginscript should wait until the ONCLICK property is activated.

Thanks in advanced,

KIXKicks

[ 01. December 2002, 07:49: Message edited by: KIXKicks ]

Top
#90067 - 2002-12-01 07:50 AM Re: KIXForms and Loginscript
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, the code looks good.

think only thing you need to add is after this line:
$FORMPASS.SHOW

add:
while $FORMPASS.visible $=execute($FORMPASS.doevents)

that should remove your both problems.

cheers.
_________________________
!

download KiXnet

Top
#90068 - 2002-12-01 08:17 AM Re: KIXForms and Loginscript
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
That does help, however the window I have create never goes away so it stays on this portion of the code. I tried to change the code to this:

code:
$FORMPASS=CREATEOBJECT("KIXTART.FORM")
$FORMPASS.SIZE=200,100
$FORMPASS.SYSMENU=0
$FORMPASS.TEXT="Enter Network Password"
$FORMPASS.CENTER

$LABELPASSINPUT=$FORMPASS.TEXTBOX("",20,10,145,20)
$LABELPASSINPUT.PASSWORDCHAR="*"
$LABELPASSINPUTBUTTON=$FORMPASS.COMMANDBUTTON("OK",100,40,40,20)
$LABELPASSINPUTBUTTON.DEFAULT=TRUE

$LABELPASSINPUTBUTTON.ONCLICK=$FORMPASS.HIDE
$PASS=$LABELPASSINPUT.VALUE

$FORMPASS.SHOW
WHILE $FORMPASS.VISIBLE
$=EXECUTE($FORMPASS.DOEVENTS())
LOOP

But it doesn't work.

[ 01. December 2002, 08:18: Message edited by: KIXKicks ]

Top
#90069 - 2002-12-01 08:20 AM Re: KIXForms and Loginscript
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yeah.
change this:
code:
$LABELPASSINPUTBUTTON.ONCLICK=$FORMPASS.HIDE

to:
code:
$LABELPASSINPUTBUTTON.ONCLICK="$$FORMPASS.HIDE"

_________________________
!

download KiXnet

Top
#90070 - 2002-12-01 08:21 AM Re: KIXForms and Loginscript
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and you can leave the execute as I put it.
_________________________
!

download KiXnet

Top
#90071 - 2002-12-01 08:33 AM Re: KIXForms and Loginscript
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
That took care of the window problem. The only thing is that $PASS is being return as empty even though I am typing in a password...
Top
#90072 - 2002-12-01 08:35 AM Re: KIXForms and Loginscript
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
By the way...BBChecker II is pretty awesome!

Here is the latest code:

code:
 $FORMPASS=CREATEOBJECT("KIXTART.FORM")
$FORMPASS.SIZE=200,100
$FORMPASS.SYSMENU=0
$FORMPASS.TEXT="Enter Network Password"
$FORMPASS.CENTER

$LABELPASSINPUT=$FORMPASS.TEXTBOX("",20,10,145,20)
$LABELPASSINPUT.PASSWORDCHAR="*"
$LABELPASSINPUTBUTTON=$FORMPASS.COMMANDBUTTON("OK",100,40,40,20)
$LABELPASSINPUTBUTTON.DEFAULT=TRUE
$LABELPASSINPUTBUTTON.ONCLICK="$$FORMPASS.HIDE"
$PASS=$LABELPASSINPUT.VALUE

$FORMPASS.SHOW
WHILE $FORMPASS.VISIBLE $=EXECUTE($FORMPASS.DOEVENTS)
LOOP

Do I need the LOOP at the end?

Top
#90073 - 2002-12-01 08:38 AM Re: KIXForms and Loginscript
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the while doevents loop structure is the one that makes the script to execute your clicks and such.

now, if you don't get value from textbox change the line to:
$PASS=$LABELPASSINPUT.text
_________________________
!

download KiXnet

Top
#90074 - 2002-12-01 08:42 AM Re: KIXForms and Loginscript
KIXKicks Offline
Starting to like KiXtart

Registered: 2002-07-26
Posts: 177
Loc: Vancouver, WA
Try it and same results...$PASS is empty...
Top
#90075 - 2002-12-01 08:50 AM Re: KIXForms and Loginscript
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yep, the line should be after the loop line
_________________________
!

download KiXnet

Top
#90076 - 2002-12-01 09:14 PM Re: KIXForms and Loginscript
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
You might want to incorporate another

$LABELPASSINPUT.OnChange = "$$pass = $$LABELPASSINPUT.Text"

(Wow these are long varnames [Roll Eyes] )

[Big Grin]

[ 01. December 2002, 21:15: Message edited by: jpols ]
_________________________



Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1114 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.07 seconds in which 0.033 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org