model_server/gala/src/controlObjects.cxx
// This function is designed to generate a check button and perform some
// black magic to show it correctly in the item list. Pointer to this
// check button must be saved somewere to let us remove this button in future.
This function is designed to generate a check button and perform some
black magic to show it correctly in the item list. Pointer to this
check button must be saved somewere to let us remove this button in future.
This function is designed to generate a check button and perform some black magic to show it correctly in the item list . Pointer to this check button must be saved somewere to let us remove this button in future .
gdListCheck* gdListView::CreateCheckButton(int row, int col) {
	const vchar     *value;
	vrect           r;
	gdListCheck*    check;
	check=new gdListCheck(this);
	check->SetClipRect(GetRect());
    value = (const vchar*)GetCellValue(row,col);
    GetCellRect(row, col, &r);
	if(value && vcharLength(value)!=0) {
		check->SetTitle(value);
		r.Inset(&r, 1, 1);
    } else {
		check->SetTitle(vcharGetEmptyString());
		r.Inset(&r, 1, 1);
		int d=r.h;
		r.x=r.x+(r.w-d)/2;
		r.w=d;
	}
    check->SetRect(&r);
	return check;
}
gdListCheck * gdListView :: CreateCheckButton ( int row , int col ) { const vchar * value ; vrect r ; gdListCheck * check ; check = new gdListCheck ( this ) ; check -> SetClipRect ( GetRect ( ) ) ; value = ( const vchar * ) GetCellValue ( row , col ) ; GetCellRect ( row , col , & r ) ; if ( value && vcharLength ( value ) != 0 ) { check -> SetTitle ( value ) ; r . Inset ( & r , 1 , 1 ) ; } else { check -> SetTitle ( vcharGetEmptyString ( ) ) ; r . Inset ( & r , 1 , 1 ) ; int d = r . h ; r . x = r . x + ( r . w - d ) / 2 ; r . w = d ; } check -> SetRect ( & r ) ; return check ; }
This function is designed to generate a check button and perform some
black magic to show it correctly in the item list.
This function is designed to generate a check button and perform some black magic to show it correctly in the item list .
// New check // set it's position