Ignore:
Timestamp:
Jul 17, 2014 8:12:29 PM (10 years ago)
Author:
ldelgass
Message:

merge background settings from trunk

Location:
branches/1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/gui/scripts/nanovisviewer.tcl

    r4531 r4550  
    222222    array set _settings {
    223223        -axesvisible       1
     224        -background        black
    224225        -colormap          default
    225226        -cutplanesvisible  0
     
    12361237            }
    12371238        }
     1239        "-background" {
     1240            set bgcolor [$itk_component(background) value]
     1241            array set fgcolors {
     1242                "black" "white"
     1243                "white" "black"
     1244                "grey"  "black"
     1245            }
     1246            configure -plotbackground $bgcolor \
     1247                -plotforeground $fgcolors($bgcolor)
     1248            DrawLegend $_current
     1249        }
    12381250        "-gridvisible" {
    12391251            SendCmd "grid visible $_settings($what)"
     
    14491461itcl::configbody Rappture::NanovisViewer::plotbackground {
    14501462    if { [isconnected] } {
    1451         foreach {r g b} [Color2RGB $itk_option(-plotbackground)] break
    1452         #fix this!
    1453         #SendCmd "color background $r $g $b"
     1463        set color $itk_option(-plotbackground)
     1464        set rgb [Color2RGB $color]
     1465        SendCmd "screen bgcolor $rgb"
     1466        $itk_component(legend) configure -background $color
    14541467    }
    14551468}
     
    14601473itcl::configbody Rappture::NanovisViewer::plotforeground {
    14611474    if { [isconnected] } {
    1462         foreach {r g b} [Color2RGB $itk_option(-plotforeground)] break
    1463         #fix this!
    1464         #SendCmd "color background $r $g $b"
     1475        set color $itk_option(-plotforeground)
     1476        set rgb [Color2RGB $color]
     1477        SendCmd "volume outline color $rgb"
     1478        SendCmd "grid axiscolor $rgb"
     1479        SendCmd "grid linecolor $rgb"
     1480        $itk_component(legend) itemconfigure labels -fill $color
     1481        $itk_component(legend) itemconfigure limits -fill $color
    14651482    }
    14661483}
     
    16211638        -font "Arial 9"
    16221639
     1640    label $inner.background_l -text "Background" -font "Arial 9"
     1641    itk_component add background {
     1642        Rappture::Combobox $inner.background -width 10 -editable no
     1643    }
     1644    $inner.background choices insert end \
     1645        "black"              "black"            \
     1646        "white"              "white"            \
     1647        "grey"               "grey"             
     1648
     1649    $itk_component(background) value $_settings(background)
     1650    bind $inner.background <<Value>> [itcl::code $this AdjustSetting background]
     1651
    16231652    blt::table $inner \
    16241653        0,0 $inner.axes  -cspan 2 -anchor w \
     
    16261655        2,0 $inner.outline  -cspan 2 -anchor w \
    16271656        3,0 $inner.volume  -cspan 2 -anchor w \
    1628         4,0 $inner.legend  -cspan 2 -anchor w
     1657        4,0 $inner.legend  -cspan 2 -anchor w \
     1658        5,0 $inner.background_l       -anchor e -pady 2 \
     1659        5,1 $inner.background                   -fill x \
    16291660
    16301661    if 0 {
     
    16321663    }
    16331664    blt::table configure $inner r* -resize none
    1634     blt::table configure $inner r5 -resize expand
     1665    blt::table configure $inner r6 -resize expand
    16351666}
    16361667
Note: See TracChangeset for help on using the changeset viewer.