| 1 |
/* File : Fl_Scroll.i */ |
| 2 |
//%module Fl_Scroll |
| 3 |
|
| 4 |
%feature("docstring") ::Fl_Scroll |
| 5 |
""" |
| 6 |
This container widget lets you maneuver around a set of widgets much larger |
| 7 |
than your window. If the child widgets are larger than the size of this |
| 8 |
object then scrollbars will appear so that you can scroll over to them: |
| 9 |
|
| 10 |
If all of the child widgets are packed together into a solid rectangle then |
| 11 |
you want to set box() to FL_NO_BOX or one of the _FRAME types. This will |
| 12 |
result in the best output. However, if the child widgets are a sparse |
| 13 |
arrangment you must set box() to a real _BOX type. This can result in some |
| 14 |
blinking during redrawing, but that can be solved by using a Fl_Double_Window. |
| 15 |
|
| 16 |
This widget can also be used to pan around a single child widget 'canvas'. |
| 17 |
This child widget should be of your own class, with a draw() method that |
| 18 |
draws the contents. The scrolling is done by changing the x() and y() of |
| 19 |
the widget, so this child must use the x() and y() to position it's drawing. |
| 20 |
To speed up drawing it should test fl_push_clip() . |
| 21 |
|
| 22 |
Another very useful child is a single Fl_Pack, which is itself a group that |
| 23 |
packs it's children together and changes size to surround them. Filling the |
| 24 |
Fl_Pack with Fl_Tabs groups (and then putting normal widgets inside those) |
| 25 |
gives you a very powerful scrolling list of individually-openable panels. |
| 26 |
|
| 27 |
Fluid lets you create these, but you can only lay out objects that fit |
| 28 |
inside the Fl_Scroll without scrolling. Be sure to leave space for the |
| 29 |
scrollbars, as Fluid won't show these either. |
| 30 |
|
| 31 |
You cannot use Fl_Window as a child of this since the clipping is not |
| 32 |
conveyed to it when drawn, and it will draw over the scrollbars and |
| 33 |
neighboring objects. |
| 34 |
""" ; |
| 35 |
|
| 36 |
%{ |
| 37 |
#include "FL/Fl_Scroll.H" |
| 38 |
%} |
| 39 |
|
| 40 |
%include "macros.i" |
| 41 |
|
| 42 |
CHANGE_OWNERSHIP(Fl_Scroll) |
| 43 |
|
| 44 |
%ignore Fl_Scroll::scrollbar; |
| 45 |
%ignore Fl_Scroll::hscrollbar; |
| 46 |
|
| 47 |
%include "FL/Fl_Scroll.H" |
| 48 |
|
| 49 |
%extend Fl_Scroll { |
| 50 |
Fl_Scrollbar* getScrollbar() { |
| 51 |
return &(self->scrollbar); |
| 52 |
} |
| 53 |
Fl_Scrollbar* getHScrollbar() { |
| 54 |
return &(self->hscrollbar); |
| 55 |
} |
| 56 |
} |