modify qx.ui.tooltip.Manager to use rich text tooltips for error messages

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

modify qx.ui.tooltip.Manager to use rich text tooltips for error messages

Dietrich Streifert
Hi all!

I need to change the tooltip manager in order to use rich text (html)
tooltips for form items having an invalid message (value in property
invalidMessage).

The only way I currently can think of is to copy qx.ui.tooltip.Manager
over to my namespace and modify the code because deriving from singleton
classes is not working (http://bugzilla.qooxdoo.org/show_bug.cgi?id=3005).

Other ways to get this working would be to have one of the following:

1. add a richErrorText property to qx.ui.tooltip.Manager which creates
the error tooltip accordingly.

2. allow the "rich" property of qx.ui.tooltip.ToolTip to be themable
which would allow to override the rich property via a modified
appearance in my own theme.

Does anyone have another idea?

Thank you for your help.

Regards
Dietrich Streifert


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: modify qx.ui.tooltip.Manager to use rich text tooltips for error messages

Dietrich Streifert
answering myself:

I came up with the following solution which uses qx.Class.patch:

qx.Mixin.define("my.ui.tooltip.PManager",
{
   /*
   
*****************************************************************************
      MEMBERS
   
*****************************************************************************
   */

   members :
   {
     _applyCurrent : function(value, old)
     {
       this.base(arguments,value,old);
       if(value) {
         value.setRich(true);
       }
     }
   }
});
qx.Class.patch(qx.ui.tooltip.Manager, my.ui.tooltip.PManager);

qx.Class.patchwraps the the old overwritten/patched member so it is
accessible to the this.base call:

https://github.com/qooxdoo/qooxdoo/blob/35db87d/framework/source/class/qx/Class.js#L1336

Not ideal, but it works.

Regards
Dietrich Streifert

Am 28.03.2012 12:44, schrieb Dietrich Streifert:

> Hi all!
>
> I need to change the tooltip manager in order to use rich text (html)
> tooltips for form items having an invalid message (value in property
> invalidMessage).
>
> The only way I currently can think of is to copy qx.ui.tooltip.Manager
> over to my namespace and modify the code because deriving from
> singleton classes is not working
> (http://bugzilla.qooxdoo.org/show_bug.cgi?id=3005).
>
> Other ways to get this working would be to have one of the following:
>
> 1. add a richErrorText property to qx.ui.tooltip.Manager which creates
> the error tooltip accordingly.
>
> 2. allow the "rich" property of qx.ui.tooltip.ToolTip to be themable
> which would allow to override the rich property via a modified
> appearance in my own theme.
>
> Does anyone have another idea?
>
> Thank you for your help.
>
> Regards
> Dietrich Streifert
>


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: modify qx.ui.tooltip.Manager to use rich text tooltips for error messages

Derrell Lipman
On Wed, Mar 28, 2012 at 07:35, Dietrich Streifert <[hidden email]> wrote:
answering myself:

I came up with the following solution which uses qx.Class.patch:

qx.Mixin.define("my.ui.tooltip.PManager",
{
  /*

*****************************************************************************
     MEMBERS

*****************************************************************************
  */

  members :
  {
    _applyCurrent : function(value, old)
    {
      this.base(arguments,value,old);
      if(value) {
        value.setRich(true);
      }
    }
  }
});
qx.Class.patch(qx.ui.tooltip.Manager, my.ui.tooltip.PManager);

qx.Class.patchwraps the the old overwritten/patched member so it is
accessible to the this.base call:

Actually (unless something has changed recently, and I don't believe it has), although you may be getting the effect you want, your statement above does not reflect reality.  When you patch a class with a method of the same name, you eliminate the old method of that name, and replace it with the patched-in method of that name. A call to this.base() within the patched-in method is calling the method of that name in the superclass of the class being patched, not the former version of the method in the class being patched.

Derrell


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: modify qx.ui.tooltip.Manager to use rich text tooltips for error messages

Dietrich Streifert
Hi Derrell!

No this works exactly as implemented in my code. I think I remember some
discussion with Sebastian Werner if it would be possible to have access
to the original patched out member function. Please read the comment
above the __mixinMemberWrapper in qx.Class:

https://github.com/qooxdoo/qooxdoo/blob/35db87d/framework/source/class/qx/Class.js#L1328



Am 28.03.2012 14:23, schrieb Derrell Lipman:

>
> Actually (unless something has changed recently, and I don't believe
> it has), although you may be getting the effect you want, your
> statement above does not reflect reality.  When you patch a class with
> a method of the same name, you eliminate the old method of that name,
> and replace it with the patched-in method of that name. A call to
> this.base() within the patched-in method is calling the method of that
> name in the superclass of the class being patched, not the former
> version of the method in the class being patched.
>
> Derrell


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: modify qx.ui.tooltip.Manager to use rich text tooltips for error messages

Derrell Lipman
On Wed, Mar 28, 2012 at 08:41, Dietrich Streifert <[hidden email]> wrote:
Hi Derrell!

No this works exactly as implemented in my code. I think I remember some
discussion with Sebastian Werner if it would be possible to have access
to the original patched out member function. Please read the comment
above the __mixinMemberWrapper in qx.Class:

https://github.com/qooxdoo/qooxdoo/blob/35db87d/framework/source/class/qx/Class.js#L1328

I stand corrected! This playground snippet demonstrates it:

qx.Class.define("my.A",
{
  extend : qx.core.Object,
  
  construct : function()
  {
    this.debug("A constructor");
  },
  
  members :
  {
    func : function()
    {
      this.debug("A.func");
    }
  }
});

qx.Mixin.define("my.M",
{
  construct : function()
  {
    this.debug("M constructor");
  },
  
  members :
  {
    func : function()
    {
      this.base(arguments);
      this.debug("M.func");
    }
  }
});

qx.Class.patch(my.A, my.M);

var a = new my.A();
a.func();

Learned something useful. Thanks! :-)

Derrell
 

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: modify qx.ui.tooltip.Manager to use rich text tooltips for error messages

Dietrich Streifert
In reply to this post by Dietrich Streifert
Seems to be solved with pull #24 from
http://bugzilla.qooxdoo.org/show_bug.cgi?id=6309 master.

Regards
Dietrich Streifert


Am 28.03.2012 12:44, schrieb Dietrich Streifert:

> Hi all!
>
> I need to change the tooltip manager in order to use rich text (html)
> tooltips for form items having an invalid message (value in property
> invalidMessage).
>
> The only way I currently can think of is to copy qx.ui.tooltip.Manager
> over to my namespace and modify the code because deriving from
> singleton classes is not working
> (http://bugzilla.qooxdoo.org/show_bug.cgi?id=3005).
>
> Other ways to get this working would be to have one of the following:
>
> 1. add a richErrorText property to qx.ui.tooltip.Manager which creates
> the error tooltip accordingly.
>
> 2. allow the "rich" property of qx.ui.tooltip.ToolTip to be themable
> which would allow to override the rich property via a modified
> appearance in my own theme.
>
> Does anyone have another idea?
>
> Thank you for your help.
>
> Regards
> Dietrich Streifert
>


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel