CBuiltInMonthCalendar


MonthCalendar has been moved to Nitisa Core in release 10.0.0.

This class is an implementation of the Built-in Month Calendar control.

You can find more information in comments below. Overrided methods can be found in corresponding base class or interface.

class CBuiltInMonthCalendar :public virtual IBuiltInMonthCalendar, public CBuiltInControl
    {
    public:
        enum MODE // Control modes
        {
            modeMonth, // Month is shown
            modeYear, // Year is shown(list of monthes)
            modeDecade, // Decade is shown(list of years)
            modeCentury // Century is shown(list of 10-year intervals)
        };

        enum ELEMENT_STATE // Element states
        {
            estNormal, // Normal
            estHovered, // Mouse pointer is over an element
            estToday, // Element corresponds to today date
            estTodayHovered, // Element corresponds to today date and mouse pointer is over it
            estActive, // Element correponds to active date
            estActiveHovered, // Element correponds to active date and mouse pointer is over it
            estTodayActive, // Element corresponds to today and to active date as well
            estTodayActiveHovered, // Element corresponds to today and to active date as well and mouse pointer is over it
            estOtherRange, // Element is another range(previous or next month/decade/century)
            estOtherRangeHovered, // Element is another range(previous or next month/decade/century) and mouse pointer is over it
            estDisabled // Element is disabled(either because of the control is disabled or the element is out of allowed date range)
        };

        enum TITLE_STATE // Title and today links states
        {
            tstNormal, // Normal
            tstHovered, // Mouse pointer is over the element
            tstActive, // Mouse pointer was down over an element
            tstActiveHovered, // Mouse pointer was down over an element and mouse pointer is over it
            tstDisabled // Disabled
        };

        enum DAY_TITLE_STATE // Day title states
        {
            dtstNormal, // Normal
            dtstDisabled // Disabled
        };
    public:
        // IBuiltInControl getters
        IBuiltInControlListener * getListener() override;
        bool isDown() override;

        // IBuiltInControl setters
        void setListener(IBuiltInControlListener *value) override;
        bool setSize(const PointF &value) override;
        bool setDPI(const Point &value) override;

        // Helpers
        void UpdateFromStyle(IStyle *style, const String &class_name) override;
        void Update() override;
        void Render(const bool last_pass, const Matrix &matrix, const BLOCK *block) override;
        void FreeResources() override;
        // Since 8.0.0
        void Refresh() override;

        // State change notifications
        void NotifyOnAttach() override;
        void NotifyOnDeactivate() override;

        // Mouse input notifications
        bool NotifyOnMouseHover(const PointF &position) override;
        bool NotifyOnMouseLeave() override;
        bool NotifyOnMouseMove(const PointF &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
        bool NotifyOnMouseLeftDown(const PointF &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
        bool NotifyOnMouseLeftUp(const PointF &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
        bool NotifyOnMouseLeftDoubleClick(const PointF &position, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift) override;
        bool NotifyOnMouseMiddleDown(const PointF &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
        bool NotifyOnMouseMiddleUp(const PointF &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
        bool NotifyOnMouseMiddleDoubleClick(const PointF &position, const bool left, const bool right, const bool ctrl, const bool alt, const bool shift) override;
        bool NotifyOnMouseRightDown(const PointF &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
        bool NotifyOnMouseRightUp(const PointF &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
        bool NotifyOnMouseRightDoubleClick(const PointF &position, const bool left, const bool middle, const bool ctrl, const bool alt, const bool shift) override;
        void NotifyOnMouseDownCancel() override;
        bool NotifyOnMouseVerticalWheel(const PointF &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift, const int delta) override;
        bool NotifyOnMouseHorizontalWheel(const PointF &position, const bool left, const bool middle, const bool right, const bool ctrl, const bool alt, const bool shift, const int delta) override;

        // Keyboard input notifications
        bool NotifyOnKeyDown(const KEY key, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
        bool NotifyOnKeyUp(const KEY key, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
        bool NotifyOnChar(const wchar_t chr, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;
        bool NotifyOnDeadChar(const wchar_t chr, const bool ctrl, const bool alt, const bool shift, const bool numlock) override;

        // Other input notifications
        bool NotifyOnDropFiles(const PointF &position, const std::vector<String> &filenames) override;

        // Clipboard notifications(since 9.0.0)
        bool NotifyOnPasteString(const String &text) override;

        // IBuiltInMonthCalendar getters
        PointF getRequiredSize() override;
        int getYear() override;
        int getMonth() override;
        int getDay() override;
        int getMinYear() override; // 1600 by default
        int getMinMonth() override; // January by default
        int getMinDay() override; // 1 by default
        int getMaxYear() override; // 3000 by default
        int getMaxMonth() override; // January by default
        int getMaxDay() override; // 1 by default
        bool isAnimating() override;

        // IBuiltInMonthCalendar setters
        bool setYear(const int value) override;
        bool setMonth(const int value) override;
        bool setDay(const int value) override;
        bool setMinYear(const int value) override;
        bool setMinMonth(const int value) override;
        bool setMinDay(const int value) override;
        bool setMaxYear(const int value) override;
        bool setMaxMonth(const int value) override;
        bool setMaxDay(const int value) override;

        // IBuiltInMonthCalendar methods
        bool Next() override;
        bool Prev() override;
        bool Today() override;

        CBuiltInMonthCalendar();

        // Getters
        MODE getMode() const; // Return mode
        bool isShowToday() const; // Return whether "today is" link should be shown
        RectF getTitlePadding() const; // Return title padding
        RectF getTodayPadding() const; // Return "today" link padding
        RectF getElementPadding() const; // Return elements padding
        RectF getDayPadding() const; // Return days padding
        float getTodayMargin() const; // Return distance between rectangle and text
        float getTodayRectWidth() const; // Return width of "today" link rectangle
        bool isAnimate() const; // Return whether range and modes should be changed with or without animation
        float getAnimateInterval() const; // Return paint interval when animating changes
        float getAnimateMinScale() const; // Return minimum scaling in range [0..1) used in animating mode changes
        float getAnimateTime() const; // Return how long animation should take
        float getScrollInterval() const; // Return range change interval when mouse is down over the next/prev range change arrows
        TEXT_ALIGN getTitleAlign(const TITLE_STATE state) const; // Return title alignement
        RectF getTitleBorderRadius(const TITLE_STATE state) const; // Return title corner radiuses
        RectF getTitleBorderWidth(const TITLE_STATE state) const; // Return title border widths
        RectC getTitleBorderColor(const TITLE_STATE state) const; // Return title border colors
        Color getTitleBackgroundColor(const TITLE_STATE state) const; // Return title background color
        Gradient *getTitleBackgroundGradient(const TITLE_STATE state); // Return title background gradient
        Color getTitleColor(const TITLE_STATE state) const; // Return title color
        RectF getTitlePrevRangeBorderRadius(const TITLE_STATE state) const; // Return prev range button corner radiuses
        RectF getTitlePrevRangeBorderWidth(const TITLE_STATE state) const; // Return prev range button border widths
        RectC getTitlePrevRangeBorderColor(const TITLE_STATE state) const; // Return prev range button border colors
        Color getTitlePrevRangeBackgroundColor(const TITLE_STATE state) const; // Return prev range button background color
        Gradient *getTitlePrevRangeBackgroundGradient(const TITLE_STATE state); // Return prev range button background gradient
        RectF getTitlePrevRangePadding(const TITLE_STATE state) const; // Return prev range button arrow padding
        Color getTitlePrevRangeColor1(const TITLE_STATE state) const; // Return prev range button arrow first point color
        Color getTitlePrevRangeColor2(const TITLE_STATE state) const; // Return prev range button arrow second point color
        Color getTitlePrevRangeColor3(const TITLE_STATE state) const; // Return prev range button arrow third point color
        RectF getTitleNextRangeBorderRadius(const TITLE_STATE state) const; // Return next range button corner radiuses
        RectF getTitleNextRangeBorderWidth(const TITLE_STATE state) const; // Return next range button border widths
        RectC getTitleNextRangeBorderColor(const TITLE_STATE state) const; // Return next range button border colors
        Color getTitleNextRangeBackgroundColor(const TITLE_STATE state) const; // Return next range button background color
        Gradient *getTitleNextRangeBackgroundGradient(const TITLE_STATE state); // Return next range button background gradient
        RectF getTitleNextRangePadding(const TITLE_STATE state) const; // Return next range button arrow padding
        Color getTitleNextRangeColor1(const TITLE_STATE state) const; // Return next range button arrow first point color
        Color getTitleNextRangeColor2(const TITLE_STATE state) const; // Return next range button arrow second point color
        Color getTitleNextRangeColor3(const TITLE_STATE state) const; // Return next range button arrow third point color
        TEXT_ALIGN getTodayAlign(const TITLE_STATE state) const; // Return "today" link text align
        RectF getTodayBorderRadius(const TITLE_STATE state) const; // Return "today" link corner radiuses
        RectF getTodayBorderWidth(const TITLE_STATE state) const; // Return "today" link border widths
        RectC getTodayBorderColor(const TITLE_STATE state) const; // Return "today" link border colors
        Color getTodayBackgroundColor(const TITLE_STATE state) const; // Return "today" link background color
        Gradient *getTodayBackgroundGradient(const TITLE_STATE state); // Return "today" link background gradient
        Color getTodayColor(const TITLE_STATE state) const; // Return "today" link text color
        RectF getTodayRectBorderRadius(const TITLE_STATE state) const; // Return "today" link rectangle corner radiuses
        RectF getTodayRectBorderWidth(const TITLE_STATE state) const; // Return "today" link rectangle border widths
        RectC getTodayRectBorderColor(const TITLE_STATE state) const; // Return "today" link rectangle border colors
        Color getTodayRectBackgroundColor(const TITLE_STATE state) const; // Return "today" link rectangle background color
        Gradient *getTodayRectBackgroundGradient(const TITLE_STATE state); // Return "today" link rectangle background gradient
        TEXT_ALIGN getElementHorizontalAlign(const ELEMENT_STATE state) const; // Return element horizontal alignment
        VERTICAL_ALIGN getElementVerticalAlign(const ELEMENT_STATE state) const; // Return element vertical alignment
        RectF getElementBorderRadius(const ELEMENT_STATE state) const; // Return element corner radiuses
        RectF getElementBorderWidth(const ELEMENT_STATE state) const; // Return element border widths
        RectC getElementBorderColor(const ELEMENT_STATE state) const; // Return element border colors
        Color getElementBackgroundColor(const ELEMENT_STATE state) const; // Return element background color
        Gradient *getElementBackgroundGradient(const ELEMENT_STATE state); // Return element background gradient
        Color getElementColor(const ELEMENT_STATE state) const; // Return element text color
        Color getElementOutlineColor(const ELEMENT_STATE state) const; // Return element outline color
        unsigned int getElementOutlineMask(const ELEMENT_STATE state) const; // Return element outline mask
        TEXT_ALIGN getDayHorizontalAlign(const ELEMENT_STATE state) const; // Return day horizontal alignment
        VERTICAL_ALIGN getDayVerticalAlign(const ELEMENT_STATE state) const; // Return day vertical alignment
        TEXT_ALIGN getDayTitleHorizontalAlign(const DAY_TITLE_STATE state) const; // Return day title horizontal alignment
        VERTICAL_ALIGN getDayTitleVerticalAlign(const DAY_TITLE_STATE state) const; // Return day title vertical alignment
        RectF getDayTitleBorderRadius(const DAY_TITLE_STATE state) const; // Return day title corner radiuses
        RectF getDayTitleBorderWidth(const DAY_TITLE_STATE state) const; // Return day title border widths
        RectC getDayTitleBorderColor(const DAY_TITLE_STATE state) const; // Return day title border colors
        Color getDayTitleBackgroundColor(const DAY_TITLE_STATE state) const; // Return day title background color
        Gradient *getDayTitleBackgroundGradient(const DAY_TITLE_STATE state); // Return day title background gradient
        Color getDayTitleColor(const DAY_TITLE_STATE state) const; // Return day title text color

        // Setters
        bool setMode(const MODE value); // Set mode
        bool setShowToday(const bool value); // Set whether "today is" link should be shown
        bool setTitlePadding(const RectF &value); // Set title padding
        bool setTodayPadding(const RectF &value); // Set "today" link padding
        bool setElementPadding(const RectF &value); // Set elements padding
        bool setDayPadding(const RectF &value); // Set days padding
        bool setTodayMargin(const float value); // Set distance between rectangle and text
        bool setTodayRectWidth(const float value); // Set width of "today" link rectangle
        bool setAnimate(const bool value); // Set whether range and modes should be changed with or without animation
        bool setAnimateInterval(const float value); // Set paint interval when animating changes
        bool setAnimateMinScale(const float value); // Set minimum scaling in range [0..1) used in animating mode changes
        bool setAnimateTime(const float value); // Set how long animation should take
        bool setScrollInterval(const float value); // Set range change interval when mouse is down over the next/prev range change arrows
        bool setTitleAlign(const TITLE_STATE state, const TEXT_ALIGN value); // Set title alignement
        bool setTitleBorderRadius(const TITLE_STATE state, const RectF &value); // Set title corner radiuses
        bool setTitleBorderWidth(const TITLE_STATE state, const RectF &value); // Set title border widths
        bool setTitleBorderColor(const TITLE_STATE state, const RectC &value); // Set title border colors
        bool setTitleBackgroundColor(const TITLE_STATE state, const Color &value); // Set title background color
        bool setTitleColor(const TITLE_STATE state, const Color &value); // Set title color
        bool setTitlePrevRangeBorderRadius(const TITLE_STATE state, const RectF &value); // Set prev range button corner radiuses
        bool setTitlePrevRangeBorderWidth(const TITLE_STATE state, const RectF &value); // Set prev range button border widths
        bool setTitlePrevRangeBorderColor(const TITLE_STATE state, const RectC &value); // Set prev range button border colors
        bool setTitlePrevRangeBackgroundColor(const TITLE_STATE state, const Color &value); // Set prev range button background color
        bool setTitlePrevRangePadding(const TITLE_STATE state, const RectF &value); // Set prev range button arrow padding
        bool setTitlePrevRangeColor1(const TITLE_STATE state, const Color &value); // Set prev range button arrow first point color
        bool setTitlePrevRangeColor2(const TITLE_STATE state, const Color &value); // Set prev range button arrow second point color
        bool setTitlePrevRangeColor3(const TITLE_STATE state, const Color &value); // Set prev range button arrow third point color
        bool setTitleNextRangeBorderRadius(const TITLE_STATE state, const RectF &value); // Set next range button corner radiuses
        bool setTitleNextRangeBorderWidth(const TITLE_STATE state, const RectF &value); // Set next range button border widths
        bool setTitleNextRangeBorderColor(const TITLE_STATE state, const RectC &value); // Set next range button border colors
        bool setTitleNextRangeBackgroundColor(const TITLE_STATE state, const Color &value); // Set next range button background color
        bool setTitleNextRangePadding(const TITLE_STATE state, const RectF &value); // Set next range button arrow padding
        bool setTitleNextRangeColor1(const TITLE_STATE state, const Color &value); // Set next range button arrow first point color
        bool setTitleNextRangeColor2(const TITLE_STATE state, const Color &value); // Set next range button arrow second point color
        bool setTitleNextRangeColor3(const TITLE_STATE state, const Color &value); // Set next range button arrow third point color
        bool setTodayAlign(const TITLE_STATE state, const TEXT_ALIGN value); // Set "today" link text align
        bool setTodayBorderRadius(const TITLE_STATE state, const RectF &value); // Set "today" link corner radiuses
        bool setTodayBorderWidth(const TITLE_STATE state, const RectF &value); // Set "today" link border widths
        bool setTodayBorderColor(const TITLE_STATE state, const RectC &value); // Set "today" link border colors
        bool setTodayBackgroundColor(const TITLE_STATE state, const Color &value); // Set "today" link background color
        bool setTodayColor(const TITLE_STATE state, const Color &value); // Set "today" link text color
        bool setTodayRectBorderRadius(const TITLE_STATE state, const RectF &value); // Set "today" link rectangle corner radiuses
        bool setTodayRectBorderWidth(const TITLE_STATE state, const RectF &value); // Set "today" link rectangle border widths
        bool setTodayRectBorderColor(const TITLE_STATE state, const RectC &value); // Set "today" link rectangle border colors
        bool setTodayRectBackgroundColor(const TITLE_STATE state, const Color &value); // Set "today" link rectangle background color
        bool setElementHorizontalAlign(const ELEMENT_STATE state, const TEXT_ALIGN value); // Set element horizontal alignment
        bool setElementVerticalAlign(const ELEMENT_STATE state, const VERTICAL_ALIGN value); // Set element vertical alignment
        bool setElementBorderRadius(const ELEMENT_STATE state, const RectF &value); // Set element corner radiuses
        bool setElementBorderWidth(const ELEMENT_STATE state, const RectF &value); // Set element border widths
        bool setElementBorderColor(const ELEMENT_STATE state, const RectC &value); // Set element border colors
        bool setElementBackgroundColor(const ELEMENT_STATE state, const Color &value); // Set element background color
        bool setElementColor(const ELEMENT_STATE state, const Color &value); // Set element text color
        bool setElementOutlineColor(const ELEMENT_STATE state, const Color &value); // Set element outline color
        bool setElementOutlineMask(const ELEMENT_STATE state, const unsigned int value); // Set element outline mask
        bool setDayHorizontalAlign(const ELEMENT_STATE state, const TEXT_ALIGN value); // Set day horizontal alignment
        bool setDayVerticalAlign(const ELEMENT_STATE state, const VERTICAL_ALIGN value); // Set day vertical alignment
        bool setDayTitleHorizontalAlign(const DAY_TITLE_STATE state, const TEXT_ALIGN value); // Set day title horizontal alignment
        bool setDayTitleVerticalAlign(const DAY_TITLE_STATE state, const VERTICAL_ALIGN value); // Set day title vertical alignment
        bool setDayTitleBorderRadius(const DAY_TITLE_STATE state, const RectF &value); // Set day title corner radiuses
        bool setDayTitleBorderWidth(const DAY_TITLE_STATE state, const RectF &value); // Set day title border widths
        bool setDayTitleBorderColor(const DAY_TITLE_STATE state, const RectC &value); // Set day title border colors
        bool setDayTitleBackgroundColor(const DAY_TITLE_STATE state, const Color &value); // Set day title background color
        bool setDayTitleColor(const DAY_TITLE_STATE state, const Color &value); // Set day title text color
    };
Namespace: nitisa::standard
Include: Standard/BuiltInControls/MonthCalendar/BuiltInMonthCalendar.h