2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 /*********************************************************************************************/
8 #include <intuition/intuition.h>
9 #include <libraries/asl.h>
10 #include <libraries/gadtools.h>
11 #include <proto/exec.h>
12 #include <proto/dos.h>
13 #include <proto/intuition.h>
14 #include <proto/gadtools.h>
15 #include <proto/asl.h>
17 #define CATCOMP_NUMBERS
25 const char *versionstring
= VERSIONSTR
;
27 /*********************************************************************************************/
29 struct Library
*AslBase
;
31 /*********************************************************************************************/
33 static struct NewMenu nm
[] =
35 {NM_TITLE
, (STRPTR
)MSG_MEN_PROJECT
},
36 {NM_ITEM
, (STRPTR
)MSG_MEN_PROJECT_OPEN
},
37 {NM_ITEM
, NM_BARLABEL
},
38 {NM_ITEM
, (STRPTR
)MSG_MEN_PROJECT_SAVEAS
},
39 {NM_ITEM
, NM_BARLABEL
},
40 {NM_ITEM
, (STRPTR
)MSG_MEN_PROJECT_PRINT
},
41 {NM_ITEM
, (STRPTR
)MSG_MEN_PROJECT_ABOUT
},
42 {NM_ITEM
, NM_BARLABEL
},
43 {NM_ITEM
, (STRPTR
)MSG_MEN_PROJECT_QUIT
},
44 {NM_TITLE
, (STRPTR
)MSG_MEN_NAVIGATION
},
45 {NM_ITEM
, (STRPTR
)MSG_MEN_NAVIGATION_FIND
},
46 {NM_ITEM
, (STRPTR
)MSG_MEN_NAVIGATION_FIND_NEXT
},
47 {NM_ITEM
, (STRPTR
)MSG_MEN_NAVIGATION_FIND_PREV
},
48 {NM_ITEM
, NM_BARLABEL
},
49 {NM_ITEM
, (STRPTR
)MSG_MEN_NAVIGATION_JUMP
},
53 /*********************************************************************************************/
57 struct NewMenu
*actnm
= nm
;
59 for(actnm
= nm
; actnm
->nm_Type
!= NM_END
; actnm
++)
61 if (actnm
->nm_Label
!= NM_BARLABEL
)
63 ULONG id
= (ULONG
)actnm
->nm_Label
;
64 CONST_STRPTR str
= MSG(id
);
66 if (actnm
->nm_Type
== NM_TITLE
)
68 actnm
->nm_Label
= str
;
70 actnm
->nm_Label
= str
+ 2;
71 if (str
[0] != ' ') actnm
->nm_CommKey
= str
;
73 actnm
->nm_UserData
= (APTR
)id
;
75 } /* if (actnm->nm_Label != NM_BARLABEL) */
77 } /* for(actnm = nm; nm->nm_Type != NM_END; nm++) */
81 /*********************************************************************************************/
85 menus
= CreateMenusA(nm
, NULL
);
86 if (!menus
) Cleanup(MSG(MSG_CANT_CREATE_MENUS
));
88 if (!LayoutMenusA(menus
, vi
, NULL
)) Cleanup(MSG(MSG_CANT_CREATE_MENUS
));
92 /*********************************************************************************************/
96 if (win
) ClearMenuStrip(win
);
97 if (menus
) FreeMenus(menus
);
102 /*********************************************************************************************/
104 STRPTR
GetFile(BOOL open
)
106 static UBYTE pathbuffer
[300];
107 static UBYTE filebuffer
[300];
108 struct FileRequester
*req
;
109 STRPTR retval
= NULL
;
111 AslBase
= OpenLibrary("asl.library", 39);
117 strncpy(filebuffer
, FilePart(filenamebuffer
), 299);
118 strncpy(pathbuffer
, filenamebuffer
, 299);
119 *(FilePart(pathbuffer
)) = 0;
121 req
= AllocAslRequestTags(ASL_FileRequest
, ASLFR_TitleText
, (IPTR
) open
? MSG(MSG_ASL_OPEN_TITLE
) : MSG(MSG_ASL_SAVE_TITLE
),
122 ASLFR_DoPatterns
, TRUE
,
123 ASLFR_InitialFile
, (IPTR
)filebuffer
,
124 ASLFR_InitialDrawer
, (IPTR
)pathbuffer
,
128 if (AslRequest(req
, NULL
))
130 strncpy(filebuffer
, req
->fr_Drawer
, 299);
131 AddPart(filebuffer
, req
->fr_File
, 299);
135 } /* if (AslRequest(req, NULL) */
141 CloseLibrary(AslBase
);
148 /*********************************************************************************************/
152 struct EasyStruct es
;
154 es
.es_StructSize
= sizeof(es
);
156 es
.es_Title
= MSG(MSG_ABOUT_TITLE
);
157 es
.es_TextFormat
= MSG(MSG_ABOUT
);
158 es
.es_GadgetFormat
= MSG(MSG_CONTINUE
);
160 EasyRequest(win
, &es
, NULL
, (IPTR
)VERSION
,
164 (IPTR
)"AROS Development Team");
168 /*********************************************************************************************/