Fix STR #2770: menubar menus have problems near screen edges.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9183 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2011-11-22 16:58:19 +00:00
parent d92f2d765b
commit c78bc79001

View File

@ -354,7 +354,7 @@ menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp,
if (Wp > W) W = Wp;
if (Wtitle > W) W = Wtitle;
if (X < scr_x) X = scr_x; if (X > scr_x+scr_w-W) X = right_edge-W; //X= scr_x+scr_w-W;
if (X < scr_x) X = scr_x; if (X > scr_x+scr_w-W) X = right_edge-W;
x(X); w(W);
h((numitems ? itemheight*numitems-LEADING : 0)+2*BW+3);
if (selected >= 0) {
@ -935,7 +935,8 @@ const Fl_Menu_Item* Fl_Menu_Item::pulldown(
// delete all the old menus and create new one:
while (pp.nummenus > pp.menu_number+1) delete pp.p[--pp.nummenus];
pp.p[pp.nummenus++]= new menuwindow(menutable, nX, nY,
title?1:0, 0, 0, title, 0, menubar, cw.x());
title?1:0, 0, 0, title, 0, menubar,
(title ? 0 : cw.x()) );
}
} else { // !m->submenu():
while (pp.nummenus > pp.menu_number+1) delete pp.p[--pp.nummenus];