FLTK logo

Re: [fltk/fltk] Small improvement to Fl_Menu_ : add a way to specify a divider drawn above a menu item vs. below it (Issue #479)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] Small improvement to Fl_Menu_ : add a way to specify a divider drawn above a menu item vs. below it (Issue #479) Albrecht Schlosser Aug 13, 2022  
 

Thank you, this is an interesting proposal.

However, why can't you just use the menu item above the one in question to draw the divider below that one? Is this due to allocating static menu entries, submenus, or ... ? I'm curious and would like to understand the issue better for later documentation.

Anyway, here are some thoughts:

  1. FL_MENU_DIVIDER is one of many bits in the flags member of Fl_Menu_Item, hence it would be possible to set both bits simultaneously and we should support this as well.
  2. I suggest not to use a combination of two characters for one flag, I'd rather choose a new one for the new flag, e.g. '^' if this is not already used. If two characters are really necessary, then the new flag should be two different character, e.g. '^_' so '^__' or '_^_' could be used for both flags at the same time w/o ambiguity.
  3. Backwards compatibility is a high priority in FLTK. We must take care not to break existing programs, hence the requirement to change existing programs would be a no-go. I don't have a final solution in mind, but one way would be to require that new programs set an option which enables the new flag parser feature (otherwise it would be ignored and used as menu text).
  4. If this flag would be implemented we'd have to consider that the existing FL_MENU_DIVIDER acts as a group delimiter so radio buttons can form separate groups. It would be an advantage if FL_MENU_DIVIDER_ABOVE would also limit radio button groups in the obvious direction (upwards). This could also be helpful if a radio button is the first entry in a menu where searching "upwards" (to find neighbor radio buttons) would access non-existing menu items. In this case an invisible divider would likely also be a "good idea".
  5. What about adding a new Fl_Menu_Item type that does nothing but drawing a menu divider? Would this also be an option for you?

As said above, these are only thoughts...


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/issues/479/1214142128@github.com>

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.