00001 // Class QRadioButton 00002 // Filename QRadioButton.h 00003 // FaPra 2003-2004, A5, Alexander Kramer 00004 00005 #ifndef QRadioButton_h 00006 #define QRadioButton_h 00007 00008 #include "QCheckBox.h" 00009 00010 //! Pre-declaration of QRadioButton 00011 class QRadioButton; 00012 00013 #include "QRadioButtonGroup.h" 00014 00015 00016 00017 //! Radio Button 00018 class QRadioButton : public QCheckBox 00019 { 00020 protected: 00021 //! reference to a group 00022 QRadioButtonGroup* RadioButtonGroup; 00023 00024 public: 00025 //! draws itself with OpenGL. Here is the OpenGL drawing code 00026 virtual void draw( QEvent* e ); 00027 00028 //! layout the children widgets. This method is called every time the size is changed. Have to be overwritten for respond on size changes 00029 virtual void layout(); 00030 00031 //! have to return true if widget should be dragged with mouse. This method is overwritten in sub classes. If returns true, widget will be dragged 00032 virtual bool canDrag( QEvent* e ); 00033 00034 //! processing mouse/keyboard events which are in widgets region. Mouse coordinates are relative to Owner 00035 virtual bool processEvent( QEvent* e ); 00036 00037 //! processing mouse events which are in Owner widget region. Mouse coordinates are relative to Owner 00038 virtual bool processMouseOwner( QEvent* e ); 00039 00040 //! called if a child is added/removed 00041 virtual void childrenChanged(); 00042 00043 //! defines whether control can have keyboard focus. Should return true if Widget wants to get keyboard focus 00044 virtual bool canFocus( QEvent* e ); 00045 00046 //! initialization code 00047 virtual void Init(); 00048 00049 //! clean up code 00050 virtual void CleanUp(); 00051 00052 //! getter method for RadioButtonGroup 00053 virtual QRadioButtonGroup* getRadioButtonGroup(); 00054 00055 //! setter method for RadioButtonGroup 00056 virtual void setRadioButtonGroup( QRadioButtonGroup* newValue ); 00057 00058 //! prints itself to the cout 00059 void print(); 00060 00061 //! Constructor 00062 QRadioButton( QWidget* aOwner ); 00063 00064 //! Destructor 00065 virtual ~QRadioButton(); 00066 00067 00068 }; 00069 #endif 00070
1.2.18