--- a/menu.c 2012-03-20 20:05:35.000000000 -0400
+++ a/menu.c 2015-08-10 16:50:49.692629728 -0400
@@ -60,8 +60,22 @@
{
int x1 = (menuLocation[x] == LEFT) ? x : rightcount--;
int x2;
- int y1 = (menuPos == BOTTOM) ? (ymax - 1) : 0;
- int y2 = (menuPos == BOTTOM) ? (ymax - subsize[x] - 2) : TITLELINES;
+ int y1, y2;
+ if (menuPos == BOTTOM)
+ {
+ y1 = ymax - 1;
+ y2 = ymax - subsize[x] - 2;
+ }
+ else if (menuPos == TOP)
+ {
+ y1 = 0;
+ y2 = TITLELINES;
+ }
+ else
+ {
+ y1 = menuPos;
+ y2 = menuPos + TITLELINES;
+ }
int high = subsize[x] + TITLELINES;
/*
@@ -401,12 +415,17 @@
if (menu->menuPos == BOTTOM)
{
mvwaddch (menu->pullWin[menu->currentTitle],
- menu->subsize[menu->currentTitle] + 1, 0, ACS_LTEE);
+ menu->subsize[menu->currentTitle] + 1, 0, ACS_LTEE);
}
- else
+ else if (menu->menuPos == TOP)
{
mvwaddch (menu->pullWin[menu->currentTitle], 0, 0, ACS_LTEE);
}
+ else
+ {
+ mvwaddch (menu->pullWin[menu->currentTitle],
+ (menu->menuPos == 0) ? 0 : (menu->menuPos - 1), 0, ACS_LTEE);
+ }
/* Draw the items. */
for (x = x0; x < x1; x++)
I haven't looked at the recent releases of CDK, the above is against 5.0-20120323... not sure if anything from that chunk in menu.c changed from then.
It does as I described before, allows you to specify either TOP, BOTTOM, or some other row number for menuRowNumber with newCDKMenu(). It could be better -- I'd like to see the menu "fly" up or down based on the position of the row number for the menu location automatically, or even add a parameter to control the direction (up or down) for the menu lists when activated. Right now it always opens downward (except for BOTTOM).
Let me know what you think -- I'd put more work into it if you think this is a worthy inclusion for CDK.