Menu

Int_AppendMenu, Int_AppendMenuEx, Int_AssignKey, Int_DeleteMenu, Int_DeleteMenuEx, Int_DeleteMenuGroupEx, Int_HideLuciaMenu, Int_InsertMenu, Int_SetMenuAccel, Int_SetMenuAccelEx, Int_SetMenuState, Int_SetMenuStateEx, Int_SetMenuStringEx, Int_ShowLuciaMenu, Int_ShowUserMenuEx, RestoreLuciaMenu

Int_AppendMenu

Description 

 Int_AppendMenu(
   char *popupstr,
   char *menustr,
   char *command
);

This function appends a new item to the end of a menu. When you select this menu item or popup menu associated command is executed.

Parameters

char *popupstr

Name of the pop-up menu.

char *menustr

Name of menu item.

char *command

Any function associated with the menustr or popupstr.

Note

If popupstr is equal to NULL (0) and menustr is not a NULL (0) string, menustr is appended to the main menu and the command is associated with this item. If popupstr is not a NULL (0) string and menustr is equal to NULL (0) string, the function appends the SEPARATOR (command is ignored in this case). If you create new popup menu item (in the main window) you also have to specify the first menu item in the menustr parameter. An underscore character (c) is represented as &c. When the menustr parameter starts with "$$" sequence, then the menu item is not visible. You should use these menu items only to define hot-key commands. You can group these menu items by specifying the popupstr parameter (all items in one popup can deleted together, see Int_DeleteMenu).

See Also 
Int_HideLuciaMenu

Int_AppendMenuEx

Description 

 Int_AppendMenuEx(
   int  groupid,
   char *popupstr,
   char *menustr,
   char *command
);

This function appends a new item to the end of the specified user-ex menu. When you select this menu item or popup menu associated command is executed. Changes become visible when you call the Int_ShowUserMenuEx function with the same groupid parameter.

Parameters

int groupid

Menu group identifier (ID).

char *popupstr

Name of the pop-up menu.

char *menustr

Name of menu item.

char *command

Any function associated with the menustr or popupstr.

Note

If popupstr is equal to NULL (0) and menustr is not a NULL (0) string, menustr is appended to the main menu and the command is associated with this item. If popupstr is not a NULL (0) string and menustr is equal to NULL (0) string, the function appends the SEPARATOR (command is ignored in this case). If you create new popup menu item (in the main window) you also have to specify the first menu item in the menustr parameter. An underscore character (c) is represented as &c. When the menustr parameter starts with "$$" sequence, then the menu item is not visible. You should use these menu items only to define hot-key commands. You can group these menu items by specifying the popupstr parameter (all items in one popup can deleted together, see Int_DeleteMenuEx).

See Also 
Int_ShowUserMenuEx, Int_SetMenuAccelEx, Int_SetMenuStateEx, Int_DeleteMenuEx, Int_DeleteMenuGroupEx, Int_SetMenuStringEx

Int_AssignKey

Description 

 Int_AssignKey(
   char *Int_Command,
   dword  Int_Accel
);

This function allows to assign a key shortcut to a command.

Int_Accel is a decimal number or a constant representing a key or key shortcut.

Parameters

char *Int_Command

Macro command name.

dword Int_Accel

Accelerator.

Int_DeleteMenu

Description 

 Int_DeleteMenu(
   char *popupstr,
   char *menustr
);

This function deletes an item in the menu.

Parameters

char *popupstr

Name of the pop-up menu.

char *menustr

Name of menu item.

Note

If popupstr is not NULL (0) string and menustr is equal to NULL (0) string, the whole popup is deleted. If popupstr is not NULL (0) string and menustr is not NULL (0) string, the function deletes the menuitem in the popup. If popupstr is NULL (0) string and menustr is not NULL (0) string, the function deletes the menu item specified by menustr. An underscore character (c) is represented as &c.

Int_DeleteMenuEx

Description 

int Int_DeleteMenuEx(
   int  menuid
);

This function deletes the specified menu item from the user-ex menu.

Parameters

int menuid

Menu item identifier.

Return Values

int

Note

You specify the menu item by filling the menuid parameter (which is returned from the Int_AppendMenuEx function).

Int_DeleteMenuGroupEx

Description 

 Int_DeleteMenuGroupEx(
   int  groupid
);

This function deletes the specified menu group from the user-ex menu.

Parameters

int groupid

Menu group identifier (ID).

Note

You specify the menu group by filling the groupid parameter.

Int_HideLuciaMenu

Description 

int Int_HideLuciaMenu();

This function removes the application menu and displays the empty menu.

Return Values

int

//Int_AppendMenu example - special application menu design.
char             caption[256],action[7][256];  
int              qw,id;
global int       xs,ys,xe,ye,radius,w,h;
strcpy(action[0],"Int_GetStringInt_DrawLine(LINE_GENERAL,RGB_DEFAULT,0,0,20, &xs, &ys, &xe, &ye,TRUE);");
strcpy(action[1],"Int_DrawLine(LINE_CROSSES,RGB_DEFAULT,0,0,20, &xs, &ys, &xe, &ye,TRUE);");
strcpy(action[2],"Int_DrawCircle(CIRCLE_HOLLOW, RGB_DEFAULT, &xs, &ys, &radius, TRUE);");
strcpy(action[3],"xs=100;ys=100;radius=50;Int_DrawCircle(CIRCLE_PREDRAW, 
RGB_DEFAULT, &xs, &ys, &radius, TRUE);");
strcpy(action[4],"w=200;h=100;Int_DrawRectangle(RECT_FIXEDSIZE, RGB_DEFAULT, &xs, &ys, &w, &h, TRUE);");
strcpy(action[5],"xs=100;ys=100;Int_DrawRectangle(RECT_FIXEDCENTER, RGB_DEFAULT, &xs, &ys, &w, &h, TRUE);");
strcpy(action[6],"Int_ShowLuciaMenu();Int_CloseTextWindow();");
SetCommandText("Working...");
strcpy(caption, "API Example - Int_AppendMenu");
Int_CreateTextWindow(caption,0,RGB(0,0,128),RGB_WHITE,100);  
strcpy(caption, "   application API Example - Int_AppendMenu\tExplore some drawing functions.   ");
Int_CreateTextWindow(caption,3,RGB(0,0,128),RGB_WHITE,100);  
Int_SetFocus(WINDOW_MAIN);
Int_HideLuciaMenu();
id=Int_AppendMenu("&Line","&General",action[0]);
Int_SetMenuAccel(id,'G');
id=Int_AppendMenu("&Line","&Crosses",action[1]);
Int_SetMenuAccel(id,'C');
id=Int_AppendMenu("&Circle","&Hollow",action[2]);
Int_SetMenuAccel(id,'H');
id=Int_AppendMenu("&Circle","&Predraw",action[3]);
Int_SetMenuAccel(id,'P');
id=Int_AppendMenu("&Rectangle","Fixed &Size",action[4]);
Int_SetMenuAccel(id,'S');
id=Int_AppendMenu("&Rectangle","&Fixed Center",action[5]);
Int_SetMenuAccel(id,'F');
id=Int_AppendMenu(NULL,"&Exit",action[6]);
Int_SetMenuAccel(id,VK_ESC);
Int_InsertMenu

Description 

 Int_InsertMenu(
   char *Popup,
   char *Refmenu,
   char *Menu,
   char *Int_Command,
   char *IsOwnerDrawn,
   char *Int_Buf1,
   char *Int_Buf2,
   char *Int_Filename
);

This function inserts a new menu.

Parameters

char *Popup

Pop-up menu.

char *Refmenu

Reference menu

char *Menu

Reference menu

char *Int_Command

Macro command name.

char *IsOwnerDrawn

If non-zero, menu is the owner drawn.

char *Int_Buf1

First buffer.

char *Int_Buf2

Second buffer.

char *Int_Filename

Address of the filename.

Int_SetMenuAccel

Description 

 Int_SetMenuAccel(
   int  Int_Index,
   dword  Int_Accel
);

This function sets the new menu accelerator to the specified menu item.

Int_Index parameter represents the menu item ID.

Parameters

int Int_Index

Index parameter.

dword Int_Accel

Accelerator.

Note

When you want to use a letter as an accelerator define it always uppercase.

See Also 
Int_HideLuciaMenu

Int_SetMenuAccelEx

Description 

 Int_SetMenuAccelEx(
   int  idm,
   dword  accel
);

This function sets the new menu accelerator to the specified menu item in user-ex menu.

Parameters

int idm

Menu item identifier.

dword accel

Menu item accelerator.

Note

When you want to use a letter as an accelerator define it always uppercase.

See Also 
Int_AppendMenuEx, Int_ShowUserMenuEx, Int_SetMenuStateEx, Int_DeleteMenuEx, Int_DeleteMenuGroupEx, Int_SetMenuStringEx

Int_SetMenuState

Description 

 Int_SetMenuState(
   char *popupstr,
   char *menustr,
   int  state,
   int  menuid
);

This function sets the state (ENABLED / DISABLED or CHECKED / UNCHECKED) of the specified menu item.

Parameters

char *popupstr

Name of the pop-up menu.

char *menustr

Name of menu item.

int state

State of the menu that will be set.

0

Disabled.

1

Enabled.

4

Uncheck.

8

Check.

2

Let state.

0

Let check.

int menuid

Menu item identifier.

Note

The state must be value gained by logical OR operation between two constants, one for(ENABLE/DISABLE) and one for(CHECK/UNCHECK). You can specify the menu item by filling the popupstr and menustr parameters, or just by filling the menuid parameter (which is returned from the Int_AppendMenu function).

See Also 
Int_AppendMenu, Int_DeleteMenu, Int_HideLuciaMenu

Int_SetMenuStateEx

Description 

int Int_SetMenuStateEx(
   int  menuid,
   int  state
);

This function sets the state (ENABLED, DISABLED, CHECKED, UNCHECKED) to the specified menu item.

Parameters

int menuid

Menu item identifier.

int state

0

Disabled.

1

Enabled.

4

Uncheck.

8

Check.

2

Let state.

0

Let check.

Return Values

int

Note

The state must be a value gained by logical OR operation between two constants, one for (ENABLE/DISABLE) and one for (CHECK/UNCHECK). You specify the menu by filling the menuid parameter (which is returned by the Int_AppendMenuEx function).

See Also 
Int_AppendMenuEx, Int_ShowUserMenuEx, Int_SetMenuAccelEx, Int_DeleteMenuEx, Int_DeleteMenuGroupEx, Int_SetMenuStringEx

Int_SetMenuStringEx

Description 

INT Int_SetMenuStringEx(
   int  menuid,
   char *String
);

This function sets the string to the specified menu item in the user-ex menu.

Parameters

int menuid

Menu item identifier.

char *String

Macro string.

Return Values

INT

Note

You specify the menu by filling the menuid parameter (which is returned from the Int_AppendMenuEx function).

See Also 
Int_AppendMenuEx, Int_ShowUserMenuEx, Int_SetMenuAccelEx, Int_DeleteMenuEx, Int_DeleteMenuGroupEx, Int_SetMenuStateEx

Int_ShowLuciaMenu

Description 

int Int_ShowLuciaMenu();

This function shows the application menu.

Return Values

int

See Also 
Int_HideLuciaMenu

Int_ShowUserMenuEx

Description 

 Int_ShowUserMenuEx(
   int  groupid
);

This function removes the application menu and displays the specified user-ex menu.

Parameters

int groupid

Menu group identifier (ID).

RestoreLuciaMenu

Description 

 RestoreLuciaMenu();

This function restores the default NIS-Elements menu.