GLK: Added pair window drawing

This commit is contained in:
Paul Gilbert 2018-10-29 00:56:13 -07:00 committed by Paul Gilbert
parent 48a00e7c00
commit 1a889689f8
3 changed files with 24 additions and 1 deletions

View File

@ -22,6 +22,8 @@
#include "gargoyle/window_pair.h"
#include "gargoyle/conf.h"
#include "gargoyle/gargoyle.h"
#include "gargoyle/screen.h"
namespace Gargoyle {
@ -121,7 +123,25 @@ void PairWindow::rearrange(const Rect &box) {
void PairWindow::redraw() {
Window::redraw();
// TODO
_child1->redraw();
_child2->redraw();
Window *child = !_backward ? _child1 : _child2;
Rect box(child->_bbox.left, child->_yAdj ? child->_bbox.top - child->_yAdj : child->_bbox.top,
child->_bbox.right, child->_bbox.bottom);
if (_vertical) {
int xBord = _wBorder ? g_conf->_wBorderX : 0;
int xPad = (g_conf->_wPaddingX - xBord) / 2;
g_vm->_screen->fillRect(Rect(box.right + xPad, box.top, box.right + xPad + xBord, box.bottom),
g_conf->_borderColor);
} else {
int yBord = _wBorder ? g_conf->_wBorderY : 0;
int yPad = (g_conf->_wPaddingY - yBord) / 2;
g_vm->_screen->fillRect(Rect(box.left, box.bottom + yPad, box.right, box.bottom + yPad + yBord),
g_conf->_borderColor);
}
}
void PairWindow::getArrangement(glui32 *method, glui32 *size, Window **keyWin) {

View File

@ -611,6 +611,7 @@ void TextBufferWindow::requestLineEvent(char *buf, glui32 maxlen, glui32 initlen
return;
}
_lineRequest = true;
int pw;
gli_tts_flush();

View File

@ -223,6 +223,8 @@ void TextGridWindow::requestLineEvent(char *buf, glui32 maxlen, glui32 initlen)
return;
}
_lineRequest = true;
if ((int)maxlen > (_width - _curX))
maxlen = (_width - _curX);