Ignore:
Timestamp:
Apr 26, 2006 6:42:46 PM (18 years ago)
Author:
mmc
Message:
  • Added <description> capability to output objects, including axes.
  • Fixed the ResultSet? so that it is more compact and supports the simulation number as a parameter. This is useful when there are datasets with wildly varying parameters.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/tooltip.tcl

    r213 r413  
    5959    bind RapptureTooltip <KeyPress> \
    6060        [list ::Rappture::Tooltip::tooltip cancel]
    61 
    62     private common icons
    63     set dir [file dirname [info script]]
    64     set icons(cue) [image create photo -file [file join $dir images cue24.gif]]
    6561}
    6662
     
    141137
    142138    # strings can't be too big, or they'll go off screen!
    143     if {[string length $mesg] > 1000} {
    144         set mesg "[string range $mesg 0 1000]..."
    145     }
    146139    set pos 0
    147140    ::for {set i 0} {$pos >= 0 && $i < 20} {incr i} {
     
    152145        set mesg "[string range $mesg 0 $pos]..."
    153146    }
     147    if {[string length $mesg] > 1000} {
     148        set mesg "[string range $mesg 0 1500]..."
     149    }
    154150    $itk_component(text) configure -text $mesg
    155151
    156152    #
    157     # Make sure the tooltip doesn't go off screen.  Then, put it up.
     153    # Make sure the tooltip doesn't go off screen.
    158154    #
    159155    update idletasks
     
    182178    }
    183179
     180    #
     181    # Will the tooltip pop up under the mouse pointer?  If so, then
     182    # it will just disappear.  Doh!  We should figure out a better
     183    # place to pop it up.
     184    #
     185    set px [winfo pointerx $hull]
     186    set py [winfo pointery $hull]
     187    if {$px >= $xpos && $px <= $xpos+[winfo reqwidth $hull]
     188          && $py >= $ypos && $py <= $ypos+[winfo reqheight $hull]} {
     189
     190        if {$px > [winfo screenwidth $hull]/2} {
     191            set signx "-"
     192            set xpos [expr {[winfo screenwidth $hull]-$px+4}]
     193        } else {
     194            set signx "+"
     195            set xpos [expr {$px+4}]
     196        }
     197        if {$py > [winfo screenheight $hull]/2} {
     198            set signy "-"
     199            set ypos [expr {[winfo screenheight $hull]-$py+4}]
     200        } else {
     201            set signy "+"
     202            set ypos [expr {$py+4}]
     203        }
     204    }
     205
     206    #
     207    # Finally, put it up.
     208    #
    184209    wm geometry $hull $signx$xpos$signy$ypos
    185210    update
     
    276301                error "wrong # args: should be \"tooltip pending widget ?@x,y?\""
    277302            }
    278             set widget [lindex $args 0]
     303            set tag [lindex $args 0]
    279304            set loc [lindex $args 1]
    280305
    281             if {[winfo exists $widget]} {
    282                 .rappturetooltip configure -message $catalog($widget)
     306            # tag name may be .g-axis -- get widget ".g" part
     307            set widget $tag
     308            if {[regexp {^(\.[^-]+)-[^\.]+$} $widget match wname]} {
     309                set widget $wname
     310            }
     311
     312            if {[winfo exists $widget] && [info exists catalog($tag)]} {
     313                .rappturetooltip configure -message $catalog($tag)
    283314                if {[string index $loc 0] == "@"} {
    284315                    .rappturetooltip show $loc
     
    381412# create a tooltip widget to show error cues
    382413Rappture::Tooltip .rappturetoolcue \
    383     -icon $Rappture::Tooltip::icons(cue) \
     414    -icon [Rappture::icon cue24] \
    384415    -background black -outline #333333 -foreground white
    385416
Note: See TracChangeset for help on using the changeset viewer.