HeaderPane
Main
Hide
Share Link
Print

AllowedViews

Defines the views the user can switch to.

C

int WINAPI SftDate_GetAllowedViews(HWND hwndCtl);
BOOL WINAPI SftDate_SetAllowedViews(HWND hwndCtl, int views);

C++

int CSftDate::GetAllowedViews() const;
int CSftCalendar::GetAllowedViews() const;
BOOL CSftDate::SetAllowedViews(int views);
BOOL CSftCalendar::SetAllowedViews(int views);

Parameters

hwndCtl

The window handle of the month calendar control (SftCalendar), or of the date field control (SftDate) whose dropdown calendar is affected.

views

A combination of the following values:

SFTDATE_VIEWS_MONTHThe month view (days of a month).
SFTDATE_VIEWS_YEARThe year view (months of a year).
SFTDATE_VIEWS_DECADEThe decade view (years of a decade).
SFTDATE_VIEWS_CENTURYThe century view (decades of a century).
SFTDATE_VIEWS_ALLAll views. This is the default.

Returns

GetAllowedViews returns the combination of allowed views.

SetAllowedViews returns TRUE if views holds only the values listed above, otherwise FALSE.

Comments

The GetAllowedViews and SetAllowedViews functions define and retrieve the views of a calendar. Clicking the title switches to the next larger allowed view, choosing a month, year or decade in a larger view switches back to the next smaller allowed view.

The smallest allowed view is the one in which the user selects: a calendar with SFTDATE_VIEWS_YEAR and SFTDATE_VIEWS_DECADE selects months, its value being the first day of the month. If no view is allowed, the month view is used.

Calendar systems with several eras (the Japanese calendar) offer the month and year views only.

The view a calendar starts with is defined using SetInitialView. The setting applies to a month calendar control and to the dropdown calendar of a date field control.

Examples

C View entire sample code

        }
        break;
    case IDC_FIRSTDAY:
        for (i = 0; i < CONTROLS; ++i)
            SftDate_SetFirstDayOfWeek(c[i], sel);
        break;
    case IDC_VIEWS:
        for (i = 0; i < CONTROLS; ++i)
            SftDate_SetAllowedViews(c[i], g_viewSets[sel]);
        break;
    case IDC_TRAILING:
        for (i = 0; i < CONTROLS; ++i)
            SftDate_SetShowTrailingDates(c[i], fChecked);
        break;
    case IDC_TODAYBUTTON:
        for (i = 0; i < CONTROLS; ++i)

C++ View entire sample code

        }
        break;
    case IDC_FIRSTDAY:
        for (int i = 0; i < CONTROLS; ++i)
            Control(i).SetFirstDayOfWeek(sel);
        break;
    case IDC_VIEWS:
        for (int i = 0; i < CONTROLS; ++i)
            Control(i).SetAllowedViews(g_viewSets[sel]);
        break;
    case IDC_TRAILING:
        for (int i = 0; i < CONTROLS; ++i)
            Control(i).SetShowTrailingDates(fChecked);
        break;
    case IDC_TODAYBUTTON:
        for (int i = 0; i < CONTROLS; ++i)

See Also C/C++ API | Categories | Notifications


Last Updated 11/26/2026 - (email)
© 2026 Softel vdm, Inc.