// ALL RIGHTS RESERVED:
// ====================
// The contents of this file, and associated files in this directory, are 
// Copyright (C) SPT , all rights reserved, 2009.
// All software Source Code, Images, Database-Design and code, Graphics Design 
// and source files, and related content (collectively referred to as SOURCE) are 
// Copyright (c) SPT, 2009, All Rights Reserved.
// http://SerialPortTool.com

// PTZ Controller is a Registered Trademark of SerialPortTool.com.


using System;
using System.Data;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections.Generic;
using SPT.PTZ.Core;

namespace PTZController
{
	public delegate void MenuEventHandler(PtzFunction function, int extra);

    public partial class MenuForm : PanelForm
    {
        public MenuForm()
        {
            InitializeComponent();
        }

        private MenuEventHandler m_menuEvent;

        public MenuEventHandler MenuEvent
        {
            get { return m_menuEvent; }
            set { m_menuEvent = value; }
        }

        private void upButton_Click(object sender, EventArgs e)
        {
            MenuEvent(PtzFunction.MenuMove, (int)MenuMoveCommand.moveUp);
        }

        private void rightButton_Click(object sender, EventArgs e)
        {
            MenuEvent(PtzFunction.MenuMove, (int)MenuMoveCommand.moveRight);
        }

        private void downButton_Click(object sender, EventArgs e)
        {
            MenuEvent(PtzFunction.MenuMove, (int)MenuMoveCommand.moveDown);
        }

        private void leftButton_Click(object sender, EventArgs e)
        {
            MenuEvent(PtzFunction.MenuMove, (int)MenuMoveCommand.moveLeft);
        }

        private void menuButton_Click(object sender, EventArgs e)
        {
            MenuEvent(PtzFunction.MenuOpen, 0);
        }

        protected override void HandleClose()
        {
            Close();
        }

        private void MenuForm_Load(object sender, EventArgs e)
        {
            helpProvider1.HelpNamespace = ProductInfo.HelpFile;

        }
    }
}