Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/MacClassic/Folderitem Functions
Function:
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacClassic/Folderitem Functions
This example is the version from Mon, 24th Sep 2017.
Project "Folderitem Functions.rbp"
FileTypes
Filetype special/any
End FileTypes
Class AboutFolderitem Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control filename Inherits Label
ControlInstance filename Inherits Label
End Control
Control displayname Inherits Label
ControlInstance displayname Inherits Label
End Control
Control filesize Inherits Label
ControlInstance filesize Inherits Label
End Control
Control directory Inherits Label
ControlInstance directory Inherits Label
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control count Inherits Label
ControlInstance count Inherits Label
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
Control fileflags Inherits Label
ControlInstance fileflags Inherits Label
End Control
Control StaticText10 Inherits Label
ControlInstance StaticText10 Inherits Label
End Control
Control folderflags Inherits Label
ControlInstance folderflags Inherits Label
End Control
Control icon Inherits Canvas
ControlInstance icon Inherits Canvas
End Control
Control StaticText11 Inherits Label
ControlInstance StaticText11 Inherits Label
End Control
Control onremotevolume Inherits Label
ControlInstance onremotevolume Inherits Label
End Control
Control StaticText9 Inherits Label
ControlInstance StaticText9 Inherits Label
End Control
Control type Inherits Label
ControlInstance type Inherits Label
End Control
Control StaticText14 Inherits Label
ControlInstance StaticText14 Inherits Label
End Control
Control Creator Inherits Label
ControlInstance Creator Inherits Label
End Control
Control StaticText12 Inherits Label
ControlInstance StaticText12 Inherits Label
End Control
Control tcicon Inherits Canvas
ControlInstance tcicon Inherits Canvas
End Control
Control StaticText16 Inherits Label
ControlInstance StaticText16 Inherits Label
End Control
Control StaticText18 Inherits Label
ControlInstance StaticText18 Inherits Label
End Control
Control StaticText20 Inherits Label
ControlInstance StaticText20 Inherits Label
End Control
Control sizevolume Inherits Label
ControlInstance sizevolume Inherits Label
End Control
Control StaticText22 Inherits Label
ControlInstance StaticText22 Inherits Label
End Control
Control freevolume Inherits Label
ControlInstance freevolume Inherits Label
End Control
Control canCatSearch Inherits Label
ControlInstance canCatSearch Inherits Label
End Control
Control StaticText21 Inherits Label
ControlInstance StaticText21 Inherits Label
End Control
Control StaticText23 Inherits Label
ControlInstance StaticText23 Inherits Label
End Control
Control StaticText24 Inherits Label
ControlInstance StaticText24 Inherits Label
End Control
Control trash Inherits Label
ControlInstance trash Inherits Label
End Control
Control desktop Inherits Label
ControlInstance desktop Inherits Label
End Control
Control temp Inherits Label
ControlInstance temp Inherits Label
End Control
Control StaticText25 Inherits Label
ControlInstance StaticText25 Inherits Label
End Control
Control unixpath Inherits Label
ControlInstance unixpath Inherits Label
End Control
Control StaticText26 Inherits Label
ControlInstance StaticText26 Inherits Label
End Control
Control shortpath Inherits Label
ControlInstance shortpath Inherits Label
End Control
Control StaticText28 Inherits Label
ControlInstance StaticText28 Inherits Label
End Control
Control longpath Inherits Label
ControlInstance longpath Inherits Label
End Control
EventHandler Sub DropObject(obj As DragItem, action As Integer) do if obj.folderItemAvailable then info obj.folderItem end if loop until not obj.nextItem End EventHandler
EventHandler Sub Open() me.acceptfileDrop "special/any" info app.ApplicationFileMBS End EventHandler
Function bool(b as boolean) As string if b then return "yes" else return "no" end if End Function
Function flags(i as integer) As string if i>=0 then return format(i,"0") else return "n/a" end if End Function
Function folder(f as folderItem) As string if f<>Nil then return f.absolutePath else return "n/a" end if End Function
Sub info(f as folderItem) dim p as Picture if f=nil or not f.exists then msgBox "Invalid Folderitem!" return end if 'RB built in: filename.text=f.name displayname.text=f.displayName filesize.text=Format((f.length+f.resourceForkLength)/1024,"0")+" KB" directory.text=bool(f.directory) count.text=str(f.count) type.text=f.mactype creator.text=f.maccreator ' MBS Plugin fileflags.text=flags(f.GetFileFlagsMBS) folderflags.text=flags(f.GetFolderFlagsMBS) icon.backdrop=f.IconMBS(32) p=f.IconImageMBS(32) if p<>nil then p.mask.Graphics.DrawPicture f.IconMaskMBS(32),0,0 tcicon.backdrop=p end if onremotevolume.text=bool(f.IsOnRemoteVolumeMBS) cancatSearch.text=Bool(f.VolSupportsCatSearchMBS) sizevolume.text=format(f.VolumeSizeMBS/1024.0/1024.0,"0.0")+" MBytes" freevolume.text=format(f.VolumeFreeSizeMBS/1024.0/1024.0,"0.0")+" MBytes" trash.text=folder(f.TrashFolder) temp.text=folder(f.temporaryFolder) desktop.text=folder(f.DesktopFolder) unixpath.text=f.UnixpathMBS shortpath.text=f.ShortPathMBS longpath.text=f.LongPathMBS // in Win Plugin. End Sub
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacClassic Plugin.




Links
MBS Xojo Plugins