// PaintSub ///////////////////////////////////////////////////////////////1.00 int ClassABrowserView::PaintSub(HDC hDC, long i, long to, int fRepaint) { int x = CAV_LEFT_TEXTMARGIN * tm.tmAveCharWidth; int line = i + nLineView; HFONT hOldFont = (HFONT)SelectObject(hDC, hFont); HPEN hOldPen = (HPEN)SelectObject(hDC, GetStockObject(dwColorMode ? WHITE_PEN : BLACK_PEN)); HBRUSH hOldBrush = (HBRUSH)SelectObject(hDC, GetStockObject(dwColorMode ? WHITE_BRUSH : BLACK_BRUSH)); for (; i <= to; i++, line++) LineOut(hDC, x, i * tm.tmHeight, line, fRepaint); SelectObject(hDC, hOldFont); SelectObject(hDC, hOldPen); SelectObject(hDC, hOldBrush); return 0; }
/* TextBox - display text for a window. * * TextBox is called by WzTextOut to display known, visible text from a window. * The regions displayed are enumerated by ApplyVis. * * hWnd handle of window being displayed * box box being output relative to screen * x leftmost point in original string * p pointer to original string * a attribute for screen */ VOID PASCAL INTERNAL TextBox (HW hWnd, BOX box, INT x, LPSTR p, INT a) { CHAR buf[MAXLINELEN]; INT cch = box.right - box.left + 1; int i; hWnd; /* unused parameter */ // // write to local screen buffer - will also write line if minor update // for ( i = 0; i < cch; i++ ) { pLocalScreen[xSize * box.top + box.left + i].Char.AsciiChar = *(p + box.left - x + i); pLocalScreen[xSize * box.top + box.left + i].Attributes = (WORD) a; } if ( ! screenWriteInProgress) { Move (p + box.left - x, buf, cch); LineOut (box.left, box.top, buf, cch, a); } }
int main() { int i; LcdInit(); printf("start of lcd_test\n"); /* printf("LcdClearDisplay\n"); LcdClearDisplay(); Wait(SEC_1); printf("LcdDrawChar(""E"", 1, LCD_LINE8 div CELL_HEIGHT)\n"); LcdDrawChar("E", 1, LCD_LINE8 div CELL_HEIGHT); Wait(SEC_1); printf("LcdDrawCharXY(""V"", 20, LCD_LINE8)\n"); LcdDrawCharXY("V", 20, LCD_LINE8); Wait(SEC_1); printf("LcdDrawCharXY(""3"", 20, LCD_LINE8)\n"); LcdDrawCharXY("3", 30, LCD_LINE8); Wait(SEC_1); printf("LcdDrawString(""EV3 BricxCC"", 4, LCD_LINE4 div CELL_HEIGHT, false)\n"); LcdDrawString("EV3 BricxCC", 4, LCD_LINE4 div CELL_HEIGHT, false); Wait(SEC_1); printf("LcdDrawString(""EV3 BricxCC"", 1, LCD_LINE5 div CELL_HEIGHT, true)\n"); LcdDrawString("EV3 BricxCC", 1, LCD_LINE5 div CELL_HEIGHT, true); Wait(SEC_1); printf("LcdDrawInt(SEC_1, 0, LCD_LINE7 div CELL_HEIGHT)\n"); LcdDrawInt(SEC_1, 0, LCD_LINE7 div CELL_HEIGHT); Wait(SEC_1); printf("LcdScrollLine()\n"); LcdScrollLine(); Wait(SEC_1); printf("LcdScrollLine()\n"); LcdScrollLine(); Wait(SEC_1); */ printf("CircleOut(50, 40, 10);\n"); printf("CircleOutEx(30, 24, 10, DRAW_OPT_FILL_SHAPE);\n"); printf("LineOut(10, 10, 80, 60);\n"); printf("RectOut(20, 20, 40, 40);\n"); printf("RectOutEx(65, 25, 20, 30, DRAW_OPT_FILL_SHAPE);\n"); printf("EllipseOut(70, 30, 15, 20);\n"); CircleOut(50, 40, 10); CircleOutEx(30, 24, 10, DRAW_OPT_FILL_SHAPE); LineOut(10, 10, 80, 60); RectOut(20, 20, 40, 40); RectOutEx(65, 25, 20, 30, DRAW_OPT_FILL_SHAPE); EllipseOut(70, 30, 15, 20); Wait(SEC_1); printf("LcdBmpFile(1, 0, 64, \"/media/card/mindstorms.rgf\");\n"); LcdBmpFile(1, 0, 64, "/media/card/mindstorms.rgf"); Wait(SEC_1); for (i = 0; i < 35; i++) { printf("LcdIcon(1, 130, 64, ICONTYPE_NORMAL, 0);\n"); LcdIcon(1, 0+((i % 7)*24), 0+((i / 7) * 12), ICONTYPE_NORMAL, i); Wait(250); } printf("LcdText(1, 0, 100, \"hello world\");\n"); LcdText(1, 0, 100, "hello world"); Wait(SEC_1); printf("LcdSelectFont(FONTTYPE_TINY);\n"); LcdSelectFont(FONTTYPE_TINY); printf("LcdText(1, 100, 100, \"testing\");\n"); LcdText(1, 100, 100, "testing"); Wait(SEC_1); // these functions will replace any file extension included in // the filename with the "correct" extension based on the // specified image format printf("LcdWriteDisplayToFile(\"/media/card/display.xbm\", ifXBM);\n"); LcdWriteDisplayToFile("/media/card/display.xbm", ifXBM); printf("LcdWriteFrameBufferToFile(\"/media/card/fbuffer.xbm\", ifXBM);\n"); LcdWriteFrameBufferToFile("/media/card/fbuffer.xbm", ifXBM); printf("LcdWriteDisplayToFile(\"/media/card/display_p1.pbm\", ifP1);\n"); LcdWriteDisplayToFile("/media/card/display_p1.pbm", ifP1); printf("LcdWriteFrameBufferToFile(\"/media/card/fbuffer_p1.pbm\", ifP1);\n"); LcdWriteFrameBufferToFile("/media/card/fbuffer_p1.pbm", ifP1); printf("LcdWriteDisplayToFile(\"/media/card/display_p4.pbm\", ifP4);\n"); LcdWriteDisplayToFile("/media/card/display_p4.pbm", ifP4); printf("LcdWriteFrameBufferToFile(\"/media/card/fbuffer_p4.pbm\", ifP4);\n"); LcdWriteFrameBufferToFile("/media/card/fbuffer_p4.pbm", ifP4); // Wait(SEC_5); LcdExit(); printf("end of lcd_test\n"); }