Exemple #1
0
std::vector<unsigned int> View::getSelectedChildrenIndexes()
{
    const std::vector<Gtk::FlowBoxChild*> children = get_selected_children();
    std::vector<unsigned int> selectedIndexes;
    ranges::transform(children,
                      ranges::back_inserter(selectedIndexes),
                      std::mem_fn(&Gtk::FlowBoxChild::get_index));

    return selectedIndexes;
}
Exemple #2
0
/**
 * \brief The focus has been set on the frame or one of its children.
 */
void bear::gui::horizontal_flow::on_focused()
{
  iterator it(get_selected_children());

  if ( it != end() )
    m_selected_children = &(*it);
  else if ( begin() != end() )
    {
      m_selected_children = &(*(begin()));
      m_selected_children->set_focus();
    }
} // gui::horizontal_flow::on_focused()
Exemple #3
0
/**
 * \brief Move the cursor one character to the left.
 * \return True if the code has been processed.
 */
bool bear::gui::horizontal_flow::move_left()
{
  bool result(false);

  iterator it=get_selected_children();

  if ( it!=end() && it!=begin() )
    {
      --it;
      m_selected_children = &(*it);
      it->set_focus();
      result = true;
    }

  return result;
} // horizontal_flow::move_left()
Exemple #4
0
/**
 * \brief Move the cursor one character to the right.
 * \return True if the code has been processed.
 */
bool bear::gui::horizontal_flow::move_right()
{
  bool result(false);

  iterator it=get_selected_children();

  if ( it!=end() )
    {
      ++it;
      if ( it!=end() )
        if ( it->get_visible() )
          {
            m_selected_children = &(*it);
            it->set_focus();
            result = true;
          }
    }

  return result;
} // horizontal_flow::move_right()
Exemple #5
0
int View::getSelectedChildIndex()
{
    return get_selected_children().at(0)->get_index();
}