_SetMenuPointP( ) (Rutina de biblioteca API)
Especifica (en píxeles) la posición de pantalla del ángulo superior izquierdo, loc, de un menú.
void _SetMenuPointP(MENUID menuid, Point loc)
MENUID menuid; /* Menu identifier. */
Point loc; /* Position of upper left corner
of the menu. */
Observaciones
Un menú se suele colocar automáticamente según su tamaño y el método utilizado por el usuario para invocarlo. Esta rutina se proporciona para anular el posicionamiento automático.
Para obtener más información acerca de cómo crear una biblioteca API e integrarla con Visual FoxPro, vea Acceso a la API de Visual FoxPro.
Ejemplo
El ejemplo siguiente crea un menú y, a continuación, lo activa en tres posiciones de pantalla distintas especificadas por _SetMenuPointP( ).
Código Visual FoxPro
SET LIBRARY TO SETMNPTP
Código C
#include <pro_ext.h>
FAR SetMenuPointPEx(ParamBlk FAR *parm)
{
MENUID menuId;
ITEMID itemId;
Point loc;
menuId = _GetNewMenuId();
_NewMenu(MPOPUP, menuId);
itemId = _GetNewItemId(menuId);
_NewItem(menuId, itemId, -2, "\\<1st item");
itemId = _GetNewItemId(menuId);
_NewItem(menuId, itemId, -2, "\\<2nd item");
itemId = _GetNewItemId(menuId);
_NewItem(menuId, itemId, -2, "\\<3rd item");
loc.v = 40; loc.h = 80;
_SetMenuPointP(menuId, loc);
_MenuInteract(&menuId, &itemId);
loc.v = 80; loc.h = 160;
_SetMenuPointP(menuId, loc);
_MenuInteract(&menuId, &itemId);
loc.v = 160; loc.h = 320;
_SetMenuPointP(menuId, loc);
_MenuInteract(&menuId, &itemId);
_DisposeMenu(menuId);
}
FoxInfo myFoxInfo[] = {
{"ONLOAD", SetMenuPointPEx, CALLONLOAD, ""},
};
FoxTable _FoxTable = {
(FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};
Vea también
_NewMenu( ) (Rutina de biblioteca API) | Acceso a la API de Visual FoxPro | _SetMenuPoint( ) (Rutina de biblioteca API) | _GetNewItemId( ) (Rutina de biblioteca API)