var-type-dialog: Reduce redundancy.
var_type_dialog_set_state() and on_toggle_2() had considerable
redundant code. This reduces it by adding a new function
on_active_button_change() that generalizes the two functions. I
also personally found the previous way of showing and hiding widgets
to be hard to follow; I think that the bitmap approach used here
is more straightforward.
This also consolidates the two separate signal handlers for each
button into one, and replaces the similar functions
select_treeview_from_format() and select_treeview_from_format_type()
by three functions find_format(), find_format_type(), and
select_treeview_at_index() that total less code.