Michel Schmid wrote:
> Hi!
> 
> FLTK: 1.1.9
> 
> I would like to have a Fl_Scroll area, but without the scrollbars. As a 
> substitue for the scrollbars i would like to draw two buttons which stand for 
> the up- and down-arrows and have the same functionallity. So they should 
> trigger the same event...
> 
> The goal is that I still have a scrollable area, but one who I can customize 
> more to my GUI-Style.

One way would be to do this just like you wrote. Did you try this?

scroll->type(0); // disable scrollbars

scroll->xposition(int); // scroll horizontally
scroll->yposition(int); // scroll vertically
scroll->position(int,int); // scroll to an arbitrary position (FLTK 1.1)
scroll->scroll_to(int,int); // dto. for FLTK 1.3

to position the scrollable area. I didn't try this, but according to the docs 
this ought to work. Of course you can use real buttons to change the scroll 
position. However you won't be able to do smooth scrolling easily.

Another way would be to implement mouse dragging. If necessary you may put a 
transparent box over the scroll area and catch the mouse events to do dragging. 
Then you can position the scroll area as described above.

For an example how to drag an object you can look at Greg's cheat page:

http://seriss.com/people/erco/fltk/#DraggableBoxes
http://seriss.com/people/erco/fltk/#ClicksOnScrollableBox

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

Reply via email to