public Menu_Container(Menu_Layer menuLayer, String user)
        {
            this.User = user;
            recycleButton = new Menu_Recycle_Bin(this);
            ImageBrush ib = new ImageBrush();
            ib.ImageSource = new BitmapImage(new Uri(@"Resource\Image\menu_bg.png", UriKind.Relative));
            this.Background = ib;
            this.menuLayer = menuLayer;
            this.Height = STATICS.MENU_BAR_SIZE.Height;
            this.Width = STATICS.MENU_BAR_SIZE.Width;
            addBoxButton.Width = (this.Width - 200) / 3;
            addBoxButton.Height = (this.Height - 10);
            addBoxButton.Content = "Create Box";
            Canvas.SetLeft(addBoxButton, 50);
            Canvas.SetTop(addBoxButton, 5);
            this.Children.Add(addBoxButton);
            addBoxButton.Click += AddBoxButton_Click;

            RecycleButton.Width = (this.Width - 200) / 3;
            RecycleButton.Height = (this.Height - 10);
            Canvas.SetLeft(RecycleButton, 100 + addBoxButton.Width);
            Canvas.SetTop(RecycleButton, 5);
            this.Children.Add(RecycleButton);

            resetButton.Width = (this.Width - 200) / 3;
            resetButton.Height = (this.Height - 10);
            resetButton.Content = "Reset";
            resetButton.TouchDown += ResetButton_Pressed;
            resetButton.TouchUp += ResetButton_Released;
            Canvas.SetLeft(resetButton, 150 + addBoxButton.Width + RecycleButton.Width);
            Canvas.SetTop(resetButton, 5);
            this.Children.Add(resetButton);

            InitializeComponent();
        }
Пример #2
0
        protected override bool checkValid(object[] senders, My_Point[] myPoints)
        {
            Menu_Sort_Box    categoryBox = senders[0] as Menu_Sort_Box;
            Menu_Recycle_Bin recycleBox  = senders[1] as Menu_Recycle_Bin;

            if (recycleBox != null && categoryBox != null && Math.Sqrt(Math.Pow((categoryBox.CurrentPosition.X - recycleBox.XCoord), 2) +
                                                                       Math.Pow((categoryBox.CurrentPosition.Y - recycleBox.YCoord), 2))
                < 50)
            {
                return(true);
            }
            return(false);
        }
Пример #3
0
        public override void Terminate(object[] senders, My_Point[] myPoints)
        {
            if (myPoints != null && senders != null)
            {
                Gesture_Event_Args gestureEventArgs = new Gesture_Event_Args();
                gestureEventArgs.GesturePoints  = myPoints;
                gestureEventArgs.GestureObjects = senders;
                this.Status = GESTURESTATUS.TERMINATE;
                OnTerminated(this, gestureEventArgs);
            }
            Menu_Recycle_Bin mc = senders[1] as Menu_Recycle_Bin;

            if (mc != null)
            {
                mc.Mc.removeRecycleNotification();
            }
        }
Пример #4
0
        public Menu_Container(Menu_Layer menuLayer, String user)
        {
            this.User     = user;
            recycleButton = new Menu_Recycle_Bin(this);
            ImageBrush ib = new ImageBrush();

            ib.ImageSource       = new BitmapImage(new Uri(@"Resource\Image\menu_bg.png", UriKind.Relative));
            this.Background      = ib;
            this.menuLayer       = menuLayer;
            this.Height          = STATICS.MENU_BAR_SIZE.Height;
            this.Width           = STATICS.MENU_BAR_SIZE.Width;
            addBoxButton.Width   = (this.Width - 200) / 3;
            addBoxButton.Height  = (this.Height - 10);
            addBoxButton.Content = "Create Box";
            Canvas.SetLeft(addBoxButton, 50);
            Canvas.SetTop(addBoxButton, 5);
            this.Children.Add(addBoxButton);
            addBoxButton.Click += AddBoxButton_Click;

            RecycleButton.Width  = (this.Width - 200) / 3;
            RecycleButton.Height = (this.Height - 10);
            Canvas.SetLeft(RecycleButton, 100 + addBoxButton.Width);
            Canvas.SetTop(RecycleButton, 5);
            this.Children.Add(RecycleButton);

            resetButton.Width      = (this.Width - 200) / 3;
            resetButton.Height     = (this.Height - 10);
            resetButton.Content    = "Reset";
            resetButton.TouchDown += ResetButton_Pressed;
            resetButton.TouchUp   += ResetButton_Released;
            Canvas.SetLeft(resetButton, 150 + addBoxButton.Width + RecycleButton.Width);
            Canvas.SetTop(resetButton, 5);
            this.Children.Add(resetButton);

            InitializeComponent();
        }