Overview
| Artifact ID: | cfc934a67d2838410d5d60a825cd3d767577f871 |
|---|---|
| Ticket: | 2912962fffffffffffffffffffffffffffffffff |
| Date: | 2009-12-12 05:09:49 |
| User: | decosterjos |
| Artifact Attached: | 1a58a8c0f3357def4b86121a2bc69c5e2bb86fa8 |
| Filename: | TabState.c |
| Description: |
Content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41/* * TabState -- * Return the state of the specified tab, based on * notebook state, currentIndex, activeIndex, and user-specified tab state. * The USER1 bit is set for the leftmost tab, and USER2 * is set for the rightmost tab. */ static Ttk_State TabState(Notebook *nb, int index) { Ttk_State state = nb->core.state; Tab *tab = Ttk_SlaveData(nb->notebook.mgr, index); int i = 0; if (index == nb->notebook.currentIndex) { state |= TTK_STATE_SELECTED; } else { state &= ~TTK_STATE_FOCUS; } if (index == nb->notebook.activeIndex) { state |= TTK_STATE_ACTIVE; } for (i = 0; i < Ttk_NumberSlaves(nb->notebook.mgr); ++i) { Tab *tab = Ttk_SlaveData(nb->notebook.mgr, i); if (tab->state == TAB_STATE_HIDDEN) { continue; } if (index == i) { state |= TTK_STATE_USER1; } break; } if (index == Ttk_NumberSlaves(nb->notebook.mgr) - 1) { state |= TTK_STATE_USER2; } if (tab->state == TAB_STATE_DISABLED) { state |= TTK_STATE_DISABLED; } return state; }
