On Wed, 17 Jul 2013, Fabien Bodard wrote:
> In fact i fnt know what you want to achieve. So I've just trying to
> understand and then make it in a good way.
> 

What I want is to draw a box and richtext which is centered in that box. The
whole picture shall fade from black to transparency in a RadialGradient
(from the middle of the picture).

> Centering is different between draw and paint
> 
> Then you can't center a richtext vertically. This make sens when wrap is
> active.
> 

Not much sense. When wrapping is active, Paint should compute the number of
lines (based on the wrapping) to center the text vertically. Paint does
offer me the Align.Center possibility so I expect that it works that way.

> And you have give a bad zone for centering.
> 

Why? I want to have the text inside this box. Did I maybe misunderstand how
text is drawn with Paint? I give some text and a rectangle. The text will be
drawn inside the rectangle, wrapping the text if necessary, right?

> My way is not the only way. ... You can center by hand too.
> 

Basically, I don't want another way and especially no workaround which has
more lines than what I wrote. I'm asking why it doesn't work as expected -
or if I expect wrong things.

> Calculate the pos in _draw not in _arrange.

Why? The positions are dependent only on the DrawingAreas' dimensions and
these can only change when the Form changes dimensions. If this happens, the
Arrange event is raised. I can see no effective difference between doing it
in dwg1_Draw/dwg2_Draw or Form_Arrange, except that in Form_Arrange the code
is executed less than (or equal to) half of the times if would have been in
the Draw events.

Regards,
Tobi

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to