コード例 #1
0
ファイル: Player.cs プロジェクト: jpbruyere/MagicCrow
        protected void PlayerPanel_MouseClick(object sender, Crow.MouseButtonEventArgs e)
        {
            MagicEngine me = MagicEngine.CurrentEngine;

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

            //MagicEngine.CurrentEngine.CancelLastActionOnStack ();
        }
コード例 #3
0
ファイル: TreeView.cs プロジェクト: jpbruyere/Crow
 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 ();
 }
コード例 #4
0
ファイル: Splitter.cs プロジェクト: jpbruyere/Crow
        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);
            }
        }
コード例 #5
0
ファイル: MenuItem.cs プロジェクト: jpbruyere/Crow
 void onMI_Click(object sender, MouseButtonEventArgs e)
 {
     Execute.Raise (this, null);
     if(!IsOpened)
         (LogicalParent as Menu).AutomaticOpenning = false;
 }
コード例 #6
0
ファイル: GraphicObject.cs プロジェクト: jpbruyere/Crow
 public virtual void onMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     GraphicObject p = Parent as GraphicObject;
     if (p != null)
         p.onMouseDoubleClick(sender,e);
     MouseDoubleClick.Raise (this, e);
 }
コード例 #7
0
ファイル: ColorSelector.cs プロジェクト: jpbruyere/Crow
 public override void onMouseDown(object sender, MouseButtonEventArgs e)
 {
     base.onMouseDown (sender, e);
     if (e.Button == MouseButton.Left)
         updateMouseLocalPos (e.Position);
 }
コード例 #8
0
ファイル: Label.cs プロジェクト: jpbruyere/Crow
        public override void onMouseUp(object sender, MouseButtonEventArgs e)
        {
            base.onMouseUp (sender, e);

            if (!SelectionInProgress)
                return;

            updatemouseLocalPos (e.Position);
            SelectionInProgress = false;
            RegisterForRedraw ();
        }
コード例 #9
0
ファイル: MouseEventArgs.cs プロジェクト: jpbruyere/Crow
 /// <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)
 {
 }
コード例 #10
0
ファイル: Label.cs プロジェクト: jpbruyere/Crow
        public override void onMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            base.onMouseDoubleClick (sender, e);

            GotoWordStart ();
            SelBegin = CurrentPosition;
            GotoWordEnd ();
            SelRelease = CurrentPosition;
            SelectionInProgress = false;
            RegisterForRedraw ();
        }
コード例 #11
0
ファイル: Window.cs プロジェクト: jpbruyere/Crow
 protected void butQuitPress(object sender, MouseButtonEventArgs e)
 {
     CurrentInterface.MouseCursor = XCursor.Default;
     close ();
 }
コード例 #12
0
ファイル: TabItem.cs プロジェクト: jpbruyere/Crow
 public override void onMouseDown(object sender, MouseButtonEventArgs e)
 {
     base.onMouseDown (sender, e);
     holdCursor = true;
 }
コード例 #13
0
ファイル: Window.cs プロジェクト: jpbruyere/Crow
 protected void butMaximizePress(object sender, MouseButtonEventArgs e)
 {
     IsMaximized = !IsMaximized;
 }
コード例 #14
0
ファイル: RadioButton.cs プロジェクト: jpbruyere/Crow
        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);
        }
コード例 #15
0
 void onClearSplatting(object sender, Crow.MouseButtonEventArgs e)
 {
     CurrentState = State.ClearSplatting;
 }
コード例 #16
0
 void onClearHM(object sender, Crow.MouseButtonEventArgs e)
 {
     CurrentState = State.ClearHM;
 }
コード例 #17
0
 void onLoad(object sender, Crow.MouseButtonEventArgs e)
 {
     CurrentState = State.LoadMap;
 }
コード例 #18
0
 void onSaveSplatting(object sender, Crow.MouseButtonEventArgs e)
 {
     Texture.Save(splattingBrushShader.OutputTex, @"splat.png");
 }
コード例 #19
0
ファイル: Splitter.cs プロジェクト: jpbruyere/Crow
        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;
            }
        }
コード例 #20
0
 public BubblingMouseButtonEventArg(MouseButtonEventArgs mbe)
     : base(mbe)
 {
 }
コード例 #21
0
ファイル: Slider.cs プロジェクト: jpbruyere/Crow
        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;
            }
        }
コード例 #22
0
ファイル: Label.cs プロジェクト: jpbruyere/Crow
        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);
        }
コード例 #23
0
ファイル: Slider.cs プロジェクト: jpbruyere/Crow
        public override void onMouseUp(object sender,MouseButtonEventArgs e)
        {
            base.onMouseUp (sender, e);

            holdCursor = false;
        }
コード例 #24
0
ファイル: TemplatedGroup.cs プロジェクト: jpbruyere/Crow
 internal virtual void itemClick(object sender, MouseButtonEventArgs e)
 {
     SelectedIndex = data.IndexOf((sender as GraphicObject).DataSource);
 }
コード例 #25
0
ファイル: Button.cs プロジェクト: jpbruyere/Crow
        public override void onMouseDown(object sender, MouseButtonEventArgs e)
        {
            IsPressed = true;

            base.onMouseDown (sender, e);

            //TODO:remove
            NotifyValueChanged ("State", "pressed");
        }
コード例 #26
0
ファイル: Button.cs プロジェクト: jpbruyere/Crow
        public override void onMouseUp(object sender, MouseButtonEventArgs e)
        {
            IsPressed = false;

            base.onMouseUp (sender, e);

            //TODO:remove
            NotifyValueChanged ("State", "normal");
        }
コード例 #27
0
ファイル: Spinner.cs プロジェクト: jpbruyere/Crow
 void onDown(object sender, MouseButtonEventArgs e)
 {
     Value -= this.SmallIncrement;
 }
コード例 #28
0
ファイル: GraphicObject.cs プロジェクト: jpbruyere/Crow
        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);
            }
        }
コード例 #29
0
ファイル: Spinner.cs プロジェクト: jpbruyere/Crow
 void onUp(object sender, MouseButtonEventArgs e)
 {
     Value += this.SmallIncrement;
 }
コード例 #30
0
ファイル: GraphicObject.cs プロジェクト: jpbruyere/Crow
        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);
        }
コード例 #31
0
ファイル: TabView.cs プロジェクト: jpbruyere/Crow
 void Ti_MouseDown(object sender, MouseButtonEventArgs e)
 {
     SelectedTab = Children.IndexOf (sender as GraphicObject);
 }
コード例 #32
0
ファイル: Expandable.cs プロジェクト: jpbruyere/Crow
 public void onClickForExpand(object sender, MouseButtonEventArgs e)
 {
     IsExpanded = !IsExpanded;
 }
コード例 #33
0
ファイル: GOLIBTest_DirViewer.cs プロジェクト: jpbruyere/Crow
		void onDirUp(object sender, MouseButtonEventArgs e)
		{
			
		}
コード例 #34
0
ファイル: TabItem.cs プロジェクト: jpbruyere/Crow
 public void butCloseTabClick(object sender, MouseButtonEventArgs e)
 {
     (Parent as TabView).RemoveChild(this);
 }
コード例 #35
0
ファイル: GOLIBTest_DirViewer.cs プロジェクト: jpbruyere/Crow
		public void onMouseDown(object sender, MouseButtonEventArgs e)
		{
			Debug.WriteLine (sender.ToString ());
		}
コード例 #36
0
ファイル: TabItem.cs プロジェクト: jpbruyere/Crow
 public override void onMouseUp(object sender, MouseButtonEventArgs e)
 {
     base.onMouseUp (sender, e);
     holdCursor = false;
     (Parent as TabView).UpdateLayout (LayoutingType.ArrangeChildren);
 }
コード例 #37
0
 void onSaveHM(object sender, Crow.MouseButtonEventArgs e)
 {
     Texture.Save(hmGenerator.OutputTex, @"heightmap.png");
 }