home *** CD-ROM | disk | FTP | other *** search
- /* miscell.c */
-
- #include "windows.h"
- #include "info.h"
- #include "miscell.h"
- #include "term.h"
- #include "asdriver.h"
- #include "xydriver.h"
- #include "term_io.h"
-
- extern HWND hMainWnd;
- extern HWND hInfoWnd;
-
- char *strrchr(char *,char);
-
- static char *StripFN(char *Ptr)
- {char *P;
- P = strrchr(Ptr,'\\');
- if(P==NULL) return Ptr;
- else return (P+1);
- } /* end StripFN */
-
- void CommonAS(char *FileName)
- {/* common asDriver startup code */
- char *Ptr;
- ascDriver();
- ascDriver();
- /* initialize info window status */
- Ptr = StripFN(FileName);
- InfoChoose('A');
- InfoFileName(Ptr);
- InfoFileSize( ascGetFileLength() );
- InfoErrors(0);
- InfoStatus("Running");
- EnableBreakButton();
- /* pop up info window */
- ShowWindow(hInfoWnd,SW_SHOW);
- SendMessage(hInfoWnd,WM_USER,0,0L);
- /* allow 55 ms for incoming char */
- SetCharWait(55);
- }
-
- void CommonXY(char *FileName,int *LastPacket,int *LastNAKcount)
- {/* common xyDriver startup code */
- char *Ptr;
- xyDriver();
- xyDriver();
- *LastPacket = -1;
- *LastNAKcount = 0;
- /* initialize info window status */
- Ptr = StripFN(FileName);
- InfoChoose('X');
- InfoFileName(Ptr);
- InfoFileSize( xyGetFileLength() );
- InfoPacket(0);
- InfoErrors(0);
- InfoStatus("Running");
- EnableBreakButton();
- /* pop up info window */
- ShowWindow(hInfoWnd,SW_SHOW);
- SendMessage(hInfoWnd,WM_USER,0,0L);
- /* allow 55 ms for incoming char */
- SetCharWait(55);
- }
-
- void EnableBreakButton(void)
- {HMENU hMenu;
- /* enable BREAK button */
- hMenu = GetMenu(hMainWnd);
- EnableMenuItem(hMenu,MSG_BREAK,MF_BYCOMMAND|MF_ENABLED);
- DrawMenuBar(hMainWnd);
- }
-
- void DisableBreakButton(void)
- {HMENU hMenu;
- /* grey the BREAK button */
- hMenu = GetMenu(hMainWnd);
- EnableMenuItem(hMenu,MSG_BREAK,MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
- DrawMenuBar(hMainWnd);
- }