Page 1 of 2 12>
Topic Options
#130245 - 2004-11-26 07:36 PM Kixform InputBox Cancel Button
Mike72677 Offline
Fresh Scripter

Registered: 2004-06-17
Posts: 32
Loc: PA
I have a simple Kixform InputBox that I can't get to work right. The box has an OK and cancel button and a box where you can type in. If you leave the text box blank and click OK, I want it to prompt you to enter a name to continue and then loop. (I have that part working). But if you click Cancel, I want the script to just end. What code do I need to get the cancel button to work? Thanks!! Here's that part of my script.

Code:
  
break on
$=setconsole("hide")

:top
$FORM = CREATEOBJECT("Kixtart.FORM")

$Name = $Form.InputBox("Enter name:", "User & PC Finder","")

IF $NAME = ""
MESSAGEBOX ("You MUST Enter A Name In To Continue", "No Name Entered", 16)
GOTO TOP
ENDIF


Top
#130246 - 2004-11-26 08:03 PM Re: Kixform InputBox Cancel Button
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
There is no way to tell if the user entered a blank value versus hitting the cancel button - what version of Kixforms you running ?
Top
#130247 - 2004-11-26 08:23 PM Re: Kixform InputBox Cancel Button
Mike72677 Offline
Fresh Scripter

Registered: 2004-06-17
Posts: 32
Loc: PA
I seen an older post with this in it:

Code:
  
$ButtonCancel = $FormQuestion.Button('Cancel', $ButtonOK.Right + 10, $TextBoxAnswer.Bottom + 5, 40, 16)
$ButtonCancel.Cancel = 1
$ButtonCancel.OnClick = 'GOSUB ButtonCancel_Click'



But wasn't sure how/if it worked. My kixfroms.dll is showing version 2.2.0.37. Thanks!

Top
#130248 - 2004-11-26 10:24 PM Re: Kixform InputBox Cancel Button
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
The example you provided is/was from a custom hand-jobbed form, where you have to do all the work in building/driving the form. InputBox is a simpler/canned form and is easier to use. For what your doing, I would suggest sticking with InputBox. Question becomes how does one trap the cancel button ... hmmmm ...

If your willing to upgrade to the latest DEV build of Kixforms ... can "fix" this up for you...

Top
#130249 - 2004-11-26 10:33 PM Re: Kixform InputBox Cancel Button
Mike72677 Offline
Fresh Scripter

Registered: 2004-06-17
Posts: 32
Loc: PA
What do I need to do to my script if I upgrade to the current version of Kixforms?
Top
#130250 - 2004-11-26 10:36 PM Re: Kixform InputBox Cancel Button
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Probably nothing ... but give the build a try ... here it is ...

Kixforms Development Build

Let me know if your script looks/behaves the same, if so - we can talk.

Top
#130251 - 2004-11-26 10:39 PM Re: Kixform InputBox Cancel Button
Mike72677 Offline
Fresh Scripter

Registered: 2004-06-17
Posts: 32
Loc: PA
Same thing. The only way to get out of the script is to type in something and click OK. Even typing something in and clicking Cancel just loops the script.
Top
#130252 - 2004-11-26 10:53 PM Re: Kixform InputBox Cancel Button
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
ja, you should be getting the same thing ... i'm going to enhance the development build to support detecting the cancel button, it means that you will have to do things a little different though ... but this is something i've been meaning to do for a while now, you just prompted me to actually go do it ....

Will post a new build tonight hopefully ... stay tuned (if you can) ...


Top
#130253 - 2004-11-26 11:04 PM Re: Kixform InputBox Cancel Button
Mike72677 Offline
Fresh Scripter

Registered: 2004-06-17
Posts: 32
Loc: PA
I'll be waiting! Thanks!!
Top
#130254 - 2004-11-26 11:06 PM Re: Kixform InputBox Cancel Button
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
don't go anywhere ... its done ... let me repost the build (5 minutes) then write a little sample script (10 minutes), be back in 15 minutes ...

-Shawn

Top
#130255 - 2004-11-26 11:19 PM Re: Kixform InputBox Cancel Button
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Ok, download the latest DEV build again (should be special build 6), and try this script ... it uses the InputBox object, and something called the "DialogResult" property, which is documented in the old CHM ... here's the script ...

Code:

Break On

$System = CreateObject("Kixtart.System")

$InputBox = $System.InputBox()

:TOP

$Name = $InputBox.Show("Enter name:", "User & PC Finder","")

If $InputBox.DialogResult = 2 ; Cancel
?"Quiting..."
Quit
Endif

If $Name = ""
$= MESSAGEBOX ("You MUST Enter A Name In To Continue", "No Name Entered", 16)
GOTO TOP
Endif

?"Name = " $Name

Exit 0



Let me know if you have any questions ...

-Shawn

Top
#130256 - 2004-11-26 11:30 PM Re: Kixform InputBox Cancel Button
Mike72677 Offline
Fresh Scripter

Registered: 2004-06-17
Posts: 32
Loc: PA
Script error : unknown command !
$InputBox = $System.InputBox()

I got the latest build (2.4.0.46) Or do I not have the latest build?

Top
#130257 - 2004-11-26 11:45 PM Re: Kixform InputBox Cancel Button
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
What does this script give you ?

Break On

$Form = CreateObject("Kixtart.Form")

?"Build=" $Form.Build

Exit 0

-Shawn

Top
#130258 - 2004-11-26 11:48 PM Re: Kixform InputBox Cancel Button
Mike72677 Offline
Fresh Scripter

Registered: 2004-06-17
Posts: 32
Loc: PA
Build=46
Top
#130259 - 2004-11-26 11:56 PM Re: Kixform InputBox Cancel Button
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Scratching my head over this one. Can you do two things ...

1) Search your entire hard drive for instances of kixforms.dll, look to see how many you got kicking around ...

2) Go to the folder that has the latest build (look at the DLL properties and look for Special Build = 6), then re-register the dll, making sure to provide the fully qualified path to the DLL on the command-line ...


Top
#130260 - 2004-11-27 12:00 AM Re: Kixform InputBox Cancel Button
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Wait a sec, think i posted the wrong version of the DLL, try downloading the DEV build again and try again ...

Sorry about that ...

-Shawn

Top
#130261 - 2004-11-27 12:02 AM Re: Kixform InputBox Cancel Button
Mike72677 Offline
Fresh Scripter

Registered: 2004-06-17
Posts: 32
Loc: PA
Reregistering the DLL appears to have fixed it! Cancel works GREAT now! Thanks!! All is well now for me! Works GREAT!!
Top
#130262 - 2004-11-27 12:52 AM Re: Kixform InputBox Cancel Button
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
I would recommend always making sure users do the following before other trouble shooting methods.

regsvr32 /u kixforms.dll

Then delete old kixforms.dll then copy new one into %windir%\system32 (excluding Windows 9x)

Then run

regsvr32 kixforms.dll

Then run new scripts

p.s. What's with the GOTO

Top
#130263 - 2004-11-27 01:16 AM Re: Kixform InputBox Cancel Button
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
...and QUIT without a parm? tsk, tsk

"Quitting..."?
Quit 0
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#130264 - 2004-11-27 03:04 AM Re: Kixform InputBox Cancel Button
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
you boys are really ream'n the old man tonight ;0)
Top
Page 1 of 2 12>


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

Who's Online
0 registered and 259 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.074 seconds in which 0.027 seconds were spent on a total of 13 queries. Zlib compression enabled.

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