dw::fltk::FltkViewport Class Reference

#include <fltkviewport.hh>

List of all members.

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.
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)

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 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 draw_area (void *data, int x, int y, int w, int h)

Private Attributes

int scrollX
int scrollY
int scrollDX
int scrollDY
int hasDragScroll
int dragScrolling
int dragX
int dragY
int horScrolling
int verScrolling
Fl_Scrollbar * vscrollbar
Fl_Scrollbar * hscrollbar
GadgetOrientation gadgetOrientation [4]
lout::container::typed::List
< lout::object::TypedPointer
< Fl_Widget > > * 
gadgets


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
SCROLLBAR_THICKNESS 

Enumerator:
GADGET_VERTICAL 
GADGET_HORIZONTAL 


Constructor & Destructor Documentation

dw::fltk::FltkViewport::FltkViewport ( int  x,
int  y,
int  w,
int  h,
const char *  label = 0 
)

dw::fltk::FltkViewport::~FltkViewport (  ) 

References gadgets.


Member Function Documentation

void dw::fltk::FltkViewport::addGadget ( Fl_Widget *  gadget  ) 

void dw::fltk::FltkViewport::adjustScrollbarsAndGadgetsAllocation (  )  [private]

void dw::fltk::FltkViewport::adjustScrollbarValues (  )  [private]

void dw::fltk::FltkViewport::draw (  ) 

void dw::fltk::FltkViewport::draw_area ( void *  data,
int  x,
int  y,
int  w,
int  h 
) [static, private]

int dw::fltk::FltkViewport::getHScrollbarThickness (  )  [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.

References SCROLLBAR_THICKNESS.

int dw::fltk::FltkViewport::getVScrollbarThickness (  )  [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.

References SCROLLBAR_THICKNESS.

int dw::fltk::FltkViewport::handle ( int  event  ) 

void dw::fltk::FltkViewport::hscrollbarCallback ( Fl_Widget *  hscrollbar,
void *  viewportPtr 
) [static, private]

Referenced by FltkViewport().

void dw::fltk::FltkViewport::hscrollbarChanged (  )  [private]

References hscrollbar, scroll(), and scrollX.

void dw::fltk::FltkViewport::positionChanged (  )  [private]

void dw::fltk::FltkViewport::resize ( int  x,
int  y,
int  w,
int  h 
)

void dw::fltk::FltkViewport::scroll ( dw::core::ScrollCommand   )  [virtual]

void dw::fltk::FltkViewport::scroll ( int  dx,
int  dy 
)

void dw::fltk::FltkViewport::scrollTo ( int  x,
int  y 
) [virtual]

void dw::fltk::FltkViewport::setCanvasSize ( int  width,
int  ascent,
int  descent 
) [virtual]

Set the canvas size.

Reimplemented from dw::fltk::FltkViewBase.

References adjustScrollbarValues().

void dw::fltk::FltkViewport::setDragScroll ( bool  enable  )  [inline]

References hasDragScroll.

void dw::fltk::FltkViewport::setGadgetOrientation ( bool  hscrollbarVisible,
bool  vscrollbarVisible,
FltkViewport::GadgetOrientation  gadgetOrientation 
)

void dw::fltk::FltkViewport::setScrollStep ( int  step  ) 

References hscrollbar, and vscrollbar.

void dw::fltk::FltkViewport::setViewportSize ( int  width,
int  height,
int  hScrollbarThickness,
int  vScrollbarThickness 
) [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.

References adjustScrollbarsAndGadgetsAllocation(), hscrollbar, scroll(), scrollX, scrollY, and vscrollbar.

int dw::fltk::FltkViewport::translateCanvasXToViewX ( int  x  )  [protected, virtual]

Implements dw::fltk::FltkViewBase.

References scrollX.

int dw::fltk::FltkViewport::translateCanvasYToViewY ( int  y  )  [protected, virtual]

Implements dw::fltk::FltkViewBase.

References scrollY.

int dw::fltk::FltkViewport::translateViewXToCanvasX ( int  x  )  [protected, virtual]

Implements dw::fltk::FltkViewBase.

References scrollX.

Referenced by positionChanged().

int dw::fltk::FltkViewport::translateViewYToCanvasY ( int  y  )  [protected, virtual]

Implements dw::fltk::FltkViewBase.

References scrollY.

Referenced by positionChanged().

void dw::fltk::FltkViewport::updateCanvasWidgets ( int  oldScrollX,
int  oldScrollY 
) [private]

References hscrollbar, and vscrollbar.

Referenced by scrollTo().

bool dw::fltk::FltkViewport::usesViewport (  )  [virtual]

Return, whether this view uses a viewport.

Implements dw::core::View.

void dw::fltk::FltkViewport::vscrollbarCallback ( Fl_Widget *  vscrollbar,
void *  viewportPtr 
) [static, private]

Referenced by FltkViewport().

void dw::fltk::FltkViewport::vscrollbarChanged (  )  [private]

References scroll(), scrollY, and vscrollbar.


Member Data Documentation

Referenced by handle().

Referenced by handle().

Referenced by FltkViewport(), handle(), and setDragScroll().

Referenced by FltkViewport(), and handle().

Fl_Scrollbar * dw::fltk::FltkViewport::hscrollbar [private]

Referenced by draw(), FltkViewport(), and scrollTo().

Referenced by draw(), FltkViewport(), and scrollTo().

Referenced by FltkViewport(), and handle().

Fl_Scrollbar* dw::fltk::FltkViewport::vscrollbar [private]


The documentation for this class was generated from the following files:

Generated on Wed Sep 7 02:00:38 2011 for Dillo by  doxygen 1.5.9