Menu

#159 Hyperlink.setWrapText(boolean)

v1.2 final
open
5
2008-01-29
2007-11-01
Clinton Lee
No

Is it possible to have a wrapText property for Hyperlink that behaves just like Label's wrapText property.

Discussion

  • Clinton Lee

    Clinton Lee - 2007-11-05

    Logged In: YES
    user_id=1033641
    Originator: YES

    I have done a simple patch to get this working. To be honest, I haven't tested the AlignX, but since I was doing wrapText I figured I'd add that in aswell. The patch is based of the latest 1.2 branch in SVN.

    Please consider this change for the next release, we are using thinwire as our UI for my company's flagship product now, And we need this to avoid names "cutting-off" in certain tables.
    File Added: hyplink_patch.patch.txt

     
  • Clinton Lee

    Clinton Lee - 2007-11-05

    Patch to enable wrapText & alignX properties on Hyperlink objects

     
  • Joshua Gertzen

    Joshua Gertzen - 2007-12-30
    • labels: --> UI Component
    • milestone: --> v1.2 final
    • assigned_to: nobody --> pra9ma
    • status: open --> closed
     
  • Joshua Gertzen

    Joshua Gertzen - 2007-12-30

    Logged In: YES
    user_id=1544509
    Originator: NO

    Implemented and checked into the 1.2 branch. Unified the common features of Hyperlink and Label under an interface called LabelComponent. With this change, Hyperlink can be treated as a Label in every way. This also means that Hyperlink implements the alignX and wrapText properties just like Label does. BEHAVIOR CHANGE: A side effect of this is that Component's getLabel() method will now return an instance of the LabelComponent interface rather than Label. To correct your existing code, you can either cast the return value of getLabel() to a Label, or you can alter the dependent code to use the LabelComponent interface instead.

     
  • Clinton Lee

    Clinton Lee - 2008-01-29

    Logged In: YES
    user_id=1033641
    Originator: YES

    Setting wordWrap to true behaves differently for Hyperlink components than Labels. On hyperlink components the text is centered vertically, but on Labels it is top aligned. The patch below makes the Hyperlink.setHeight method the same as Label's which fixes this problem.

    Index: F:/devel/thinwire-1.2_SVN/src/thinwire/render/web/resources/Hyperlink.js

    --- F:/devel/thinwire-1.2_SVN/src/thinwire/render/web/resources/Hyperlink.js (revision 626)
    +++ F:/devel/thinwire-1.2_SVN/src/thinwire/render/web/resources/Hyperlink.js (working copy)
    @@ -59,7 +59,7 @@

    setHeight: function(height) {
    arguments.callee.$.call(this, height);
    - this._box.style.lineHeight = this._box.style.height;
    + if (this._box.style.whiteSpace == "nowrap") this._box.style.lineHeight = this._box.style.height;
    },

    setLocation: function(location) {

     
  • Clinton Lee

    Clinton Lee - 2008-01-29
    • status: closed --> open
     

Log in to post a comment.

Monday.com Logo