Dillo v3.1.1-46-g8a360e32
Loading...
Searching...
No Matches
fltkviewport.hh
Go to the documentation of this file.
1#ifndef __DW_FLTKVIEWPORT_HH__
2#define __DW_FLTKVIEWPORT_HH__
3
4#include <FL/Fl_Group.H>
5#include <FL/Fl_Scrollbar.H>
6
7#include "core.hh"
8#include "fltkcore.hh"
9#include "fltkviewbase.hh"
10
11namespace dw {
12namespace fltk {
13
15{
16public:
18
19private:
20 enum { SCROLLBAR_THICKNESS = 15 };
21
26
27 Fl_Scrollbar *vscrollbar, *hscrollbar;
28
30 lout::container::typed::List <lout::object::TypedPointer < Fl_Widget> >
32
35 void hscrollbarChanged ();
36 void vscrollbarChanged ();
37 void positionChanged ();
38
39 static void hscrollbarCallback (Fl_Widget *hscrollbar, void *viewportPtr);
40 static void vscrollbarCallback (Fl_Widget *vscrollbar, void *viewportPtr);
41
42 void selectionScroll();
43 static void selectionScroll(void *vport);
44
45 void updateCanvasWidgets (int oldScrollX, int oldScrollY);
46 static void draw_area (void *data, int x, int y, int w, int h);
47
48protected:
49 int translateViewXToCanvasX (int x);
50 int translateViewYToCanvasY (int y);
51 int translateCanvasXToViewX (int x);
52 int translateCanvasYToViewY (int y);
53
54public:
55 FltkViewport (int x, int y, int w, int h, const char *label = 0);
57
58 void resize(int x, int y, int w, int h);
59 void draw ();
60 int handle (int event);
61
62 void setCanvasSize (int width, int ascent, int descent);
63
64 bool usesViewport ();
67 void scroll(int dx, int dy);
69 void scrollTo (int x, int y);
70 void setViewportSize (int width, int height,
71 int hScrollbarThickness, int vScrollbarThickness);
72 void setScrollStep(int step);
73
74 void setGadgetOrientation (bool hscrollbarVisible, bool vscrollbarVisible,
76 void setDragScroll (bool enable) { hasDragScroll = enable ? 1 : 0; }
77 void addGadget (Fl_Widget *gadget);
78};
79
80} // namespace fltk
81} // namespace dw
82
83#endif // __DW_FLTKVIEWPORT_HH__
84
void scrollTo(int x, int y)
Scroll the vieport to the given position.
static void vscrollbarCallback(Fl_Widget *vscrollbar, void *viewportPtr)
static void draw_area(void *data, int x, int y, int w, int h)
int translateCanvasXToViewX(int x)
void addGadget(Fl_Widget *gadget)
int translateViewXToCanvasX(int x)
int translateViewYToCanvasY(int y)
Fl_Scrollbar * hscrollbar
Fl_Scrollbar * vscrollbar
void scroll(int dx, int dy)
int getVScrollbarThickness()
Get the thickness of the vertical scrollbar, when it is visible.
void setCanvasSize(int width, int ascent, int descent)
Set the canvas size.
void updateCanvasWidgets(int oldScrollX, int oldScrollY)
void setDragScroll(bool enable)
static void hscrollbarCallback(Fl_Widget *hscrollbar, void *viewportPtr)
void adjustScrollbarsAndGadgetsAllocation()
bool usesViewport()
Return, whether this view uses a viewport.
int translateCanvasYToViewY(int y)
GadgetOrientation gadgetOrientation[4]
void setScrollStep(int step)
void setViewportSize(int width, int height, int hScrollbarThickness, int vScrollbarThickness)
Set the viewport size.
void setGadgetOrientation(bool hscrollbarVisible, bool vscrollbarVisible, GadgetOrientation gadgetOrientation)
void resize(int x, int y, int w, int h)
lout::container::typed::List< lout::object::TypedPointer< Fl_Widget > > * gadgets
int getHScrollbarThickness()
Get the thickness of the horizontal scrollbar, when it is visible.
ScrollCommand
Definition types.hh:35
Dw is in this namespace, or sub namespaces of this one.