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