Exemple #1
0
 private static void OnHostGotFocus(object sender, RoutedEventArgs e)
 {
     if (GetFloatingTouchScreenKeyboard(sender as DependencyObject))
     {
         if (_InstanceObject == null)
         {
             _InstanceObject = new FloatingTouchScreenKeyboard();
             _InstanceObject.AreAnimationsEnabled = true;
             _InstanceObject.Placement            = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
             _InstanceObject.Width  = 900;
             _InstanceObject.Height = 400;
             _InstanceObject.IsOpen = true;
         }
         else
         {
             _InstanceObject.IsOpen = true;
         }
     }
 }
Exemple #2
0
        public void InitializeContainer()
        {
            keyboard = new FloatingTouchScreenKeyboard();
            keyboard.IsDragHelperAllowedToHide = true;
            keyboard.Width                = STATICS.MENU_BAR_SIZE.Width;
            keyboard.Height               = 260;
            keyboard.TouchDown           += Keyboard_TouchDown;
            keyboard.MouseLeftButtonDown += Keyboard_MouseLeftButtonDown;
            keyboard.Visibility           = Visibility.Hidden;

            bin_textBox.Width      = keyboard.Width;
            bin_textBox.Height     = 30;
            bin_textBox.Background = new SolidColorBrush(Colors.LightGray);
            bin_textBox.Foreground = new SolidColorBrush(Colors.Black);
            bin_textBox.MaxLines   = 2;
            bin_textBox.KeyDown   += Bin_textBox_KeyDown;
            bin_textBox.Visibility = Visibility.Hidden;

            resetNotification.Width  = 100;
            resetNotification.Height = 100;
            resetNotification.IsManipulationEnabled = false;
            resetNotification.AppendText("The board will be \nreset if all three\nreset buttons are \npressed at the \nsame time");
            resetNotification.Visibility = Visibility.Hidden;
            Canvas.SetLeft(resetNotification, 170 + addBoxButton.Width + recycleButton.Width);
            Canvas.SetTop(resetNotification, this.Height * -2);
            this.Children.Add(resetNotification);

            recycleNotification.Width  = 80;
            recycleNotification.Height = 50;
            recycleNotification.IsManipulationEnabled = false;
            recycleNotification.AppendText("The category \nbox will be \ndeleted.");
            recycleNotification.Visibility = Visibility.Hidden;
            Canvas.SetLeft(recycleNotification, 125 + addBoxButton.Width);
            Canvas.SetTop(recycleNotification, this.Height * -1);
            this.Children.Add(recycleNotification);

            Matrix mtKBD = new Matrix();

            mtKBD.Translate(-5, keyboard.Height * -1);
            keyboard.RenderTransform = new MatrixTransform(mtKBD);

            Matrix mtTB = new Matrix();

            mtTB.Translate(0, -1 * (keyboard.Height + bin_textBox.Height));
            bin_textBox.RenderTransform = new MatrixTransform(mtTB);

            if (STATICS.ALEX_ACTIVE && User.Equals("Alex"))
            {
                RecycleButton.XCoord = STATICS.SCREEN_WIDTH / 2;
                RecycleButton.YCoord = STATICS.SCREEN_HEIGHT - this.Height / 2;
            }
            else if (STATICS.BEN_ACTIVE && User.Equals("Ben"))
            {
                //To-be Finished
            }
            else if (STATICS.CHRIS_ACTIVE && User.Equals("Chris"))
            {
                RecycleButton.XCoord = this.Height / 2;
                RecycleButton.YCoord = STATICS.SCREEN_HEIGHT / 2;
            }
            else if (STATICS.DANNY_ACTIVE && User.Equals("Danny"))
            {
                RecycleButton.XCoord = STATICS.SCREEN_WIDTH - this.Height / 2;
                RecycleButton.YCoord = STATICS.SCREEN_HEIGHT / 2;
            }
            this.Container.Children.Add(bin_textBox);
            this.Container.Children.Add(keyboard);
        }