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

Tabs widget. More...

#include <CTabs.h>

Inheritance diagram for sptk::CTabs:
sptk::CGroup sptk::CLayoutManager sptk::CLayoutClient sptk::CDialogTabs

Public Member Functions

 CTabs (const char *label=0L, int32_t layoutSize=10, CLayoutAlign layoutAlign=CLayoutAlign::TOP)
 Constructor in SPTK style. More...
 
 ~CTabs ()
 Destructor.
 
virtual Fl_Group * newPage (const char *label, bool autoColor)
 Creates a new CGroup page. More...
 
virtual Fl_Group * newScroll (const char *label, bool autoColor)
 Creates a new CScroll page. More...
 
virtual void draw ()
 Custom draw method.
 
void showTabs (bool show)
 Show/hide tabs flag. More...
 
uint32_t pageCount () const
 Returns tabs count.
 
uint32_t pageNumber () const
 Returns selected page number.
 
void pageNumber (uint32_t pageNumber)
 Sets selected page by number. More...
 
void remove (Fl_Group *page)
 Removes a page completely. More...
 
virtual String className () const
 Returns widget class name (internal SPTK RTTI). More...
 
- Public Member Functions inherited from sptk::CGroup
bool drawClipped () const
 
void drawClipped (bool drawClipped)
 
 CGroup (const char *label=nullptr, int layoutSize=10, CLayoutAlign layoutAlign=CLayoutAlign::TOP)
 
void draw () override
 
void resize (int x, int y, int w, int h) override
 
bool preferredSize (int &w, int &h) override
 
void clear () override
 Removes all the widgets inside the group. More...
 
const Stringlabel () const override
 Returns the current label. More...
 
String className () const override
 Returns widget class name (internal SPTK RTTI). More...
 
virtual void label (const String &l)
 
virtual const Stringlabel () const
 
- Public Member Functions inherited from sptk::CLayoutManager
 CLayoutManager (Fl_Group *group, int layoutSize, CLayoutAlign ca)
 
 ~CLayoutManager () override=default
 
virtual void clear ()
 Removes all the children. More...
 
int layoutSpacing () const
 
void layoutSpacing (int ls)
 
void layoutGrowMode (CLayoutGrowMode gm=CLayoutGrowMode::LGM_AUTO_GROW)
 
CLayoutGrowMode layoutGrowMode () const
 
void relayout ()
 
void frame (CFrame *frame, bool drawBackground=true)
 Defines frame. More...
 
const CFrameframe () const
 Returnes the current frame.
 
uint32_t frameWidth () const
 Returns frame width.
 
virtual void loadLayout (const xdoc::SNode &node, CLayoutXMLmode xmlMode)
 Loads group controls data from XML node. More...
 
virtual void saveLayout (const xdoc::SNode &node, CLayoutXMLmode xmlMode) const
 Saves group controls data into XML node. More...
 
void nameIndex (CWidgetNamesMap &index, bool recursive, bool clean=true) const
 Builds an index of internal widget names. More...
 
bool noXml () const
 Returns flag of blocking XML processing. More...
 
void noXml (bool noXml)
 Sets flag of blocking XML processing. 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
 

Static Public Member Functions

static CLayoutClientcreator (const xdoc::SNode &node)
 Creates a widget based on the XML node information. More...
 
- Static Public Member Functions inherited from sptk::CGroup
static CLayoutClientcreator (const xdoc::SNode &node)
 Creates a widget based on the XML node information. More...
 
- Static Public Member Functions inherited from sptk::CLayoutManager
static void registerControl (std::string typeName, createControlCallback creator) noexcept
 Register control type for loading layouts. More...
 
static const std::map< std::string, Fl_Boxtype > & boxTypeNames ()
 Returns a read-only map of box type names and corresponding constants.
 

Protected Member Functions

virtual void prepareNewPage (Fl_Group *page, bool autoColor)
 
- Protected Member Functions inherited from sptk::CGroup
void ctor_init (const char *label)
 
- Protected Member Functions inherited from sptk::CLayoutManager
bool autoLayout (int x, int y, int &w, int &h, bool resizeWidgets) const
 
virtual void paintBackground ()
 
- 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::CLayoutManager
int m_layoutSpacing
 
CLayoutGrowMode m_layoutGrowMode
 
Fl_Group * m_group
 
CFramem_frame
 
bool m_frameDrawBackground
 
bool m_noXml
 
- Protected Attributes inherited from sptk::CLayoutClient
Fl_Widget * m_widget
 
String m_name
 
String m_label
 
CLayoutAlign m_layoutAlign
 
- Static Protected Attributes inherited from sptk::CLayoutManager
static std::map< std::string, Fl_Boxtype > m_boxTypeNames
 
static createControlCallbackMap controlCreator
 

Detailed Description

Tabs widget.

It can show the tabs in several rows if they are too wide to fit.

Constructor & Destructor Documentation

◆ CTabs()

sptk::CTabs::CTabs ( const char *  label = 0L,
int32_t  layoutSize = 10,
CLayoutAlign  layoutAlign = CLayoutAlign::TOP 
)

Constructor in SPTK style.

Parameters
labelconst char*, label
layoutSizeint, widget align in layout
layoutAlignCLayoutAlign, widget align in layout

Member Function Documentation

◆ className()

virtual String sptk::CTabs::className ( ) const
inlinevirtual

Returns widget class name (internal SPTK RTTI).

Reimplemented from sptk::CGroup.

◆ creator()

static CLayoutClient * sptk::CTabs::creator ( const xdoc::SNode &  node)
static

Creates a widget based on the XML node information.

Parameters
nodexml::Node*, an XML node with widget information

◆ newPage()

virtual Fl_Group * sptk::CTabs::newPage ( const char *  label,
bool  autoColor 
)
virtual

Creates a new CGroup page.

Parameters
labelTab and page label
autoColorAuto-color assignment on/off

◆ newScroll()

virtual Fl_Group * sptk::CTabs::newScroll ( const char *  label,
bool  autoColor 
)
virtual

Creates a new CScroll page.

Parameters
labelTab and page label
autoColorAuto-color assignment on/off

◆ pageNumber()

void sptk::CTabs::pageNumber ( uint32_t  pageNumber)

Sets selected page by number.

Parameters
pageNumberuint32_t, a page number to select

◆ prepareNewPage()

virtual void sptk::CTabs::prepareNewPage ( Fl_Group *  page,
bool  autoColor 
)
protectedvirtual

Sets default parameters for a new page

Reimplemented in sptk::CDialogTabs.

◆ remove()

void sptk::CTabs::remove ( Fl_Group *  page)

Removes a page completely.

Parameters
pageFl_Group*, page to remove

◆ showTabs()

void sptk::CTabs::showTabs ( bool  show)

Show/hide tabs flag.

Parameters
showbool, if true the tabs would be visible

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

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