2 /* copyright (c) 1997 William R. Pearson */
4 /* used only in Mac versions for file selection */
5 /* should use navigation services if available */
12 #include <Resources.h>
14 #include <StandardFile.h>
28 void HiliteDlog(DialogPtr);
30 SFTypeList tlist={'TEXT',0L,0L,0L};
34 FileDlog(prompt,freply)
36 StandardFileReply *freply;
39 if (GetResource('DLOG',SFileDID)==NIL) {
40 fprintf(stderr," cannot load %d DLOG resource\n",SFileDID); exit(1);
43 ParamText((StringPtr)prompt,"\p","\p","\p");
44 /* SFPGetFile(wpos, (StringPtr)prompt, 0L,(short)1, tlist, 0L, freply, FileDID, NIL); */
54 ParamText("\p","\p","\p","\p");
55 PtoCstr((StringPtr)prompt);
58 TFileDlog(prompt,freply,plist,nl)
60 StandardFileReply *freply;
65 if (GetResource('DLOG',SFileDID)==NIL) {
66 fprintf(stderr," cannot load %d TFile DLOG resource\n",SFileDID); exit(1);
69 ParamText((StringPtr)prompt,"\p","\p","\p");
70 /* SFPGetFile(wpos,(StringPtr)prompt,0L,(short)nl,plist,0L,freply,FileDID,NIL); */
79 ParamText("\p","\p","\p","\p");
80 PtoCstr((StringPtr)prompt);
83 SFileDlog(prompt,freply)
85 StandardFileReply *freply;
89 if (GetResource('DLOG',SFileDID)==NIL) {
90 fprintf(stderr," cannot load %d DLOG resource\n",SFileDID); exit(1);
94 ParamText((StringPtr)prompt,"\p","\p","\p");
96 /* StandardGetFile(NIL,(short)1,tlist,freply); */
105 ParamText("\p","\p","\p","\p");
106 PtoCstr((StringPtr)prompt);
109 STFileDlog(char *prompt, StandardFileReply *freply,
110 SFTypeList plist, int nl)
114 if (GetResource('DLOG',SFileDID)==NIL) {
115 fprintf(stderr," cannot load %d TFile DLOG resource\n",SFileDID); exit(1);
118 ParamText((StringPtr)prompt,"\p","\p","\p");
128 ParamText("\p","\p","\p","\p");
129 PtoCstr((StringPtr)prompt);
132 PauseAlert(unsigned char *prompt)
134 if (GetResource('DLOG',PauseID)==NIL) {
135 fprintf(stderr," cannot load %d TFile DLOG resource\n",PauseID); exit(1);
137 CtoPstr((char *)prompt);
138 ParamText(prompt,"\p","\p","\p");
139 CautionAlert(PauseID,NULL);
140 ParamText("\p","\p","\p","\p");
143 IntroDlog(int DlogID, unsigned char *prompt)
148 CtoPstr((char *)prompt);
149 ParamText(prompt,"\p","\p","\p");
151 if (GetResource('DLOG',DlogID)==NIL) {
152 fprintf(stderr," cannot load %d Intro DLOG resource\n",DlogID); exit(1);
154 DP = GetNewDialog(DlogID,NULL,(WindowPtr)-1);
159 ModalDialog(0L,&itemHit);
161 ParamText("\p","\p","\p","\p");
165 NIntroDlog(int DlogID,unsigned char *p0,unsigned char *p1,
166 unsigned char *p2,unsigned char *p3)
172 for (p=p0; *p; p++) if (*p=='\n') *p=' ';
173 for (p=p1; *p; p++) if (*p=='\n') *p=' ';
174 for (p=p2; *p; p++) if (*p=='\n') *p=' ';
175 for (p=p2; *p; p++) if (*p=='\n') *p=' ';
181 ParamText(p0,p1,p2,p3);
183 if (GetResource('DLOG',DlogID)==NIL) {
184 fprintf(stderr," cannot load %d Intro DLOG resource\n",DlogID); exit(1);
186 DP = GetNewDialog(DlogID,NULL,(WindowPtr)-1);
191 ModalDialog(0L,&itemHit);
193 ParamText("\p","\p","\p","\p");
201 HiliteDlog(DialogPtr DP)
208 GetDialogItem(DP,1,&tType,&tItem,&tRect);
209 PenSize(3, 3); /* Change pen to draw thick default outline */
210 InsetRect(&tRect, -4, -4); /* Draw outside the button by 1 pixel */
211 FrameRoundRect(&tRect, 16, 16); /* Draw the outline */
212 PenSize(1, 1); /* Restore the pen size to the default value */