Overview
| Artifact ID: | cfc934a67d2838410d5d60a825cd3d767577f871 |
|---|---|
| Ticket: | 2912962fffffffffffffffffffffffffffffffff |
| Date: | 2009-12-12 05:09:49 |
| User: | decosterjos |
| Artifact Attached: | 1a58a8c0f3357def4b86121a2bc69c5e2bb86fa8 |
| Filename: | TabState.c |
| Description: |
Content:
/*
* 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;
}
