Page 1 of 1 1
Topic Options
#89364 - 2002-11-13 06:12 PM Kixforms: FileOpenDialog()
krabourn Offline
Hey THIS is FUN
*****

Registered: 2000-12-11
Posts: 244
Loc: San Antonio, Texas, USA
I think I have found a bug in Kixforms for the FileOpenDialog() method. I have noticed that sporadic behavor from this method. It will let me open files anywhere from 1 to as many as 7 times and then, POOF, the scripts quits with no error code.

Is this a known issue that I have missed or am I doing something wrong?

code:
FUNCTION Open_Click()
; $FileComputerList = $Form.FileOpenDialog('Open Computer List', '.\', 'COMPUTER.LST', 'Computer Lists|*.lst|All Files|*.*')
?
$Form.FileOpenDialog('Open Computer List', '.\', 'COMPUTER.LST', 'Computer Lists|*.lst|All Files|*.*')

? @error ' --- ' @serror
IF $FileComputerList
Load_Click()
ENDIF
ENDFUNCTION

Output
code:
C:\Programs\Kix\kixforms\RTA\removeclient.lst
0 --- The operation completed successfully.

C:\Programs\Kix\kixforms\RTA>kix32 rta.kix

C:\Programs\Kix\kixforms\RTA\removeclient.lst
0 --- The operation completed successfully.
C:\Programs\Kix\kixforms\RTA\COMPUTER.LST
0 --- The operation completed successfully.
C:\Programs\Kix\kixforms\RTA\removeclient.lst
0 --- The operation completed successfully.
C:\Programs\Kix\kixforms\RTA\COMPUTER.LST
0 --- The operation completed successfully.
C:\Programs\Kix\kixforms\RTA\removeclient.lst
0 --- The operation completed successfully.
C:\Programs\Kix\kixforms\RTA\COMPUTER.LST
0 --- The operation completed successfully.
C:\Programs\Kix\kixforms\RTA\removeclient.lst
0 --- The operation completed successfully.

Thanks
_________________________
Kelly

Top
#89365 - 2002-11-13 06:21 PM Re: Kixforms: FileOpenDialog()
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
My gut feeling is that I still don't have that FILTER parameter working quite right yet. Krabourn, just as a test, can you null-out ("") the filter parm and run your tests again to see if it still craps out ?
Top
#89366 - 2002-11-13 07:54 PM Re: Kixforms: FileOpenDialog()
krabourn Offline
Hey THIS is FUN
*****

Registered: 2000-12-11
Posts: 244
Loc: San Antonio, Texas, USA
It still dies.

code:
$Form.FileOpenDialog('Open Computer List', '.\', 'COMPUTER.LST','')

or

$Form.FileOpenDialog('Open Computer List', '.\', 'COMPUTER.LST')

_________________________
Kelly

Top
#89367 - 2002-11-13 08:02 PM Re: Kixforms: FileOpenDialog()
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Try putting an extra parm set to zero at the end, exmaple:

$FileName = $Form.FileOpenDialog('Open Computer List', '.\', 'COMPUTER.LST','',0)

Same ?

Top
#89368 - 2002-11-13 08:05 PM Re: Kixforms: FileOpenDialog()
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
I can't verify this behavior. Could it be something else?
Top
#89369 - 2002-11-13 08:08 PM Re: Kixforms: FileOpenDialog()
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Speaking of the FileOpenDialog...is it possible to have a default flag of '4' to mask the 'Open as read-only' checkbox? As far as I know, we don't have a way of checking if that checkbox is checked anyway.
Top
#89370 - 2002-11-13 08:12 PM Re: Kixforms: FileOpenDialog()
krabourn Offline
Hey THIS is FUN
*****

Registered: 2000-12-11
Posts: 244
Loc: San Antonio, Texas, USA
Still a no go.

code:
$Form.FileOpenDialog('Open Computer List', '.\', 'COMPUTER.LST', '', 0)

Shawn:
I forgot to mention. I am using the build that you sent me. The DLL is dated 11/5/2002. Just in case.
_________________________
Kelly

Top
#89371 - 2002-11-13 08:14 PM Re: Kixforms: FileOpenDialog()
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
I'm using that same build, but still can't reproduce the error.
Top
#89372 - 2002-11-13 08:16 PM Re: Kixforms: FileOpenDialog()
krabourn Offline
Hey THIS is FUN
*****

Registered: 2000-12-11
Posts: 244
Loc: San Antonio, Texas, USA
Microsoft Windows 2000 [Version 5.00.2195]
Kix32 4.12 (Final)
Kixforms 11/5/2002
_________________________
Kelly

Top
#89373 - 2002-11-13 08:20 PM Re: Kixforms: FileOpenDialog()
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
krabourn, I think it has to be something else causing the script to quit. Your example output is showing that the operation has completed successfully and then exits.

Or...is it crapping out the next time you call the function?

Try putting a 'debug on' in your function to verify.

Top
#89374 - 2002-11-13 08:35 PM Re: Kixforms: FileOpenDialog()
krabourn Offline
Hey THIS is FUN
*****

Registered: 2000-12-11
Posts: 244
Loc: San Antonio, Texas, USA
I have tried Debug and that does not help. I can remark out the FileOpenDialog() line and everyhting works fine. I have tried Kix 4.11 through 4.12.

I also took the spaces out after the commas and that did not help.

I guess I am getting desparate.
_________________________
Kelly

Top
#89375 - 2002-11-13 08:39 PM Re: Kixforms: FileOpenDialog()
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Is the script acutally trapping (ie, theres an eventlog exception) or is it just not performing the Dialog ?
Top
#89376 - 2002-11-13 08:45 PM Re: Kixforms: FileOpenDialog()
krabourn Offline
Hey THIS is FUN
*****

Registered: 2000-12-11
Posts: 244
Loc: San Antonio, Texas, USA
I was wr.. wr.. wrong. Taking the spaces out did help. [Smile]

[ 13. November 2002, 20:46: Message edited by: krabourn ]
_________________________
Kelly

Top
#89377 - 2002-11-13 09:11 PM Re: Kixforms: FileOpenDialog()
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Chris, I hear you buddy, I've been doing some strategizing of late in terms of a better (more dotnet-like) approach to the Common Dialogs. It is a mistake to treat them as simple method calls - they should be seperate stand-alone objects in their own right. Having said that, what I propose is something like the following:

Instantiate the OpenFileDialog as a seperate object at the top of one's script:

code:
 
$OpenFileDialog = $Form.OpenFileDialog()
$OpenFileDialog.Extention = ".kix"
$OpenFileDialog.Directory = ".\"
$OpenFileDialog.Filter = "All Files|*.*"

and then to invoke the dialog:

code:
If $OpenFileDialog.ShowDialog() = 1 ; OK

?"File=" $OpenFileDialog.FileName

EndIf

Then, I can move to implement a more robust versions of all the following: BrowseForFolderDialog, FileCopyDialog, PrintDialog, ColorDialog and FontDialog.

Any thoughts ?

Top
#89378 - 2002-11-13 09:14 PM Re: Kixforms: FileOpenDialog()
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Shawn, I dig it, baby. I think that is a shagadellic idea.
Top
#89379 - 2002-11-13 10:03 PM Re: Kixforms: FileOpenDialog()
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Of course, this will change the under-the-covers
landscape of Kixforms a little bit. Remember how
we were talking about bypassing regsvr32 and
poking the registry directly - this may get
trickier in this new scenario - but no big deal
because I'm planning on implementing two new
major Kixforms classes anyway.

In the registry, Kixforms is under HKEY_CLASSES_ROOT with the key:

Kixtart.Form

well, there will be two more (in the short-term anyways):

Kixtart.Form
Kixtart.Dialog
Kixtart.Graphics

These will make their appearance in up-comming
builds. They won't be directly accessible
through code however - they will just be
containers for a ton of new objects in works.
Kixtart.Dialog will contain all the new Dialog
classes we just discussed. Kixtart.Graphics will
contain a set of objects used for rendering. For
example: the following classes:

Icon
Bitmap
Image (the base class for Icon and Bitmap)

and a bunch of rendering methods, some of which
are:

DrawImage
DrawPoly
DrawArc
DrawRectangles
DrawGradientFill

[ 13. November 2002, 22:06: Message edited by: Shawn ]

Top
#89380 - 2002-11-13 10:05 PM Re: Kixforms: FileOpenDialog()
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Therein lies the danger of bypassing the 'usual' install.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#89381 - 2002-11-14 10:11 AM Re: Kixforms: FileOpenDialog()
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6343
Loc: Stuttgart, Germany
hmm ... now I am a bit disconcerted

What does the implementation of that classes imply for the programmer ?

Do we have to Create those as additional objects or are they accessed by Kixtart.form anyway ?

Do we have to preceed subsequent calls of objects in these with Form.Dialog(Graphics).Object ?
(Don't think so after re-reading)

Please clarify

J.
_________________________



Top
#89382 - 2002-11-14 10:30 AM Re: Kixforms: FileOpenDialog()
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
j,
can't be 100,1% sure but there has been lot of stuff in reg before and those had "nothing" to do with the usage.
if I understood your question...

shawn, what you mean with bypassing regsvr32?
 
_________________________
!

download KiXnet

Top
#89383 - 2002-11-14 02:06 PM Re: Kixforms: FileOpenDialog()
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Jochen,

quote:

Do we have to Create those as additional objects
or are they accessed by Kixtart.form anyway ?

Good question. In the case of the Common Dialogs,
haven't really decided yet ... but lets talk
about the Graphics classes first. They will be
accessed through Kixtart.Form something like
this (for example, to create a bitmap):

code:
$Bitmap = $Form.Graphics.Bitmap(".\kixtart.bmp")

?"Bitmap Width=" $Bitmap.Width

?"Bitmap Height=" $Bitmap.Height

Then, lets say you wanted to draw the bitmap
somewhere on a form, like this:

code:
$Form.Graphics.DrawImage($Bitmap,10,10)

All graphics objects would be accessed and
manipulated through the Graphics property of any
class that supported graphics (right now, only a
handfull).

The Common Dialogs are a different story. Two
options here. One is to instantiate the dialogs
seperately using CreateObject like this:

code:
$Dialogs = CreateObject("Kixtart.Dialogs")

$OpenFileDialog = $Dialogs.OpenFileDialog

$OpenFileDialog.ShowDialog()

or, the other way is to instantiate through a
property called Dialogs in all Kixtart.Form
classes like this:

code:
$OpenFileDialog = $Form.Dialogs.OpenFileDialog()

$OpenFileDialog.ShowDialog()

Any thoughts on the best approach here ?

Jooel, yeah - think you might have been on
vacation when we discussed bypassing regsvr32 to
register Kixforms, and just use registry pokes.
And - when a new build of Kixforms is released -
simply copy over the existing DLL and not re
-register the component. This is an OK thing to
do, as long as none of the underlying COM
classes have been changed. Which WILL be the
case when these two new major classes are
released. Once its re-registered, then one can
go back to simply copying over the DLL. But
Les's point about bypassing regsvr32 is valid.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 172 anonymous users online.
Newest Members
FlyHorton, mschwj, Barchester, Evgeniy, kvanacker
17498 Registered Users

Generated in 0.042 seconds in which 0.011 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