00001 // Filename: pgMouseWatcherRegion.h 00002 // Created by: drose (02Jul01) 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 #ifndef PGMOUSEWATCHERREGION_H 00016 #define PGMOUSEWATCHERREGION_H 00017 00018 #include "pandabase.h" 00019 00020 #include "mouseWatcherRegion.h" 00021 00022 class PGItem; 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : PGMouseWatcherRegion 00026 // Description : This is a specialization on MouseWatcherRegion, to 00027 // add a bit more fields that are relevant to the PG 00028 // system. Each PGItem corresponds to exactly one 00029 // PGMouseWatcherRegion. 00030 //////////////////////////////////////////////////////////////////// 00031 class EXPCL_PANDA_PGUI PGMouseWatcherRegion : public MouseWatcherRegion { 00032 public: 00033 PGMouseWatcherRegion(PGItem *item); 00034 virtual ~PGMouseWatcherRegion(); 00035 00036 virtual void enter_region(const MouseWatcherParameter ¶m); 00037 virtual void exit_region(const MouseWatcherParameter ¶m); 00038 virtual void within_region(const MouseWatcherParameter ¶m); 00039 virtual void without_region(const MouseWatcherParameter ¶m); 00040 virtual void press(const MouseWatcherParameter ¶m); 00041 virtual void release(const MouseWatcherParameter ¶m); 00042 virtual void keystroke(const MouseWatcherParameter ¶m); 00043 virtual void candidate(const MouseWatcherParameter ¶m); 00044 virtual void move(const MouseWatcherParameter ¶m); 00045 00046 private: 00047 PGItem *_item; 00048 static int _next_index; 00049 00050 public: 00051 static TypeHandle get_class_type() { 00052 return _type_handle; 00053 } 00054 static void init_type() { 00055 MouseWatcherRegion::init_type(); 00056 register_type(_type_handle, "PGMouseWatcherRegion", 00057 MouseWatcherRegion::get_class_type()); 00058 } 00059 virtual TypeHandle get_type() const { 00060 return get_class_type(); 00061 } 00062 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00063 00064 private: 00065 static TypeHandle _type_handle; 00066 00067 friend class PGItem; 00068 }; 00069 00070 #include "pgMouseWatcherRegion.I" 00071 00072 #endif