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);
        }
        public void HideKeyBoard()
        {
            if (_keyboard == null) return;

            UnRegisterElement(_keyboard);
            Canvas.Children.Remove(_keyboard);
            _keyboard = null;
        }
 public void ShowKeyBoard()
 {
     _keyboard = new FloatingTouchScreenKeyboard
     {
         Name = "Keyboard",
         Width = 900,
         Height = 400,
         AreAnimationsEnabled = true
     };
     RegisterElement((IMTouchControl)_keyboard, true, null);
     Canvas.SetZIndex(_keyboard, 600000);
     Canvas.Children.Add(_keyboard);
 }
Beispiel #4
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.canvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 2:
                this.groupBox1 = ((System.Windows.Controls.GroupBox)(target));

            #line 29 "..\..\MainWindow.xaml"
                this.groupBox1.TouchDown += new System.EventHandler <System.Windows.Input.TouchEventArgs>(this.groupBox1_TouchDown);

            #line default
            #line hidden

            #line 30 "..\..\MainWindow.xaml"
                this.groupBox1.TouchMove += new System.EventHandler <System.Windows.Input.TouchEventArgs>(this.groupBox1_TouchMove);

            #line default
            #line hidden

            #line 31 "..\..\MainWindow.xaml"
                this.groupBox1.TouchLeave += new System.EventHandler <System.Windows.Input.TouchEventArgs>(this.groupBox1_TouchLeave);

            #line default
            #line hidden
                return;

            case 3:
                this.txtBox1 = ((System.Windows.Controls.TextBox)(target));

            #line 43 "..\..\MainWindow.xaml"
                this.txtBox1.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.txtBox1_MouseDown);

            #line default
            #line hidden

            #line 43 "..\..\MainWindow.xaml"
                this.txtBox1.TouchDown += new System.EventHandler <System.Windows.Input.TouchEventArgs>(this.txtBox1_TouchDown);

            #line default
            #line hidden
                return;

            case 4:
                this.groupBox2 = ((System.Windows.Controls.GroupBox)(target));

            #line 53 "..\..\MainWindow.xaml"
                this.groupBox2.TouchDown += new System.EventHandler <System.Windows.Input.TouchEventArgs>(this.groupBox2_TouchDown);

            #line default
            #line hidden

            #line 54 "..\..\MainWindow.xaml"
                this.groupBox2.TouchMove += new System.EventHandler <System.Windows.Input.TouchEventArgs>(this.groupBox2_TouchMove);

            #line default
            #line hidden
                return;

            case 5:
                this.txtBox2 = ((System.Windows.Controls.TextBox)(target));

            #line 65 "..\..\MainWindow.xaml"
                this.txtBox2.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.txtBox2_MouseDown);

            #line default
            #line hidden

            #line 65 "..\..\MainWindow.xaml"
                this.txtBox2.TouchDown += new System.EventHandler <System.Windows.Input.TouchEventArgs>(this.txtBox2_TouchDown);

            #line default
            #line hidden
                return;

            case 6:
                this.Keyboard = ((WpfKb.Controls.FloatingTouchScreenKeyboard)(target));
                return;
            }
            this._contentLoaded = true;
        }