RT1050 GUI demo using emWin library

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CALENDAR.h Source File

CALENDAR.h

00001 /*********************************************************************
00002 *                SEGGER Microcontroller GmbH & Co. KG                *
00003 *        Solutions for real time microcontroller applications        *
00004 **********************************************************************
00005 *                                                                    *
00006 *        (c) 1996 - 2016  SEGGER Microcontroller GmbH & Co. KG       *
00007 *                                                                    *
00008 *        Internet: www.segger.com    Support:  support@segger.com    *
00009 *                                                                    *
00010 **********************************************************************
00011 
00012 ** emWin V5.38 - Graphical user interface for embedded applications **
00013 All  Intellectual Property rights  in the Software belongs to  SEGGER.
00014 emWin is protected by  international copyright laws.  Knowledge of the
00015 source code may not be used to write a similar product.  This file may
00016 only be used in accordance with the following terms:
00017 
00018 The software has been licensed to  NXP Semiconductors USA, Inc.  whose
00019 registered  office  is  situated  at 411 E. Plumeria Drive, San  Jose,
00020 CA 95134, USA  solely for  the  purposes  of  creating  libraries  for
00021 NXPs M0, M3/M4 and  ARM7/9 processor-based  devices,  sublicensed  and
00022 distributed under the terms and conditions of the NXP End User License
00023 Agreement.
00024 Full source code is available at: www.segger.com
00025 
00026 We appreciate your understanding and fairness.
00027 ----------------------------------------------------------------------
00028 Licensing information
00029 
00030 Licensor:                 SEGGER Microcontroller Systems LLC
00031 Licensed to:              NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA
00032 Licensed SEGGER software: emWin
00033 License number:           GUI-00186
00034 License model:            emWin License Agreement, dated August 20th 2011
00035 Licensed product:         -
00036 Licensed platform:        NXP's ARM 7/9, Cortex-M0,M3,M4
00037 Licensed number of seats: -
00038 ----------------------------------------------------------------------
00039 File        : CALENDAR.h
00040 Purpose     : Message box interface
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef CALENDAR_H
00045 #define CALENDAR_H
00046 
00047 #include "WM.h"
00048 
00049 #if GUI_WINSUPPORT
00050 
00051 #if defined(__cplusplus)
00052   extern "C" {     /* Make sure we have C-declarations in C++ programs */
00053 #endif
00054 
00055 /*********************************************************************
00056 *
00057 *       Defines
00058 *
00059 **********************************************************************
00060 */
00061 #define CALENDAR_CI_WEEKEND 0
00062 #define CALENDAR_CI_WEEKDAY 1
00063 #define CALENDAR_CI_SEL     2
00064 
00065 #define CALENDAR_CI_HEADER  3
00066 #define CALENDAR_CI_MONTH   4
00067 #define CALENDAR_CI_LABEL   5
00068 #define CALENDAR_CI_FRAME   6
00069 
00070 #define CALENDAR_FI_CONTENT 0
00071 #define CALENDAR_FI_HEADER  1
00072 
00073 #define CALENDAR_SI_HEADER  0
00074 #define CALENDAR_SI_CELL_X  1
00075 #define CALENDAR_SI_CELL_Y  2
00076 
00077 /*********************************************************************
00078 *
00079 *       Notification codes
00080 *
00081 * The following is the list of notification codes specific to this widget,
00082 * Send with the WM_NOTIFY_PARENT message
00083 */
00084 #define CALENDAR_NOTIFICATION_MONTH_CLICKED  (WM_NOTIFICATION_WIDGET + 0)
00085 #define CALENDAR_NOTIFICATION_MONTH_RELEASED (WM_NOTIFICATION_WIDGET + 1)
00086 
00087 /*********************************************************************
00088 *
00089 *       Types
00090 *
00091 **********************************************************************
00092 */
00093 /*********************************************************************
00094 *
00095 *       CALENDAR_DATE
00096 */
00097 typedef struct {
00098   int Year;
00099   int Month;
00100   int Day;
00101 } CALENDAR_DATE;
00102 
00103 /*********************************************************************
00104 *
00105 *       CALENDAR_SKINFLEX_PROPS
00106 */
00107 typedef struct {
00108   GUI_COLOR aColorFrame[3]; // Frame colors of buttons
00109   GUI_COLOR aColorUpper[2]; // Upper gradient colors of buttons
00110   GUI_COLOR aColorLower[2]; // Lower gradient colors of buttons
00111   GUI_COLOR ColorArrow;     // Arrow colors
00112 } CALENDAR_SKINFLEX_PROPS;
00113 
00114 /*********************************************************************
00115 *
00116 *       Public code
00117 *
00118 **********************************************************************
00119 */
00120 WM_HWIN CALENDAR_Create           (WM_HWIN hParent, int xPos, int yPos, unsigned Year, unsigned Month, unsigned Day, unsigned FirstDayOfWeek, int Id, int Flags);
00121 void    CALENDAR_GetDate          (WM_HWIN hWin, CALENDAR_DATE * pDate);
00122 void    CALENDAR_GetSel           (WM_HWIN hWin, CALENDAR_DATE * pDate);
00123 void    CALENDAR_SetDate          (WM_HWIN hWin, CALENDAR_DATE * pDate);
00124 void    CALENDAR_SetSel           (WM_HWIN hWin, CALENDAR_DATE * pDate);
00125 void    CALENDAR_ShowDate         (WM_HWIN hWin, CALENDAR_DATE * pDate);
00126 
00127 /*********************************************************************
00128 *
00129 *       Default related
00130 */
00131 void    CALENDAR_SetDefaultBkColor(unsigned Index, GUI_COLOR Color);
00132 void    CALENDAR_SetDefaultColor  (unsigned Index, GUI_COLOR Color);
00133 void    CALENDAR_SetDefaultDays   (const char ** apDays);
00134 void    CALENDAR_SetDefaultFont   (unsigned Index, const GUI_FONT * pFont);
00135 void    CALENDAR_SetDefaultMonths (const char ** apMonths);
00136 void    CALENDAR_SetDefaultSize   (unsigned Index, unsigned Size);
00137 
00138 /*********************************************************************
00139 *
00140 *       Skinning related
00141 */
00142 void    CALENDAR_GetSkinFlexProps (CALENDAR_SKINFLEX_PROPS * pProps, int Index);
00143 void    CALENDAR_SetSkinFlexProps (const CALENDAR_SKINFLEX_PROPS * pProps, int Index);
00144 
00145 /*********************************************************************
00146 *
00147 *       The callback ...
00148 *
00149 * Do not call it directly ! It is only to be used from within an
00150 * overwritten callback.
00151 */
00152 void CALENDAR_Callback(WM_MESSAGE * pMsg);
00153 
00154 #if defined(__cplusplus)
00155   }
00156 #endif
00157 
00158 #endif // GUI_WINSUPPORT
00159 #endif // CALENDAR_H
00160 
00161 /*************************** End of file ****************************/