Main Page | Namespace List | Class Hierarchy | Data Structures | File List | Data Fields | Globals

activeleaf.h

Go to the documentation of this file.
00001 //--- < ACTIVELEAF.H > ----------| ViewGraph - A Flexible Graph view Framework |
00002 //
00003 // Active leaves respond to mouseOn/mouseOff
00004 // events by repainting and changing cursor 
00005 // shape. They can repaint for selected/unselected
00006 // state, however, they do not keep selection
00007 // state (that would be a waste of memory). You
00008 // must use a SelectionGroup for that.
00009 // 
00010 // $Author: botik32 $
00011 // $Revision: 1.2 $
00012 // $Date: 2004/05/03 21:02:01 $
00013 //-----------------------------------------------------------------------------/
00014 
00015 #ifndef ACTIVELEAF_H
00016 #define ACTIVELEAF_H
00017 
00018 #include <cZUI/leafnode.h>
00019 #include <cZUI/drivers/surfacedriver.h>
00020 
00021 class ActiveLeaf;
00022 class MouseDownEvent;
00023 class MouseUpEvent;
00024 
00025 typedef void (ActiveLeaf::*paintfunc)( Camera * );
00026 
00027 // A leaf with predefined roles of a hover/normal 
00028 // or normal/selected "widget".
00029 class ActiveLeaf : public LeafNode
00030 {
00031 protected:
00032         virtual void paint( Camera * )=0;
00033         virtual void paint_hover( Camera *c ){ paint(c); };
00034         virtual void paint_selected( Camera *c ){ paint(c); };
00035         virtual void paint_selected_inactive( Camera *c )
00036         { paint(c); };
00037         virtual paintfunc get_paintfunc( Camera * );
00038 public:
00039         virtual void mouse_down( MouseDownEvent * );
00040         virtual void mouse_up( MouseUpEvent * );
00041         bool handle_event( Event * );
00042         bool handle_message( Message * );
00043         ActiveLeaf( double, double );   
00044 };
00045 
00046 #endif
00047 
00048 /// $Log: activeleaf.h,v $
00049 /// Revision 1.2  2004/05/03 21:02:01  botik32
00050 /// Significant changes and many bugfixes.
00051 /// ScrollableView now has a background color used to
00052 /// tell SurfaceDriver to clear with.
00053 /// SurfaceDriver's clear() requires a color now
00054 /// Added SceneEvents for all node additions/removals
00055 /// in GroupNode and Camera.
00056 /// Added paint_selected and paint_selected_invalid
00057 /// to ActiveLeaf
00058 /// Modified ActiveLeaf's mouse_down and mouse_up
00059 /// handler signatures to accept an Event* instead of
00060 /// Camera*
00061 /// - Many more bugfixes
00062 ///
00063 /// Revision 1.1.1.1  2004/03/26 10:50:26  botik32
00064 /// Initial release
00065 ///
00066 /// Revision 1.1.1.1  2004/03/26 08:53:33  botik
00067 /// initial import
00068 ///
00069 ///
00070 /// Revision 1.2  2003/12/04 15:02:20  botik
00071 /// Changed activeleaf to have mouse_down and mouse_up
00072 /// functions as public
00073 ///
00074 /// Revision 1.1  2003/11/16 10:04:39  botik
00075 /// added active leaf nodes that simplify library usage
00076 ///

Generated on Wed Jun 23 18:47:20 2004 for cZUI by doxygen 1.3.5