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

Calendar widget. More...

#include <CCalendar.h>

Inheritance diagram for sptk::CCalendar:
sptk::CLayoutClient

Public Member Functions

 CCalendar (const char *label, int layoutSize=20, CLayoutAlign layoutAlignment=CLayoutAlign::TOP)
 SPTK-style constructor. More...
 
 CCalendar (int x, int y, int w, int h, const char *label=nullptr)
 FLTK-style constructor. More...
 
void resize (int x, int y, int w, int h) override
 Widget resize. More...
 
int maxHeight () const
 Reports the maximum height of the calendar widget.
 
void autoHeight (int minHeight)
 Resizes widget to the optimal height, considering minHeight.
 
void date (DateTime dt)
 Sets the calendar date.
 
DateTime date () const
 Reports the calendar date.
 
- 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 dayButtonClicked (uint32_t day)
 The reaction function for the clicking on one of the day buttons.
 
void switchButtonClicked (int32_t monthChange)
 The reaction function for the clicking on one of the month change buttonss.
 
- 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

Calendar widget.

A calendar class implements one month calendar. The calendar window allows to select the date. You can change a day, a month and a year selected in the widget.

Constructor & Destructor Documentation

◆ CCalendar() [1/2]

sptk::CCalendar::CCalendar ( const char *  label,
int  layoutSize = 20,
CLayoutAlign  layoutAlignment = CLayoutAlign::TOP 
)

SPTK-style constructor.

Parameters
labelconst char *, the widget label
layoutSizeint, the size of widget in layout
layoutAlignmentCLayoutAlign, widget align in the layout

◆ CCalendar() [2/2]

sptk::CCalendar::CCalendar ( int  x,
int  y,
int  w,
int  h,
const char *  label = nullptr 
)

FLTK-style constructor.

Parameters
xint, widget x-coordinate
yint, widget y-coordinate
wint, widget width
hint, widget height
labelint, optional widget label

Member Function Documentation

◆ resize()

void sptk::CCalendar::resize ( int  x,
int  y,
int  w,
int  h 
)
override

Widget resize.

Parameters
xint, widget x-coordinate
yint, widget y-coordinate
wint, widget width
hint, widget height

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

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