summaryrefslogtreecommitdiff
path: root/src/Fl_Menu.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-08-08 10:07:03 +0000
committerManolo Gouy <Manolo>2011-08-08 10:07:03 +0000
commitde0be01e2321ad0b682e85fdb7ec1dd427dfd897 (patch)
tree0fbb9c3e8786a869536836f7c0acb66a2094ab0b /src/Fl_Menu.cxx
parentb9e2720061626691f88b82d57c054eb2af27edb1 (diff)
Fix STR #2695: to scroll menus properly, use Fl::x(),y(),w() and h() functions that return
the work area rather than the screen size. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8929 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Menu.cxx')
-rw-r--r--src/Fl_Menu.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index e2fe0936d..a4fd085ff 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -279,7 +279,10 @@ menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp,
int scr_x, scr_y, scr_w, scr_h;
int tx = X, ty = Y;
- Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h);
+ scr_x = Fl::x();
+ scr_w = Fl::w();
+ scr_y = Fl::y();
+ scr_h = Fl::h();
if (!right_edge || right_edge > scr_x+scr_w) right_edge = scr_x+scr_w;
end();
@@ -410,10 +413,11 @@ void menuwindow::position(int X, int Y) {
// scroll so item i is visible on screen
void menuwindow::autoscroll(int n) {
- int scr_x, scr_y, scr_w, scr_h;
+ int scr_y, scr_h;
int Y = y()+Fl::box_dx(box())+2+n*itemheight;
- Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h);
+ scr_y = Fl::y();
+ scr_h = Fl::h();
if (Y <= scr_y) Y = scr_y-Y+10;
else {
Y = Y+itemheight-scr_h-scr_y;