Esempio n. 1
0
            public Box(int row, int col, Grid containingGrid, IList<Box> boxList, TextBlock textBox, WebLayoutChangerAction action)
            {
                _boxList = boxList;
                _grid = containingGrid;
                _textBox = textBox;
                _action = action;

                Row = row;
                Column = col;

                TheBorder = new Border();
                TheBorder.Style = System.Windows.Application.Current.Resources[Key_ToolLayout_BoxBorderStyle] as Style;

                TheRectangle = new System.Windows.Shapes.Rectangle();
                TheRectangle.Style = System.Windows.Application.Current.Resources[Key_ToolLayout_BoxNormalStyle] as Style;

                TheBorder.Child = TheRectangle;
                TheBorder.SetValue(Grid.RowProperty, row);
                TheBorder.SetValue(Grid.ColumnProperty, Column);
            
                _grid.Children.Add(TheBorder);
                
                TheRectangle.MouseEnter += TheRectangle_MouseEnter;
                _grid.MouseLeave += Grid_MouseLeave;

                TheRectangle.MouseLeftButtonUp += TheRectangle_MouseLeftButtonUp;
            }
Esempio n. 2
0
            public Box(int row, int col, Grid containingGrid, IList <Box> boxList, TextBlock textBox, WebLayoutChangerAction action)
            {
                _boxList = boxList;
                _grid    = containingGrid;
                _textBox = textBox;
                _action  = action;

                Row    = row;
                Column = col;

                TheBorder       = new Border();
                TheBorder.Style = System.Windows.Application.Current.Resources[Key_ToolLayout_BoxBorderStyle] as Style;

                TheRectangle       = new System.Windows.Shapes.Rectangle();
                TheRectangle.Style = System.Windows.Application.Current.Resources[Key_ToolLayout_BoxNormalStyle] as Style;

                TheBorder.Child = TheRectangle;
                TheBorder.SetValue(Grid.RowProperty, row);
                TheBorder.SetValue(Grid.ColumnProperty, Column);

                _grid.Children.Add(TheBorder);

                TheRectangle.MouseEnter += TheRectangle_MouseEnter;
                _grid.MouseLeave        += Grid_MouseLeave;

                TheRectangle.MouseLeftButtonUp += TheRectangle_MouseLeftButtonUp;
            }
Esempio n. 3
0
        public LayoutPopup(ActionDispatcher dispatcher, IEnumerable <WebActionNode> actions)
        {
            InitializeComponent();


            Popup.IsOpen = false;

            IsTabStop = true; // allow focus

            _actionDispatcher = dispatcher;

            //because the layout popup is just like a context menu, handle the right mouse explicitly.
            HostRoot.MouseRightButtonDown += delegate(object sender, MouseButtonEventArgs e) { e.Handled = true; Hide(); };
            HostRoot.MouseRightButtonUp   += (sender, e) => e.Handled = true;

            foreach (WebLayoutChangerAction node in actions)
            {
                if (node.ActionID.Equals("chooseBoxLayout"))
                {
                    _imageBoxAction = node;
                }
                else if (node.ActionID.Equals("chooseTileLayout"))
                {
                    _tilesAction = node;
                }
            }

            ImageBoxLayoutText.Text = _imageBoxAction.Label = Labels.MenuImageBoxLayout;
            TileLayoutText.Text     = _tilesAction.Label = Labels.MenuTileLayout;

            CreateGridElements();
        }
Esempio n. 4
0
        private void OnClick(WebLayoutChangerAction action, int rows, int columns)
        {
            Hide();

            var msg = new SetLayoutActionMessage
            {
                Columns    = columns,
                Rows       = rows,
                TargetId   = action.Identifier,
                Identifier = action.Identifier
            };

            _actionDispatcher.EventDispatcher.DispatchMessage(msg);
        }
Esempio n. 5
0
        private void OnClick(WebLayoutChangerAction action, int rows, int columns)
        {
            Hide();

            var msg = new SetLayoutActionMessage
                          {
                              Columns = columns,
                              Rows = rows,
                              TargetId = action.Identifier,
                              Identifier = action.Identifier
                          };

            _actionDispatcher.EventDispatcher.DispatchMessage(msg);
        }
Esempio n. 6
0
        public LayoutPopup(ActionDispatcher dispatcher, IEnumerable<WebActionNode> actions)
        {
            InitializeComponent();


            Popup.IsOpen = false;

            IsTabStop = true; // allow focus

            _actionDispatcher = dispatcher;

            //because the layout popup is just like a context menu, handle the right mouse explicitly.
            HostRoot.MouseRightButtonDown += delegate(object sender, MouseButtonEventArgs e) { e.Handled = true; Hide(); };
            HostRoot.MouseRightButtonUp += (sender, e) => e.Handled = true;

            foreach (WebLayoutChangerAction node in actions)
            {
                if (node.ActionID.Equals("chooseBoxLayout"))
                    _imageBoxAction = node;
                else if (node.ActionID.Equals("chooseTileLayout"))
                    _tilesAction = node;
            }

            ImageBoxLayoutText.Text = _imageBoxAction.Label = Labels.MenuImageBoxLayout;
            TileLayoutText.Text = _tilesAction.Label = Labels.MenuTileLayout;

            CreateGridElements();
        }