Re: Text over a few pads

From: Damir Buskulic (buskulic@lapp.in2p3.fr)
Date: Wed Dec 08 1999 - 19:01:36 MET


Hi Rene,

Thanks. But a user has to make a pad before he draws something.
Furthermore, if you create this new pad and forget to cd() to the main
canvas before drawing the transparent pad, you will not have the desired
effect.
 I agree that all this works quite well and is quite logical but having
to think about transparent pads while just trying to put a text over a
whole image makes some of my colleagues nervous. 
 I was thinking of a more intuitive solution, such as an editor taking
care of superimposed sheets, a la Photoshop. Each sheet could be seen as
a transparent pad. Perhaps is it just a matter of rewriting the editor.

Any other suggestion ?

Damir


Rene Brun wrote:
> 
> Hi Damir,
> Yes, this is possible, using the Root transparent pads feature.
> We announced this new feature in version 2.20, but this is not yet
> well documented. In the release notes, you can find:
> - TPad: implemented transparent pads. A pad is made transparent by
>   setting its fill style (using SetFillStyle()) in the range 4000-4100.
>   Where 4000 is fully transparent and 4100 fully opaque. All magic
>   is done in the method PaintBox() using the new (private) methods
>   CopyBackgroundPixmaps() and CopyBackgroundPixmap(). Transparent pads
>   need to always be updated if anything in the canvas is changed
>   or moved. This is handled in PaintModified().
> 
> - TAttFill: new method IsTransparent(). Returns true is fill style is
>   in the range 4000-4100.
> 
> So, suppose you have an existing canvas with several pads.
> You create a new pad (transparent) covering for example the entire
> canvas.
> Then you draw you primitives in this pad.
> The same can be achieved with the graphics editor.
> 
> example:
> root [0] .x tutorials/h1draw.C
> root [1] TPad *newpad=new TPad("newpad","a transparent pad",0,0,1,1);
> root [2] newpad.SetFillStyle(4000);
> root [3] newpad.Draw();
> root [4] newpad.cd();
> root [5] // create some primitives, etc
> 
> Rene Brun
> 
> Damir Buskulic wrote:
> >
> > Hi,
> >
> > I would like to draw a label or text going on top of a few pads, like
> > "preliminary" or some such.
> > How do I do this ?
> > If I draw the text on a pad, it is clipped at the pad border. If I plot
> > it on the underlying canvas, it is hidden by the pads...
> >
> > Any (simple ?) solution
> >
> > Damir
> > --
> > =====================================================================
> > | Damir Buskulic                  | Universite de Savoie/LAPP       |
> > |                                 | Chemin de Bellevue, B.P. 110    |
> > | Tel : +33 (0)450091600          | F-74941 Annecy-le-Vieux Cedex   |
> > | e-mail: buskulic@lapp.in2p3.fr  | FRANCE                          |
> > =====================================================================
> > mailto:buskulic@lapp.in2p3.fr

-- 
=====================================================================
| Damir Buskulic                  | Universite de Savoie/LAPP       |
|                                 | Chemin de Bellevue, B.P. 110    |
| Tel : +33 (0)450091600          | F-74941 Annecy-le-Vieux Cedex   |
| e-mail: buskulic@lapp.in2p3.fr  | FRANCE                          |
=====================================================================
mailto:buskulic@lapp.in2p3.fr



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:44 MET