Platforms to show: All Mac Windows Linux Cross-Platform
/Main/MBS Plugin Lister/MBS Plugin Lister
Required plugins for this example:
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Main/MBS Plugin Lister/MBS Plugin Lister
This example is the version from Sun, 29th Nov 2014.
Project "MBS Plugin Lister.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
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
Dim dlg as new OpenDialog
Dim f as FolderItem
redim MBSstack(-1)
ListBox1.DeleteAllRows
dlg.Title="Select a mac application"
dlg.Filter= FileTypes1.Apps
f=dlg.ShowModal()
If f <> Nil and f.Directory then
ProcessPackage f
End if
for each s as string in MBSstack
Listbox1.AddRow s
next
Exception
MsgBox "Error in PushButton1"
End EventHandler
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Sub ProcessContentsFolder(f as folderitem)
dim i,c as integer
dim g as FolderItem
c=f.Count
for i = 1 to c
g=f.TrueItem(i)
if g<>Nil and g.Directory and g.Name = "Frameworks" then
ProcessFolder g
end if
next
End Sub
Sub ProcessFolder(f as folderitem)
dim i as Integer
dim s as string
for i = 1 to f.Count
if instr(f.Item(i).name, "MBS") > 0 then
s = NthField(f.Item(i).name, ".rbx", 1)
if MBSstack.IndexOf(s) < 0 then
MBSstack.Append s
end if
end if
next
End Sub
Sub ProcessPackage(f as folderitem)
dim i,c as integer
dim g as FolderItem
c=F.Count
for i = 1 to c
g=f.TrueItem(i)
if g<>Nil and g.Directory and g.Name = "Contents" then
ProcessContentsFolder g
end if
next
End Sub
Property MBSstack() As string
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
FileTypes1
Filetype apps
End FileTypes1
End Project
See also:
The items on this page are in the following plugins: MBS Main Plugin.