No matter what post type you select, it shows default posts only. That's because on line 45 the code is
$args = 'numberposts=' . $number . '&offset' . $offset . '&post_type' . $posttype . '&cat=' . $cat;
whereas it should be
$args = 'numberposts=' . $number . '&offset=' . $offset . '&post_type=' . $posttype . '&cat=' . $cat;
Also Want to give a suggestion. Default Recent posts widget does not show dates but this one shows. I don't want to show dates in it so please include option to remove the dates or remove them by default.