MenuBar Interface Reference

A Menubar control is a control that represents a menu. More...

Inheritance diagram for MenuBar:

Inheritance graph
Collaboration diagram for MenuBar:

Collaboration graph
List of all members.

Properties

IDispatch *RW Menu []
 The Action object that represents the menu.

Detailed Description

A Menubar control is a control that represents a menu.

Examples:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

f = o.CreateForm(0,0,0,0)

f.Text = "WSO"
f.ClientWidth = 300
f.ClientHeight = 100
f.CenterControl()

ReBar = f.CreateReBar(0,0,0,0)
ReBar.Align = o.Translate("AL_TOP")
ReBar.BandBorders = true
MenuBar = ReBar.CreateMenuBar(0,0,0,0)
FileMenu = MenuBar.Menu.Add("File")
ToolBar = ReBar.CreateToolBar(0,0,0,0)
ToolBar.Buttons.Add("Button1")
ToolBar.Buttons.Add("Button2")
ToolBar.Buttons.Add("Button3")
ToolBar.Buttons.Add("Button4")
ToolBar.Buttons.Add("Button5")
ToolBar.ShowText = true

with (FileMenu.Add("Open","CTRL+O"))
{
        OnExecute = OpenFile
}

FileMenu.Add("-")

with (FileMenu.Add("Exit","ESC"))
{
        OnExecute = CloseForm
}

HelpMenu = MenuBar.Menu.Add("Help")
with (HelpMenu.Add("Help","F1"))
{
        OnExecute = Help
}

f.Show()

o.Run()


function CloseForm(Sender)
{
        f.Close()
}

function OpenFile(Sender)
{
        //Some code...
}

function Help(Sender)
{
        //Some code...
}

Result:

MenuBar1.jpg
MenuBar2.jpg


Property Documentation

IDispatch* RW Menu

The Action object that represents the menu.


WSO 1.1 Documentation. Date modified:Wed Aug 12 18:12:53 2015. (C) Veretennikov A. B. 2004-2015