void quithook(float x=0.0f,float y=0.0f) { delete VOLREN; GUI::deletetexmap(GUI_texid); closewindow(); if (GUI_record || GUI_demo) fclose(GUI_recfile); exit(0); }
void showhelp(char far *heading,char far *text) { makewindow(9,5,70,21,heading); window(11,6,69,20); gotoxy(1,2); cprintf(text); window(1,1,80,25); waitkey(); closewindow(9,5,70,21); }
void global uivclose( VSCREEN *vptr ) /***********************************/ { if( vptr->open ) { closewindow( &(vptr->window) ); if( ( vptr->flags & V_UNBUFFERED ) == 0 ) { if( ( vptr->flags & V_UNFRAMED ) == 0 ) { bunframe( &(vptr->window.type.buffer) ); } bfree( &(vptr->window.type.buffer) ); } vptr->open = FALSE; } }
int choosefunction() { char ch; makewindow(11,7,68,13,"Function Keys"); window(13,8,67,12); gotoxy(1,1); cprintf("\nPress the function key that you require help with\n" "or any other key to return to the help menu"); window(1,1,80,25); ch = getch(); closewindow(11,7,68,13); if (ch != 0) return(0); ch = getch(); return(ch); }
VBARMENU* global uimenubar( VBARMENU *bar ) /*****************************************/ { register int count; register MENUITEM* menus; register VBARMENU* prevMenu; if( NumMenus > 0 ) { closewindow( &BarWin ); NumMenus = 0; } prevMenu = Menu; Menu = bar; /* resetting old_shift is a bit kludgy but it's either this or */ /* rewrite a bunch of code that somebody else wrote - yuk */ /* UIData->old_shift = 0; */ if( Menu != NULL ) { Menu->active = FALSE; Menu->draginmenu = FALSE; Menu->indicators = TRUE; Menu->altpressed = FALSE; Menu->ignorealt = FALSE; Menu->movedmenu = FALSE; Menu->popuppending = FALSE; Menu->disabled = FALSE; count = 0; for( menus = Menu->titles; !MENUENDMARKER( *menus ); ++menus ) { if( ++count >= MAX_MENUS ) { break; } } NumMenus = count; uisetmenudesc(); BarWin.area.row = 0; BarWin.area.col = 0; BarWin.area.height = uimenuheight(); BarWin.area.width = UIData->width; BarWin.priority = P_MENU; BarWin.update = drawbar; BarWin.parm = NULL; openwindow( &BarWin ); InitMenuPopupPending = FALSE; } return( prevMenu ); }
void filedelete() { char delname[20]; int x; delname[0] = 0; makewindow( 10,9,55,14,"Delete File"); gotoxy(12,12); cprintf("Filename : "); retcursor(); x= inputstring(wherex(),12,delname); if (x>0) { x = unlink(delname); if (x == -1) burp(); } hidecursor(); closewindow(10,9,55,14); }
void intern closebackground( void ) /*********************************/ { closewindow( &UIData->blank ); }
int choice(int n,char far *ch[]) /* first line of array gives the window title */ { int x; int y; int z; char let; int chi; int maxlen; int current; current = 1; maxlen = 0; for ( x = 0; x <= n; x++) { y = strlen(ch[x]); if ( maxlen < y ) maxlen = y; } if (maxlen < 24 ) maxlen = 24; maxlen += 2; x = (80 - maxlen)/2; y = (12 - n); if (y == 7) y = 8; makewindow( x-4, y-2, x + maxlen +3, y + (2* n) + 2, ch[0]); gotoxy(x-2, y); cprintf(" Select a Number or <esc>"); gotoxy( x-1, y + (2 * (1)) ); putch(16); cprintf("%d ", current); cprintf("%s ",ch[current]); putch(17); for (z=2 ; z <= n; z++) { gotoxy( x-1, y + (2 * (z)) ); cprintf(" %d ", z); cprintf("%s",ch[z]); } do { let = getch(); if (let == 0) { gotoxy( x-1, y + (2 * (current)) ); cprintf(" %d ",current); cprintf("%s ",ch[current]); chi = getch(); switch (chi) { case ARROWD : current++; if (current > n) current = 1; break; case ARROWU : current--; if (current < 1) current = n; break; default : ungetch(chi); } gotoxy( x-1, y + (2 * (current)) ); putch(16); cprintf("%d ",current); cprintf("%s ",ch[current]); putch(17); } else if ((let > 58 ) && (let <= 58 + n)) let = let + '0' - 58; } while ( (let > '0'+ n || let < '1') && let != 27 && let != 13) ; closewindow( x-4, y-2, x+ maxlen + 3, y + (2* n)+2 ); if (let == 27) return(0); else if (let == 13) return(current); else return(let - '0'); }
void showtotals() { char headstr[30]; char numstr1[30]; char numstr2[30]; char numstr3[30]; char endstring[30]; coltype col1,col2; int x; double y; if (totalvalue >= 1.0e8 || totalvalue <= -1.0e8) { burp(); if (totalvalue > 0.0) { makewindow(10,5,60,19,"TOO RICH"); gotoxy(14,8); cprintf("You are too Rich."); gotoxy(14,10); cprintf("This is a free society so you have a choice:"); gotoxy(14,12); cprintf("1. Make a LARGE DONATION TO CHARITY."); gotoxy(14,14); cprintf("2. Buy an EXPENSIVE version of this program."); gotoxy(14,16); } else { makewindow(10,5,60,19,"BANKRUPT !"); gotoxy(14,8); cprintf("You are too Poor."); gotoxy(14,10); cprintf("This is a free society so you have a choice:"); gotoxy(14,12); cprintf("1. Become a charity."); gotoxy(14,14); cprintf("2. Buy an EXPENSIVE version of this program."); gotoxy(14,16); } cprintf("NOTE: We cannot guarantee values produced"); gotoxy(14,18); cprintf(" when such large numbers are used."); delay(6000); closewindow(10,5,60,19); totalvalue = 0.0; } switch (sys.screen) { case SCREEN1 : ltoa(totalputs,numstr3,10); ltoa(totalcalls,numstr2,10); col1 = HELDC; col2 = HELDP; if (sys.display == HELDS) { strcpy(headstr," Tot. Value $ "); sprintf(numstr1,"%-12.2f",totalvalue); strcpy(endstring," "); } else { strcpy(headstr," Tot. Delta "); sprintf(numstr1,"%-12.2f",totaldelta); strcpy(endstring,"$/c"); } break; case SCREEN2 : break; case SCREEN3 : if (sys.display == INVVOL || sys.display == OVERVALUED) { strcpy(headstr," Weighted Vol. "); strcpy(endstring," \% "); sprintf(numstr1,"%-5.*f",2,weightedvol); sprintf(numstr2,"%-4.*f \%",2,weightedvolc); sprintf(numstr3,"%-4.*f \%",2,weightedvolp); col1 = VOLC; col2 = VOLP; } break; }
void global uiclosepopup( UI_WINDOW *window ) { closewindow( window ); window->update = NULL; }
void getdir() { char buff[30]; struct ffblk ffblk; int x; int y; int z; int disnum; int done; char ch; disnum = 0; x = 12; y = 9; makewindow( 10,7,71,23,"Directory"); done= findfirst("*.*", &ffblk, 0); while (!done) { while (disnum == 0 && !done) { gotoxy(x,y); cprintf("%s",ffblk.ff_name); y++; if (y > 21 && x == 57) { x = 12; y = 9; disnum = 1; } else if (y > 21) { y = 9; x += 15; }; done = findnext(&ffblk); }; z = 0; do { if (disnum != 0) { gotoxy(15,22); cprintf("Press Pagedown to continue or <esc> to quit"); ch = getch(); if (ch == 27) { done = -1; disnum = 0; z = 1; } else if (ch == 0) { ch = getch(); if (ch == PGDN) { disnum = 0; x = 12; y = 9; z = 1; window(11,8,70,22);clrscr();window(1,1,80,25);} } } else { gotoxy(15,22); cprintf("Press <esc> to quit"); ch = getch(); if (ch == 27) { done = -1; disnum = 0; z = 1; } } } while (z == 0); } closewindow( 10,7,71,23); }
SHORT file_quit(void) { closewindow(); }
void debugloop() { int key; a: if (!(debugds & 2)) nextopcode(); if (!(debugds & 1)) nextspcopcode(); b: // redrawing the display is always a good idea refresh(); wrefresh(debugwin); key = getch(); if (key >= 0 && key < 256) key = toupper(key); switch (key) { case KEY_F(1): // run execut = 1; return; case KEY_F(2): // debugsavestate statesaver(); goto b; case KEY_F(4): // debugloadstate debugloadstate(); goto a; case 27: // exit return; case '\n': // step goto e; /* Ported this but couldn't bring myself to commit it. pagefault said to remove it. case '-': // skip opcode */ case 'C': // clear numinst = 0; goto a; case 'M': // modify { WINDOW *w; unsigned addr, value, n; w = openwindow(7, 33, 11, 24, " Enter Address : "); mvwaddstr(w, 3, 1, " Previous Value: "); mvwaddstr(w, 5, 1, " Enter Value : "); wrefresh(w); echo(); n = mvwscanw(w, 1, 21, "%x", &addr); noecho(); if (n == 1) { mvwprintw(w, 3, 21, "%02x", memtabler8_wrapper(addr >> 16, addr)); wrefresh(w); echo(); n = mvwscanw(w, 5, 21, "%x", &value); noecho(); if (n == 1) { memtablew8_wrapper(addr >> 16, addr, value); }} closewindow(w); goto b; }