Platforms to show: All Mac Windows Linux Cross-Platform
/MacOSX/Spotlight/Find REALbasic Projects
Required plugins for this example: MBS Picture Plugin, MBS MacOSX Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacOSX/Spotlight/Find REALbasic Projects
This example is the version from Thu, 6th Apr 2016.
Project "Find REALbasic Projects.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class MainWindow Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control List Inherits Listbox
ControlInstance List Inherits Listbox
EventHandler Sub Open()
List.ColumnAlignmentOffset(0)=20
End EventHandler
End Control
Control UpdateTimer Inherits Timer
ControlInstance UpdateTimer Inherits Timer
EventHandler Sub Action()
MainWindow.List.DeleteAllRows
dim items() as MDItemMBS = q.Results
for each it as MDItemMBS in items
AddItem it
next
Title = str(UBound(items)+1)+" items"
End EventHandler
End Control
EventHandler Sub Close()
if q<>nil then
q.stop
q=nil
end if
End EventHandler
EventHandler Sub Open()
q=new MyQuery("kMDItemKind == 'Real Studio Project'")
if q.Handle=0 then
MsgBox "Failed to create query"
else
if q.Execute(q.kMDQueryWantsUpdates) then
'ok
q.EnableUpdates
else
MsgBox "Failed to run query"
end if
end if
End EventHandler
Sub AddItem(it as MDItemMBS)
dim file as FolderItem = GetFolderItem(it.path, folderitem.PathTypeShell)
if file = nil then
Return
end if
List.AddRow file.DisplayName
List.RowPicture(list.LastIndex)=file.IconMBS(16)
List.Celltag(List.LastIndex,0)=file
End Sub
Property q As MyQuery
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Class MyQuery Inherits MDQueryMBS
EventHandler Sub Finish()
MainWindow.UpdateTimer.Mode = 1
End EventHandler
EventHandler Sub Progress(AddedItems() as MDItemMBS, ChangedItems() as MDItemMBS, RemovedItems() as MDItemMBS)
MainWindow.UpdateTimer.Mode = 1
End EventHandler
EventHandler Sub Update(AddedItems() as MDItemMBS, ChangedItems() as MDItemMBS, RemovedItems() as MDItemMBS)
MainWindow.UpdateTimer.Mode = 1
End EventHandler
End Class
End Project
The items on this page are in the following plugins: MBS MacOSX Plugin.