Changeset 1216


Ignore:
Timestamp:
Nov 14, 2008, 3:19:10 AM (11 years ago)
Author:
dkearney
Message:

adding fix to controls.tcl to properly display all enabled tabs when some of the available tabs are disabled. this fix helps allow photonicsdb to dynamically display inputs for layers of materials while keeping the first and last tabs always enabled.

also included is an example which displays the bad behavior in previous versions of rappture as part of the buggy_xml series.

Location:
trunk
Files:
4 added
1 edited

Legend:

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

    r786 r1216  
    4747    private variable _dispatcher ""  ;# dispatcher for !events
    4848    private variable _controls ""    ;# list of known controls
     49    private variable _showing ""     ;# list of enabled (showing) controls
    4950    private variable _name2info      ;# maps control name => info
    5051    private variable _scheme ""      ;# layout scheme (tabs/hlabels)
     
    446447    }
    447448
     449    # store the showing tabs in the object so it can be used in _changeTabs
     450    set _showing $showing
     451
    448452    #
    449453    # Decide on a layout scheme:
     
    689693itcl::body Rappture::Controls::_changeTabs {} {
    690694    set i [$_tabs index select]
    691     set name [lindex $_controls $i]
     695    # we use _showing here instead of _controls because sometimes tabs
     696    # are disabled, and the index of the choosen tab always matches
     697    # _showing, even if tabs are disabled.
     698    set name [lindex $_showing $i]
    692699    if {"" != $name} {
    693700        foreach w [grid slaves $_frame] {
Note: See TracChangeset for help on using the changeset viewer.