Hi all,

REALbasic 2005r4 Pro for Mac OS X
Mac OS X 10.3.9


I just saw a difference between the presence or the absence of:

SaveDlg.Filter = GraphicsFT.All

If you put that line (of course with a defined GraphicsFT File Type), you will get a "GroupBox with a StaticText ("Format:") / PopupMenu (<Display Name>)"...

You will be able to choose the target File Type from that PopupMenu.

In my case, the first defined File Type is "image/bmp", then I get as the default PopupMenu entry is: "Windows Bitmap Image"...

When I removed the bmp entry (the next entry is GIF) I get as the default PopupMenu entry is: "Graphics Interchange Format Image"...

FYI: I have defined: BMP, GIF, JPG, PICT, PNG and TIFF. So when I click in the PopupMenu, I get these entries: image/bmp, image/gif, image/jpg, image/pict, image/png and image/tiff... (the Display Name values for the file types).

Using the filter line also adds the correct extension for the selected file type: if you choose "image/png" in the PopupMenu, you will see .png as the file name extension...


WARNING: you have to provide the data in the correct format because the above mechanism only provide the extension and does not do anything more than that !

As an example, if you use .SaveAsPicture and choose bmp, the file is saved as PICT but the file extension is bmp (and so you lie to everyone and Preview will not display the file unless you remove the extension (.bmp) or change it to .pct or .pict [.pect works too !].



Unfortunately, using:

SaveDlg.Filter = GraphicsFT.PICT

does not provide this mechanism; i.e. is ignored / only GraphicsFT.All provide the above mechanism.


How do I know what Method to use (to provide the data in the correct type) ?

  SaveFI = SaveDlg.ShowModal()
  If SaveFI = Nil Then
    // Did you clicked in Cancel ?
    Return False
  End If

  MsgBox SaveFI.Type + EndOfLine + SaveFI.MacType + EndOfLine + SaveFI.Name

Type is empty
MacType = "????"
Name returns the whole name _WITH_ the extension.

So a simple check in the extension gives the choosed type and allows you to call the Method that will save the data with the correct format.

Ask me if the above is not clear enough,

Emile


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to