diff options
| author | Fabien Costantini <fabien@onepost.net> | 2008-09-15 08:41:54 +0000 |
|---|---|---|
| committer | Fabien Costantini <fabien@onepost.net> | 2008-09-15 08:41:54 +0000 |
| commit | b9ca1333769f87c029430a9d14a7a9937d400f93 (patch) | |
| tree | 61b8043afc286a950b7624004ed549f84531fdb3 /FL/Fl_Scroll.H | |
| parent | fdcfef214e67b0b1162ef4098ba960efd7049523 (diff) | |
Doxygen documentation WP8 Done. Reserved WP9, WP10. Will now check WP3 from engelsman and integrates it.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6250 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Scroll.H')
| -rw-r--r-- | FL/Fl_Scroll.H | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/FL/Fl_Scroll.H b/FL/Fl_Scroll.H index 0838c54f0..49390e123 100644 --- a/FL/Fl_Scroll.H +++ b/FL/Fl_Scroll.H @@ -31,6 +31,63 @@ #include "Fl_Group.H" #include "Fl_Scrollbar.H" +/** + This container widget lets you maneuver around a set of widgets much + larger than your window. If the child widgets are larger than the size + of this object then scrollbars will appear so that you can scroll over + to them: + <P ALIGN=CENTER>\image html Fl_Scroll.gif </P> + <P>If all of the child widgets are packed together into a solid + rectangle then you want to set box() to FL_NO_BOX or + one of the _FRAME types. This will result in the best output. + However, if the child widgets are a sparse arrangment you must set + box() to a real _BOX type. This can result in some + blinking during redrawing, but that can be solved by using a + Fl_Double_Window. </P> + + By default you can scroll in both directions, and the scrollbars + disappear if the data will fit in the area of the scroll. + <P>Use Fl_Scroll::type() to change this as follows : + <UL> + <LI>0 - No scrollbars </LI> + <LI>Fl_Scroll::HORIZONTAL - Only a horizontal scrollbar. </LI> + <LI>Fl_Scroll::VERTICAL - Only a vertical scrollbar. </LI> + <LI>Fl_Scroll::BOTH - The default is both scrollbars. </LI> + <LI>Fl_Scroll::HORIZONTAL_ALWAYS - Horizontal scrollbar always on, vertical always off. </LI> + <LI>Fl_Scroll::VERTICAL_ALWAYS - Vertical scrollbar always on, horizontal always off. </LI> + <LI>Fl_Scroll::BOTH_ALWAYS - Both always on. </LI> + </UL> + + <P> Use <B> scrollbar.align(int) ( see void Fl_Widget::align(Fl_Align) ) :</B> + to change what side the scrollbars are drawn on.<BR>If the + FL_ALIGN_LEFT bit is on, the vertical scrollbar is on the left. + If the FL_ALIGN_TOP bit is on, the horizontal scrollbar is on + the top. Note that only the alignment flags in scrollbar are + considered. The flags in hscrollbar however are ignored. + + <P>This widget can also be used to pan around a single child widget + "canvas". This child widget should be of your own class, with a + draw() method that draws the contents. The scrolling is done by + changing the x() and y() of the widget, so this child + must use the x() and y() to position it's drawing. + To speed up drawing it should test fl_push_clip(). + + <P>Another very useful child is a single + Fl_Pack, which is itself a group that packs it's children + together and changes size to surround them. Filling the Fl_Pack + with Fl_Tabs groups (and then putting + normal widgets inside those) gives you a very powerful scrolling list + of individually-openable panels. </P> + + <P>Fluid lets you create these, but you can only lay out objects that + fit inside the Fl_Scroll without scrolling. Be sure to leave + space for the scrollbars, as Fluid won't show these either. </P> + <P><I>You cannot use Fl_Window as a child of this since the + clipping is not conveyed to it when drawn, and it will draw over the + scrollbars and neighboring objects.</I> +*/ + +*/ class FL_EXPORT Fl_Scroll : public Fl_Group { int xposition_, yposition_; @@ -66,7 +123,9 @@ public: BOTH_ALWAYS = 7 }; + /** Gets the current horizontal scrolling position. */ int xposition() const {return xposition_;} + /** Gets the current vertical scrolling position. */ int yposition() const {return yposition_;} void scroll_to(int, int); void clear(); |
