FLTK logo

[fltk/fltk] FL_Browser_ : horizontal scrollbar to top: undocumented feature or bug? (#237)

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 ]

[fltk/fltk] FL_Browser_ : horizontal scrollbar to top: undocumented feature or bug? (#237) Kevin Routley Jun 06, 2021  
 

In an Fl_Browser, the horizontal scrollbar can be moved to the top of the widget. The puzzler is this feature is driven by the align() value of scrollbar, not hscrollbar!

I.e. modifying test/browser.cxx as follows results in a horizontal scrollbar at the top:

  browser = new Fl_Select_Browser(0, 0, window.w(), 350, 0);
  browser->type(FL_MULTI_BROWSER);  //original
  browser->has_scrollbar(Fl_Browser_::BOTH_ALWAYS); // add this to force horizontal scrollbar
  browser->scrollbar.align(FL_ALIGN_TOP); // moves horizontal scrollbar to the top
  browser->callback(b_cb); // original

In Fl_Browser_.cxx are the following lines:

 78  if (hscrollbar.visible()) {
 79    H -= scrollsize;
 80    if (scrollbar.align() & FL_ALIGN_TOP) Y += scrollsize;
 81  }

If this is a supported feature, it seems to me line 80 should read:

 80    if (hscrollbar.align() & FL_ALIGN_TOP) Y += scrollsize;

although making this change may be a backwards compatibility issue.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

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'.