core/vgui/vgui_drag_tableau.h
Go to the documentation of this file.
00001 // This is core/vgui/vgui_drag_tableau.h
00002 #ifndef vgui_drag_tableau_h_
00003 #define vgui_drag_tableau_h_
00004 //:
00005 // \file
00006 // \author Andrew W. Fitzgibbon, Oxford RRG
00007 // \date   11 Jan 00
00008 // \brief  A bare tableau which uses the vgui_drag_mixin.
00009 //
00010 //         Contains classes: vgui_drag_tableau vgui_drag_tableau_new
00011 //
00012 // \verbatim
00013 //  Modifications
00014 //   000111 AWF Initial version.
00015 //   26-APR-2002 K.Y.McGaul - Converted to doxygen style comments.
00016 //   01-OCT-2002 K.Y.McGaul - Moved vgui_drag to vgui_drag_tableau.
00017 //   02-OCT-2002 K.Y.McGaul - Added vgui_drag_tableau_new.
00018 //   10-SEP-2004 Peter Vanroose  Inlined all 1-line methods in class decl
00019 // \endverbatim
00020 
00021 #include <vgui/vgui_tableau.h>
00022 #include <vgui/vgui_drag_mixin.h>
00023 
00024 //: A bare tableau which uses the vgui_drag_mixin
00025 //
00026 //  It is useful for making tableaux which have simple interaction
00027 //  functionality.  It is expected that this tableau would be used
00028 //  as a base class for your own derived tableau, not that this
00029 //  tableau would be used directly.
00030 class vgui_drag_tableau : public vgui_tableau, public vgui_drag_mixin
00031 {
00032  public:
00033   //: Constructor - don't use this, use vgui_drag_tableau_new.
00034   vgui_drag_tableau() {}
00035 
00036  protected:
00037   //: Destructor - called by vgui_drag_tableau_sptr.
00038   ~vgui_drag_tableau() {}
00039 
00040   //: Handle all events sent to this tableau.
00041   bool handle(const vgui_event& e)
00042   {
00043     if (vgui_drag_mixin::handle(e)) return true;
00044     return vgui_tableau::handle(e);
00045   }
00046 };
00047 
00048 #include <vgui/vgui_drag_tableau_sptr.h>
00049 
00050 //: Creates a smart-pointer to a vgui_drag_tableau.
00051 struct vgui_drag_tableau_new : public vgui_drag_tableau_sptr
00052 {
00053   //: Constructor - create a default vgui_drag_tableau.
00054   vgui_drag_tableau_new() : vgui_drag_tableau_sptr(new vgui_drag_tableau) {}
00055 };
00056 
00057 #endif // vgui_drag_tableau_h_