Panda3D
 All Classes Functions Variables Enumerations
mouseWatcherParameter.cxx
00001 // Filename: mouseWatcherParameter.cxx
00002 // Created by:  drose (06Jul01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "mouseWatcherParameter.h"
00016 
00017 ////////////////////////////////////////////////////////////////////
00018 //     Function: MouseWatcherParameter::output
00019 //       Access: Published
00020 //  Description: 
00021 ////////////////////////////////////////////////////////////////////
00022 void MouseWatcherParameter::
00023 output(ostream &out) const {
00024   bool output_anything = false;
00025 
00026   if (has_button()) {
00027     out << _button;
00028     output_anything = true;
00029   }
00030 
00031   if (has_keycode()) {
00032     if (output_anything) {
00033       out << ", ";
00034     }
00035     out << "key" << _keycode;
00036     output_anything = true;
00037   }
00038 
00039   if (_mods.is_any_down()) {
00040     if (output_anything) {
00041       out << ", ";
00042     }
00043     out << _mods;
00044     output_anything = true;
00045   }
00046 
00047   if (has_mouse()) {
00048     if (output_anything) {
00049       out << ", ";
00050     }
00051     out << "(" << _mouse << ")";
00052     output_anything = true;
00053   }
00054 
00055   if (is_outside()) {
00056     if (output_anything) {
00057       out << ", ";
00058     }
00059     out << "outside";
00060     output_anything = true;
00061   }
00062 
00063   if (!output_anything) {
00064     out << "no parameters";
00065   }
00066 }
 All Classes Functions Variables Enumerations