Exemplo n.º 1
0
 private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args)
 {
     if ((this.child != null))
     {
         this.child.Allocation = args.Allocation;
     }
 }
Exemplo n.º 2
0
    // system event handlers

    protected virtual void OnWidgetResize(object o, Gtk.SizeAllocatedArgs args)
    {
        if (initted)
        {
            ResizeProjectionMatrix(args.Allocation);
        }
    }
Exemplo n.º 3
0
		static void Size_Allocated (object obj, SizeAllocatedArgs args)
		{
			Rectangle rect = args.Allocation;
			if (rect.Width == 0 || rect.Height == 0)
				Console.WriteLine ("ERROR: Allocation is null!");
			Console.WriteLine ("Size: ({0}, {1})", rect.Width, rect.Height);
		}
Exemplo n.º 4
0
 void Child_SizeAllocated(object o, SizeAllocatedArgs args)
 {
     if (!alloction.Equals(args.Allocation))
     {
         alloction = args.Allocation;
         JudgePostion();
     }
 }
Exemplo n.º 5
0
		void HandleBarFrameSizeAllocated (object o, SizeAllocatedArgs args)
		{
			if (!lastFrameSize.Equals (args.Allocation.Size)) {
				lastFrameSize = args.Allocation.Size;
				if (autoShowFrame != null)
					bar.Frame.UpdateSize (bar, autoShowFrame);
			}
		}
Exemplo n.º 6
0
 protected virtual void OnScrolledInfoSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
 {
     if (infoLabel.WidthRequest != scrolledInfo.Allocation.Width)
     {
         infoLabel.WidthRequest          = scrolledInfo.Allocation.Width;
         labelTemplateTitle.WidthRequest = scrolledInfo.Allocation.Width;
     }
 }
Exemplo n.º 7
0
 protected void OnHpanedReportSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
 {
     if (args.Allocation.Width != hpanedWidth)
     {
         hpanedWidth = args.Allocation.Width;
         SetHPanedPosition();
     }
 }
Exemplo n.º 8
0
 private void CustomExpender_SizeAllocated(object o, SizeAllocatedArgs args)
 {
     if (this.Parent == null || this.Parent.Parent == null)
     {
         return;
     }
     this.Parent.Parent.QueueDraw();
 }
Exemplo n.º 9
0
		void HandleViewTextEditorhandleSizeAllocated (object o, SizeAllocatedArgs args)
		{
			int newX = textEditor.Allocation.Width - this.Allocation.Width - 8;
			var containerChild = ((TextEditor.EditorContainerChild)textEditor [frame]);
			if (newX != containerChild.X) {
				this.entryLineNumber.WidthRequest = textEditor.Allocation.Width / 4;
				containerChild.X = newX;
				textEditor.QueueResize ();
			}
		}
Exemplo n.º 10
0
		void HandleViewTextEditorhandleSizeAllocated (object o, SizeAllocatedArgs args)
		{
			int newX = widget.TextEditor.Allocation.Width - this.Allocation.Width - 8;
			TextEditorContainer.EditorContainerChild containerChild = ((Mono.TextEditor.TextEditorContainer.EditorContainerChild)widget.TextEditorContainer[container]);
			if (newX != containerChild.X) {
				this.entryLineNumber.WidthRequest = widget.Vbox.Allocation.Width / 4;
				containerChild.X = newX;
				widget.TextEditorContainer.QueueResize ();
			}
		}
Exemplo n.º 11
0
 void OnSizeAllocated(object o, SizeAllocatedArgs args)
 {
     if (refreshed) {
        refreshed = false;
        return;
       }
       if (Allocation.Width != old_width)
        Refresh ();
       old_width = Allocation.Width;
       refreshed = true;
 }
Exemplo n.º 12
0
        protected void OnFixedBgSizeAllocated(object o, SizeAllocatedArgs args)
        {
            if (fixedBgAllocateFlag) {
                fixedBgAllocateFlag = false;
                return;
            }
            fixedBgAllocateFlag = true;

            Gtk.Requisition ireq = mainImageBg.SizeRequest ();
            Gtk.Fixed.FixedChild w = ((global::Gtk.Fixed.FixedChild) (fixedBg [mainImageBg]));
            w.X = args.Allocation.Width - ireq.Width;
            w.Y = args.Allocation.Height - ireq.Height + IMAGE_BG_OFFSSETY;
        }
Exemplo n.º 13
0
        private static void OnSizeAllocated(object obj, SizeAllocatedArgs args)
        {
            Window window = obj as Window;
            if (obj == null) return;

            Gdk.Rectangle allocation = args.Allocation;

            if (window.IsRealized) {
                window.GdkWindow.MoveResize (allocation.X,
                                 allocation.Y,
                                 allocation.Width,
                                 allocation.Height);
            }
        }
Exemplo n.º 14
0
        void HandleSizeAllocated(object o, SizeAllocatedArgs args)
        {
            width=args.Allocation.Width;
            height=args.Allocation.Height;

            if (oldwidth == width && oldheight == height)
                return;

            oldwidth = width;
            oldheight = height;

            if(baseimage.Pixbuf==null)
                return;
            dispimage.Pixbuf=baseimage.Pixbuf.ScaleSimple(args.Allocation.Width,args.Allocation.Height,InterpType.Bilinear);
        }
Exemplo n.º 15
0
 protected virtual void OnSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
 {
     /*
      *  int w;
      *  Gdk.Rectangle a;
      *  w = (hexTV.Allocation.Width+asciiTV.Allocation.Width);
      *  a = hexTV.Allocation;
      *  a.Height = 400;
      *  a.Width = (w * 2) /3;
      *  hexTV.Allocation = a;
      *  a.X += a.Width;
      *  a.Width /= 2;
      *  asciiTV.Allocation=a;
      */
 }
Exemplo n.º 16
0
    private void OnSizeAllocated(object o, Gtk.SizeAllocatedArgs e)
    {
        windowWidth  = e.Allocation.Width;
        windowHeight = e.Allocation.Height;


        //table.Resize ((uint)windowWidth, (uint)windowHeight);
        uint width  = (uint)(windowWidth / 3);
        uint height = (uint)(windowHeight / 3);

        foreach (CameraView view in views)
        {
            view.Resize(width, height);
        }

        //Console.WriteLine ("Resize " + windowWidth + "px " + windowHeight+" px");
    }
Exemplo n.º 17
0
        private void MainResized(object obj, Gtk.SizeAllocatedArgs args)
        {
            // If the details pane pops up and covers the selected tile,
            // fix it.

            Gtk.Container mainChild = main.Child as Gtk.Container;
            if (mainChild != null)
            {
                Gtk.Widget focusChild = mainChild.FocusChild;
                mainChild.FocusChild = null;
                mainChild.FocusChild = focusChild;

                GroupView gv = mainChild as GroupView;
                if (gv != null)
                {
                    gv.AdjustCategories(args.Allocation.Height);
                }
            }
        }
        void OnResized(object s, Gtk.SizeAllocatedArgs a)
        {
            Stetic.Wrapper.Container cont = wrapper as Stetic.Wrapper.Container;
            if (cont != null)
            {
                if (cont.DesignHeight != DesignHeight)
                {
                    cont.DesignHeight = DesignHeight;
                }
                if (cont.DesignWidth != DesignWidth)
                {
                    cont.DesignWidth = DesignWidth;
                }
            }

            if (DesignSizeChanged != null)
            {
                DesignSizeChanged(this, a);
            }
        }
Exemplo n.º 19
0
    protected void OnStageVboxSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
    {
        if (stage_vbox.Children.Length == 0)
        {
            stage_vbox.QueueDraw();
        }
        else
        {
            int frame = 7;
            // Search for stages outer rect
            int l = stage_vbox.Children[0].Allocation.Left + frame;
            int t = stage_vbox.Children[0].Allocation.Top + frame;
            int r = stage_vbox.Children[0].Allocation.Right - frame;
            int b = stage_vbox.Children[0].Allocation.Bottom - frame;

            for (int i = 1; i < stage_vbox.Children.Length; i++)
            {
                if (stage_vbox.Children[i].Allocation.Left + frame < l)
                {
                    l = stage_vbox.Children[i].Allocation.Left + frame;
                }
                if (stage_vbox.Children[i].Allocation.Top + frame < t)
                {
                    t = stage_vbox.Children[i].Allocation.Top + frame;
                }
                if (stage_vbox.Children[i].Allocation.Right - frame > r)
                {
                    r = stage_vbox.Children[i].Allocation.Right - frame;
                }
                if (stage_vbox.Children[i].Allocation.Bottom - frame > b)
                {
                    b = stage_vbox.Children[i].Allocation.Bottom - frame;
                }
            }

            stage_vbox.QueueDrawArea(0, 0, stage_vbox.Allocation.Width, t);
            stage_vbox.QueueDrawArea(0, 0, l, stage_vbox.Allocation.Height);
            stage_vbox.QueueDrawArea(r, 0, stage_vbox.Allocation.Width, stage_vbox.Allocation.Height);
            stage_vbox.QueueDrawArea(0, b, stage_vbox.Allocation.Width, stage_vbox.Allocation.Height);
        }
    }
Exemplo n.º 20
0
        // This handler gets fired when the glArea widget is re-sized
        void OnSizeAllocated(object o, Gtk.SizeAllocatedArgs e)
        {
            height = e.Allocation.Height;
            width  = e.Allocation.Width;
            float parentRel = (float)width / height;

            Console.WriteLine(parentRel);

            // Avoid devide-by-zero error
            if (height == 0)
            {
                height = 1;
            }
            gl.glViewport(0, 0, width, height);
            gl.glMatrixMode(gl.GL_PROJECTION);
            gl.glLoadIdentity();
            glu.gluPerspective(45.0f, (float)width / (float)height, 1f, 100.0f);
            gl.glTranslatef(0.0f, 0.0f, -10.0f);
            gl.glMatrixMode(gl.GL_MODELVIEW);
            gl.glLoadIdentity();
        }
Exemplo n.º 21
0
        protected virtual void OnDrawingareaSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
        {
            // Center the source in the drawing area if its size
            // is smaller than the drawing area one
            if (args.Allocation.Width > sourceWidth)
            {
                xOffset = (Allocation.Width - sourceWidth) / 2;
            }
            else
            {
                xOffset = 0;
            }

            if (args.Allocation.Height > sourceHeight)
            {
                yOffset = (Allocation.Height - sourceHeight) / 2;
            }
            else
            {
                yOffset = 0;
            }
        }
 void HandleSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
 {
     if (SizeFunc != null)
     {
         var req = Math.Min(SizeFunc(), textEditor.Allocation.Width - border * 2);
         if (req != wRequest)
         {
             wRequest = req;
             QueueResize();
         }
     }
     else
     {
         if (Allocation.Width > textEditor.Allocation.Width - border * 2)
         {
             if (textEditor.Allocation.Width - border * 2 > 0)
             {
                 QueueResize();
             }
         }
     }
     Resize(Allocation);
 }
Exemplo n.º 23
0
 public void ScrollToBottom(object sender, Gtk.SizeAllocatedArgs e)
 {
     RecvChatWidget.ScrollToIter(RecvChatWidget.Buffer.EndIter, 0, false, 0, 0);
 }
Exemplo n.º 24
0
		void HandleSwSizeAllocated (object o, SizeAllocatedArgs args)
		{
			if (!initialLogShow && outputView.Visible) {
				var val = (double) ((double) control.Position / (double) control.Allocation.Width);
				PropertyService.Set (logSeparatorPositionPropertyName, val);
			}
		}
Exemplo n.º 25
0
 private void ScrollToEnd(object sender, Gtk.SizeAllocatedArgs e)
 {
     textviewConsole.ScrollToIter(textviewConsole.Buffer.EndIter, 0, false, 0, 0);
 }
		void HandleViewTextEditorhandleSizeAllocated (object o, SizeAllocatedArgs args)
		{
			if (frame == null || textEditor == null)
				return;
			int newX = textEditor.Allocation.Width - Allocation.Width - 8;
			TextEditor.EditorContainerChild containerChild = ((TextEditor.EditorContainerChild)textEditor [frame]);
			if (newX != containerChild.X) {
				searchEntry.WidthRequest = textEditor.Allocation.Width / 3;
				containerChild.X = newX;
				textEditor.QueueResize ();
			}
		}
Exemplo n.º 27
0
 protected void OnSizeAllocated(object o, SizeAllocatedArgs args)
 {
     Logger.Debug("Size was allocated");
     if (!moving) {
         Logger.Debug("Setting up to resize");
         GLib.Idle.Add (MovePreview);
         moving = true;
     }
     else
         moving = false;
 }
Exemplo n.º 28
0
 protected virtual void OnBoxInfoSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
 {
 }
 public void ScrollToBottomOnRender(object sender, Gtk.SizeAllocatedArgs e)
 {
     _textfieldOutput.ScrollToIter(_textfieldOutput.Buffer.EndIter, 0, true, 0, 0);
 }
Exemplo n.º 30
0
 private void OnSideSizeAllocated(object o, SizeAllocatedArgs args)
 {
     SetSizeRequest (-1, args.Allocation.Height + (Allocation.Height - args.Allocation.Height));
 }
Exemplo n.º 31
0
        void onResize(object o, SizeAllocatedArgs args)
        {
            MainClass.win.setmapwidget(map1);

            if (requested == true)
            {
                if (args.Allocation.Width > 100)
                {
                    requested = false;
                    map1.SetAsWater();
                  //   map1.set_optimal_size(args.Allocation.Width);
                     map1.SetGridRegion(MainClass.client.Network.CurrentSim.Handle);
                }
            }
        }
 void SelectionSizeAllocated(object obj, Gtk.SizeAllocatedArgs args)
 {
     PlaceSelectionBoxInternal(selectionWidget);
 }
Exemplo n.º 33
0
 private void on_app1_size_allocate(object obj, SizeAllocatedArgs args)
 {
     int width;
     int height;
     app1.GetSize(out width, out height);
     if(width >= 1000)
         normalGUI = true;
     else
         normalGUI = false;
     if(normalGUI != normalGUIOld) {
         Log.WriteLine("Change Size. New is normal? -> " + normalGUI.ToString());
         normalGUIOld = normalGUI;
         changeGUIAspect();
     }
 }
Exemplo n.º 34
0
 void HandleSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
 {
     AdjustPositionInEditor(Allocation);
 }
Exemplo n.º 35
0
 private void ScrollMessages(object sender, Gtk.SizeAllocatedArgs e)
 {
     messages.ScrollToIter(messages.Buffer.EndIter, 0, false, 0, 0);
 }
Exemplo n.º 36
0
 //滚轮滚动到底部
 protected void ScrollToEnd(object sender, Gtk.SizeAllocatedArgs e)
 {
     textview1.ScrollToIter(textview1.Buffer.EndIter, 0, false, 0, 0);
 }
Exemplo n.º 37
0
		void OnTreeSizeChanged (object s, SizeAllocatedArgs a)
		{
			int x, y, w, h;
			GetPosition (out x, out y);
			h = (int)sw.Vadjustment.Upper;
			w = (int)sw.Hadjustment.Upper;
			int dy = y + h - this.Screen.Height;
			int dx = x + w - this.Screen.Width;

			if (dy > 0 && sw.VscrollbarPolicy == PolicyType.Never) {
				sw.VscrollbarPolicy = PolicyType.Always;
				sw.HeightRequest = h - dy - 10;
			} else if (sw.VscrollbarPolicy == PolicyType.Always && sw.Vadjustment.Upper == sw.Vadjustment.PageSize) {
				sw.VscrollbarPolicy = PolicyType.Never;
				sw.HeightRequest = -1;
			}

			if (dx > 0 && sw.HscrollbarPolicy == PolicyType.Never) {
				sw.HscrollbarPolicy = PolicyType.Always;
				sw.WidthRequest = w - dx - 10;
			} else if (sw.HscrollbarPolicy == PolicyType.Always && sw.Hadjustment.Upper == sw.Hadjustment.PageSize) {
				sw.HscrollbarPolicy = PolicyType.Never;
				sw.WidthRequest = -1;
			}
			// Force a redraw of the whole window. This is a workaround for bug 7538
			QueueDraw ();
		}
Exemplo n.º 38
0
        void onResize(object o,SizeAllocatedArgs args)
        {
            size=args.Allocation.Width<args.Allocation.Height?args.Allocation.Width:args.Allocation.Height;
            size=size/3;
            if(oldsize==size)
                return;

            oldsize=size;

            for(int x = 0; x < 9; x++)
            {
                maps[x].set_optimal_size(size);
            }
        }
Exemplo n.º 39
0
 protected void OnTextview1SizeAllocated (object o, SizeAllocatedArgs args)
 {
     vpaned1.Position = vpaned1.Allocation.Height; //add -50 for correct size of description box
 }
Exemplo n.º 40
0
		void OnTreeSizeChanged (object s, SizeAllocatedArgs a)
		{
			int x,y,w,h;
			GetPosition (out x, out y);
			h = (int) sw.Vadjustment.Upper;
			w = (int) sw.Hadjustment.Upper;
			int dy = y + h - this.Screen.Height;
			int dx = x + w - this.Screen.Width;
			
			if (dy > 0 && sw.VscrollbarPolicy == PolicyType.Never) {
				sw.VscrollbarPolicy = PolicyType.Always;
				sw.HeightRequest = h - dy - 10;
			} else if (sw.VscrollbarPolicy == PolicyType.Always && sw.Vadjustment.Upper == sw.Vadjustment.PageSize) {
				sw.VscrollbarPolicy = PolicyType.Never;
				sw.HeightRequest = -1;
			}
			
			if (dx > 0 && sw.HscrollbarPolicy == PolicyType.Never) {
				sw.HscrollbarPolicy = PolicyType.Always;
				sw.WidthRequest = w - dx - 10;
			} else if (sw.HscrollbarPolicy == PolicyType.Always && sw.Hadjustment.Upper == sw.Hadjustment.PageSize) {
				sw.HscrollbarPolicy = PolicyType.Never;
				sw.WidthRequest = -1;
			}
		}
Exemplo n.º 41
0
	void SizeAllocatedHandler (object obj, SizeAllocatedArgs args)
	{
                Gdk.Rectangle rect = args.Allocation;
                if (rect.Equals (Gdk.Rectangle.Zero))
                        Console.WriteLine ("ERROR: Allocation is null!");

		int nrows = Allocation.Height / line_height;
		if (nrows != rows){
			rows = nrows;
			Reload ();
		}

		if (args.Allocation.Width != old_width)
			ellipses.Clear ();

		old_width = args.Allocation.Width;
	}
Exemplo n.º 42
0
	static void SizeAllocatedHandler (object obj, SizeAllocatedArgs args)
	{
		rect = args.Allocation;
	}
Exemplo n.º 43
0
 private void OnSizeAllocated(object o, SizeAllocatedArgs args)
 {
     foreach(iFolderViewGroup group in viewGroups)
        {
     group.OnSizeAllocated(o, args);
        }
 }
Exemplo n.º 44
0
		void OnItemSizeChange (object o, SizeAllocatedArgs args)
		{
			if (gettingSize || !gotSize)
				return;
			int os;
			if (calculatedSizes.TryGetValue ((Gtk.Widget) o, out os)) {
				int ns = (Orientation == Orientation.Horizontal ? args.Allocation.Width : args.Allocation.Height);
				if (os != ns) {
					Gtk.Application.Invoke (delegate {
						OnItemChange (null, null);
					});
				}
			}
		}
Exemplo n.º 45
0
	void SizeAllocatedHandler (object obj, SizeAllocatedArgs args)
	{
		Gdk.Rectangle rect = args.Allocation;
		if (rect.Equals (Gdk.Rectangle.Zero))
			Console.WriteLine ("ERROR: Allocation is null!");

                SizeChanged (rect.Width, rect.Height);
        }
Exemplo n.º 46
0
 protected void onSize(object o, SizeAllocatedArgs args)
 {
     if (circuit != null)
         circuit.draw();
 }
Exemplo n.º 47
0
		void HandleSwSizeAllocated (object o, SizeAllocatedArgs args)
		{
			if (!initialLogShow && outputView.Visible) {
				var val = (double) ((double) control.Position / (double) control.Allocation.Width);
				LogSeparatorPosition.Value = val;
			}
		}
Exemplo n.º 48
0
 public void Scroll2(object sender, Gtk.SizeAllocatedArgs e)
 {
     logtextview.ScrollToIter(logtextview.Buffer.EndIter, 0, false, 0, 0);
 }
Exemplo n.º 49
0
		void HandleControlSizeAllocated (object o, SizeAllocatedArgs args)
		{
			if (initialLogShow && outputView.Visible) {
				SetInitialOutputViewSize (args.Allocation.Width);
				initialLogShow = false;
			}
		}
Exemplo n.º 50
0
 private void HandleHostSizeAllocated(object o, SizeAllocatedArgs args)
 {
     Relocate ();
 }
Exemplo n.º 51
0
			void SizeAllocatedHandler (object o, SizeAllocatedArgs args) {
				Render();
			}
Exemplo n.º 52
0
 protected virtual void OnTextview(object o, Gtk.SizeAllocatedArgs args)
 {
     calcwidth();
 }
Exemplo n.º 53
0
 void HandleSizeAllocated(object o, SizeAllocatedArgs args)
 {
     this.SetSizeRequest(400, 64);
 }
        private void OnSizeAllocated(object o, SizeAllocatedArgs args)
        {
            // FIXME: Do we really need to do resizing this way? It blows.
            Gdk.Rectangle rect = args.Allocation;

            uint requested_columns = (uint) rect.Width/150;
            if (requested_columns == 0) requested_columns = 1;

            if (similar_items_table.NColumns != requested_columns) {
                // Need to clear the table before we resize it, apparently.
                foreach (Widget child in similar_items_table.Children)
                    similar_items_table.Remove (child);

                similar_items_table.Resize (DEFAULT_SIMILAR_TABLE_ROWS, requested_columns);
                RenderSimilarArtists ();
            }
        }