Monday, April 18, 2011

R0.5 NEED HELP - CCHECK

The problem in my ccheck is that I cannot choose the second option. Whatever I press, the 'X' still hold in the first one.
Here is my code:

CCheck::CCheck(bool Checked,const char* Format, const char* Text, int Row, int Col, int Width, bool IsRadio)
 : CField(Row, Col, Width, 1), Label(Text, 0, 4, (Width-4)){
 Label.frame((CFrame*)this);
 _flag = (int) Checked;
    _radio = (int) IsRadio;
 strcpy(_format, Format);
 _data = &_flag;
}
CCheck::CCheck(const CCheck& C): CField(C), Label(C.Label){
 Label.frame((CFrame*)this);
 _flag = C._flag;
 _radio = C._radio;
 strcpy(_format, C._format);
 _data = &_flag;
}
void CCheck::draw(int fn){
 bio_displayflag(_format, absRow(), absCol(), _flag);
 Label.draw(fn);
}
int CCheck::edit(){
 //eturns bio_flag()'s returned value.
 return bio_flag(_format, absRow(), absCol(), &_flag, _radio);
}
bool CCheck::editable()const{
 //Always return true;
 return true;
}
void CCheck::set(const void* flag){
 _flag = (int) flag;
}
bool CCheck::checked()const{
 return true;
}
void CCheck::checked(bool val){
 _flag = val;
}

No comments:

Post a Comment