Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example:
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Main/Listbox Popupmenu
This example is the version from Sat, 26th Aug 2016.
Project "Listbox Popupmenu.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 Function CellClick(row as Integer, column as Integer, x as Integer, y as Integer) As Boolean
if column = 1 then
dim m as new MenuItem
dim s1 as new MenuItem
s1.text = "Apple"
m.Append s1
dim s2 as new MenuItem
s2.text = "Peach"
m.Append s2
dim s3 as new MenuItem
s3.text = "Banana"
m.Append s3
dim s4 as new MenuItem
s4.text = "Ananas"
m.Append s4
dim selected as MenuItem = m.PopUp
if Selected <> nil then
me.Cell(row, column) = selected.Text
end if
end if
Return true
End EventHandler
EventHandler Sub Open()
for i as integer = 1 to 100
Listbox1.AddRow str(i), "Please select"
next
End EventHandler
End Control
Control Label1 Inherits Label
ControlInstance Label1 Inherits Label
End Control
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project
See also:
The items on this page are in the following plugins: MBS Main Plugin.