#ifndef GUIFIXED_HEADER #define GUIFIXED_HEADER 1 ////////////////////////////////////////////////////////// //! rcsid="$Id: Fixed.hh,v 1.6 2000/07/07 12:59:12 ees1cg Exp $" //! file="amma/GUI/GTK/Fixed.hh" //! lib=GUI //! docentry="GUI.Widget" //! author="Charles Galambos" //! date="17/06/99" #include "amma/GUI/CWidget.hh" #include "amma/Pixel.hh" #include "amma/PThread/MsgPipe.hh" #include "amma/Tuple2.hh" #include "amma/HashAR.hh" //! userlevel=Develop //: Fixed layout widget. class GUIFixedWidgetBodyC : public GUIContainerWidgetBodyC { public: GUIFixedWidgetBodyC(); //: Default constructor. virtual BooleanT Create(); //: Create the widget. virtual BooleanT Service(); //: Service render request. BooleanT Move(GUIWidgetC &widge,PixelC where); //: Move a widget. // Must be called from the GUI thread. virtual BooleanT Add(const GUIWidgetC &widge); //: Add a child widget. // Must be called from the GUI thread. void AddWidget(const GUIWidgetC &newun,PixelC where); //: Add new widget. // Thread safe. void GUIAddWidget(GUIWidgetC &newun,PixelC &where); //: Add new widget. // GUI thread only. protected: virtual PixelC Position(const GUIWidgetC &widge); //: Where should we place this widget. HashARC where; // Table of widget locations. PThread::MsgPipeC > newuns; // Widgets mods. int defaultPos; }; //! userlevel=Normal //: Fixed layout widget. class GUIFixedWidgetC : public GUIContainerWidgetC { public: GUIFixedWidgetC() : DPEntityC(aTRUE) {} //: Default constructor. // Creates an invalid handle. GUIFixedWidgetC(BooleanT) : DPEntityC(*new GUIFixedWidgetBodyC()) {} //: Default constructor. // Creates an invalid handle. protected: GUIFixedWidgetC(GUIFixedWidgetBodyC &bod) : DPEntityC(bod) {} //: Body constructor. GUIFixedWidgetBodyC &Body() { return dynamic_cast(DPEntityC::Body()); } //: Access body. const GUIFixedWidgetBodyC &Body() const { return dynamic_cast(DPEntityC::Body()); } //: Access body. public: void GUIAddWidget(GUIWidgetC &newun,PixelC &where) { Body().GUIAddWidget(newun,where); } //: Add new widget. // GUI thread only. void AddWidget(const GUIWidgetC &newun,PixelC where) { Body().AddWidget(newun,where); } //: Add new widget. // Thread safe. void MoveWidget(const GUIWidgetC &newun,PixelC where) { Body().AddWidget(newun,where); } //: Move a widget // Thread safe. friend class GUIFixedWidgetBodyC; }; #endif