| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Popup Menu |
A while back, you posted a small program that demonstrated how
to put a context sensitive popup menu into a generic, hello world
style PM program. I've been toying with the code recently and have
a question. When you have a menu bar on a PM window, if the window
is too near the bottom of your screen, a lengthy menu will adjust
itself so that everything on the menu is visible on the screen. It
will also adjust itself if the PM window is too near the right side
of the screen (the menu popping up on the left side of the menu
instead of the right).
How would you go about doing something like this with the context
sensitive popup menu example? (I've seen PM programs like FM/2 that
adjust the popup menu and then place your mouse pointer centered on
the menu).
As it is now, if the PM window is too near the bottom of the screen,
and if you have a lengthy submenu, the thing runs off the bottom of the
screen and is unreachable by the mouse pointer. Also, if the PM window
is too near the right of the screen, the submenu runs off the right side
of the screen, as well.
I figured out that the p->x & p->y in the following fragment govern the
position of the context sensitive menu on the screen, but I'm too new at
PM programming to know how to make a submenu adjust itself if it's too
near the bottom or right side of the screen, let alone reposition the
mouse pointer .
void pop(HWND hwnd, MPARAM mp1)
{
HWND hwndMenu;
POINTS *p;
hwndMenu = WinLoadMenu(hwnd, 0, ID_POPUPMENU);
p = (POINTS *)&mp1;
WinPopupMenu(hwnd, hwnd, hwndMenu, p->x, p->y, 0,
PU_KEYBOARD | PU_MOUSEBUTTON1);
}
--- PPoint 2.00
* Origin: ** Snake-Byte Incorporated ** (1:3819/128.103)SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955 SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809 @PATH: 3819/128 157 3615/50 396/1 270/101 712/515 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.