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);
hwndCtl
The window handle of the month calendar control (SftCalendar), or of the date field control (SftDate) whose dropdown calendar is affected.
A combination of the following values:
| SFTDATE_VIEWS_MONTH | The month view (days of a month). |
| SFTDATE_VIEWS_YEAR | The year view (months of a year). |
| SFTDATE_VIEWS_DECADE | The decade view (years of a decade). |
| SFTDATE_VIEWS_CENTURY | The century view (decades of a century). |
| SFTDATE_VIEWS_ALL | All views. This is the default. |
GetAllowedViews returns the combination of allowed views.
SetAllowedViews returns TRUE if views holds only the values listed above, otherwise FALSE.
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.
}
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)
}
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