Exemplo n.º 1
0
        /// <summary>
        ///
        /// slips a larger view between the enclosing NSClipView and the
        /// receiver, and adjusts the ruler origin to lie at the same point in the
        /// receiver. Apps that tile pages differently might want to do this when
        /// an NSView representing a page is moved.
        ///
        /// </summary>
        /// <param name="sender">
        /// A <see cref="NSObject"/>
        /// </param>

        partial void nestle(NSObject sender)
        {
            NSScrollView enclosingScrollView = EnclosingScrollView;

            if (enclosingScrollView == null)
            {
                return;
            }

            if (Superview is NestleView)
            {
                enclosingScrollView.DocumentView = this;
            }
            else
            {
                RectangleF nFrame, rFrame;
                NestleView nestleView;

                rFrame = Frame;
                nFrame = new RectangleF(0.0f, 0.0f, rFrame.Width + 64.0f, rFrame.Height + 64.0f);

                nestleView = new NestleView(nFrame);

                nestleView.AddSubview(this);
                rFrame.Location = new PointF(32.0f, 32.0f);
                Frame           = rFrame;
                enclosingScrollView.DocumentView = nestleView;
            }

            Window.MakeFirstResponder(this);
            setRulerOffsets();
            updateRulers();
            enclosingScrollView.NeedsDisplay = true;
        }
Exemplo n.º 2
0
		/// <summary>
		/// 
		/// slips a larger view between the enclosing NSClipView and the
		/// receiver, and adjusts the ruler origin to lie at the same point in the
		/// receiver. Apps that tile pages differently might want to do this when
		/// an NSView representing a page is moved.
		/// 
		/// </summary>
		/// <param name="sender">
		/// A <see cref="NSObject"/>
		/// </param>		

		partial void nestle (NSObject sender)
		{
			NSScrollView enclosingScrollView = EnclosingScrollView;
			
			if (enclosingScrollView == null) 
				return;
			
			if (Superview is NestleView)
				enclosingScrollView.DocumentView = this;
			else {
				RectangleF nFrame, rFrame;
				NestleView nestleView;
				
				rFrame = Frame;
				nFrame = new RectangleF(0.0f, 0.0f, rFrame.Width + 64.0f, rFrame.Height + 64.0f);
				
				nestleView = new NestleView (nFrame);

				nestleView.AddSubview (this);
				rFrame.Location = new PointF (32.0f, 32.0f);
				Frame = rFrame;
				enclosingScrollView.DocumentView = nestleView;
				
			}
			
			Window.MakeFirstResponder (this);
			setRulerOffsets ();
			updateRulers ();
			enclosingScrollView.NeedsDisplay = true;
		}