AddMenu

<< Click to Display Table of Contents >>

Manual > Control Reference > Basics > Menu control > Methods >

AddMenu


 

Add a menu item.

 


Syntax 1

AddMenu(

         parentPopupId,

         "string",

         text,

         eventMsg

         [,bChecked = F]

         [,enableState="enable"]

         )

 

 

Adds text (selection) as a menu item.

 


Parameters

 

parentPopupId


Type:

character


Parent popup ID. If adding to the first level, specify "root".

 

itemType


Type:

character


"string"

 

text


Type:

character


The text to display in the menu.

 

eventMsg


Type:

character


The string passed in the msg argument of the OnMenu event when the menu is selected.

 

For the following system menus, please specify the following strings in eventMsg.

 

File Menu

 

open

[file_open]

Open with URL

[file_open_url]

printing

[print]

Print Preview

[print_preview]

Print settings

[print_setup]

Screenshot(bmp)

[screenshot_bmp]

Screenshot(jpeg)

[screenshot_jpeg]

View Menu

 

Status Bar

[view_status_bar]

Zoom in

[zoom_in]

Cancel zoom in

[zoom_reset]

25%

[zoom_25]

50%

[zoom_50]

75%

[zoom_75]

100%

[zoom_100]

125%

[zoom_125]

150%

[zoom_150]

175%

[zoom_175]

200%

[zoom_200]

250%

[zoom_250]

300%

[zoom_300]

Shown in actual size

[stretch_none]

Stretch to fit

[stretch_full]

Stretch to fit size (maintain aspect ratio)

[stretch_holdrate]

Display full screen

[full_screen]

Operation Menu

 

Log in

[login]

Logout

[logout]

Debug Menu

 

Open the Debug dialog

[debug_dialog]

Enable Debugging

[debug_online]

Help Menu

 

Version Information

[about_application]

 

bChecked


Type:

Boolean


When TRUE, places a check mark next to the menu item.

 

enableState


Type:

character


The state of the menu item.

"enable" - The menu item is displayed normally.

"disenable" - Disables the menu item so that it cannot be selected. It is not dimmed.

"gray" - Disables the menu item so that it cannot be selected and is dimmed.

 

Return Value



Type:

Boolean


FALSE - Failure. TRUE - Success.

 

 


Syntax 2

AddMenu(

         parentPopupId,

         "separator"

         )

 

 

Adds a separator as a menu item.

 


Parameters

 

parentPopupId


Type:

character


Parent popup ID. If adding to the first level, specify "root".

 

itemType


Type:

character


"separator"

 

Return Value



Type:

Boolean


FALSE - Failure. TRUE - Success.

 

 


Syntax 3

AddMenu(

         parentPopupId,

         "popup",

         text,

         popupId

         )

 

 

Adds a popup item as a menu item, which can contain child menu items.

 


Parameters

 

parentPopupId


Type:

character


Parent popup ID. If adding to the first level, specify "root".

 

itemType


Type:

character


"popup"

 

text


Type:

character


The text to display in the menu.

 

popupId


Type:

character


Popup ID. Specifying this popupId as the parentPopupId of AddItem allows you to add sub-level menu items.

 

Return Value



Type:

Boolean


FALSE - Failure. TRUE - Success.

 


hmtoggle_plus1Explanation

 


reference