/** * @file XTPCalendarEventRecurrenceDlg.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ #if !defined(_XTP_CALENDAR_EVENT_RECURRENCE_DLG_H__) # define _XTP_CALENDAR_EVENT_RECURRENCE_DLG_H__ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * This constant defines a value which returned from * CXTPCalendarEventRecurrenceDlg::DoModal() when the "Remove Recurrence" * button is pressed. * * @see CXTPCalendarEventRecurrenceDlg */ static const int XTP_CALENDAR_DLGRESULT_REMOVE_RECURRENCE = 103; /** * @brief * This class is used for manipulations with recurrence state of the events. * * @see CXTPCalendarEventPropertiesDlg */ class _XTP_EXT_CLASS CXTPCalendarEventRecurrenceDlg : public CDialog { /** @cond */ DECLARE_DYNAMIC(CXTPCalendarEventRecurrenceDlg) /** @endcond */ public: enum { IDD = XTP_IDD_CALENDAR_RECURRENCE_PROPERTIES }; /** * @brief * Dialog class constructor. * * @param pMasterEvent [in] Master event pointer to edit recurrence. * @param pParent [in] Pointer to parent window. Can be NULL. * @param nIDTemplate [in] Contains the ID number of a dialog-box template resource. * * @see ~CXTPCalendarEventRecurrenceDlg() */ CXTPCalendarEventRecurrenceDlg(CXTPCalendarEvent* pMasterEvent, CWnd* pParent = NULL, UINT nIDTemplate = CXTPCalendarEventRecurrenceDlg::IDD); /** * @brief * Default collection destructor. */ virtual ~CXTPCalendarEventRecurrenceDlg(); BOOL m_bDisableRemove; /**< Set TRUE to disable button remove recurrence. FALSE by default.*/ int nWorkWeekMask; /**< This structure member represents week working days using XTPCalendarWeekDay enumeration.*/ protected: /** * @brief * Initialize data for Start and End combobox controls. * * @details * Time formatted using active locale. */ virtual void InitStartEndCB(); /** * @brief * Initialize data for Duration combobox control. * * @details * Time duration formatted using active resource file. */ virtual void InitDurationCB(); /** * @brief * Initialize data for days of week names. * * @param wndCB A CComboBox object reference to set data. * * @details * Values formatted using active locale. */ virtual void InitDayOfWeekCBs(CComboBox& wndCB); /** * @brief * Initialize data for months names. * * @param wndCB A CComboBox object reference to set data. * * @details * Values formatted using active resource file. */ virtual void InitMonthCBs(CComboBox& wndCB); /** * @brief * Initialize data for which day (First, Second, ...). * * @param wndCB - A CComboBox object reference to set data. * * @details * Values formatted using active resource file. */ virtual void InitWhichDayCBs(CComboBox& wndCB); /** * @brief * Shows error message if the user's input is incorrect. * * @param pWnd A pointer to control with wrong value (to set focus). * * @details * Message formatted using active resource file. */ virtual void MsgBox_WrongValue(CWnd* pWnd); /** * @brief * Shows error message if the user's input is incorrect. * * @param nCtrlID A dialog control ID with wrong value (to set focus). * @param nMin A minimum value of allowed range. * @param nMax A maximum value of allowed range. * * @details * Message formatted using active resource file. */ virtual void MsgBox_WrongValueRange(UINT nCtrlID, int nMin, int nMax); virtual BOOL OnInitDialog(); virtual void DoDataExchange(CDataExchange* pDX); virtual void OnOK(); afx_msg void OnStartComboChanged(); afx_msg void OnEndComboChanged(); afx_msg void OnDurationComboChanged(); afx_msg void OnStartComboEdited(); afx_msg void OnEndComboEdited(); afx_msg void OnDurationComboEdited(); afx_msg void OnBnClickedButtonRemoveRecurrence(); // Update visible state of controls, according to the selected mode: // day/week/month/year. wparam - ID of the selected radio afx_msg void OnBnClickedRadioDailyYearly(UINT wparam); afx_msg void OnTimer(UINT_PTR nIDEvent); virtual void _MoveControlsBy_Y(); virtual int _AddString(CComboBox& wndCB, UINT nStrResID, DWORD_PTR dwItemData); virtual int _AddLocaleString(CComboBox& wndCB, LCTYPE lcidStr, DWORD_PTR dwItemData); virtual void OnStartChanged(); virtual void _OnStartChanged(); virtual void OnEndChanged(); virtual void _OnEndChanged(); virtual void OnDurationChanged(); virtual void _OnDurationChanged(); // Gets Time in Minutes, shown in ComboBox virtual int GetChangedComboTimeInMin(CComboBox& wndCb); virtual int GetDurationComboInMin(); // Shows or hides control on the dialog with specified id virtual void ShowWindow(int nID, BOOL bShow = TRUE); virtual void MoveWindow_Y(int nID, int nYOffset); virtual CRect GetCtrlRect(int nID); /** @cond */ DECLARE_MESSAGE_MAP() /** @endcond */ protected: CXTPCalendarEventPtr m_ptrMasterEvent; /**< Pointer to master event */ CXTPCalendarRecurrencePatternPtr m_ptrPattern; /**< recurrence pattern */ COleDateTime m_dtStart; /**< Store StartTime editor value.*/ COleDateTime m_dtEnd; /**< Store EndTime editor value.*/ COleDateTime m_dtStartDate; /**< Store StartDate editor value. UpdateData method used to Exchange value with dialog control.*/ COleDateTime m_dtEndDate; /**< Store EndDate editor value. UpdateData method used to Exchange value with dialog control.*/ CComboBox m_wndCbStart; /**< StartTime combobox object.*/ CComboBox m_wndCbEnd; /**< EndTime combobox object. */ CComboBox m_wndCbDuration; /**< Duration combobox object. */ int m_nOccurNum; /**< Store Number of occurrences editor value. UpdateData method used to Exchange value with dialog control.*/ /** Daly recurrence case*/ int m_nDayInterval; /**< Store days interval editor value. UpdateData method used to Exchange value with dialog control.*/ /** Weekly recurrence case*/ int m_nWeeklyInterval; /**< Store weeks interval editor value. UpdateData method used to Exchange value with dialog control.*/ BOOL m_bMonday; /**< Store Monday checkbox state. UpdateData method used to Exchange value with dialog control.*/ BOOL m_bTuesday; /**< Store Tuesday checkbox state. UpdateData method used to Exchange value with dialog control.*/ BOOL m_bWednesday; /**< Store Wednesday checkbox state. UpdateData method used to Exchange value with dialog control.*/ BOOL m_bThursday; /**< Store Thursday checkbox state. UpdateData method used to Exchange value with dialog control.*/ BOOL m_bFriday; /**< Store Friday checkbox state. UpdateData method used to Exchange value with dialog control.*/ BOOL m_bSaturday; /**< Store Saturday checkbox state. UpdateData method used to Exchange value with dialog control.*/ BOOL m_bSunday; /**< Store Sunday checkbox state. UpdateData method used to Exchange value with dialog control.*/ /** Monthly recurrence case*/ int m_MonthDate; /**< Store month day editor value. UpdateData method used to Exchange value with dialog control.*/ int m_nMonthInterval; /**< Store month interval editor value. UpdateData method used to Exchange value with dialog control.*/ int m_nMonthInterval2; /**< Store month interval editor value (for second case). UpdateData method used to Exchange value with dialog control.*/ CComboBox m_wndCbMonthDay; /**< Day of week combobox object for monthly recurrence.*/ CComboBox m_wndCbMonthWhich; /**< Which Day combobox object for monthly recurrence.*/ /** Yearly recurrence case*/ int m_nDayOfMonth; /**< Store month day editor value for Yearly recurrence. UpdateData method used to Exchange value with dialog control.*/ CComboBox m_wndYearMonth; /**< Month combobox object for Yearly recurrence.*/ CComboBox m_wndComboYearMonth2; /**< Month combobox object for Yearly recurrence (for second case).*/ CComboBox m_wndCbYearWhich; /**< Which Day combobox object for Yearly recurrence.*/ CComboBox m_wndCbYearDay; /**< Day of week combobox object for Yearly recurrence.*/ }; ///////////////////////////////////////////////////////////////////////////// AFX_INLINE void CXTPCalendarEventRecurrenceDlg::ShowWindow(int nID, BOOL bShow) { if (GetDlgItem(nID)) GetDlgItem(nID)->ShowWindow(bShow ? SW_SHOW : SW_HIDE); } # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(_XTP_CALENDAR_EVENT_RECURRENCE_DLG_H__)