[Gambas-user] Print probleem with pictures/text

Benoit Minisini gambas at ...1...
Sun Jul 23 00:07:20 CEST 2006


On Saturday 22 July 2006 23:54, Ron Onstenk wrote:
> On Friday 21 July 2006 08:22, Timothy Marshal-Nichols wrote:
> > *** Timothy: The text is taken from a TextArea and should be multi line
> > in the print out. The Align options like Center do work.
> >
> > What I think you want is a 'WordWrap' option. This is not supported by
> > the Draw.Text() method. But it should be possible to use
> > Draw.TextWidth(txt) to create a usable version of WordWrap. Evan if it is
> > not perfect.
> > ***
>
> You are correct with 'WordWrap'.
> In the screen shot the cyan is the size and the text is not wrapped :(
>
> Using next code part:
>  bigText = file.Load("garantie.text")
>  draw.BackColor = color.Red
>  draw.FillColor = color.Green
>  draw.ForeColor = color.Yellow
>  draw.Transparent = FALSE
>  draw.FillColor = color.Cyan
>  draw.FillStyle = fill.Solid
>
>  ' Draw.Text(bigText, 100, (Printer.Height / 2) + 100 + (Printer.Height /
> 4), Printer.Width - 200, Draw.TextHeight(bigText), Align.left) '
> Draw.Rect(100, (Printer.Height / 2) + 100 + (Printer.Height / 4),
> Printer.Width - 200, Draw.TextHeight(bigText)) Draw.Rect(100,
> (Printer.Height / 2) + 100 + (Printer.Height / 4), 1000,
> Draw.TextHeight(bigText)) Draw.Text(bigText, 100, (Printer.Height / 2) +
> 100 + (Printer.Height / 4), 1000, Draw.TextHeight(bigText), Align.left)
>
> I'll try to make a function for wordwrap or the bigtext must provide the
> correct width.
>
> Anyway I should be able to more now after all the struggle.
>
> Thanks again
>
> Ron

There is no word wrap at the moment because I don't know if this was possible 
in gb.gtk. When the Draw class will be written in gb.gtk, maybe you will this 
feature (and others) added to gb.qt. It depends on what we can do with both 
gb.qt and gb.gtk.

Regards,

-- 
Benoit Minisini




More information about the User mailing list