Exemplo n.º 1
0
        protected void PlayerPanel_MouseClick(object sender, Crow.MouseButtonEventArgs e)
        {
            MagicEngine me = MagicEngine.CurrentEngine;

            if (me.pp != me.ip)
            {
                return;
            }
            me.MagicStack.TryToHandleClick(this);
        }
Exemplo n.º 2
0
        void ActionDone_MouseClick(object sender, Crow.MouseButtonEventArgs e)
        {
            if (NextActionOnStack != null)
            {
                NextActionOnStack.Validate();
            }
            else if (UIActionIsChoice)
            {
                PopMSE();
            }

            //MagicEngine.CurrentEngine.CancelLastActionOnStack ();
        }
Exemplo n.º 3
0
 internal override void itemClick(object sender, MouseButtonEventArgs e)
 {
     GraphicObject tmp = sender as GraphicObject;
     if (!tmp.HasFocus)
         return;
     if (selectedItemContainer != null) {
         selectedItemContainer.Foreground = Color.Transparent;
         selectedItemContainer.Background = Color.Transparent;
     }
     selectedItemContainer = tmp;
     selectedItemContainer.Foreground = SelectionForeground;
     selectedItemContainer.Background = SelectionBackground;
     NotifyValueChanged ("SelectedItem", SelectedItem);
     raiseSelectedItemChanged ();
 }
Exemplo n.º 4
0
        public override void onMouseUp(object sender, MouseButtonEventArgs e)
        {
            base.onMouseUp (sender, e);

            GenericStack gs = Parent as GenericStack;

            if (init1 >= 0 && u1 == Unit.Percent) {
                if (gs.Orientation == Orientation.Horizontal)
                    go1.Width = new Measure ((int)Math.Ceiling (
                        go1.Width.Value * 100.0 / (double)gs.Slot.Width), Unit.Percent);
                else
                    go1.Height = new Measure ((int)Math.Ceiling (
                        go1.Height.Value * 100.0 / (double)gs.Slot.Height), Unit.Percent);
            }
            if (init2 >= 0 && u2 == Unit.Percent) {
                if (gs.Orientation == Orientation.Horizontal)
                    go2.Width = new Measure ((int)Math.Floor (
                        go2.Width.Value * 100.0 / (double)gs.Slot.Width), Unit.Percent);
                else
                    go2.Height = new Measure ((int)Math.Floor (
                        go2.Height.Value * 100.0 / (double)gs.Slot.Height), Unit.Percent);
            }
        }
Exemplo n.º 5
0
 void onMI_Click(object sender, MouseButtonEventArgs e)
 {
     Execute.Raise (this, null);
     if(!IsOpened)
         (LogicalParent as Menu).AutomaticOpenning = false;
 }
Exemplo n.º 6
0
 public virtual void onMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     GraphicObject p = Parent as GraphicObject;
     if (p != null)
         p.onMouseDoubleClick(sender,e);
     MouseDoubleClick.Raise (this, e);
 }
Exemplo n.º 7
0
 public override void onMouseDown(object sender, MouseButtonEventArgs e)
 {
     base.onMouseDown (sender, e);
     if (e.Button == MouseButton.Left)
         updateMouseLocalPos (e.Position);
 }
Exemplo n.º 8
0
        public override void onMouseUp(object sender, MouseButtonEventArgs e)
        {
            base.onMouseUp (sender, e);

            if (!SelectionInProgress)
                return;

            updatemouseLocalPos (e.Position);
            SelectionInProgress = false;
            RegisterForRedraw ();
        }
Exemplo n.º 9
0
 /// <summary>
 /// Constructs a new <see cref="MouseButtonEventArgs"/> instance.
 /// </summary>
 /// <param name="args">The <see cref="MouseButtonEventArgs"/> instance to clone.</param>
 public MouseButtonEventArgs(MouseButtonEventArgs args)
     : this(args.X, args.Y, args.Button, args.IsPressed)
 {
 }
Exemplo n.º 10
0
        public override void onMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            base.onMouseDoubleClick (sender, e);

            GotoWordStart ();
            SelBegin = CurrentPosition;
            GotoWordEnd ();
            SelRelease = CurrentPosition;
            SelectionInProgress = false;
            RegisterForRedraw ();
        }
Exemplo n.º 11
0
 protected void butQuitPress(object sender, MouseButtonEventArgs e)
 {
     CurrentInterface.MouseCursor = XCursor.Default;
     close ();
 }
Exemplo n.º 12
0
 public override void onMouseDown(object sender, MouseButtonEventArgs e)
 {
     base.onMouseDown (sender, e);
     holdCursor = true;
 }
Exemplo n.º 13
0
 protected void butMaximizePress(object sender, MouseButtonEventArgs e)
 {
     IsMaximized = !IsMaximized;
 }
Exemplo n.º 14
0
        public override void onMouseClick(object sender, MouseButtonEventArgs e)
        {
            Group pg = Parent as Group;
            if (pg != null) {
                for (int i = 0; i < pg.Children.Count; i++) {
                    RadioButton c = pg.Children [i] as RadioButton;
                    if (c == null)
                        continue;
                    c.IsChecked = (c == this);
                }
            } else
                IsChecked = !IsChecked;

            base.onMouseClick (sender, e);
        }
Exemplo n.º 15
0
 void onClearSplatting(object sender, Crow.MouseButtonEventArgs e)
 {
     CurrentState = State.ClearSplatting;
 }
Exemplo n.º 16
0
 void onClearHM(object sender, Crow.MouseButtonEventArgs e)
 {
     CurrentState = State.ClearHM;
 }
Exemplo n.º 17
0
 void onLoad(object sender, Crow.MouseButtonEventArgs e)
 {
     CurrentState = State.LoadMap;
 }
Exemplo n.º 18
0
 void onSaveSplatting(object sender, Crow.MouseButtonEventArgs e)
 {
     Texture.Save(splattingBrushShader.OutputTex, @"splat.png");
 }
Exemplo n.º 19
0
        public override void onMouseDown(object sender, MouseButtonEventArgs e)
        {
            base.onMouseDown (sender, e);
            go1 = go2 = null;
            init1 = init2 = -1;
            delta = 0;

            GenericStack gs = Parent as GenericStack;
            int ptrSplit = gs.Children.IndexOf (this);
            if (ptrSplit == 0 || ptrSplit == gs.Children.Count - 1)
                return;

            go1 = gs.Children [ptrSplit - 1];
            go2 = gs.Children [ptrSplit + 1];

            if (gs.Orientation == Orientation.Horizontal) {
                initSplit (go1.Width, go1.Slot.Width, go2.Width, go2.Slot.Width);
                min1 = go1.MinimumSize.Width;
                min2 = go2.MinimumSize.Width;
                max1 = go1.MaximumSize.Width;
                max2 = go2.MaximumSize.Width;
                if (init1 >= 0)
                    go1.Width = init1;
                if (init2 >= 0)
                    go2.Width = init2;
            } else {
                initSplit (go1.Height, go1.Slot.Height, go2.Height, go2.Slot.Height);
                min1 = go1.MinimumSize.Height;
                min2 = go2.MinimumSize.Height;
                max1 = go1.MaximumSize.Height;
                max2 = go2.MaximumSize.Height;
                if (init1 >= 0)
                    go1.Height = init1;
                if (init2 >= 0)
                    go2.Height = init2;
            }
        }
Exemplo n.º 20
0
 public BubblingMouseButtonEventArg(MouseButtonEventArgs mbe)
     : base(mbe)
 {
 }
Exemplo n.º 21
0
        public override void onMouseDown(object sender, MouseButtonEventArgs e)
        {
            base.onMouseDown (sender, e);

            Rectangle cursInScreenCoord = ScreenCoordinates (cursor + Slot.Position);
            if (cursInScreenCoord.ContainsOrIsEqual (e.Position))
                holdCursor = true;
            else if (_orientation == Orientation.Horizontal) {
                if (e.Position.X < cursInScreenCoord.Left)
                    Value -= LargeIncrement;
                else
                    Value += LargeIncrement;
            } else {
                if (e.Position.Y < cursInScreenCoord.Top)
                    Value -= LargeIncrement;
                else
                    Value += LargeIncrement;
            }
        }
Exemplo n.º 22
0
        public override void onMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (this.HasFocus && _selectable){
                updatemouseLocalPos (e.Position);
                SelBegin = -1;
                SelRelease = -1;
                SelectionInProgress = true;
                RegisterForRedraw();//TODO:should put it in properties
            }

            //done at the end to set 'hasFocus' value after testing it
            base.onMouseDown (sender, e);
        }
Exemplo n.º 23
0
        public override void onMouseUp(object sender,MouseButtonEventArgs e)
        {
            base.onMouseUp (sender, e);

            holdCursor = false;
        }
Exemplo n.º 24
0
 internal virtual void itemClick(object sender, MouseButtonEventArgs e)
 {
     SelectedIndex = data.IndexOf((sender as GraphicObject).DataSource);
 }
Exemplo n.º 25
0
        public override void onMouseDown(object sender, MouseButtonEventArgs e)
        {
            IsPressed = true;

            base.onMouseDown (sender, e);

            //TODO:remove
            NotifyValueChanged ("State", "pressed");
        }
Exemplo n.º 26
0
        public override void onMouseUp(object sender, MouseButtonEventArgs e)
        {
            IsPressed = false;

            base.onMouseUp (sender, e);

            //TODO:remove
            NotifyValueChanged ("State", "normal");
        }
Exemplo n.º 27
0
 void onDown(object sender, MouseButtonEventArgs e)
 {
     Value -= this.SmallIncrement;
 }
Exemplo n.º 28
0
        public virtual void onMouseUp(object sender, MouseButtonEventArgs e)
        {
            //bubble event to the top
            GraphicObject p = Parent as GraphicObject;
            if (p != null)
                p.onMouseUp(sender,e);

            MouseUp.Raise (this, e);

            if (MouseIsIn (e.Position) && IsActive) {
                if (CurrentInterface.clickTimer.ElapsedMilliseconds < Interface.DoubleClick)
                    CurrentInterface.eligibleForDoubleClick = this;
                onMouseClick (this, e);
            }
        }
Exemplo n.º 29
0
 void onUp(object sender, MouseButtonEventArgs e)
 {
     Value += this.SmallIncrement;
 }
Exemplo n.º 30
0
        public virtual void onMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (CurrentInterface.eligibleForDoubleClick == this && CurrentInterface.clickTimer.ElapsedMilliseconds < Interface.DoubleClick)
                onMouseDoubleClick (this, e);
            else
                currentInterface.clickTimer.Restart();
            CurrentInterface.eligibleForDoubleClick = null;

            if (CurrentInterface.activeWidget == null)
                CurrentInterface.activeWidget = this;
            if (this.Focusable && !Interface.FocusOnHover) {
                BubblingMouseButtonEventArg be = e as BubblingMouseButtonEventArg;
                if (be.Focused == null) {
                    be.Focused = this;
                    CurrentInterface.FocusedWidget = this;
                }
            }
            //bubble event to the top
            GraphicObject p = Parent as GraphicObject;
            if (p != null)
                p.onMouseDown(sender,e);

            MouseDown.Raise (this, e);
        }
Exemplo n.º 31
0
 void Ti_MouseDown(object sender, MouseButtonEventArgs e)
 {
     SelectedTab = Children.IndexOf (sender as GraphicObject);
 }
Exemplo n.º 32
0
 public void onClickForExpand(object sender, MouseButtonEventArgs e)
 {
     IsExpanded = !IsExpanded;
 }
Exemplo n.º 33
0
		void onDirUp(object sender, MouseButtonEventArgs e)
		{
			
		}
Exemplo n.º 34
0
 public void butCloseTabClick(object sender, MouseButtonEventArgs e)
 {
     (Parent as TabView).RemoveChild(this);
 }
Exemplo n.º 35
0
		public void onMouseDown(object sender, MouseButtonEventArgs e)
		{
			Debug.WriteLine (sender.ToString ());
		}
Exemplo n.º 36
0
 public override void onMouseUp(object sender, MouseButtonEventArgs e)
 {
     base.onMouseUp (sender, e);
     holdCursor = false;
     (Parent as TabView).UpdateLayout (LayoutingType.ArrangeChildren);
 }
Exemplo n.º 37
0
 void onSaveHM(object sender, Crow.MouseButtonEventArgs e)
 {
     Texture.Save(hmGenerator.OutputTex, @"heightmap.png");
 }