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.

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"?)

Returns the length of the string after wrapping.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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.

[]s,
                                               |alo
                                               +----
--
  It doesn't bother me that people say things like
   "you'll never get anywhere with this attitude".
   In a few decades, it will make a good paragraph
      in my biography. You know, for a laugh.
--
http://www.laranja.org/                mailto:[EMAIL PROTECTED]
         pgp key: http://www.laranja.org/pessoal/pgp

Eu jogo RPG! (I play RPG)         http://www.eujogorpg.com.br/
Python Foundry Guide http://www.sf.net/foundry/python-foundry/

_______________________________________________________________
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