and with default */
| 816 | |
| 817 | /* and with default */ |
| 818 | void |
| 819 | getlind(const char *prompt, char *bufp, const char *dflt) |
| 820 | { |
| 821 | #ifndef TOPL_GETLINE |
| 822 | struct Window *cwin; |
| 823 | struct IntuiMessage *imsg; |
| 824 | long class, code, qual; |
| 825 | int aredone = 0; |
| 826 | struct Gadget *gd; |
| 827 | static int once; |
| 828 | |
| 829 | *StrString = 0; |
| 830 | if (dflt) |
| 831 | strcpy(StrString, dflt); |
| 832 | StrWindow.Title = (UBYTE *) prompt; |
| 833 | StrWindow.Screen = HackScreen; |
| 834 | |
| 835 | if (!once) { |
| 836 | if (bigscreen) { |
| 837 | StrWindow.LeftEdge = |
| 838 | (HackScreen->Width / 2) - (StrWindow.Width / 2); |
| 839 | if (amii_wins[WIN_MAP]) { |
| 840 | StrWindow.TopEdge = amii_wins[WIN_MAP]->win->TopEdge; |
| 841 | } else { |
| 842 | StrWindow.TopEdge = |
| 843 | (HackScreen->Height / 2) - (StrWindow.Height / 2); |
| 844 | } |
| 845 | } |
| 846 | SetBorder(&String); |
| 847 | SetBorder(&Gadget2); |
| 848 | once = 1; |
| 849 | } |
| 850 | |
| 851 | if (WINVERS_AMIV || WINVERS_AMII) { |
| 852 | #ifdef INTUI_NEW_LOOK |
| 853 | StrWindow.Extension = wintags; |
| 854 | StrWindow.Flags |= WFLG_NW_EXTENDED; |
| 855 | fillhook.h_Entry = (void *) &LayerFillHook; |
| 856 | fillhook.h_Data = (void *) -2; |
| 857 | fillhook.h_SubEntry = 0; |
| 858 | #endif |
| 859 | } |
| 860 | |
| 861 | if ((cwin = OpenWindow((void *) &StrWindow)) == NULL) { |
| 862 | return; |
| 863 | } |
| 864 | |
| 865 | while (!aredone) { |
| 866 | WaitPort(cwin->UserPort); |
| 867 | while ((imsg = (void *) GetMsg(cwin->UserPort)) != NULL) { |
| 868 | class = imsg->Class; |
| 869 | code = imsg->Code; |
| 870 | qual = imsg->Qualifier; |
| 871 | gd = (struct Gadget *) imsg->IAddress; |
| 872 | |
| 873 | switch (class) { |
| 874 | case VANILLAKEY: |
| 875 | if (code == '\033' |
no test coverage detected