#89364 - 2002-11-13 06:12 PM
Kixforms: FileOpenDialog()
|
krabourn
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
|
|
|
|
#89377 - 2002-11-13 09:11 PM
Re: Kixforms: FileOpenDialog()
|
Shawn
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
|
|
|
|
#89383 - 2002-11-14 02:06 PM
Re: Kixforms: FileOpenDialog()
|
Shawn
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
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 515 anonymous users online.
|
|
|