Last change
on this file since 1216 was
1216,
checked in by dkearney, 15 years ago
|
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.
|
File size:
1.3 KB
|
Line | |
---|
1 | This is an example from Satoshi Ishii working on PhotonicsDB. He was trying |
---|
2 | to setup tabs in the gui by using groups of groups. He wanted the first and |
---|
3 | last tab to always be enabled. The tabs in between the first and last |
---|
4 | contained enable tests. |
---|
5 | |
---|
6 | Rappture was able to successfully create the tabs, but the last tab always |
---|
7 | contained data from the first disabled tab. The cause of this problem is that |
---|
8 | gui/scripts/control.tcl, which is in charge of setting up the tabs, gets an |
---|
9 | index of which tab was selected and uses this index to access the name and |
---|
10 | value of the tab to be shown. The index is used in a list which contains all |
---|
11 | possible tabs, not a list that contains only the enabled tabs. The result is |
---|
12 | that when we have a list containing five total tabs numbered 1-5, and tabs |
---|
13 | 1,2, and 5 are enabled, an index of 3 would choose a disabled tab to show. |
---|
14 | |
---|
15 | This problem was solved by adding an additional private variable to the |
---|
16 | controls object that keeps track of which tabs are enabled and shown. We now |
---|
17 | index into the _showing list instead of the _controls list. In the example |
---|
18 | above the _showing list would contain tabs 1, 2 and 5. When the last tab was |
---|
19 | chosen in the graphical user interface, _changeTabs function would receive |
---|
20 | an index of 3 referencing tab 5 and the correct tab would be displayed to the |
---|
21 | user. |
---|
Note: See
TracBrowser
for help on using the repository browser.