Dillo v3.1.1-119-g140d9ebd
|
#include <fltkviewport.hh>
Public Types | |
enum | GadgetOrientation { GADGET_VERTICAL , GADGET_HORIZONTAL } |
Public Member Functions | |
FltkViewport (int x, int y, int w, int h, const char *label=0) | |
~FltkViewport () | |
void | resize (int x, int y, int w, int h) |
void | draw () |
int | handle (int event) |
void | setCanvasSize (int width, int ascent, int descent) |
Set the canvas size. | |
bool | usesViewport () |
Return, whether this view uses a viewport. | |
int | getHScrollbarThickness () |
Get the thickness of the horizontal scrollbar, when it is visible. | |
int | getVScrollbarThickness () |
Get the thickness of the vertical scrollbar, when it is visible. | |
int | getScrollbarOnLeft () |
void | scroll (int dx, int dy) |
void | scroll (dw::core::ScrollCommand cmd) |
Scroll the viewport as commanded. | |
void | scrollTo (int x, int y) |
Scroll the vieport to the given position. | |
void | setViewportSize (int width, int height, int hScrollbarThickness, int vScrollbarThickness) |
Set the viewport size. | |
void | setScrollStep (int step) |
void | setGadgetOrientation (bool hscrollbarVisible, bool vscrollbarVisible, GadgetOrientation gadgetOrientation) |
void | setDragScroll (bool enable) |
void | addGadget (Fl_Widget *gadget) |
void | setScrollbarOnLeft (bool enable) |
void | setScrollbarPageMode (bool enable) |
void | setPageOverlap (int overlap) |
Public Member Functions inherited from dw::fltk::FltkWidgetView | |
FltkWidgetView (int x, int y, int w, int h, const char *label=0) | |
~FltkWidgetView () | |
void | drawText (core::style::Font *font, core::style::Color *color, core::style::Color::Shading shading, int x, int y, const char *text, int len) |
void | drawSimpleWrappedText (core::style::Font *font, core::style::Color *color, core::style::Color::Shading shading, int x, int y, int w, int h, const char *text) |
void | drawImage (core::Imgbuf *imgbuf, int xRoot, int yRoot, int x, int y, int width, int height) |
bool | usesFltkWidgets () |
void | addFltkWidget (Fl_Widget *widget, core::Allocation *allocation) |
void | removeFltkWidget (Fl_Widget *widget) |
void | allocateFltkWidget (Fl_Widget *widget, core::Allocation *allocation) |
void | drawFltkWidget (Fl_Widget *widget, core::Rectangle *area) |
Public Member Functions inherited from dw::fltk::FltkViewBase | |
FltkViewBase (int x, int y, int w, int h, const char *label=0) | |
~FltkViewBase () | |
void | draw () |
int | handle (int event) |
void | setLayout (core::Layout *layout) |
This methods notifies the view, that it has been attached to a layout. | |
void | setCursor (core::style::Cursor cursor) |
Set the cursor appearance. | |
void | setBgColor (core::style::Color *color) |
Set the background of the view. | |
void | startDrawing (core::Rectangle *area) |
Called before drawing. | |
void | finishDrawing (core::Rectangle *area) |
Called after drawing. | |
void | queueDraw (core::Rectangle *area) |
Queue a region, which is given in canvas coordinates, for drawing. | |
void | queueDrawTotal () |
Queue the total viewport for drawing. | |
void | cancelQueueDraw () |
Cancel a draw queue request. | |
void | drawPoint (core::style::Color *color, core::style::Color::Shading shading, int x, int y) |
void | drawLine (core::style::Color *color, core::style::Color::Shading shading, int x1, int y1, int x2, int y2) |
void | drawTypedLine (core::style::Color *color, core::style::Color::Shading shading, core::style::LineType type, int width, int x1, int y1, int x2, int y2) |
void | drawRectangle (core::style::Color *color, core::style::Color::Shading shading, bool filled, int x, int y, int width, int height) |
void | drawArc (core::style::Color *color, core::style::Color::Shading shading, bool filled, int centerX, int centerY, int width, int height, int angle1, int angle2) |
void | drawPolygon (core::style::Color *color, core::style::Color::Shading shading, bool filled, bool convex, core::Point *points, int npoints) |
core::View * | getClippingView (int x, int y, int width, int height) |
void | mergeClippingView (core::View *clippingView) |
void | setBufferedDrawing (bool b) |
Public Member Functions inherited from lout::object::Object | |
virtual | ~Object () |
The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. | |
virtual bool | equals (Object *other) |
Returns, whether two objects are equal. | |
virtual int | hashValue () |
Return a hash value for the object. | |
virtual Object * | clone () |
Return an exact copy of the object. | |
virtual void | intoStringBuffer (misc::StringBuffer *sb) |
Store a textual representation of the object in a misc::StringBuffer. | |
const char * | toString () |
Use object::Object::intoStringBuffer to return a textual representation of the object. | |
virtual size_t | sizeOf () |
Return the number of bytes, this object totally uses. | |
Protected Member Functions | |
int | translateViewXToCanvasX (int x) |
int | translateViewYToCanvasY (int y) |
int | translateCanvasXToViewX (int x) |
int | translateCanvasYToViewY (int y) |
Private Types | |
enum | { SCROLLBAR_THICKNESS = 15 } |
Private Member Functions | |
void | adjustScrollbarsAndGadgetsAllocation () |
void | adjustScrollbarValues () |
void | hscrollbarChanged () |
void | vscrollbarChanged () |
void | positionChanged () |
void | selectionScroll () |
void | repeatPageScroll () |
void | updateCanvasWidgets (int oldScrollX, int oldScrollY) |
Static Private Member Functions | |
static void | hscrollbarCallback (Fl_Widget *hscrollbar, void *viewportPtr) |
static void | vscrollbarCallback (Fl_Widget *vscrollbar, void *viewportPtr) |
static void | selectionScroll (void *vport) |
static void | repeatPageScroll (void *data) |
static void | draw_area (void *data, int x, int y, int w, int h) |
Private Attributes | |
int | scrollX |
int | scrollY |
int | scrollDX |
int | scrollDY |
int | scrollbarOnLeft |
int | hasDragScroll |
int | dragScrolling |
int | dragX |
int | dragY |
int | horScrolling |
int | verScrolling |
bool | scrollbarPageMode |
int | pageOverlap |
enum dw::core::ScrollCommand | pageScrolling |
float | pageScrollInterval |
float | pageScrollDelay |
Fl_Scrollbar * | vscrollbar |
Fl_Scrollbar * | hscrollbar |
GadgetOrientation | gadgetOrientation [4] |
lout::container::typed::List< lout::object::TypedPointer< Fl_Widget > > * | gadgets |
Additional Inherited Members | |
Protected Attributes inherited from dw::fltk::FltkViewBase | |
core::Layout * | theLayout |
int | canvasWidth |
int | canvasHeight |
int | mouse_x |
int | mouse_y |
Fl_Widget * | focused_child |
Definition at line 34 of file fltkviewport.hh.
|
private |
Enumerator | |
---|---|
SCROLLBAR_THICKNESS |
Definition at line 40 of file fltkviewport.hh.
Enumerator | |
---|---|
GADGET_VERTICAL | |
GADGET_HORIZONTAL |
Definition at line 37 of file fltkviewport.hh.
dw::fltk::FltkViewport::FltkViewport | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
const char * | label = 0 |
||
) |
Definition at line 55 of file fltkviewport.cc.
References DBG_OBJ_CREATE, dragScrolling, GADGET_HORIZONTAL, GADGET_VERTICAL, gadgetOrientation, gadgets, hasDragScroll, horScrolling, hscrollbar, hscrollbarCallback(), dw::core::NONE_CMD, pageOverlap, pageScrollDelay, pageScrolling, pageScrollInterval, scrollbarPageMode, scrollDX, scrollDY, scrollX, scrollY, verScrolling, vscrollbar, and vscrollbarCallback().
dw::fltk::FltkViewport::~FltkViewport | ( | ) |
Definition at line 92 of file fltkviewport.cc.
References DBG_OBJ_DELETE, and gadgets.
void dw::fltk::FltkViewport::addGadget | ( | Fl_Widget * | gadget | ) |
Definition at line 669 of file fltkviewport.cc.
References adjustScrollbarsAndGadgetsAllocation(), lout::container::typed::List< T >::append(), and gadgets.
|
private |
Definition at line 98 of file fltkviewport.cc.
References _MSG, adjustScrollbarValues(), GADGET_HORIZONTAL, GADGET_VERTICAL, gadgetOrientation, gadgets, hscrollbar, lout::container::typed::Collection< T >::iterator(), SCROLLBAR_THICKNESS, scrollbarOnLeft, lout::container::typed::Collection< T >::size(), and vscrollbar.
Referenced by addGadget(), resize(), setGadgetOrientation(), setScrollbarOnLeft(), and setViewportSize().
|
private |
Definition at line 162 of file fltkviewport.cc.
References dw::fltk::FltkViewBase::canvasHeight, dw::fltk::FltkViewBase::canvasWidth, hscrollbar, scrollX, scrollY, and vscrollbar.
Referenced by adjustScrollbarsAndGadgetsAllocation(), scrollTo(), and setCanvasSize().
void dw::fltk::FltkViewport::draw | ( | ) |
Definition at line 224 of file fltkviewport.cc.
References _MSG, draw(), draw_area(), hscrollbar, SCROLLBAR_THICKNESS, scrollbarOnLeft, scrollDX, scrollDY, and vscrollbar.
Referenced by draw().
|
staticprivate |
Definition at line 201 of file fltkviewport.cc.
References gadgets, and lout::container::typed::Collection< T >::iterator().
Referenced by draw().
|
virtual |
Get the thickness of the horizontal scrollbar, when it is visible.
Does not have to be implemented, when usesViewport returns false.
Implements dw::core::View.
Definition at line 481 of file fltkviewport.cc.
References SCROLLBAR_THICKNESS.
|
inlinevirtual |
Implements dw::core::View.
Definition at line 96 of file fltkviewport.hh.
References scrollbarOnLeft.
|
virtual |
Get the thickness of the vertical scrollbar, when it is visible.
Does not have to be implemented, when usesViewport returns false.
Implements dw::core::View.
Definition at line 486 of file fltkviewport.cc.
References SCROLLBAR_THICKNESS.
int dw::fltk::FltkViewport::handle | ( | int | event | ) |
Definition at line 271 of file fltkviewport.cc.
References _MSG, dw::core::BOTTOM_CMD, dw::core::style::CURSOR_DEFAULT, dw::core::style::CURSOR_MOVE, dragScrolling, dragX, dragY, dw::fltk::FltkViewBase::handle(), handle(), hasDragScroll, horScrolling, hscrollbar, dw::fltk::FltkViewBase::mouse_x, dw::fltk::FltkViewBase::mouse_y, dw::core::NONE_CMD, pageScrollDelay, pageScrolling, positionChanged(), repeatPageScroll(), dw::core::SCREEN_DOWN_CMD, dw::core::SCREEN_UP_CMD, scroll(), SCROLLBAR_THICKNESS, scrollbarPageMode, selectionScroll(), dw::fltk::FltkViewBase::setCursor(), dw::core::TOP_CMD, verScrolling, and vscrollbar.
Referenced by handle().
|
staticprivate |
Definition at line 183 of file fltkviewport.cc.
Referenced by FltkViewport().
|
private |
Definition at line 168 of file fltkviewport.cc.
References hscrollbar, scroll(), and scrollX.
|
private |
Definition at line 446 of file fltkviewport.cc.
References dragScrolling, dw::core::Layout::motionNotify(), dw::fltk::FltkViewBase::mouse_x, dw::fltk::FltkViewBase::mouse_y, dw::fltk::FltkViewBase::theLayout, translateViewXToCanvasX(), and translateViewYToCanvasY().
Referenced by handle(), and scrollTo().
|
private |
Definition at line 580 of file fltkviewport.cc.
References pageScrolling, pageScrollInterval, repeatPageScroll(), and scroll().
Referenced by handle(), and repeatPageScroll().
|
staticprivate |
Definition at line 586 of file fltkviewport.cc.
void dw::fltk::FltkViewport::resize | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Definition at line 190 of file fltkviewport.cc.
References adjustScrollbarsAndGadgetsAllocation(), H, dw::fltk::FltkViewBase::theLayout, and dw::core::Layout::viewportSizeChanged().
|
virtual |
Scroll the viewport as commanded.
Reimplemented from dw::core::View.
Definition at line 527 of file fltkviewport.cc.
References dw::core::BOTTOM_CMD, dw::fltk::FltkViewBase::canvasHeight, hscrollbar, dw::core::LEFT_CMD, dw::core::LINE_DOWN_CMD, dw::core::LINE_UP_CMD, pageOverlap, dw::core::RIGHT_CMD, dw::core::SCREEN_DOWN_CMD, dw::core::SCREEN_LEFT_CMD, dw::core::SCREEN_RIGHT_CMD, dw::core::SCREEN_UP_CMD, scroll(), SCROLLBAR_THICKNESS, scrollTo(), scrollX, dw::core::TOP_CMD, and vscrollbar.
void dw::fltk::FltkViewport::scroll | ( | int | dx, |
int | dy | ||
) |
Definition at line 522 of file fltkviewport.cc.
References scrollTo(), scrollX, and scrollY.
Referenced by handle(), hscrollbarChanged(), repeatPageScroll(), scroll(), selectionScroll(), setViewportSize(), and vscrollbarChanged().
|
virtual |
Scroll the vieport to the given position.
Does not have to be implemented, when usesViewport returns false.
Implements dw::core::View.
Definition at line 491 of file fltkviewport.cc.
References adjustScrollbarValues(), dw::fltk::FltkViewBase::canvasHeight, dw::fltk::FltkViewBase::canvasWidth, hscrollbar, lout::misc::max(), lout::misc::min(), positionChanged(), SCROLLBAR_THICKNESS, scrollDX, scrollDY, dw::core::Layout::scrollPosChanged(), scrollX, scrollY, dw::fltk::FltkViewBase::theLayout, updateCanvasWidgets(), and vscrollbar.
|
private |
Definition at line 557 of file fltkviewport.cc.
References hscrollbar, dw::fltk::FltkViewBase::mouse_x, dw::fltk::FltkViewBase::mouse_y, scroll(), and vscrollbar.
Referenced by handle(), and selectionScroll().
|
staticprivate |
Definition at line 574 of file fltkviewport.cc.
References selectionScroll().
|
virtual |
Set the canvas size.
Reimplemented from dw::fltk::FltkViewBase.
Definition at line 437 of file fltkviewport.cc.
References adjustScrollbarValues(), and dw::fltk::FltkViewBase::setCanvasSize().
|
inline |
Definition at line 106 of file fltkviewport.hh.
References hasDragScroll.
Referenced by UIcmd_tab_new().
void dw::fltk::FltkViewport::setGadgetOrientation | ( | bool | hscrollbarVisible, |
bool | vscrollbarVisible, | ||
FltkViewport::GadgetOrientation | gadgetOrientation | ||
) |
Definition at line 659 of file fltkviewport.cc.
References adjustScrollbarsAndGadgetsAllocation(), and gadgetOrientation.
void dw::fltk::FltkViewport::setPageOverlap | ( | int | overlap | ) |
Definition at line 466 of file fltkviewport.cc.
References pageOverlap.
Referenced by UIcmd_tab_new().
void dw::fltk::FltkViewport::setScrollbarOnLeft | ( | bool | enable | ) |
Definition at line 591 of file fltkviewport.cc.
References adjustScrollbarsAndGadgetsAllocation(), and scrollbarOnLeft.
Referenced by UIcmd_tab_new().
void dw::fltk::FltkViewport::setScrollbarPageMode | ( | bool | enable | ) |
Definition at line 471 of file fltkviewport.cc.
References scrollbarPageMode.
Referenced by UIcmd_tab_new().
void dw::fltk::FltkViewport::setScrollStep | ( | int | step | ) |
Definition at line 460 of file fltkviewport.cc.
References hscrollbar, and vscrollbar.
Referenced by UIcmd_tab_new().
|
virtual |
Set the viewport size.
Does not have to be implemented, when usesViewport returns false.
This will normally imply a resize of the UI widget. Width and height are the dimensions of the new size, including the scrollbar thicknesses.
Implements dw::core::View.
Definition at line 598 of file fltkviewport.cc.
References _MSG, adjustScrollbarsAndGadgetsAllocation(), hscrollbar, scroll(), scrollX, scrollY, and vscrollbar.
|
protectedvirtual |
Implements dw::fltk::FltkViewBase.
Definition at line 647 of file fltkviewport.cc.
References scrollX.
|
protectedvirtual |
Implements dw::fltk::FltkViewBase.
Definition at line 652 of file fltkviewport.cc.
References scrollY.
|
protectedvirtual |
Implements dw::fltk::FltkViewBase.
Definition at line 637 of file fltkviewport.cc.
References scrollX.
Referenced by positionChanged().
|
protectedvirtual |
Implements dw::fltk::FltkViewBase.
Definition at line 642 of file fltkviewport.cc.
References scrollY.
Referenced by positionChanged().
|
private |
Definition at line 624 of file fltkviewport.cc.
References hscrollbar, and vscrollbar.
Referenced by scrollTo().
|
virtual |
Return, whether this view uses a viewport.
Implements dw::core::View.
Definition at line 476 of file fltkviewport.cc.
|
staticprivate |
Definition at line 178 of file fltkviewport.cc.
Referenced by FltkViewport().
|
private |
Definition at line 173 of file fltkviewport.cc.
References scroll(), scrollY, and vscrollbar.
|
private |
Definition at line 45 of file fltkviewport.hh.
Referenced by FltkViewport(), handle(), and positionChanged().
|
private |
Definition at line 45 of file fltkviewport.hh.
Referenced by handle().
|
private |
Definition at line 45 of file fltkviewport.hh.
Referenced by handle().
|
private |
Definition at line 55 of file fltkviewport.hh.
Referenced by adjustScrollbarsAndGadgetsAllocation(), FltkViewport(), and setGadgetOrientation().
|
private |
Definition at line 57 of file fltkviewport.hh.
Referenced by addGadget(), adjustScrollbarsAndGadgetsAllocation(), draw_area(), FltkViewport(), and ~FltkViewport().
|
private |
Definition at line 45 of file fltkviewport.hh.
Referenced by FltkViewport(), handle(), and setDragScroll().
|
private |
Definition at line 46 of file fltkviewport.hh.
Referenced by FltkViewport(), and handle().
|
private |
Definition at line 53 of file fltkviewport.hh.
Referenced by adjustScrollbarsAndGadgetsAllocation(), adjustScrollbarValues(), draw(), FltkViewport(), handle(), hscrollbarChanged(), scroll(), scrollTo(), selectionScroll(), setScrollStep(), setViewportSize(), and updateCanvasWidgets().
|
private |
Definition at line 48 of file fltkviewport.hh.
Referenced by FltkViewport(), scroll(), and setPageOverlap().
|
private |
Definition at line 51 of file fltkviewport.hh.
Referenced by FltkViewport(), and handle().
|
private |
Definition at line 49 of file fltkviewport.hh.
Referenced by FltkViewport(), handle(), and repeatPageScroll().
|
private |
Definition at line 50 of file fltkviewport.hh.
Referenced by FltkViewport(), and repeatPageScroll().
|
private |
Definition at line 44 of file fltkviewport.hh.
Referenced by adjustScrollbarsAndGadgetsAllocation(), draw(), getScrollbarOnLeft(), and setScrollbarOnLeft().
|
private |
Definition at line 47 of file fltkviewport.hh.
Referenced by FltkViewport(), handle(), and setScrollbarPageMode().
|
private |
Definition at line 43 of file fltkviewport.hh.
Referenced by draw(), FltkViewport(), and scrollTo().
|
private |
Definition at line 43 of file fltkviewport.hh.
Referenced by draw(), FltkViewport(), and scrollTo().
|
private |
Definition at line 42 of file fltkviewport.hh.
Referenced by adjustScrollbarValues(), FltkViewport(), hscrollbarChanged(), scroll(), scroll(), scrollTo(), setViewportSize(), translateCanvasXToViewX(), and translateViewXToCanvasX().
|
private |
Definition at line 42 of file fltkviewport.hh.
Referenced by adjustScrollbarValues(), FltkViewport(), scroll(), scrollTo(), setViewportSize(), translateCanvasYToViewY(), translateViewYToCanvasY(), and vscrollbarChanged().
|
private |
Definition at line 46 of file fltkviewport.hh.
Referenced by FltkViewport(), and handle().
|
private |
Definition at line 53 of file fltkviewport.hh.
Referenced by adjustScrollbarsAndGadgetsAllocation(), adjustScrollbarValues(), draw(), FltkViewport(), handle(), scroll(), scrollTo(), selectionScroll(), setScrollStep(), setViewportSize(), updateCanvasWidgets(), and vscrollbarChanged().