Right, I can try it too. It was one of the options I considered, but we had 
some previous tests, with PopUp, and I decided to continue that way.
Maybe this option, extending from Alert, is simpler because when extending from 
PopUp I had to implement all the CSS's in sass "and they are not little" 😝. 

I'll let you know when I test it.

Thx 

Hiedra

-----Mensaje original-----
De: Piotr Zarzycki <piotrzarzyck...@gmail.com> 
Enviado el: miércoles, 22 de diciembre de 2021 12:34
Para: Apache Royale Development <dev@royale.apache.org>
Asunto: Re: New Jewel ContextMenuPopUp

Hi Maria,

You could also try to use Alert, which has AlertView - which could be extended. 
In AlertView you have method createContent which can be override and you could 
assign completely new content to that.

śr., 22 gru 2021 o 09:43 Maria Jose Esteve <mjest...@iest.com> napisał(a):

> For now I have implemented the second option:
>
>                                override public function set 
> content(value:org.apache.royale.core.UIBase):void
>                                {
>                                                if(content != value)
>                                                {
>
>  super.content = value;
>
>  content.className="jewel contextmenupopupcontent";
>                                                }
>                                }
>
> This is the result [1]
>
> [1]
> https://drive.google.com/file/d/1qoeo_p4L4rcuk45DDwy_Ph4w6k-dj9Gv/view
> ?usp=sharing
>
> Hiedra
>
> -----Mensaje original-----
> De: Maria Jose Esteve <mjest...@iest.com> Enviado el: martes, 21 de 
> diciembre de 2021 23:41
> Para: dev@royale.apache.org
> Asunto: New Jewel ContextMenuPopUp
>
> Hi, I need some advice...
>
> I'm trying to implement a ContextMenuPopUp, similar to the current 
> Jewel PopUp but without background color and whose positioning is 
> based on mouse coordinates.
> In this first attempt I have extended ContextMenuPopUp from PopUp to 
> be able to change the typeNames and className of "content" and some 
> other things like changing the IBeadView to a new ContextMenuPopUpView 
> or IBeadController to a new ContextMenuPopUpMouseController.
> My problem is when I override the setter of "content" because the 
> variable "_content" is private in PopUp:
>
> In Jewel PopUp.as:
>
>                                public function PopUp()
>                                {
>                                                super();
>                                                typeNames = "jewel popup";
>                                }
>                                public function set 
> content(value:UIBase):void
>                                {
>                                                if(_content != value)
>                                                {
>                                                                
> _content = value;
>
>  _content.className="jewel popupcontent";
>                                                }
>                                }
>
> In ContextMenuPopUp.as:
>
>                                public function ContextMenuPopUp()
>                                {
>                                                super();
>                                                typeNames = "jewel 
> contextmenupopup";
>                                }
>
>                                override public function set 
> content(value:org.apache.royale.core.UIBase):void
>                                {
>                                                if(_content != value)
>                                                {
>                                                                
> _content = value;
>
>  _content.className="jewel contextmenupopupcontent";
>                                                }
>                                }
>
> But sure, I can't refer to _content because it is private in the base 
> class.
> The options I'm shuffling:
> - Change the scope from private to protected in PopUp.as and leave the 
> code that I have shown above.
> - Change the override to something like this: (work)
>
>
>                                override public function set 
> content(value:org.apache.royale.core.UIBase):void
>
>                                {
>
>                                                if(content != value)
>
>                                                {
>
>
>  super.content = value;
>
>
>  content.className="jewel contextmenupopupcontent";
>
>                                                }
>
>                                }
> - Or, clone PopUp.as and change what I need directly.
>
> How would you extend PopUp?
>
> Hiedra
>
>

-- 

Piotr Zarzycki

Reply via email to