Article View: comp.windows.interviews
Article #14Problem with updating ScrollBox
From: Even Oscar Andersen
Date: Wed, 28 Oct 1992 12:01
Date: Wed, 28 Oct 1992 12:01
70 lines
2735 bytes
2735 bytes
I use the following:
(Glyph *)_cursor = new Background(
(LauoutKit *)->spaces(1, 0.2, <current font>,
<black color>),
<black color>
);
(ScrollBox *)_body _ (LayoutKit *)->vscrollbox();
_body->ref();
(Composition *)_paragraph[0] = new LRComposition(
(LayoutKit *)->vbox(5),
new SimpleCompositor,
nil,
4*72.0,
fil,
fil,
GlyphIndex(100)
);
_paragraph[0]->insert(GlyphIndex(0), _cursor);
_paragraph[0]->insert(GlyphIndex(1), (LayoutKit *)->hglue(0, fil, 0));
_body->insert(GlyphIndex(0), _paragraph[0]);
_body->insert(GlyphIndex(1), (LayoutKit *)vglue());
body(_body);
_paragraph[0]->repair();
-------
When the program runs, my window comes up with the cursor as i wanted.
But when I want to add a new _paragraph[x] to the _body,
the cursor is not visible.
--
<add newline>
<remove _cursor, OK>
<add _paragraph[1]>
_paragraph[1] = new LRComposition(<as _paragraph[0])
_paragraph[1]->insert(.._cursor)
_paragraph[1]->insert(..hglue)
_body->insert(GlyphIndex(1), _paragraph[1]);
body(_body);
_paragraph[1]->repair();
-----
The idea is to add the new paragraph between the last paragraph, and the vglue.
-----
When I want a new line the cursor disappears and is placed at the next line, but
it is not visible until I type a character.
If I type two Newlines, both are added to _body, but when I start typing
text(placed in last line), the cursor and characters shows up under the previous
line displayed(e.g. the line has some characters). Since I typed two newlines,
there should be 1 line of space between them.
I may no move the cursor upwards, when it comes to a line which is not shown, the
cursor disappears. If I now type some text and later resize the window, the
hidden line becomes visible.
I have tried to use _glyph->damage_all(), when encountering a newline, but still
can't get it right.
BTW. is this a "good" way to implement a software cursor, should I use other
glyphs instead ?
Even Oscar Andersen
Technical Details
Message-ID:
<1992Oct28.120110.7992@ifi.uio.no>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!aun.uninett.no!nuug!ifi.uio.no!evenaShow Full Headers
Complete Article Headers
Nntp-Posting-Host: atrid.ifi.uio.no Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!aun.uninett.no!nuug!ifi.uio.no!evena From: evena@ifi.uio.no (Even Oscar Andersen) Subject: Problem with updating ScrollBox Message-ID: <1992Oct28.120110.7992@ifi.uio.no> Sender: evena@ifi.uio.no (Even Oscar Andersen) Organization: Dept. of Informatics, University of Oslo, Norway Date: Wed, 28 Oct 1992 12:01:10 GMT Lines: 72 Originator: evena@atrid.ifi.uio.no