Greg Ercolano wrote:
> Michael Sweet wrote:
>> I'm -0 on providing per-widget control of the scrollbar size - IMHO
>> it only encourages inconsistent UI, and scrollable areas are not
>> typically used in situations where smaller controls are used anyways.
> 
>       Yes, I found myself writing the docs in such a way as to say
>       "Don't use this method unless you really need to override
>       global control.." and was including text recommending global
>       control through Fl::scrollbar_size() is better..

    Here's what I've written for the get/set methods to control
    scroller size locally. Hopefully it's clear; let me know if
    it isn't.

--- snip

  /**
    Gets the current size of the scrollbars' troughs, in pixels.

    By default this returns the value of the global Fl::scrollbar_size()
    unless this widget's scrollbar_size(int) has been changed.

    \returns Scrollbar size in pixels.
    \see Fl::scrollbar_size(int)
  */
  int Fl_Browser_::scrollbar_size() const {
      return((scollbar_size_ == -1) ? Fl::scrollbar_size() : scrollbar_size_);
  }

  /**
    Sets the pixel size of the scrollbars' troughs to the \p size, in pixels.

    Normally you should not need this method, and should use
    Fl::scrollbar_size(int) instead, which manages the scrollbar size
    of ALL your widgets, so that your application has a consistent
    scrollbar size throughout. This is normally what you want.

    Only use THIS method if you really need to override the global
    scrollbar size. The need for this should be rare.

    Setting \p size to the special value of -1 causes the widget to
    track the global Fl::scrollbar_size(), which is the default.

    \param[in] size Sets the scrollbar size in pixels.\n
                    If -1 (default), scrollbar size tracks the global 
Fl::scrollbar_size()
    \see Fl::scrollbar_size()
  */
  void Fl_Browser_::scrollbar_size(int size) {
      scrollbar_size_ = size;
  }

--- snip
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to