Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Apr 30, 2017 2:00 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Create image FileTypes?
PostPosted: Sat May 11, 2013 11:30 am 
Offline

Joined: Fri Jun 05, 2009 4:54 pm
Posts: 484
Location: London, England
Hello all,
In my app I have an image well, which I want users to be able to drop image files onto.

I have the following code in the imagewell's dropObject event:

If Obj.PictureAvailable then
me.image=obj.picture
Elseif Obj.FolderItemAvailable then
me.image=Picture.Open(obj.FolderItem)
End if


I understand that I also need to create the FileTypes, and then add them as acceptedFileTypes via the app's properties editor.

The Language Reference states that a file type is created using the code below:

Dim jpegType As New FileType
jpegType.Name = "image/jpeg"
jpegType.MacType = "JPEG"
jpegType.MacCreator = "prvw"
jpegType.Extensions = "jpg;jpeg"

Dim pngType As New FileType
pngType.Name = "image/png"
pngType.MacType = "PNG "
pngType.MacCreator = "ogle"
pngType.Extensions = "png"

Dim f As FolderItem
//using the addition and conversion operators...
f = GetOpenFolderItem( jpegType + pngType )


Could someone please tell me where I place this code, as I put it into the window's open event, but when I try to add them to the app's list of accepted filetypes - none are displayed in the list editor??

Thank you all in advance.

_________________
RealStudio Professional Edition 2012 r2
Developing on OS X 10.8 (Mountain Lion)
Deploying on Windows XP / Vista / 7 / 8


Top
 Profile  
 
 Post subject: Re: Create image FileTypes?
PostPosted: Sat May 11, 2013 11:56 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
Those file types are transient: they only exist for as long as that event.
Use Project/Add/File Type Set
to create a permanent, app -wide definition.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group