00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PAPYRUSHANDLEBOX_H
00020 #define PAPYRUSHANDLEBOX_H
00021
00022 #include <papyrus/boxed.h>
00023
00024 namespace Papyrus {
00025
00029 class Handlebox : public Boxed {
00030 public:
00031
00032 typedef PapyrusSmartPointer<Handlebox> pointer;
00033
00034 Handlebox(Handles handles=CORNER_HANDLES);
00035
00036 static Handlebox::pointer create(Handles handles=CORNER_HANDLES);
00037
00038 virtual ~Handlebox();
00039
00040 void set_handle_shape( Position p, Drawable::pointer shape, bool activate=true );
00041
00042 void set_handle_shape( Handles h, Drawable::pointer shape, bool activate=true );
00043
00044 Drawable::pointer get_handle_shape( Position p );
00045
00046 void activate_handle( Position p, bool activate=true );
00047
00048 void activate_handle( Handles h, bool activate=true );
00049
00050 void deactivate_handle( Position p );
00051
00052 void deactivate_handle( Handles h );
00053
00054 bool is_active( Position p );
00055
00056 bool is_active( Handles h );
00057
00058 int inside_handle( double x, double y );
00059
00060 PAPYRUS_CLASS_NAME("Handle Box");
00061
00062 PAPYRUS_CLONE_METHOD( Handlebox );
00063
00064 protected:
00065 Drawable::pointer m_handle_shape[ 8 ];
00066 bool m_handle_active[8];
00067 bool m_initializing;
00068
00073 virtual void rebuild_extents();
00074
00075 virtual void position_handle( Drawable::pointer, double x, double y );
00076
00077 virtual void on_child_added( Drawable::pointer child );
00078
00079 virtual void on_child_removed( Drawable::pointer child );
00080
00081 };
00082
00083 }
00084
00085 #endif