/* 
 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; version 2 of the
 * License.
 * 
 * This program 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 General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301  USA
 */
#include "tut_stdafx.h"

#include "../stub_menu.h"

namespace mforms
{
namespace stub
{

//------------------------------------------------------------------------------
MenuImpl::MenuImpl(Menu* self)
: ObjectImpl(self)
{
}

//------------------------------------------------------------------------------
bool MenuImpl::create(Menu* self)
{
  return true;
}

//------------------------------------------------------------------------------
void MenuImpl::remove_item(Menu* self, int i)
{
}

//------------------------------------------------------------------------------
int MenuImpl::add_item(Menu* self, const std::string &caption, const std::string &action)
{
  return 0;
}

//------------------------------------------------------------------------------
int MenuImpl::add_separator(Menu* self)
{
  return 0;
}

//------------------------------------------------------------------------------
int MenuImpl::add_submenu(Menu* self, const std::string &caption, Menu *submenu)
{
  return 0;
}

//------------------------------------------------------------------------------
void MenuImpl::set_item_enabled(Menu* self, int i, bool flag)
{
}

//------------------------------------------------------------------------------
void MenuImpl::popup_at(Menu* self, Object *control, int x, int y)
{
}

void  MenuImpl::clear(Menu *self)
{
}

//------------------------------------------------------------------------------
void MenuImpl::init()
{
  ::mforms::ControlFactory *f = ::mforms::ControlFactory::get_instance();

  f->_menu_impl.create = &MenuImpl::create;
  f->_menu_impl.remove_item = &MenuImpl::remove_item;
  f->_menu_impl.add_item = &MenuImpl::add_item;
  f->_menu_impl.add_separator = &MenuImpl::add_separator;
  f->_menu_impl.add_submenu = &MenuImpl::add_submenu;
  f->_menu_impl.set_item_enabled = &MenuImpl::set_item_enabled;
  f->_menu_impl.popup_at = &MenuImpl::popup_at; 
  f->_menu_impl.clear = &MenuImpl::clear; 
}

}
}