mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
stuff
This commit is contained in:
parent
9a567761c7
commit
ba117e608b
@ -17,7 +17,8 @@ void GuiBehavior::BehaviorFunctor::doit(GuiBehavior*) {
|
||||
}
|
||||
|
||||
GuiBehavior::GuiBehavior(const string& name) : GuiItem(name),
|
||||
_eh((EventHandler*)0L) {
|
||||
_eh((EventHandler*)0L),
|
||||
_behavior_running(false) {
|
||||
}
|
||||
|
||||
GuiBehavior::~GuiBehavior(void) {
|
||||
|
@ -450,6 +450,8 @@ void GuiButton::start_behavior(void) {
|
||||
GuiBehavior::start_behavior();
|
||||
if (_mgr == (GuiManager*)0L)
|
||||
return;
|
||||
if (!this->is_active())
|
||||
return;
|
||||
_eh->add_hook(_down_event, GuiButton::behavior_down, (void*)this);
|
||||
_eh->add_hook(_down_rollover_event, GuiButton::behavior_down, (void*)this);
|
||||
}
|
||||
|
@ -16,9 +16,9 @@ GuiChooser::ChooseFunctor::~ChooseFunctor(void) {
|
||||
}
|
||||
|
||||
void GuiChooser::ChooseFunctor::doit(GuiBehavior* b) {
|
||||
if (b == this->_ch->_prev_button)
|
||||
if ((b == this->_ch->_prev_button) && this->_ch->_prev_button->is_active())
|
||||
this->_ch->move_prev();
|
||||
if (b == this->_ch->_next_button)
|
||||
if ((b == this->_ch->_next_button) && this->_ch->_next_button->is_active())
|
||||
this->_ch->move_next();
|
||||
}
|
||||
|
||||
@ -50,13 +50,23 @@ void GuiChooser::move_prev(void) {
|
||||
_items[tmp]->manage(_mgr, *_eh);
|
||||
if (tmp == 0)
|
||||
_prev_button->inactive();
|
||||
else
|
||||
else {
|
||||
_prev_button->up();
|
||||
if (_behavior_running) {
|
||||
_prev_button->start_behavior();
|
||||
_prev_button->set_behavior_functor(_prev_functor);
|
||||
}
|
||||
}
|
||||
int foo = _items.size() - 1;
|
||||
if (tmp == foo)
|
||||
_next_button->inactive();
|
||||
else
|
||||
else {
|
||||
_next_button->up();
|
||||
if (_behavior_running) {
|
||||
_next_button->start_behavior();
|
||||
_next_button->set_behavior_functor(_next_functor);
|
||||
}
|
||||
}
|
||||
}
|
||||
_curr = tmp;
|
||||
}
|
||||
@ -77,12 +87,23 @@ void GuiChooser::move_next(void) {
|
||||
_items[tmp]->manage(_mgr, *_eh);
|
||||
if (tmp == 0)
|
||||
_prev_button->inactive();
|
||||
else
|
||||
else {
|
||||
_prev_button->up();
|
||||
if (tmp == (_items.size() - 1))
|
||||
if (_behavior_running) {
|
||||
_prev_button->start_behavior();
|
||||
_prev_button->set_behavior_functor(_prev_functor);
|
||||
}
|
||||
}
|
||||
int foo = _items.size() - 1;
|
||||
if (tmp == foo)
|
||||
_next_button->inactive();
|
||||
else
|
||||
else {
|
||||
_next_button->up();
|
||||
if (_behavior_running) {
|
||||
_next_button->start_behavior();
|
||||
_next_button->set_behavior_functor(_next_functor);
|
||||
}
|
||||
}
|
||||
}
|
||||
_curr = tmp;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user