Changeset 4647 for branches


Ignore:
Timestamp:
Oct 9, 2014 12:35:07 PM (7 years ago)
Author:
gah
Message:

fix for note.tcl. Mirror changes from release branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/gui/scripts/note.tcl

    r3025 r4647  
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
     2
    13# ----------------------------------------------------------------------
    24#  COMPONENT: Note - widget for displaying HTML notes
     
    79# ======================================================================
    810#  AUTHOR:  Michael McLennan, Purdue University
    9 #  Copyright (c) 2004-2007  Purdue Research Foundation
     11#  Copyright (c) 2004-2012  HUBzero Foundation, LLC
    1012#
    1113#  See the file "license.terms" for information on usage and
     
    3032    protected method _setContents {info}
    3133    protected method _escapeChars {text}
    32     protected method _revEscapeChars {text}
    3334
    3435    private variable _owner ""    ;# thing managing this control
     
    7273    eval itk_initialize $args
    7374
    74     _setContents [$_owner xml get $_path.contents]
    75 }
     75    _setContents [string trim [$_owner xml get $_path.contents]]
     76    set w [string trim [$_owner xml get $_path.width]]
     77    if { $w != "" } {
     78        $itk_component(html) configure -width $w
     79    }
     80    set h [string trim [$_owner xml get $_path.height]]
     81    if { $h != "" } {
     82        $itk_component(html) configure -height $h
     83    }   
     84}
     85
    7686
    7787# ----------------------------------------------------------------------
     
    181191            $itk_component(html) load $html -in $file
    182192        }
    183         ^xhtml:// {
    184             set html [string range $info 7 end]
    185             puts stderr "html html=$html"
    186             $itk_component(html) load $html
    187         }
    188193        default {
    189             puts stderr "info=$info"
    190             set html "<html><body><p>[_revEscapeChars $info]</p></body></html>"
    191             puts stderr "default html=$html"
     194            set html "<html><body><p>[_escapeChars $info]</p></body></html>"
    192195            $itk_component(html) load $html
    193196        }
     
    210213    return $info
    211214}
    212 
    213 # ----------------------------------------------------------------------
    214 # USAGE: _escapeChars <info>
    215 #
    216 # Used internally to convert XML entity references back to ordinary text. 
    217 # Used when trying to display html, which may have things like
    218 # "<b>" or "x < 2" embedded within it.
    219 # ----------------------------------------------------------------------
    220 itcl::body Rappture::Note::_revEscapeChars {info} {
    221     regsub -all {\&quot;} $info \" info
    222     regsub -all {\&lt;} $info < info
    223     regsub -all {\&gt;} $info > info
    224     regsub -all {\&amp;} $info & info
    225     return $info
    226 }
Note: See TracChangeset for help on using the changeset viewer.