예제 #1
0
파일: Game.cs 프로젝트: outrera/SadConsole
 private void Game_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     Global.RenderRect   = new Rectangle(0, 0, (int)e.NewSize.Width, (int)e.NewSize.Height);
     Global.RenderOutput = new RenderTarget2D(GraphicsDevice, Global.RenderRect.Width, Global.RenderRect.Height);
     Global.RenderWidth  = Global.RenderRect.Width;
     Global.RenderHeight = Global.RenderRect.Height;
 }
예제 #2
0
 private void ViewPaneSizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (Workspace != null)
     {
         ViewPortChanged();
     }
 }
예제 #3
0
 /// <summary>
 ///  <para>Called when this adapter's DrawingSurface control has been resized.</para>
 ///  <para>Relays the event to this adapter's event handlers.</para>
 /// </summary>
 /// <param name="sender">The DrawingSurface control that has been resized.</param>
 /// <param name="e">Provides the surface's updated width and height.</param>
 private void OnSizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     if (this.Resized != null)
     {
         this.Resized.Invoke(this, CoronaLabs.WinRT.EmptyEventArgs.Instance);
     }
 }
예제 #4
0
 private void UserControl_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     Top.Margin    = new System.Windows.Thickness(e.NewSize.Width / 13);
     Bottom.Margin = new System.Windows.Thickness(e.NewSize.Width / 13);
     Left.Margin   = new System.Windows.Thickness(e.NewSize.Width / 13);
     Right.Margin  = new System.Windows.Thickness(e.NewSize.Width / 13);
 }
예제 #5
0
 private void Window_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     Left      = Left + oldWidth - ActualWidth;
     Top       = Top + oldHeight - ActualHeight;
     oldWidth  = ActualWidth;
     oldHeight = ActualHeight;
 }
예제 #6
0
 private void TilesControl_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     if (DataContext is GraphTilesVm dc)
     {
         dc.ImageSize = new TT.Sz2 <double>(e.NewSize.Width, e.NewSize.Height);
     }
 }
예제 #7
0
        private void View_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            var view = GetView() as GameView;

            _game.Width  = view.Width;
            _game.Height = view.Height;
        }
예제 #8
0
 private void wbImage_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     if (DataContext is GraphLatticeVm)
     {
         ((GraphLatticeVm)DataContext).ImageSize = new FS.Sz2 <double>(e.NewSize.Width, e.NewSize.Height);
     }
 }
예제 #9
0
 private void OnSizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     if (e.HeightChanged)
     {
         var heightDifference = e.NewSize.Height - e.PreviousSize.Height;
         Top -= heightDifference / 2.0;
     }
 }
예제 #10
0
 void CustomerScreenWindow_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     PluginContext.Log.InfoFormat("Customer window size changed. Window state is {0}", WindowState);
     if (WindowState == System.Windows.WindowState.Minimized)
     {
         WindowState = System.Windows.WindowState.Maximized;
     }
 }
예제 #11
0
 void AssociatedObjectSizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     foreach (var dataGridColumn in AssociatedObject.Columns)
     {
         var dataGridLength = dataGridColumn.Width;
         dataGridColumn.ClearValue(DataGridColumn.WidthProperty);
         dataGridColumn.Width = dataGridLength;
     }
 }
예제 #12
0
        private void VisualElement_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            int width = (int)(e.NewSize.Width / CurrentWindow.TextView.FormattedLineSource.ColumnWidth);

            // From R docs:  Valid values are 10...10000 with default normally 80.
            _terminalWidth = Math.Max(10, Math.Min(10000, width));

            Session.OptionsSetWidthAsync(_terminalWidth).SilenceException <RException>().SilenceException <MessageTransportException>().DoNotWait();
        }
        private void Details_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            double   tw = e.NewSize.Width;
            GridView gv = lvDetails.View as GridView;

            gv.Columns[2].Width = Math.Min(70, Math.Max(40, tw * 0.2));
            gv.Columns[1].Width = Math.Min(110, Math.Max(60, tw * 0.257));
            gv.Columns[0].Width = tw - gv.Columns[1].Width - gv.Columns[2].Width - 2;
        }
예제 #14
0
 /// <summary>
 /// Forwards the new size to the render window
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnSizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     if (m_renderWindow != null)
     {
         Size l_size = new Size();
         l_size.Width  = ( uint )e.NewSize.Width;
         l_size.Height = ( uint )e.NewSize.Height;
         m_renderWindow.Resize(l_size);
     }
 }
예제 #15
0
 private void outputTextBox_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     if (e.HeightChanged)
     {
         if (outputScrollViewer.VerticalOffset + outputScrollViewer.ViewportHeight == outputScrollViewer.ExtentHeight)
         {
             outputScrollViewer.ScrollToBottom();
         }
     }
 }
예제 #16
0
        /// <summary>
        /// Handles the SizeChanged event of the NumericView control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.SizeChangedEventArgs"/> instance containing the event data.</param>
        private void NumericView_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            Dispatcher.BeginInvoke(() =>
            {
                uxnumericIssueGraphView.Width    = uxnumericTextView.ActualWidth - 20;
                uxnumericIssueGraphView.MinWidth = uxnumericTextView.ActualWidth - 20;
                uxnumericIssueGraphView.MaxWidth = uxnumericTextView.ActualWidth - 20;

                uxnumericIssueGraphView.UpdateSliderWidth();
            });
        }
예제 #17
0
        /// <summary>
        /// When a galaxy gain or loses rings, the tile must change position so the center point is always over the
        /// subject.
        /// </summary>
        private void RingCollection_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            var OffsetX = (RingCollection.ActualWidth - INITIAL_RING_WIDTH) / 2;
            var OffsetY = (RingCollection.ActualHeight - INITIAL_RING_WIDTH) / 2;

            TranslateTransform Transform = new TranslateTransform();

            Transform.X = (OffsetX * -1) - 28;
            Transform.Y = (OffsetY * -1) - 28;
            MainTile.RenderTransform = Transform;
        }
예제 #18
0
        /// <summary>
        /// Reisize the <see cref="WriteableBitmap"/> based on new control size.
        /// </summary>
        private void OnSizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            //Resize the current bitmap
            _bitmap = _bitmap.Resize(
                (int)e.NewSize.Width
                , (int)e.NewSize.Height
                , WriteableBitmapExtensions.Interpolation.Bilinear
                );

            Source = _bitmap;
        }
예제 #19
0
        private void expand_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            var header = expand.Template.FindName("HeaderSite", expand) as Control;
            var height = e.NewSize.Height;

            if (header != null)
            {
                height = height - header.ActualHeight;
            }
            gridColorzone.Height = height;
        }
예제 #20
0
        /// <summary>
        /// Resizes the InkCanvas whenever this panel is resized.
        /// </summary>
        void SketchPanel_Resize(object sender, System.Windows.SizeChangedEventArgs e)
        {
            if (inkCanvas.Width < this.Width)
            {
                inkCanvas.Width = this.Width;
            }

            if (inkCanvas.Height < this.Height)
            {
                inkCanvas.Height = this.Height;
            }
        }
예제 #21
0
        private void GraphPanelSizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            var viewModel = DataContext as ChartViewModel;

            if (viewModel == null)
            {
                return;
            }
            viewModel.Width  = _GraphPanel.ActualWidth;
            viewModel.Height = _GraphPanel.ActualHeight;
            viewModel.Parent = _GraphPanel;
        }
예제 #22
0
 void LayoutGroups_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     if (e.NewSize.Height < 500)
     {
         layoutGroup2.Visibility = System.Windows.Visibility.Collapsed;
         layoutGroup3.Visibility = System.Windows.Visibility.Collapsed;
     }
     else
     {
         layoutGroup2.Visibility = System.Windows.Visibility.Visible;
         layoutGroup3.Visibility = System.Windows.Visibility.Visible;
     }
 }
        private void OnViewSizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            var webView = (WebBrowser)sender;

            webView.GetReactContext()
            .GetNativeModule <UIManagerModule>()
            .EventDispatcher
            .DispatchEvent(
                new WebViewContentSizeChangedEvent(
                    webView.GetTag(),
                    e.NewSize.Width,
                    e.NewSize.Height));
        }
 void GameWindowClientSizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
 {
     if (game.IsActive)
     {
         if (!this.inDeviceTransition && ((this.game.Window.ActualHeight != 0) || (this.game.Window.ActualWidth != 0)))
         {
             this.resizedBackBufferWidth  = (int)this.game.Window.ActualWidth;
             this.resizedBackBufferHeight = (int)this.game.Window.ActualHeight;
             this.useResizedBackBuffer    = true;
             this.ChangeDevice(false);
         }
     }
 }
예제 #25
0
        private void InputControlOnSizeChanged(object sender, System.Windows.SizeChangedEventArgs sizeChangedEventArgs)
        {
            ImageAreaRow.Height = new System.Windows.GridLength(InputControl.Height);
            Height = InfoAreaHeight.Height.Value + InputControl.Height;
            Top    = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height / 2f - Height / 2;
            Left   = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width / 2f - Width / 2;

            _startSize     = new Vector2((float)ActualWidth, (float)ActualHeight);
            _startPosition = new Vector2(
                (float)Left,
                (float)Top
                );
            InputControl.SizeChanged -= InputControlOnSizeChanged;
        }
예제 #26
0
        private void PlotWindowPane_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            var unadjustedPixelSize = WpfUnitsConversion.ToPixels(Content as Visual, e.NewSize);

            // If the window gets below a certain minimum size, plot to the minimum size
            // and user will be able to use scrollbars to see the whole thing
            int pixelWidth  = Math.Max((int)unadjustedPixelSize.Width, MinPixelWidth);
            int pixelHeight = Math.Max((int)unadjustedPixelSize.Height, MinPixelHeight);

            // Throttle resize requests since we get a lot of size changed events when the tool window is undocked
            IdleTimeAction.Cancel(this);
            IdleTimeAction.Create(() => {
                PlotContentProvider.DoNotWait(_plotHistory.PlotContentProvider.ResizePlotAsync(pixelWidth, pixelHeight));
            }, 100, this);
        }
예제 #27
0
        private void presentation_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            // Just for debugging
            //if (e.HeightChanged)
            //{
            //    GuiLogMessage("Height changed from " + e.PreviousSize.Height + " to " + e.NewSize.Height, NotificationLevel.Info);
            //}

            //if (e.WidthChanged)
            //{
            //    GuiLogMessage("Width changed from " + e.PreviousSize.Width + " to " + e.NewSize.Width, NotificationLevel.Info);
            //}

            updatePresentation();
        }
예제 #28
0
        /// <summary>
        /// Handles the SizeChanged event of the View control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.SizeChangedEventArgs"/> instance containing the event data.</param>
        private void View_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            this._height = e.NewSize.Height;
            this._width  = e.NewSize.Width;

            var rightSide = e.NewSize.Width + this._x + 15;

            if (rightSide > this._windowInformation.Position.Right)
            {
                this.View.Left = this.ApplyScalingX(this._x - (rightSide - this._windowInformation.Position.Right) - PopupMargin);
            }
            else
            {
                this.View.Left = this.ApplyScalingX(this._x + 15);
            }
        }
    void WidthButton_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
    {
        var thisButton = sender as Button;

        if (thisButton == null)
        {
            return;
        }
        var containerPair = _containers.FirstOrDefault(pair => pair.Value.Contains(thisButton));

        if (containerPair.Value == null)
        {
            return;
        }
        var maxWidth = containerPair.Value.Max(btn => btn.ActualWidth);

        containerPair.Value.ForEach(btn => btn.Width = maxWidth);
    }
예제 #30
0
        private void UserControl_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
        {
            if (this.ActualWidth == 0 | this.ActualHeight == 0)
            {
                return;
            }

            if (this.ActualWidth > this.ActualHeight)
            {
                this.CoverImage.Width  = this.ActualWidth;
                this.CoverImage.Height = this.ActualWidth;
            }
            else
            {
                this.CoverImage.Width  = this.ActualHeight;
                this.CoverImage.Height = this.ActualHeight;
            }
        }