コード例 #1
0
ファイル: VoteBall.cs プロジェクト: JohanF/MajorityRules
        public VoteBall(Vector p, CanvasController CC, Color c, int R, bool yn, bool vB, string text)
        {
            fill = new SolidColorBrush()
            {
                Color = c
            };

            Title = new TextBlock()
            {
                Text          = text,
                FontFamily    = new FontFamily("Segoe UI"),
                FontSize      = 20,
                TextAlignment = System.Windows.TextAlignment.Center,
                Foreground    = Brushes.Black
            };

            this.position         = p;
            this.CanvasCtrl       = CC;
            this._radius          = R;
            this.yes              = yn;
            this.voteBool         = vB;
            this.selectedBall     = null;
            this.ballClicked      = false;
            this.safeZoneT        = 0;
            this.Title.Visibility = Visibility.Hidden;

            Ellipse = new Ellipse()
            {
                Fill = fill,
            };

            Ellipse.AddHandler(TouchExtensions.TapGestureEvent, new RoutedEventHandler(Ellipse_TapGestureEvent));
        }
コード例 #2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public SurfaceWindow1()
        {
            InitializeComponent();

            // Add handlers for window availability events
            AddWindowAvailabilityHandlers();

            canvasController = new CanvasController(MainCanvas, (int)MainWindow.Width, (int)MainWindow.Height, DebugText);

            IdeaInput.Visibility = System.Windows.Visibility.Hidden;
            IdeaInput.KeyUp     += new KeyEventHandler(IdeaInput_KeyUp);

            messageHub.Subscribe <NewIdeaEvent>((m) =>
            {
                Debug.WriteLine("Received");
                toggleTextBoxHide();
            }
                                                );

            messageHub.Subscribe <DismissTextboxEvent>((m) =>
            {
                Debug.WriteLine("Dismiss textbox");
                IdeaInput.Visibility = Visibility.Hidden;
            }
                                                       );
        }
コード例 #3
0
ファイル: ButtonBall.cs プロジェクト: JohanF/MajorityRules
 public ButtonBall(Vector Position, Vector Velocity, Canvas mainCanvas, int rad, Color c, CanvasController CC, String text) : base(Position, Velocity, mainCanvas, rad, c, CC, text)
 {
     Title.Text       = "Add new Idea";
     Title.FontSize   = 20;
     Title.FontWeight = FontWeights.UltraBold;
     Debug.WriteLine("Ball button created");
     this.CanvasCtrl = CC;
 }
コード例 #4
0
ファイル: GravityBall.cs プロジェクト: JohanF/MajorityRules
 public GravityBall(Vector Position, Vector Velocity, Canvas mainCanvas, int rad, Color c, CanvasController CC, String text)
     : base(Position, Velocity, mainCanvas, rad, c, CC, text)
 {
     Title.Text       = "Gravity";
     Title.FontSize   = 26;
     Title.FontWeight = FontWeights.UltraBold;
     this.CanvasCtrl  = CC;
 }
コード例 #5
0
        public IdeaBall(Vector Position, Vector Velocity, Canvas mainCanvas, int rad, Color c, CanvasController CC, String text)
        {
            random = new Random();
            fill   = new SolidColorBrush()
            {
                Color = c
            };

            this.Velocity          = Velocity;
            this.Position          = Position;
            this.mainCanvas        = mainCanvas;
            this.IsTouched         = false;
            this.timerReset        = 0;
            this.affectedByGravity = true;
            this.CanvasCtrl        = CC;
            this.runHandler        = true;
            this.text           = text;
            this.transformGroup = new TransformGroup();
            this.rotation       = new RotateTransform(0);
            this.transformGroup.Children.Add(this.rotation);


            Ellipse = new Ellipse()
            {
                Fill = fill,
            };


            Title = new TextBlock()
            {
                Text             = text,
                FontFamily       = new FontFamily("Segoe UI"),
                FontSize         = 20,
                IsHitTestVisible = false,
                TextAlignment    = System.Windows.TextAlignment.Center
            };

            Radius = rad;

            timer.Elapsed += new ElapsedEventHandler(Ellipse_HoldGestureEvent);
            timer.Interval = 1000;

            pulseTimer.Elapsed += new ElapsedEventHandler(Ellipse_ClickedFeedbackEvent);
            pulseTimer.Interval = 125;

            Ellipse.IsManipulationEnabled = true;
            this.Ellipse.RenderTransform  = this.transformGroup;

            Ellipse.TouchDown  += new System.EventHandler <System.Windows.Input.TouchEventArgs>(Ellipse_TouchDown);
            Ellipse.TouchMove  += new System.EventHandler <System.Windows.Input.TouchEventArgs>(Ellipse_TouchMove);
            Ellipse.TouchLeave += new System.EventHandler <System.Windows.Input.TouchEventArgs>(Ellipse_TouchLeave);
            Ellipse.AddHandler(TouchExtensions.TapGestureEvent, new RoutedEventHandler(Ellipse_TapGestureEvent));
            Ellipse.ManipulationStarting        += this.TouchableThing_ManipulationStarting;
            Ellipse.ManipulationDelta           += this.TouchableThing_ManipulationDelta;
            Ellipse.ManipulationInertiaStarting += this.TouchableThing_ManipulationInertiaStarting;
        }
コード例 #6
0
        public BallInfoText(Vector p, CanvasController CC, int w, int h, string t)
        {
            this.position   = p;
            this.CanvasCtrl = CC;
            this._width     = w;
            this._heigth    = h;
            this.grid       = new Grid();

            rectangle = new Rectangle()
            {
                Width  = w,
                Height = h
            };

            textBlock = new TextBlock()
            {
                Text = t,
            };

            textBlock.Foreground = Brushes.Black;

            grid.Children.Add(rectangle);
            grid.Children.Add(textBlock);
        }