Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCF/PopupMenu MacOSX
Required plugins for this example: MBS MacCF Plugin, MBS Main Plugin, MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCF/PopupMenu MacOSX
This example is the version from Sun, 17th Mar 2012.
Project "PopupMenu MacOSX.rbp"
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control PopupMenu1 Inherits PopupMenu
ControlInstance PopupMenu1 Inherits PopupMenu
EventHandler Sub Open() dim m,s as MenuMBS m=me.MenuMBS m.italic(1)=true m.bold(2)=true m.underline(3)=true m.Condense(4)=true m.extend(5)=true m.Outline(6)=true m.shadow(7)=true m.Enabled(8)=true m.enabled(9)=false m.Mark(4)=17 m.Mark(5)=18 m.Mark(6)=19 m.Mark(7)=20 'm.CommandID(1)=100001 'm.CommandID(2)=100002 'm.CommandID(3)=100003 'm.CommandID(4)=100004 'm.CommandID(5)=100005 'm.CommandID(6)=100006 s=new MenuMBS if s.NewMenu(0,"Submenu") then s.AppendItem "Hello 1" s.AppendItem "Hello 2" s.AppendItem "Hello 3" s.AppendItem "Hello 4" s.Mark(1)=17 s.Mark(2)=18 s.Mark(3)=19 s.Mark(4)=20 // to get events there s.CommandID(1)=100011 s.CommandID(2)=100012 s.CommandID(3)=100013 s.CommandID(4)=100014 m.SubMenu(8)=s end if End EventHandler
End Control
EventHandler Sub Open() m=new MyCarbonApplicationEvents m.Listen End EventHandler
Property m As myCarbonApplicationEvents
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
Class MyCarbonApplicationEvents Inherits CarbonApplicationEventsMBS
EventHandler Function ProcessCommand(AttributeFlags as integer, CommandId as integer, Handle as integer, Index as integer) As boolean Window1.StaticText2.text=hex(CommandId) End EventHandler
End Class
End Project

Feedback, Comments & Corrections

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

MBS Xojo Chart Plugins