home *** CD-ROM | disk | FTP | other *** search
- /* CalendarMenu.c - Contains procedure to do a popup calendar menu.
- Written by Darin Gurney, Jun 10, 1994
-
- Needs to be accompanied by the CalendarMenu.rsrc
-
- */
-
-
- #include "CalendarMenu.h"
- #include <OSUtils.h>
-
- #define cMenuID 135
-
-
- MenuHandle cMenuHdl;
-
-
-
- /* ________________________ PopupCalendarMenu ________________________
- Pops up a Calendar menu at th position passed. Caller is responsible
- for drawing the 'Hot Spot' in some fashion.
- */
- void PopupCalendarMenu( Point pPt, unsigned long *date )
- {
- long lValue;
- long tDate;
- unsigned char pStr[20];
- DateTimeRec dtr;
-
-
- Delay ( 5L, &lValue );
- if (!StillDown() ) return;
-
- InitCursor();
- if (cMenuHdl==NULL)
- cMenuHdl = GetMenu( cMenuID );
- InsertMenu( cMenuHdl,hierMenu );
- NumToString( (long)(*date - 0x80000000), pStr );
- SetItem( cMenuHdl, 1, pStr );
- lValue = PopUpMenuSelect( cMenuHdl, pPt.v, pPt.h, 1);
- if ( lValue ) {
- GetItem( cMenuHdl, 2, pStr );
- StringToNum( pStr, (long*)date );
- *date += 0x80000000;
- }
- DeleteMenu( cMenuID );
- }
-
-
-
-