/* 
 * © 2009 Sun Microsystems, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */
#include "stdafx.h"

#include "mforms/mforms.h"

using namespace mforms;

  

GRTTreeView::GRTTreeView(bool border)
{
  _grttreeview_impl= &ControlFactory::get_instance()->_grttreeview_impl;

  _grttreeview_impl->create(this, border);
}


void GRTTreeView::set_model(bec::TreeModel *model)
{
  _grttreeview_impl->set_model(this, model);
}


int GRTTreeView::add_column(GRTTreeColumnType type, int model_column, const std::string &name)
{
  return _grttreeview_impl->add_column(this, type, model_column, name);
}


int GRTTreeView::add_column_editable(GRTTreeColumnType type, int model_column, const std::string &name)
{
  return _grttreeview_impl->add_column_editable(this, type, model_column, name);
}


void GRTTreeView::refresh(const bec::NodeId &node)
{
  _grttreeview_impl->refresh(this, node);
}


void GRTTreeView::set_column_width(int model_column, int width)
{
  _grttreeview_impl->set_column_width(this, model_column, width);
}


void GRTTreeView::row_activate_callback(const bec::NodeId &node, int column)
{
  _activate_signal.emit(node, column);
}


void GRTTreeView::set_allow_multi_selection(bool flag)
{
  _grttreeview_impl->set_allow_multi_selection(this, flag);
}


bool GRTTreeView::get_selected_node(bec::NodeId &node)
{
  return _grttreeview_impl->get_selected_node(this, node);
}


int GRTTreeView::get_selection(std::vector<bec::NodeId> &nodes)
{
  return _grttreeview_impl->get_selection(this, nodes);
}

