On Sat, May 18, 2002 at 02:27:06PM -0300, Lalo Martins wrote:
> On Sat, May 18, 2002 at 02:27:41PM +0100, James Hollingshead wrote:
> > 
> > Fonts aren't necessarily monospaced, so I couldn't decide between
> > trying to work out how many "M"s fit on a line and then wrapping at
> > that, or being more complicated and having differing numbers of chars
> > on each line. The second approach would I think either require lots of
> > trial and error calls to pgSizeText() for every line, or maybe an
> > array containing the size of each ascii char so we could calculate
> > directly in the client.
> 
> I propose a sollution for this is implemented in the server.

On the server certainly seems a sensible way of doing this to me. I
don't know anything about the server internals so can't really comment
on what the cleanest way would be though.
 
> PGREQ_WRAPTEXT
> additional data: struct pgreqd_handlestruct
> server response type: PG_RESPONSE_RET
> 
> Given a handle to a widget, this reads the widget's current text, font and
> width, and wraps the string corresponding to the widget's text so that it
> fits the screen.
> 
> (RFC: wrap at word-boundary or "dumb-wrap"?)

If it only did dumb-wrapping then wouldn't it be quite tricky to
implement word-boundary wrapping in the client if you needed it? And
vice versa as well.

> Perhaps there are other possibilities. One is, given a string handle and a
> font and width, return a lot of strings; or allowing a widget to show a
> string beginning from a given offset (then all of the necessary widgets
> would show the same string, as far as the server is concerned, but each will
> be showing a different part of it). Or, of course, making the label widget
> multi-line with auto-wrapping ;-)
 
> James, as a side comment: couldn't this code use the textbox instead? What
> would be the problems? Bookmarking? IIRC the textbox is already quite usable
> for read-only plaintext.

It probably could, but when I first tried it I couldn't persuade the
textbox to show anything. It certainly doesn't seem to work for me if
I change it to textbox and leave everything else unchanged. Maybe I
need to update my pgserver.

James

_______________________________________________________________
Hundreds of nodes, one monster rendering program.
Now that's a super model! Visit http://clustering.foundries.sf.net/

_______________________________________________
Pgui-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/pgui-devel

Reply via email to