sptk2 logo
SPTK Home Page
Public Member Functions | Protected Member Functions | List of all members
sptk::CScrollBar Class Reference

#include <CScrollBar.h>

Inheritance diagram for sptk::CScrollBar:
sptk::CLayoutClient

Public Member Functions

 CScrollBar (int layoutSize=16, CLayoutAlign layoutAlign=CLayoutAlign::RIGHT)
 
 CScrollBar (int x, int y, int w, int h)
 
bool preferredSize (int &w, int &h) override
 
int handle (int event) override
 
String className () const override
 Returns widget class name (internal SPTK RTTI). More...
 
- Public Member Functions inherited from sptk::CLayoutClient
 CLayoutClient (Fl_Widget *widget, int layoutSize, CLayoutAlign ca)
 
virtual ~CLayoutClient ()
 
CLayoutAlign layoutAlign () const
 
void layoutAlign (CLayoutAlign al)
 
int layoutSize () const
 
void layoutSize (int ls)
 
virtual void label (const String &l)
 
virtual const Stringlabel () const
 
void name (const char *aname)
 
void name (const String &aname)
 
const Stringname () const
 
virtual bool preferredSize (int &w, int &h)
 
virtual bool computeSize (int &w, int &h)
 
virtual String className () const
 
Fl_Widget * widget () const
 
virtual void load (const xdoc::SNode &node, CLayoutXMLmode xmlMode)
 
virtual void load (const std::shared_ptr< xdoc::Node > &node)
 
virtual void save (const std::shared_ptr< xdoc::Node > &node, CLayoutXMLmode xmlMode) const
 

Protected Member Functions

void draw () override
 
- Protected Member Functions inherited from sptk::CLayoutClient
int lastPreferredH () const
 
int lastPreferredW () const
 
void lastPreferredH (int height)
 
void lastPreferredW (int width)
 

Additional Inherited Members

- Protected Attributes inherited from sptk::CLayoutClient
Fl_Widget * m_widget
 
String m_name
 
String m_label
 
CLayoutAlign m_layoutAlign
 

Detailed Description

Extended version of Scroll Bar - to add theme support

Constructor & Destructor Documentation

◆ CScrollBar() [1/2]

sptk::CScrollBar::CScrollBar ( int  layoutSize = 16,
CLayoutAlign  layoutAlign = CLayoutAlign::RIGHT 
)
inline

Constructor in SPTK style

Parameters
layoutSizeint, widget align in layout
layoutAlignCLayoutAlign, widget align in layout

◆ CScrollBar() [2/2]

sptk::CScrollBar::CScrollBar ( int  x,
int  y,
int  w,
int  h 
)
inline

Constructor in FLTK style

Parameters
xint, x-position
yint, y-position
wint, width
hint, height

References NONE.

Member Function Documentation

◆ className()

String sptk::CScrollBar::className ( ) const
inlineoverridevirtual

Returns widget class name (internal SPTK RTTI).

Reimplemented from sptk::CLayoutClient.

◆ draw()

void sptk::CScrollBar::draw ( )
overrideprotected

Custom draw method to support SPTK themes

◆ handle()

int sptk::CScrollBar::handle ( int  event)
override

Custom handle() method - event processing

◆ preferredSize()

bool sptk::CScrollBar::preferredSize ( int &  w,
int &  h 
)
overridevirtual

Computes the optimal progress bar size

Parameters
wint&, input - width offered by the program, output - width required by widget
hint&, input - height offered by the program, output - height required by widget
Returns
true if the size is stable (doesn't depend on input sizes)

Reimplemented from sptk::CLayoutClient.


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

Fri Oct 14 2022 09:58:39: SPTK 5.4.1