void GuiDlgStateSelect::OnUpdateScreen(void)
{
    int sel = list->GetSelectedItem();
    if( sel >= 0 && sel != last_selected ) {
        SetSelectedState(last_index, sel);
    }
}
unsigned int ON_ComponentStatus::SetSelectedState(
    bool bSelectedState,
    bool bPersistent,
    bool bSynchronizeHighlight
  )
{
  if (bSelectedState)
  {
    return 
      bPersistent
      ? SetSelectedState(ON_ComponentState::SelectedPersistent, bSynchronizeHighlight)
      : SetSelectedState(ON_ComponentState::Selected, bSynchronizeHighlight)
      ;
  }
  return SetSelectedState(ON_ComponentState::NotSelected, bSynchronizeHighlight);
}