00001 // Class QRadioButtonGroup 00002 // Radio Button Group 00003 // Filename QRadioButtonGroup.cpp 00004 // FaPra 2003-2004, A5, Alexander Kramer 00005 00006 00007 #include "QRadioButtonGroup.h" 00008 #include <iostream> 00009 using namespace std; 00010 00011 // ---------------------------------------------------------- 00012 00013 //! adds a button to this group 00014 void QRadioButtonGroup::add( QRadioButton* button ) 00015 { 00016 if (button != 0) Items.push_front(button); 00017 00018 } // end of add() 00019 00020 //! removes a button from this group 00021 void QRadioButtonGroup::remove( QRadioButton* button ) 00022 { 00023 Items.remove(button); 00024 } // end of remove() 00025 00026 //! sets given radio button as selected 00027 void QRadioButtonGroup::setAsSelected( QRadioButton* button ) 00028 { 00029 00030 list<QRadioButton*>::const_iterator iter; 00031 // Iterate through list 00032 for (iter=Items.begin(); iter != Items.end(); iter++) 00033 { 00034 if ((*iter) != button) 00035 { 00036 (*iter)->setState(cbUnchecked); 00037 } 00038 else 00039 { 00040 (*iter)->setState(cbChecked); 00041 } 00042 } 00043 } // end of setAsSelected() 00044 00045 // WARNING : The implementation of this method will be automatically generated with code generator. 00046 // To prevent this add '//KEEP' at the first line of the implementation.(first line after '{') 00047 //! prints itself to the cout 00048 void QRadioButtonGroup::print() 00049 { 00050 //KEEP 00051 cout << "Class : QRadioButtonGroup" << endl; 00052 cout << "Items.size() = " << Items.size() << endl; 00053 } // end of print() 00054 00055 // WARNING : The implementation of this method will be automatically generated with code generator. 00056 // To prevent this add '//KEEP' at the first line of the implementation.(first line after '{') 00057 //! Constructor 00058 QRadioButtonGroup::QRadioButtonGroup( ) 00059 { 00060 } // end of QRadioButtonGroup() 00061 00062 // WARNING : The implementation of this method will be automatically generated with code generator. 00063 // To prevent this add '//KEEP' at the first line of the implementation.(first line after '{') 00064 //! Destructor 00065 QRadioButtonGroup::~QRadioButtonGroup() 00066 { 00067 } // end of ~QRadioButtonGroup() 00068 00069 // end of implementation of QRadioButtonGroup 00070 00071
1.2.18