4 * Copyright 2006 Develer S.r.l. (http://www.develer.com/)
5 * Copyright 2000,2001 Bernardo Innocenti <bernie@codewiz.org>
6 * This file is part of DevLib - See README.devlib for information.
11 * \author Bernardo Innocenti <bernie@develer.com>
13 * \brief Custom Qt widget for emulating a graphics LCD display (implementation)
18 *#* Revision 1.1 2006/01/16 03:51:35 bernie
19 *#* Add LCD Qt emulator.
36 * Qt widget to emulate a dot-matrix LCD display.
38 class EmulLCD : public QFrame
44 enum { COLS = 20, ROWS = 4 };
47 EmulLCD(QWidget *parent = 0, const char *name = 0);
50 // Base class overrides
52 virtual QSizePolicy sizePolicy() const;
53 virtual QSize sizeHint() const;
54 virtual void drawContents(QPainter *p);
58 void MoveCursor (int col, int row);
59 void ShowCursor (bool show = true);
60 void PutChar (unsigned char c);
63 void SetCGRamAddr (unsigned char addr);
67 void SetPainter(QPainter & p);
68 void RedrawText(QPainter & p);
69 void PrintChar(QPainter & p, int row, int col);
72 QFont lcd_font; ///< Display character font
73 QColor fg_color, bg_color; ///< LCD colors
74 int font_width, font_height; ///< Font dimensions
75 int frame_width; ///< Frame width (and height)
76 int cr_row, cr_col; ///< Cursor position
77 int cgramaddr; ///< CGRAM Address (-1 disabled)
78 unsigned char ddram[ROWS][COLS];///< Display data RAM
79 unsigned char cgram[8*8]; ///< CGRAM
80 bool show_cursor; ///< Cursor enabled?
83 #endif // !defined(EMULLCD_H)