Changeset 1862


Ignore:
Timestamp:
Aug 16, 2010, 6:27:53 PM (14 years ago)
Author:
gah
Message:
 
Location:
branches/blt4/gui/scripts
Files:
3 edited

Legend:

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

    r1652 r1862  
    1616
    1717namespace eval Rappture::icon {
    18     variable iconpath [file join $RapptureGUI::library scripts images]
     18    variable iconpath [list [file join $RapptureGUI::library scripts images]]
    1919    variable icons
    2020}
  • branches/blt4/gui/scripts/textentry.tcl

    r1860 r1862  
    9292            rename -font -hintfont hintFont Font
    9393        }
    94         pack $itk_component(hints) -side bottom -fill x 
     94        pack $itk_component(hints) -side bottom -fill x
    9595    }
    9696
     
    231231        # take down any existing widget
    232232        foreach win [pack slaves $itk_interior] {
    233             if { [winfo name $win] != "hints" } {
    234                 pack forget $win
    235             }
     233            pack forget $win
    236234        }
    237235
     
    549547# CONFIGURATION OPTION: -state
    550548# ----------------------------------------------------------------------
     549
     550
     551
    551552itcl::configbody Rappture::TextEntry::state {
    552553    set valid {normal disabled}
  • branches/blt4/gui/scripts/textresult.tcl

    r1710 r1862  
    2828    inherit itk::Widget
    2929
    30     constructor {args} { # defined below }
    31 
     30    constructor {args} {
     31        # defined below
     32    }
    3233    public method add {dataobj {settings ""}}
    3334    public method get {}
    3435    public method delete {args}
    3536    public method scale {args}
    36     public method parameters {title args} { # do nothing }
     37    public method parameters {title args} {
     38        # do nothing
     39    }
    3740    public method download {option args}
    3841
    3942    public method select {option args}
    4043    public method find {option}
     44    public method popup {option args}
    4145
    4246    private variable _dataobj ""  ;# data object currently being displayed
     
    141145    $itk_component(text) tag configure ERROR -foreground red
    142146
    143     eval itk_initialize $args
     147    itk_component add emenu {
     148        menu $itk_component(text).menu -tearoff 0
     149    } {
     150        ignore -tearoff
     151    }
     152    $itk_component(emenu) add command \
     153        -label "Copy" -accelerator "^C" \
     154        -command [list event generate $itk_component(text) <<Copy>>]
     155    $itk_component(emenu) add command \
     156        -label "Select All" -accelerator "^A" \
     157        -command [itcl::code $this select all]
     158    $itk_component(emenu) add command \
     159        -label "Select None" -accelerator "Esc" \
     160        -command [list puts stderr $this select none]
     161    bind $itk_component(text) <<PopupMenu>> \
     162        [itcl::code $this popup menu emenu %X %Y]
     163
     164   eval itk_initialize $args
    144165}
    145166
     
    337358    switch -- $option {
    338359        all {
     360            puts stderr "$itk_component(text) tag add sel 1.0 end"
    339361            $itk_component(text) tag add sel 1.0 end
    340362        }
     
    412434    $itk_component(findstatus) configure -text $status
    413435}
     436
     437# ----------------------------------------------------------------------
     438# USAGE: _popup menu <which> <X> <Y>
     439#
     440# Used internally to manage edit operations.
     441# ----------------------------------------------------------------------
     442itcl::body Rappture::TextResult::popup {option args} {
     443    puts stderr "popup option=$option args=$args"
     444    switch -- $option {
     445        menu {
     446            if {[llength $args] != 3} {
     447                error "wrong # args: should be \"_popup $option which x y\""
     448            }
     449            set mname [lindex $args 0]
     450            set x [lindex $args 1]
     451            set y [lindex $args 2]
     452            tk_popup $itk_component($mname) $x $y
     453        }
     454        default {
     455            error "bad option \"$option\": should be menu"
     456        }
     457    }
     458}
Note: See TracChangeset for help on using the changeset viewer.