Platforms to show: All Mac Windows Linux Cross-Platform
/MacFrameworks/QuickLook/QLPreviewView control
Required plugins for this example: MBS MacBase Plugin, MBS MacFrameworks Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacFrameworks/QuickLook/QLPreviewView control
This example is the version from Sat, 16th Jan 2015.
Project "QLPreviewView control.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control Listbox1 Inherits Listbox
ControlInstance Listbox1 Inherits Listbox
EventHandler Sub Change()
if me.ListIndex>=0 then
dim file as FolderItem = me.RowTag(me.ListIndex)
// In carbon apps first item is not visible. Second item is Visible. Works fine in Cocoa
n.previewItem = file
else
n.previewItem = nil
end if
End EventHandler
End Control
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control QLPreviewViewControlMBS1 Inherits QLPreviewViewControlMBS
ControlInstance QLPreviewViewControlMBS1 Inherits QLPreviewViewControlMBS
EventHandler Sub Open()
n = me.view
n.shouldCloseWithWindow = true
n.autostarts = True
End EventHandler
End Control
EventHandler Sub Open()
if not QLPreviewViewMBS.Available then
MsgBox "This example requires Mac OS X 10.6."
quit
end if
dim folder as FolderItem = SpecialFolder.Pictures.Child("Bilder")
dim c as integer = folder.Count
for i as integer = 1 to c
dim file as FolderItem = folder.TrueItem(i)
if file<>nil and file.Directory = false and file.Visible then
Listbox1.AddRow file.DisplayName
Listbox1.RowTag(listbox1.LastIndex) = file
end if
next
End EventHandler
Property n As QLPreviewViewMBS
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project
See also:
The items on this page are in the following plugins: MBS MacFrameworks Plugin.