/* insert or delete columns */ static ELVBOOL vio_shift (GUIWIN *gw, /* window to be shifted */ int qty, /* columns to insert (may be negative to delete) */ int rows) /* number of rows affected (always 1 for this GUI) */ { CHAR cell[2]; /* revert to the normal font */ vio_revert ((VWIN *)gw); /* move the physical cursor to where this window thinks it is */ movecurs ((VWIN *)gw); /* This is what we'll fill the scrolled region with: */ cell[0] = ' '; cell[1] = vc_current; cell[0] = '#'; cell[1] = 0xe0; if (qty > 0) { VioScrollRt (c_row, c_col, c_row, o_ttycolumns - 1, qty, cell, 0); } else { /* take the absolute value of qty */ qty = -qty; VioScrollLf (c_row, c_col, c_row, o_ttycolumns - 1, qty, cell, 0); } return ElvTrue; }
int ConScroll(int Way, int X, int Y, int W, int H, TAttr Fill, int Count) { int MX, MY; int MouseHidden = 0; TCell FillCell = (TCell)(Fill << 8); if (MousePresent && MouseVisible) { ConQueryMousePos(&MX, &MY); if ((MX >= X) && (MX < X + W) && (MY >= Y) && (MY < Y + H)) { DrawMouse(0); MouseHidden = 1; } } switch (Way) { case csUp: VioScrollUp((USHORT)Y, (USHORT)X, (USHORT)(Y + H - 1), (USHORT)(X + W - 1), (USHORT)Count, (PBYTE)&FillCell, 0); break; case csDown: VioScrollDn((USHORT)Y, (USHORT)X, (USHORT)(Y + H - 1), (USHORT)(X + W - 1), (USHORT)Count, (PBYTE)&FillCell, 0); break; case csLeft: VioScrollLf((USHORT)Y, (USHORT)X, (USHORT)(Y + H - 1), (USHORT)(X + W - 1), (USHORT)Count, (PBYTE)&FillCell, 0); break; case csRight: VioScrollRt((USHORT)Y, (USHORT)X, (USHORT)(Y + H - 1), (USHORT)(X + W - 1), (USHORT)Count, (PBYTE)&FillCell, 0); break; } if (MouseHidden) DrawMouse(1); return 0; }
USHORT __pascal VIOSCROLLLF(const USHORT TopRow, const USHORT LeftCol, const USHORT BotRow, const USHORT RightCol, const USHORT Columns, const PBYTE Cell, const HVIO Handle) { return VioScrollLf(TopRow, LeftCol, BotRow, RightCol, Columns, Cell, Handle); }