这篇教程C++ wherex函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wherex函数的典型用法代码示例。如果您正苦于以下问题:C++ wherex函数的具体用法?C++ wherex怎么用?C++ wherex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wherex函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainint main() { clrscr(); bordercolor(0); bgcolor(6); renderMenu(100); textcolor(7); gotoxy(0, 1); updateStatus(' '); cursor(1); while(1) { char c;/* uint8_t row; uint8_t col; for (row = 0; row < 16; row++) { gotoxy(0, row + 3); cprintf("%3d ", row * 16); for (col = 0; col < 16; col++) { cputc(row * 16 + col); cputc(' '); } }*/ c = cgetc(); if (c == 20) { // backspace } else if (c == 13) { // Return } else if (c == 157) { // Left uint8_t xpos = wherex() - 1; gotox(xpos); } else if (c == 29) { // Right uint8_t xpos = wherex() + 1; gotox(xpos); } else if (c == 17) { // Down uint8_t ypos = wherey() + 1; gotoy(ypos); } else if (c == 145) { // Up uint8_t ypos = wherey() - 1; gotoy(ypos); } else if (c == 19) { // Pos1 } else if (c == 3) { // ESC -> Menu processMenu(); } else { cputc(c); } updateStatus(c); }}
开发者ID:afester,项目名称:CodeSamples,代码行数:60,
示例2: erase_backwardvoid erase_backward(uint8_t count){ cclear(1); /* Erase cursor */ gotox(wherex() - (count + 1)); cclear(count); gotox(wherex() - count);}
开发者ID:gungwald,项目名称:posix-6502,代码行数:7,
示例3: ctk_draw_menus/*-----------------------------------------------------------------------------------*/voidctk_draw_menus(struct ctk_menus *menus){ struct ctk_menu *m; /* Draw menus */ (void)textcolor(MENUCOLOR); gotoxy(0, 0); revers(1); cputc(' '); for(m = menus->menus->next; m != NULL; m = m->next) { draw_menu(m, m == menus->open); } /* Draw desktopmenu */ if(wherex() + strlen(menus->desktopmenu->title) + 1 >= sizex) { gotoxy(sizex - (unsigned char)strlen(menus->desktopmenu->title) - 1, 0); } else { cclear(sizex - wherex() - (unsigned char)strlen(menus->desktopmenu->title) - 1); } draw_menu(menus->desktopmenu, menus->desktopmenu == menus->open); revers(0);}
开发者ID:Inscribe,项目名称:msp430xf1611,代码行数:26,
示例4: wherexvoid Mlecz::rysowanie(){ int x = wherex(); int y = wherey(); gotoxy(this->x, this->y); cputs("M"); gotoxy(x, y);}
开发者ID:zuzanna2905,项目名称:swiat,代码行数:7,
示例5: screen_draw_bordervoid screen_draw_border(char *help_msg){ int px, py; int i, msg_len; trim(help_msg); px = wherex(); py = wherey(); gotoxy(0, 0); for (i = 0;i <= WIN_WIDTH;i++) cprintf("%c", BORDER_HOR); for (i = 1;i < WIN_HEIGHT;i++) { gotoxy(0, i); cprintf("%c", BORDER_VER); gotoxy(WIN_WIDTH, i); cprintf("%c", BORDER_VER); } gotoxy(0, WIN_HEIGHT); for (msg_len = strlen(help_msg), i = 0;i < (WIN_WIDTH - msg_len) / 2;i++) cprintf("%c", BORDER_HOR); cprintf("%s", help_msg); for (i += msg_len;i <= WIN_WIDTH;i++) cprintf("%c", BORDER_HOR); gotoxy(px, py);}
开发者ID:bcho-archive,项目名称:aqulia,代码行数:28,
示例6: wherexvoid Zolw::rysowanie(){ int x = wherex(); int y = wherey(); gotoxy(this->x, this->y); cputs("Z"); gotoxy(x, y);}
开发者ID:zuzanna2905,项目名称:swiat,代码行数:7,
示例7: renderMenuvoid renderMenu(uint8_t current) { uint8_t idx = 0; textcolor(1); revers(1); gotoxy(0, 0); for (idx = 0; idx < menuSize; idx++) { if (idx == current) { textcolor(3); cputs(menu[idx]); /*****************/ cputsxy(0, 1, "/xf0/xc0/xc0/xc0/xc0/xee"); gotoxy(0, 2); cprintf("/xdd%s/xdd", fileMenu[0]); gotoxy(0, 3); cprintf("/xdd%s/xdd", fileMenu[1]); gotoxy(0, 4); cprintf("/xdd%s/xdd", fileMenu[2]); gotoxy(0, 5); cprintf("/xdd%s/xdd", fileMenu[3]); cputsxy(0, 6, "/xed/xc0/xc0/xc0/xc0/xfd"); /*****************/ } else { cputs(menu[idx]); } textcolor(1); cputs(" "); } for (idx = wherex(); idx < 40; idx++) { cputc(' '); }}
开发者ID:afester,项目名称:CodeSamples,代码行数:34,
示例8: drawchatwinvoid drawchatwin(box_t *boxch, char* topname, char* botname) { struct text_info ti; int i; _wscroll=0; gettextinfo(&ti); textcolor(WHITE); textbackground(BLACK); clrscr(); uwin.top=1; uwin.left=1; uwin.right=ti.screenwidth; uwin.bottom=ti.screenheight/2-1; uwin.colour=GREEN; swin.top=ti.screenheight/2+1; swin.left=1; swin.right=ti.screenwidth; swin.bottom=ti.screenheight; swin.colour=LIGHTGREEN; gotoxy(1,ti.screenheight/2); putch(196); putch(196); putch(196); putch(196); putch(180); cputs(topname); putch(195); for(i=wherex();i<=ti.screenwidth;i++) putch(196); _wscroll=1;}
开发者ID:ftnapps,项目名称:pkg-sbbs,代码行数:33,
示例9: SelectScreen void ATCInput::Echo (char *Msg) { SelectScreen(); gotoxy (CrntColumn_c, INPUT_LINE); cprintf(Msg); CrntColumn_c = wherex(); }
开发者ID:paulanthonywilson,项目名称:airtrafficcontrol,代码行数:7,
示例10: aceptar_cancelarBoolean aceptar_cancelar(){ int i = 0, lasti = 0, key, fila = wherey(), x = wherex(); char *buttons[] = {" Aceptar ", " Cancelar "}; gotoxy(x + 1, fila); cputs(" Aceptar Cancelar "); gotoxy(x + calculate_xpos(buttons, i), fila); marcar_texto(buttons[i], strlen(buttons[i])); msg_snd(); do{ key = bioskey(0); if((key & SC_IZQ) == SC_IZQ){ i--; if((i>=0)&&(i<=1))JVGtecla(); } if((key & SC_DER) == SC_DER){ i++; if((i>=0)&&(i<=1))JVGtecla(); } if(i >= 2) i = 1; if(i < 0) i = 0; gotoxy(x + calculate_xpos(buttons, lasti), fila); desmarcar_texto(buttons[lasti], strlen(buttons[lasti])); gotoxy(x + calculate_xpos(buttons, i), fila); marcar_texto(buttons[i], strlen(buttons[i])); lasti = i; }while(((key & SC_ENTER)!= SC_ENTER) && ((key & SC_ABAJO) != SC_ABAJO)); gotoxy(x + calculate_xpos(buttons, i), fila); desmarcar_texto(buttons[i], strlen(buttons[i])); _setcursortype(_NORMALCURSOR); if(i == 0) return Verdadero; return Falso;}
开发者ID:coredumped,项目名称:Mesh2,代码行数:32,
示例11: get_input_terminated_by/* * get_input_terminated_by() reads input (handling backspace correctly) until * a terminator of |terminators| is encountered or |out| is full (outlen-1 * characters were read). * * get_input_terminated_by() returns the terminator it encountered. * */input_terminator_t get_input_terminated_by(input_terminator_mask_t terminators, char *out, BYTE outlen) { BYTE i = strlen(out); BYTE c, x, y; x = wherex() - i; y = wherey(); while (1) { c = cgetc(); if (((terminators & INPUT_TERMINATOR_RETURN) == INPUT_TERMINATOR_RETURN) && (c == PETSCII_CR)) { return INPUT_TERMINATOR_RETURN; } else if (((terminators & INPUT_TERMINATOR_SPACE) == INPUT_TERMINATOR_SPACE) && (c == PETSCII_SP)) { return INPUT_TERMINATOR_SPACE; } else if (c == PETSCII_DEL) { /* If you are at the left-most position, do nothing */ if (i == 0) continue; out[--i] = '/0'; cputcxy(x+i, y, ' '); gotoxy(x+i, y); continue; } if (i == (outlen-1)) { continue; } cputc(c); out[i++] = c; }}
开发者ID:nnev,项目名称:c128-kasse,代码行数:35,
示例12: wherexvoid Guarana::rysowanie(){ int x = wherex(); int y = wherey(); gotoxy(this->x, this->y); cputs("G"); gotoxy(x, y);}
开发者ID:zuzanna2905,项目名称:swiat,代码行数:7,
示例13: _8254CounterIENunsigned int _8254CounterIEN(unsigned Base, unsigned irq, unsigned F96,int df){ unsigned int CBase; int t; ADDRESS = Base; CBase = Base + 0x10; if(F96==1){ flag2 = 1; //for setcountflag isr CtrMode(CBase,0,2); CtrLoad(CBase,0,0x10); } do{ CtrMode(CBase,1,2); CtrLoad(CBase,1,0x10); CtrMode(CBase,2,2); CtrLoad(CBase,2,0x10); initirq(irq,setcountflag); outportb(Base+0x0E,0x02);//enable COUNTER IRQ on PCIe-DIO-24DCS if(F96==1){ outportb(Base+0x1E, 0x00); //enable interrupt for dio-96CT outportb(Base+0x1F, 0x00); //clear interrupt latch for dio-96CT } outportb(Base+0xF, 0x00); // clear interrupt latch for dio-24 isrflag = 0; outportb(0x20, 0x20); outportb(0xA0, 0x20); delay(1000); outportb(Base+0xD, 0x00); // turn off interrupt for dio-24 outportb(Base+0x0f, 0); // clear left over IRQs if(F96==1) outportb(Base+0x1E, 0x00); //disable interrupt for dio-96CT outportb(0x20, 0x20); outportb(0xA0, 0x20); restoreirq(irq); t = isrflag; textcolor(t?GREEN:RED); cprintf("%s",t?"IRQ ":"NoIRQ "); if((80 - wherex()) < 10) gotoxy(1,wherey()); t = 0; }while((!kbhit()) && (df)); //exit after running once if !Debug mode if (df) { getch(); printf("/n"); } if(F96==1){ CtrMode(CBase,0,2); //stop counters counting CtrMode(CBase,1,2); CtrMode(CBase,2,2); outportb(Base+0x1E,0x00); //disable interrupt for dio-96CT } if (isrflag) return 0; else return 1;}
开发者ID:jmcarter9t,项目名称:PCI-tests,代码行数:59,
示例14: gettextinfovoid gettextinfo(struct text_info *info) { info->curx = wherex(); info->cury = wherey(); info->attribute = thData.attrib; info->normattr = 0x07; info->screenwidth = thData.width; info->screenheight = thData.height;};
开发者ID:zuzanna2905,项目名称:swiat,代码行数:8,
示例15: gettextinfo/*---------------------------------------------------------------------*Name gettextinfo - give the user information on video mode, window coordinates and video attributesUsage #include <conio.h> void gettextinfo(struct text_info *r);Prototype in conio.hDescription fills the text_info structure with the current video information.Return value NoneNOTE: text_info structure is partial prefix of _video structure*---------------------------------------------------------------------*/void gettextinfo(struct text_info *r){ *r = *(struct text_info *)& _video; /* move data all at once */ r->winleft += 1; /* 1,1 origin */ r->wintop += 1; r->winright += 1; r->winbottom += 1; r->curx = wherex(); r->cury = wherey();}
开发者ID:WiLLStenico,项目名称:TestesEOutrasBrincadeiras,代码行数:28,
示例16: GetCursvoid GetCurs(int *x, int *y){#ifdef UNIX getsyx(*y, *x);#else /* X and Y are zero-based */ *x = wherex() - 1; *y = wherey() - 1;#endif}
开发者ID:base698,项目名称:ProQCC,代码行数:11,
示例17: save_cursvoid save_curs(POINT * p){ ////fn void save_curs(POINT * p) ////brief Salvarea pozitiei cursorului. ////param p Variabila tip POINT care stocheaza pozitia cursorului /// ///Implementarea salvarii pozitiei cursorului. p->x = wherex(); p->y = wherey();}
开发者ID:dumitrubogdanmihai,项目名称:levenshtein-project,代码行数:11,
示例18: Inputstatic char Input (char* Prompt, char* Buf, unsigned char Count)/* Read input from the user, return 1 on success, 0 if aborted */{ int Frame; unsigned char OldColor; unsigned char OldCursor; unsigned char x1; unsigned char i; unsigned char done; char c; /* Clear the current prompt line */ cclearxy (0, MAX_Y-1, MAX_X); /* Display the new prompt */ OldColor = textcolor (COLOR_TEXTHIGH); cputsxy (0, MAX_Y-1, Prompt); (void) textcolor (COLOR_TEXTLOW); /* Remember where we are, enable the cursor */ x1 = wherex (); OldCursor = cursor (1); /* Get input and handle it */ i = done = 0; do { c = cgetc (); if (isalnum (c) && i < Count) { Buf [i] = c; cputcxy (x1 + i, MAX_Y-1, c); ++i; } else if (i > 0 && c == CH_DEL) { --i; cputcxy (x1 + i, MAX_Y-1, ' '); gotoxy (x1 + i, MAX_Y-1); } else if (c == '/n') { Buf [i] = '/0'; done = 1; } else if (IsAbortKey (c)) { /* Abort */ done = 2; } } while (!done); /* Reset settings, display old prompt line */ cursor (OldCursor); (void) textcolor (OldColor); DrawFrames (); Frame = ActiveFrame; ActiveFrame = -1; ActivateFrame (Frame, 0); return (done == 1);}
开发者ID:AntiheroSoftware,项目名称:cc65,代码行数:54,
示例19: LireNbreFilmValideint LireNbreFilmValide(void) { int NbrFilms; cout << "Nombre de film lou/x82s (1 /x85 3) : "; int CurrX = wherex(); int CurrY = wherey(); do { gotoxy(CurrX,CurrY); NbrFilms = ConvertireUnCharEnInt(_getche()); } while(NbrFilms > 3 || NbrFilms < 1); return NbrFilms;}
开发者ID:pierrelocas,项目名称:Projets,代码行数:11,
示例20: wherexvoid Screen::myCprintf( uint8_t attr, char *fmt, ... ) { int x = wherex( ); int y = wherey( ); va_list ap; va_start( ap, fmt ); myCprintf_internal( x, y, attr, fmt, ap ); va_end( ap );}
开发者ID:corbindavenport,项目名称:cobalt,代码行数:11,
示例21: chatcharint chatchar(WINDOW *win, int ch) { window(win->left,win->top,win->right,win->bottom); gotoxy(win->x,win->y); textcolor(win->colour); putch(ch); if(ch=='/r') putch('/n'); win->x=wherex(); win->y=wherey(); return(0);}
开发者ID:ftnapps,项目名称:pkg-sbbs,代码行数:11,
示例22: clreolvoid clreol (void){ int X, Y; char Spaces[100]; memset (Spaces, ' ', sizeof (Spaces)); X = wherex (); Y = wherey (); Spaces[80-X] = 0; printf ("%s", Spaces); gotoxy (X, Y);}
开发者ID:bochaqos,项目名称:trmnl,代码行数:12,
示例23: cvline/* Output a vertical line with the given length at the current cursor * position. */void __fastcall__ cvline( unsigned char length ){ // FIXME: Optimize me. unsigned char x = wherex(); unsigned char y = wherey(); unsigned char i; for( i=0; i<length; i++ ) { gotoxy( x, y+i ); cputc( 1 ); }}
开发者ID:Arkuda,项目名称:rpc8e-cc65,代码行数:15,
示例24: draw_menustatic voiddraw_menu(struct ctk_menu *m, unsigned char open){ unsigned char x, x2, y; if(open) { x = x2 = wherex(); if(x2 + CTK_CONF_MENUWIDTH > sizex) { x2 = sizex - CTK_CONF_MENUWIDTH; } for(y = 0; y < m->nitems; ++y) { if(y == m->active) { (void)textcolor(ACTIVEMENUITEMCOLOR); revers(0); } else { (void)textcolor(MENUCOLOR); revers(1); } gotoxy(x2, y + 1); if(m->items[y].title[0] == '-') { chline(CTK_CONF_MENUWIDTH); } else { cputs(m->items[y].title); } if(x2 + CTK_CONF_MENUWIDTH > wherex()) { cclear(x2 + CTK_CONF_MENUWIDTH - wherex()); } } gotoxy(x, 0); (void)textcolor(OPENMENUCOLOR); revers(0); } cputs(m->title); cputc(' '); (void)textcolor(MENUCOLOR); revers(1);}
开发者ID:Inscribe,项目名称:msp430xf1611,代码行数:40,
示例25: GetPassvoid GetPass (char *Pass, int Len){ int index = 0; WORD x,y; // Get the y co-ordinate y = wherey (); do { // get the current x co-ordinate x = wherex (); // get the next character from the input buffer Pass [index] = (char) getch (); // if its an enter, terminate the string if (Pass [index] == 0x0D) Pass [index] = '/0'; // if its a delete move the cursor back, and remove the last character from the string else if (Pass [index] == 0x08) { if (index-1 >= 0) { index -= 2; // blank out the last * gotoxy ((WORD) (x-1), y); putch (' '); gotoxy ((WORD) (x-1), y); } else { index = -1; } } else // display a * for the character putch ('*'); // move to the next character in the array index++; } while (Pass [index-1] && index < Len); // apply a newline character if needed if (Pass [index-1]) Pass [index-1] = NULL; putch ('/n');}
开发者ID:jgallimore,项目名称:novell-tools,代码行数:52,
示例26: chBack/* move cursor back one char with ** recognition of row change*/ void chBack(void){ signed char x, y; x = wherex(); y = wherey(); x-=1; if (x < 0) { x=39; y-=1; } gotoxy(x,y);}
开发者ID:MonteCarlos,项目名称:cc65,代码行数:16,
示例27: mainvoid main (void){ int linha, coluna; clrscr (); cprintf ("Esta e a linha 1/r/n"); cprintf ("A linha 2 e um pouco mais longa/r/n"); cprintf ("Esta e a ultima linha"); linha = wherey(); coluna = wherex (); cprintf ("/r/nA posicao do cursor era linha %d coluna %d/n", linha, coluna);}
开发者ID:leonardoapolinario,项目名称:C-And-C-Plus-Plus-Bible,代码行数:13,
示例28: draw_menu/*-----------------------------------------------------------------------------------*/static voiddraw_menu(struct ctk_menu *m){ unsigned char x, x2, y; textcolor(VNC_OUT_MENUCOLOR); x = wherex(); cputs(m->title); cputc(' '); x2 = wherex(); if(x + CTK_CONF_MENUWIDTH > sizex) { x = sizex - CTK_CONF_MENUWIDTH; } for(y = 0; y < m->nitems; ++y) { if(y == m->active) { textcolor(VNC_OUT_ACTIVEMENUCOLOR); revers(0); } else { textcolor(VNC_OUT_MENUCOLOR); } gotoxy(x, y + 1); if(m->items[y].title[0] == '-') { chline(CTK_CONF_MENUWIDTH); } else { cputs(m->items[y].title); } if(x + CTK_CONF_MENUWIDTH > wherex()) { cclear(x + CTK_CONF_MENUWIDTH - wherex()); } revers(1); } gotoxy(x2, 0); textcolor(VNC_OUT_MENUCOLOR); update_area(x, 0, CTK_CONF_MENUWIDTH, m->nitems + 1);}
开发者ID:Asterios,项目名称:contiki-econotag,代码行数:40,
示例29: updateStatusvoid updateStatus(uint8_t c) { uint8_t xpos = wherex(); uint8_t ypos = wherey(); gotoxy(0, 24); textcolor(1); revers(1); cprintf("Ln: %-2d Col: %-2d %3d INS ", ypos, xpos, c); textcolor(7); revers(0); gotoxy(xpos, ypos);}
开发者ID:afester,项目名称:CodeSamples,代码行数:13,
示例30: chForth/* move cursor forth one char with ** recognition of row change*/void chForth(void){ signed char x, y; x = wherex(); y = wherey(); x+=1; if (x >= 40) { x=0; y+=1; } gotoxy(x,y);}
开发者ID:MonteCarlos,项目名称:cc65,代码行数:16,
注:本文中的wherex函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ which函数代码示例 C++ where函数代码示例 |