mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
1.20 + ordering issue fix, so I can tag this for 1.5.4
This commit is contained in:
parent
6cd8951d9c
commit
addb68b630
@ -69,7 +69,6 @@ PGButton(const PGButton ©) :
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
PandaNode *PGButton::
|
PandaNode *PGButton::
|
||||||
make_copy() const {
|
make_copy() const {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
return new PGButton(*this);
|
return new PGButton(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +80,6 @@ make_copy() const {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void PGButton::
|
void PGButton::
|
||||||
enter_region(const MouseWatcherParameter ¶m) {
|
enter_region(const MouseWatcherParameter ¶m) {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
if (get_active()) {
|
if (get_active()) {
|
||||||
set_state(_button_down ? S_depressed : S_rollover);
|
set_state(_button_down ? S_depressed : S_rollover);
|
||||||
}
|
}
|
||||||
@ -96,7 +94,6 @@ enter_region(const MouseWatcherParameter ¶m) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void PGButton::
|
void PGButton::
|
||||||
exit_region(const MouseWatcherParameter ¶m) {
|
exit_region(const MouseWatcherParameter ¶m) {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
if (get_active()) {
|
if (get_active()) {
|
||||||
set_state(S_ready);
|
set_state(S_ready);
|
||||||
}
|
}
|
||||||
@ -112,7 +109,6 @@ exit_region(const MouseWatcherParameter ¶m) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void PGButton::
|
void PGButton::
|
||||||
press(const MouseWatcherParameter ¶m, bool background) {
|
press(const MouseWatcherParameter ¶m, bool background) {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
if (has_click_button(param.get_button())) {
|
if (has_click_button(param.get_button())) {
|
||||||
if (get_active()) {
|
if (get_active()) {
|
||||||
_button_down = true;
|
_button_down = true;
|
||||||
@ -131,7 +127,6 @@ press(const MouseWatcherParameter ¶m, bool background) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void PGButton::
|
void PGButton::
|
||||||
release(const MouseWatcherParameter ¶m, bool background) {
|
release(const MouseWatcherParameter ¶m, bool background) {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
if (has_click_button(param.get_button())) {
|
if (has_click_button(param.get_button())) {
|
||||||
_button_down = false;
|
_button_down = false;
|
||||||
if (get_active()) {
|
if (get_active()) {
|
||||||
@ -154,7 +149,6 @@ release(const MouseWatcherParameter ¶m, bool background) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void PGButton::
|
void PGButton::
|
||||||
click(const MouseWatcherParameter ¶m) {
|
click(const MouseWatcherParameter ¶m) {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param);
|
PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param);
|
||||||
string event = get_click_event(param.get_button());
|
string event = get_click_event(param.get_button());
|
||||||
play_sound(event);
|
play_sound(event);
|
||||||
@ -176,7 +170,6 @@ click(const MouseWatcherParameter ¶m) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void PGButton::
|
void PGButton::
|
||||||
setup(const string &label, float bevel) {
|
setup(const string &label, float bevel) {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
clear_state_def(S_ready);
|
clear_state_def(S_ready);
|
||||||
clear_state_def(S_depressed);
|
clear_state_def(S_depressed);
|
||||||
clear_state_def(S_rollover);
|
clear_state_def(S_rollover);
|
||||||
@ -233,7 +226,6 @@ setup(const string &label, float bevel) {
|
|||||||
void PGButton::
|
void PGButton::
|
||||||
setup(const NodePath &ready, const NodePath &depressed,
|
setup(const NodePath &ready, const NodePath &depressed,
|
||||||
const NodePath &rollover, const NodePath &inactive) {
|
const NodePath &rollover, const NodePath &inactive) {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
clear_state_def(S_ready);
|
clear_state_def(S_ready);
|
||||||
clear_state_def(S_depressed);
|
clear_state_def(S_depressed);
|
||||||
clear_state_def(S_rollover);
|
clear_state_def(S_rollover);
|
||||||
@ -254,7 +246,6 @@ setup(const NodePath &ready, const NodePath &depressed,
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void PGButton::
|
void PGButton::
|
||||||
set_active(bool active) {
|
set_active(bool active) {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
if (active != get_active()) {
|
if (active != get_active()) {
|
||||||
PGItem::set_active(active);
|
PGItem::set_active(active);
|
||||||
set_state(active ? S_ready : S_inactive);
|
set_state(active ? S_ready : S_inactive);
|
||||||
@ -271,7 +262,6 @@ set_active(bool active) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool PGButton::
|
bool PGButton::
|
||||||
add_click_button(const ButtonHandle &button) {
|
add_click_button(const ButtonHandle &button) {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
return _click_buttons.insert(button).second;
|
return _click_buttons.insert(button).second;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,7 +276,6 @@ add_click_button(const ButtonHandle &button) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool PGButton::
|
bool PGButton::
|
||||||
remove_click_button(const ButtonHandle &button) {
|
remove_click_button(const ButtonHandle &button) {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
return (_click_buttons.erase(button) != 0);
|
return (_click_buttons.erase(button) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,6 +288,6 @@ remove_click_button(const ButtonHandle &button) {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool PGButton::
|
bool PGButton::
|
||||||
has_click_button(const ButtonHandle &button) {
|
has_click_button(const ButtonHandle &button) {
|
||||||
LightReMutexHolder holder(_lock);
|
|
||||||
return (_click_buttons.count(button) != 0);
|
return (_click_buttons.count(button) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user