Hello,

I often was bothered when using FLTK menus (FLTK 1.1.1.9 under WinXP), because it was difficult and sometimes not possible to choose menuitems. Because of dealing with a huge menu structure, I finally realised, what in detail causes my problems: When touching the right border of screen, the last layer of menuitems moves to the left and covers higher layer of submenus. When this happens, it is not possible to choose the next item of the submenu and it is not possible anyway to choose other items. It only works to move the whole window the way, the right border is not touched.

I think there are two strategies to prevent this problem:

1. Every submenu should check, whether it covers the next higher submenu and move to a point, where it doesn't.

2. When touching the right border of screen, the menu should move the x0 of the whole menu to the left. This seems most easy to me.

A workaround may be, to make every submenu a little smaller, then the next level. But this would make the menu huge, because the first level items must be longer than the longest item of the last lever plus minimum 1 character for each level between.

What do you think, which way to go? I would like to solve this problem, because it is really bothering, when you are not able, to choose the menutitem, you want to choose.

The attached test program shows the problem, when opening Fl_Choice or Fl_Menu_Button near right side of screen. You will see, that long final layer of menu hides the upper submenus and it is not possible to choose other items, than the first.
#include <string>
        using std::string;
#include <Fl/Fl.h>
#include <Fl/Fl_Window.h>
#include <Fl/Fl_Choice.h>
#include <Fl/Fl_Menu_Button.h>

int main (int argc, char *argv[])
{
        Fl_Window W(200, 100, "Menutest");
        Fl_Choice* pC= new Fl_Choice(10, 10, 180, 25);
        Fl_Menu_Button* pB= new Fl_Menu_Button(10, 40, 180, 25);
        W.end();
        string Sub= "askjflksajfl";
        int n= 3;
        for (int i= 0; i< n; ++i)
        {
                string S1(1, char('A' + i));
                S1+= Sub + string(3*i, '*') + '/';
                for (int j= 0; j< n; ++j)
                {
                        string S2= S1 + char('0' + j) + Sub + string(3*j, '*') 
+ '/';
                        for (int k= 0; k< n; ++k)
                        {
                                string S3= S2 + char('a' + k) + Sub + 
string(3*k, '*') + '/';
                                for (int l= 0; l< n; ++l)
                                {
                                        string S4= S3 + char('A' + l) + Sub + 
Sub + Sub + Sub;
                                        pC->add(S4.c_str());
                                        pB->add(S4.c_str());
                                }
                        }
                }
        }
        W.show();
        Fl::run();
        return 0;
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to