InsertMenu

<< Click to Display Table of Contents >>

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

InsertMenu


 

Insert a menu item.

 


Syntax 1

InsertMenu(

         parentPopupId,

         position,

         "string",

         text,

         eventMsg

         [,bChecked = F]

         [,enableState="enable"]

         )

 

Inserts text (choice) as a menu item.

 


Parameters

 

parentPopupId


Type:

character


Parent popup ID. If you want to insert it at the first level, specify "root".

 

position


Type:

Number


The zero-based position to insert the menu item.

Argument for InsertMenu only.

 

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

InsertMenu(

         parentPopupId,

         position,

         "separator"

         )

 

Inserts a separator as a menu item.

 


Parameters

 

parentPopupId


Type:

character


Parent popup ID. If you want to insert it at the first level, specify "root".

 

position


Type:

Number


The zero-based position to insert the menu item.

Argument for InsertMenu only.

 

itemType


Type:

character


"separator"

 

Return Value



Type:

Boolean


FALSE - Failure. TRUE - Success.

 

 


Syntax 3

InsertMenu(

         parentPopupId,

         position,

         "popup",

         text,

         popupId

         )

 

Inserts a popup item as a menu item, to which you can add child menu items.

 


Parameters

 

parentPopupId


Type:

character


Parent popup ID. If you want to insert it at the first level, specify "root".

 

position


Type:

Number


The zero-based position to insert the menu item.

Argument for InsertMenu only.

 

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