Now saves time.
[cake.git] / workbench / prefs / time / misc.c
blob7053152ae4e6e7ae374b1fe325d87dd9305c37ab
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 /*********************************************************************************************/
11 #include "global.h"
12 #include "version.h"
14 #include <string.h>
16 /*********************************************************************************************/
18 struct NewMenu nm[] =
20 {NM_TITLE, (STRPTR)MSG_MEN_PROJECT },
21 {NM_ITEM, (STRPTR)MSG_MEN_PROJECT_QUIT },
22 {NM_TITLE, (STRPTR)MSG_MEN_EDIT },
23 {NM_ITEM, (STRPTR)MSG_MEN_EDIT_RESTORE },
24 {NM_END }
27 /*********************************************************************************************/
29 void InitMenus(void)
31 struct NewMenu *actnm = nm;
33 for(actnm = nm; actnm->nm_Type != NM_END; actnm++)
35 if (actnm->nm_Label != NM_BARLABEL)
37 ULONG id = (ULONG)actnm->nm_Label;
38 STRPTR str = MSG(id);
40 if (actnm->nm_Type == NM_TITLE)
42 actnm->nm_Label = str;
43 } else {
44 actnm->nm_Label = str + 2;
45 if (str[0] != ' ') actnm->nm_CommKey = str;
47 actnm->nm_UserData = (APTR)id;
49 } /* if (actnm->nm_Label != NM_BARLABEL) */
51 } /* for(actnm = nm; nm->nm_Type != NM_END; nm++) */
55 /*********************************************************************************************/
57 LONG NumMonthDays(struct ClockData *cd)
59 struct ClockData cd2;
60 ULONG secs;
61 LONG monthday = 28;
63 cd2 = *cd;
65 while(monthday < 32)
67 cd2.mday = monthday;
69 secs = Date2Amiga(&cd2);
70 secs += 24 * 60 * 60; /* day++ */
72 Amiga2Date(secs, &cd2);
74 if (cd2.month != cd->month) break;
76 monthday++;
79 return monthday;
82 /*********************************************************************************************/