Panda3D

pgItemNotify.h

00001 // Filename: pgItemNotify.h
00002 // Created by:  drose (18Aug05)
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 PGITEMNOTIFY_H
00016 #define PGITEMNOTIFY_H
00017 
00018 #include "pandabase.h"
00019 #include "pset.h"
00020 
00021 class PGItem;
00022 class MouseWatcherParameter;
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //       Class : PGItemNotify
00026 // Description : Objects that inherit from this class can receive
00027 //               specialized messages when PGItems change in certain
00028 //               ways.
00029 ////////////////////////////////////////////////////////////////////
00030 class EXPCL_PANDA_PGUI PGItemNotify {
00031 public:
00032   INLINE PGItemNotify();
00033   virtual ~PGItemNotify();
00034 
00035 protected:
00036   virtual void item_transform_changed(PGItem *item);
00037   virtual void item_frame_changed(PGItem *item);
00038   virtual void item_draw_mask_changed(PGItem *item);
00039 
00040   virtual void item_enter(PGItem *item, const MouseWatcherParameter &param);
00041   virtual void item_exit(PGItem *item, const MouseWatcherParameter &param);
00042   virtual void item_within(PGItem *item, const MouseWatcherParameter &param);
00043   virtual void item_without(PGItem *item, const MouseWatcherParameter &param);
00044   virtual void item_focus_in(PGItem *item);
00045   virtual void item_focus_out(PGItem *item);
00046   virtual void item_press(PGItem *item, const MouseWatcherParameter &param);
00047   virtual void item_release(PGItem *item, const MouseWatcherParameter &param);
00048   virtual void item_keystroke(PGItem *item, const MouseWatcherParameter &param);
00049   virtual void item_candidate(PGItem *item, const MouseWatcherParameter &param);
00050   virtual void item_move(PGItem *item, const MouseWatcherParameter &param);
00051 
00052 protected:
00053   void add_item(PGItem *item);
00054   void remove_item(PGItem *item);
00055 
00056 private:
00057   typedef pset<PGItem *> Items;
00058   Items _items;
00059 
00060   friend class PGItem;
00061 };
00062 
00063 #include "pgItemNotify.I"
00064 
00065 #endif
 All Classes Functions Variables Enumerations