c - set_cursor_position(...); doesn't scroll the console -
I created a function that takes the cursor to the Y axis when set_cursor_position (axisX, axisY) in the down arrow console; But this will not go down from the unselected portion of the console currently. I have to scroll down manually for this and it crashes the whole function oddly. Function:
int scanArrow (integer range, int x, int y, char fgr, char bgr) {int place = 0, axisX = X, axisY = y; Unsigned four f; If (range> gt; 0) {printColor (axisX, axisY, "*", fgr, bgr); Set_cursor_position (axisX, axisY); Do {ch = meet (); If (f == 0 || f == 0xE0) {ch = getch (); Switch (f) {case KEY_UP: if (place> 0) {printf ("\ b"); AxisY--; PrintColor (Axix, XX, "*", FGR, BGR); Set_cursor_position (axisX, axisY); place--; } break; Case KEY_DOWN: If (location + 1 & lt; boundary) {printf ("\ b"); AxisY ++; Printcollar (axisax, ++ axis, "*", FGR, BRGR); Set_cursor_position (axisX, axisY); Place ++; } break; Case KEY_LEFT: If (location> 9) {printf ("\ b"); Axis = axis - 20; PrintColor (axisX, axisY, "*", fgr, bgr); Set_cursor_position (axisX, axisY); Place = location - 10; } And if (place> gt;) {printf ("\ b"); Ax = y; PrintColor (axisX, axisY, "*", fgr, bgr); Set_cursor_position (axisX, axisY); Place = 0; } break; Case KEY_RIGHT: if (location + 10 & lt; boundary) {printf ("\ b"); Axis = axis + 20; PrintColor (axisX, axisY, "*", fgr, bgr); Set_cursor_position (axisX, axisY); Place = location + 10; } And if (location + 1 & lt; border) {printf ("\ b"); Axis y = ((range -1) * 2); PrintColor (axisX, axisY, "*", fgr, bgr); Set_cursor_position (axisX, axisY); Location = boundary - 1; } break; }}} While ((ch! = KEY_ENTER) & amp; amp; (ch! = KEY_ESC)); Return location + 1; } And {return location; Technically, it prints a "*" and creates it with the help of the up and down arrows (left and right up and down (x10)). Instead of typing something, choose from the menus using arrows For, but it is not working, if the height of the menu is greater than the console. set_cursor_position:
zero set_cursor_position (int x, int y) {COORD c; Handle hCons; HCons = GetStdHandle (STD_OUTPUT_HANDLE); C. X = X; C. Y = y; SetConsole cursor position (hCons, c); Return; }
Comments
Post a Comment