diff --git a/panda/src/gui/guiButton.I b/panda/src/gui/guiButton.I index a4ffc0a0e8..b82381a162 100644 --- a/panda/src/gui/guiButton.I +++ b/panda/src/gui/guiButton.I @@ -47,7 +47,7 @@ INLINE void GuiButton::up(void) { switch_state(UP_ROLLOVER); break; default: - gui_cat->warning() << "got up from invalid state (" << _state << ")" + gui_cat->warning() << "got up from invalid state (" << (int)_state << ")" << endl; } } @@ -61,7 +61,7 @@ INLINE void GuiButton::down(void) { switch_state(DOWN_ROLLOVER); break; default: - gui_cat->warning() << "got down from invalid state (" << _state << ")" + gui_cat->warning() << "got down from invalid state (" << (int)_state << ")" << endl; } } @@ -77,8 +77,8 @@ INLINE void GuiButton::inactive(void) { switch_state(INACTIVE_ROLLOVER); break; default: - gui_cat->warning() << "got inactive from invalid state (" << _state << ")" - << endl; + gui_cat->warning() << "got inactive from invalid state (" << (int)_state + << ")" << endl; } } @@ -95,8 +95,8 @@ INLINE void GuiButton::click(void) { case INACTIVE: break; default: - gui_cat->warning() << "got click from invalid state (" << _state << ")" - << endl; + gui_cat->warning() << "got click from invalid state (" << (int)_state + << ")" << endl; } } diff --git a/panda/src/gui/guiButton.cxx b/panda/src/gui/guiButton.cxx index 8e2f318832..ccabc31293 100644 --- a/panda/src/gui/guiButton.cxx +++ b/panda/src/gui/guiButton.cxx @@ -86,7 +86,7 @@ void GuiButton::switch_state(GuiButton::States nstate) { _mgr->remove_label(_inactive); break; default: - gui_cat->warning() << "switching away from invalid state (" << _state + gui_cat->warning() << "switching away from invalid state (" << (int)_state << ")" << endl; } _state = nstate; @@ -150,7 +150,7 @@ void GuiButton::switch_state(GuiButton::States nstate) { _rgn->trap_clicks(false); break; default: - gui_cat->warning() << "switched to invalid state (" << _state << ")" + gui_cat->warning() << "switched to invalid state (" << (int)_state << ")" << endl; } } @@ -165,10 +165,10 @@ void GuiButton::recompute_frame(void) { GuiButton::GuiButton(const string& name, GuiLabel* up, GuiLabel* up_roll, GuiLabel* down, GuiLabel* down_roll, GuiLabel* inactive) : GuiItem(name), _up(up), _up_rollover(up_roll), _down(down), - _down_rollover(down_roll), _inactive(inactive), _state(GuiButton::NONE), - _up_event(name + "-up"), _up_rollover_event(name + "-up-rollover"), - _down_event(name +"-down"), _down_rollover_event(name + "-down-rollover"), - _inactive_event(name + "-inactive") { + _down_rollover(down_roll), _inactive(inactive), _up_event(name + "-up"), + _up_rollover_event(name + "-up-rollover"), _down_event(name +"-down"), + _down_rollover_event(name + "-down-rollover"), + _inactive_event(name + "-inactive"), _state(GuiButton::NONE) { GetExtents(up, down, up_roll, down_roll, inactive, _left, _right, _bottom, _top); _rgn = new GuiRegion("button-" + name, _left, _right, _bottom, _top, true); @@ -247,5 +247,5 @@ void GuiButton::output(ostream& os) const { os << " inactive event - '" << _inactive_event << "'" << endl; os << " rgn - 0x" << (void*)_rgn << endl; os << " frame - " << _rgn->get_frame() << endl; - os << " state - " << _state << endl; + os << " state - " << (int)_state << endl; } diff --git a/panda/src/gui/guiButton.h b/panda/src/gui/guiButton.h index 7e285ed09f..30a72b2e4e 100644 --- a/panda/src/gui/guiButton.h +++ b/panda/src/gui/guiButton.h @@ -32,7 +32,7 @@ private: public: GuiButton(const string&, GuiLabel*, GuiLabel*, GuiLabel*, GuiLabel*, GuiLabel*); - ~GuiButton(void); + virtual ~GuiButton(void); virtual void manage(GuiManager*, EventHandler&); virtual void unmanage(void); diff --git a/panda/src/gui/guiFrame.cxx b/panda/src/gui/guiFrame.cxx index 14c74ec520..38e70650b4 100644 --- a/panda/src/gui/guiFrame.cxx +++ b/panda/src/gui/guiFrame.cxx @@ -7,7 +7,7 @@ GuiFrame::Boxes::iterator GuiFrame::find_box(GuiItem* item) { bool found = false; - Boxes::iterator ret; + Boxes::iterator ret = _items.end(); Boxes::iterator i; for (i=_items.begin(); (!found)&&(i!=_items.end()); ++i) if ((*i).get_item() == item) { @@ -79,7 +79,7 @@ void GuiFrame::recompute_frame(void) { } break; default: - gui_cat->warning() << "unknown packing type (" << pack << ")" + gui_cat->warning() << "unknown packing type (" << (int)pack << ")" << endl; } } @@ -198,7 +198,7 @@ void GuiFrame::output(ostream& os) const { int n = (*i).get_num_links(); if (n > 0) { for (int j=0; jget_num_children(dgt); ++i) if (mak->get_child(dgt, i)->get_child()->get_type() == MouseWatcher::get_class_type()) { diff --git a/panda/src/gui/guiRollover.h b/panda/src/gui/guiRollover.h index 3c5ec1119d..c1cc9306f3 100644 --- a/panda/src/gui/guiRollover.h +++ b/panda/src/gui/guiRollover.h @@ -23,7 +23,7 @@ private: virtual void recompute_frame(void); public: GuiRollover(const string&, GuiLabel*, GuiLabel*); - ~GuiRollover(void); + virtual ~GuiRollover(void); virtual void manage(GuiManager*, EventHandler&); virtual void unmanage(void);