Page 1 of 1 1
Topic Options
#30379 - 2002-10-08 04:39 AM Graphical user input
Ironpaw Offline
Fresh Scripter

Registered: 2002-10-08
Posts: 6
I'm getting more into kix and I was after a way to use a graphical window to ask for user input.

I can put up a yes/no window and use the reply but I'd like something like

"what is your IP Address"
graphically and feed that back to the script.

Heres the graphical yes/no for the fellow new ppl

$selection=MESSAGEBOX("Your PC is a Satellite PC. Are you in a satellite site?","Attention",4132)

IF $selection=6
beep
echo pressed yes
goto somewhere
IF $selection=7
echo pressed no

Top
#30380 - 2002-10-08 04:44 AM Re: Graphical user input
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Search the board for KixForms discussions.

Download here: http://harmsy.freeuk.com/kixforms/downloads.htm

[ 08. October 2002, 04:45: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#30381 - 2002-10-08 04:49 AM Re: Graphical user input
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Why do you want them to enter an IP address? You can easily pull that with the @IPADDRESSx macro or if they use a VPN/Dial-UP there are other ways to retrieve the IP address used to log in.
_________________________
There are two types of vessels, submarines and targets.

Top
#30382 - 2002-10-08 04:57 AM Re: Graphical user input
Ironpaw Offline
Fresh Scripter

Registered: 2002-10-08
Posts: 6
I want to ask for the IP as I have a batch that attaches to remote systems and sux all there logs to the local system. Our logs are all over the place. I can do all this from the command line but I am making a tool for the "help desk" so it has to be usable for the "technical elite."

The idea is they enter the ip (this is a unix backend shop so I need the actual IP) and it opens all the logs for em. I'll take a look at the post above. Reminds me of the average unix reply i get "read the man pages" as if I hadn't already...

Thanks

Top
#30383 - 2002-10-08 05:06 AM Re: Graphical user input
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I gave you the information you ask for. I have never coded anything using KixForms, but thought it fit the bill based on your inquiry.

There is no magic bullet that would give you a completed solution. You will have to learn about KixForms. Sorry you didn't like my post.

[ 08. October 2002, 05:07: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#30384 - 2002-10-08 05:15 AM Re: Graphical user input
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
What version of Kixtart are you using ?
Top
#30385 - 2002-10-08 05:42 AM Re: Graphical user input
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
iron dude - howard wasn't pointing you to the man pages - he was pointing you to a potential solution ... like he said, download the latest version of kixforms, register the component on your workstation, then run this script using the lastest version of kixtart. won't find any of this stuff in the man pages im afraid. and this script (UDF) is hot off the press ...

I call it "WhazabyIP"

It pops up a dialog box, complete with IP form fields, and asks the user "Whazaby the IP?"

code:
Break On

$ip = WhuzabyIP()

?"ip=" $ip

Exit 1

Function WhuzabyIP()

Dim $Form,$Txt1,$Txt2,$Txt3,$Txt4
Dim $Exit

$Form = CreateObject("Kixtart.Form")
$Form.Caption = "WhuzabyIP ?"
$Form.BackColor = SkyBlue

$Form.ScaleHeight = 150
$Form.ScaleWidth = 270
$Form.FontSize = 12

$Txt1 = $Form.TextBox("",10,50,50,30)
$Txt1.MaxLength = 3
$Txt1.AutoTab = 1
$Txt1.Text = Split(@IPADDRESS0,".")[0]

$Txt2 = $Form.TextBox("",75,50,50,30)
$Txt2.MaxLength = 3
$Txt2.AutoTab = 1
$Txt2.Text = Split(@IPADDRESS0,".")[1]

$Txt3 = $Form.TextBox("",140,50,50,30)
$Txt3.MaxLength = 3
$Txt3.AutoTab = 1
$Txt3.Text = Split(@IPADDRESS0,".")[2]

$Txt4 = $Form.TextBox("",205,50,50,30)
$Txt4.MaxLength = 3
$Txt4.AutoTab = 1
$Txt4.Text = Split(@IPADDRESS0,".")[3]

$Exit = $Form.CommandButton("OK")
$Exit.Center
$Exit.Top = $Txt1.Bottom + 15
$Exit.OnClick = "$$Form.Tag = 1"
$Exit.TabStop = 0

$Form.FontSize = 16
$Form.PrintXY(10,10,"Whaza IP be ?")

$Txt1.SetFocus
$Form.Center
$Form.Show
$Form.Tag = 0

While $Form.Visible And $Form.Tag = 0
$=Execute($Form.DoEvents)
Loop

If $Form.Tag = 1 ; OK
$WhuzabyIP = $Txt1.Text+"."+$Txt2.Text+"."+$Txt3.Text+"."+$Txt4.Text
Else
$WhuzabyIP = ""
EndIf

EndFunction



[ 08. October 2002, 05:46: Message edited by: Shawn ]

Top
#30386 - 2002-10-08 05:45 AM Re: Graphical user input
Ironpaw Offline
Fresh Scripter

Registered: 2002-10-08
Posts: 6
Sorry Howard I'm an ass I didn't fully read you post it was actually very good. I'm looking into it now. I thought you where directing me to a search area and I've been a searching. (I'll slap myself for you)

I am using version 3.60 (stuck with it as it is on all clients all over the country and "they" will not change it for me).

Top
#30387 - 2002-10-08 05:58 AM Re: Graphical user input
Ironpaw Offline
Fresh Scripter

Registered: 2002-10-08
Posts: 6
Shawn thanks that looks excellent. I am ignoring my last post and downloading the latest kix. The tool will only be used by IT types and we can all use a latter kix so no worries.

Kix is looking more like perl to me all the time after seeing your script, very good, ideal actually.

Thanks

Still feeling stupid for my ealier post had being an arse to people who are trying to help!

Top
#30388 - 2002-10-08 06:59 AM Re: Graphical user input
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Ironpaw,

Much like you, I was in the same situation of deployment of new version of Kixtart..

I would suggest having a look at - Deployment of Kix Scripts

While it is by no means a "perfect solution," there are many concepts and hurdles that we had to cross too.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1782 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.061 seconds in which 0.025 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