mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -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::
|
||||
make_copy() const {
|
||||
LightReMutexHolder holder(_lock);
|
||||
return new PGButton(*this);
|
||||
}
|
||||
|
||||
@ -81,7 +80,6 @@ make_copy() const {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PGButton::
|
||||
enter_region(const MouseWatcherParameter ¶m) {
|
||||
LightReMutexHolder holder(_lock);
|
||||
if (get_active()) {
|
||||
set_state(_button_down ? S_depressed : S_rollover);
|
||||
}
|
||||
@ -96,7 +94,6 @@ enter_region(const MouseWatcherParameter ¶m) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PGButton::
|
||||
exit_region(const MouseWatcherParameter ¶m) {
|
||||
LightReMutexHolder holder(_lock);
|
||||
if (get_active()) {
|
||||
set_state(S_ready);
|
||||
}
|
||||
@ -112,7 +109,6 @@ exit_region(const MouseWatcherParameter ¶m) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PGButton::
|
||||
press(const MouseWatcherParameter ¶m, bool background) {
|
||||
LightReMutexHolder holder(_lock);
|
||||
if (has_click_button(param.get_button())) {
|
||||
if (get_active()) {
|
||||
_button_down = true;
|
||||
@ -131,7 +127,6 @@ press(const MouseWatcherParameter ¶m, bool background) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PGButton::
|
||||
release(const MouseWatcherParameter ¶m, bool background) {
|
||||
LightReMutexHolder holder(_lock);
|
||||
if (has_click_button(param.get_button())) {
|
||||
_button_down = false;
|
||||
if (get_active()) {
|
||||
@ -154,7 +149,6 @@ release(const MouseWatcherParameter ¶m, bool background) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PGButton::
|
||||
click(const MouseWatcherParameter ¶m) {
|
||||
LightReMutexHolder holder(_lock);
|
||||
PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param);
|
||||
string event = get_click_event(param.get_button());
|
||||
play_sound(event);
|
||||
@ -176,7 +170,6 @@ click(const MouseWatcherParameter ¶m) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PGButton::
|
||||
setup(const string &label, float bevel) {
|
||||
LightReMutexHolder holder(_lock);
|
||||
clear_state_def(S_ready);
|
||||
clear_state_def(S_depressed);
|
||||
clear_state_def(S_rollover);
|
||||
@ -233,7 +226,6 @@ setup(const string &label, float bevel) {
|
||||
void PGButton::
|
||||
setup(const NodePath &ready, const NodePath &depressed,
|
||||
const NodePath &rollover, const NodePath &inactive) {
|
||||
LightReMutexHolder holder(_lock);
|
||||
clear_state_def(S_ready);
|
||||
clear_state_def(S_depressed);
|
||||
clear_state_def(S_rollover);
|
||||
@ -254,7 +246,6 @@ setup(const NodePath &ready, const NodePath &depressed,
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PGButton::
|
||||
set_active(bool active) {
|
||||
LightReMutexHolder holder(_lock);
|
||||
if (active != get_active()) {
|
||||
PGItem::set_active(active);
|
||||
set_state(active ? S_ready : S_inactive);
|
||||
@ -271,7 +262,6 @@ set_active(bool active) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool PGButton::
|
||||
add_click_button(const ButtonHandle &button) {
|
||||
LightReMutexHolder holder(_lock);
|
||||
return _click_buttons.insert(button).second;
|
||||
}
|
||||
|
||||
@ -286,7 +276,6 @@ add_click_button(const ButtonHandle &button) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool PGButton::
|
||||
remove_click_button(const ButtonHandle &button) {
|
||||
LightReMutexHolder holder(_lock);
|
||||
return (_click_buttons.erase(button) != 0);
|
||||
}
|
||||
|
||||
@ -299,6 +288,6 @@ remove_click_button(const ButtonHandle &button) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool PGButton::
|
||||
has_click_button(const ButtonHandle &button) {
|
||||
LightReMutexHolder holder(_lock);
|
||||
return (_click_buttons.count(button) != 0);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user