コード例 #1
0
 private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args)
 {
     if ((this.child != null))
     {
         this.child.Allocation = args.Allocation;
     }
 }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: ly774508966/glompVR
    // system event handlers

    protected virtual void OnWidgetResize(object o, Gtk.SizeAllocatedArgs args)
    {
        if (initted)
        {
            ResizeProjectionMatrix(args.Allocation);
        }
    }
コード例 #3
0
ファイル: Size.cs プロジェクト: ystk/debian-gtk-sharp2
		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);
		}
コード例 #4
0
 void Child_SizeAllocated(object o, SizeAllocatedArgs args)
 {
     if (!alloction.Equals(args.Allocation))
     {
         alloction = args.Allocation;
         JudgePostion();
     }
 }
コード例 #5
0
ファイル: DockBarItem.cs プロジェクト: nieve/monodevelop
		void HandleBarFrameSizeAllocated (object o, SizeAllocatedArgs args)
		{
			if (!lastFrameSize.Equals (args.Allocation.Size)) {
				lastFrameSize = args.Allocation.Size;
				if (autoShowFrame != null)
					bar.Frame.UpdateSize (bar, autoShowFrame);
			}
		}
コード例 #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;
     }
 }
コード例 #7
0
 protected void OnHpanedReportSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
 {
     if (args.Allocation.Width != hpanedWidth)
     {
         hpanedWidth = args.Allocation.Width;
         SetHPanedPosition();
     }
 }
コード例 #8
0
 private void CustomExpender_SizeAllocated(object o, SizeAllocatedArgs args)
 {
     if (this.Parent == null || this.Parent.Parent == null)
     {
         return;
     }
     this.Parent.Parent.QueueDraw();
 }
コード例 #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 ();
			}
		}
コード例 #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 ();
			}
		}
コード例 #11
0
ファイル: elabel.cs プロジェクト: RoDaniel/featurehouse
 void OnSizeAllocated(object o, SizeAllocatedArgs args)
 {
     if (refreshed) {
        refreshed = false;
        return;
       }
       if (Allocation.Width != old_width)
        Refresh ();
       old_width = Allocation.Width;
       refreshed = true;
 }
コード例 #12
0
ファイル: MainWindow.cs プロジェクト: pupitetris/imr
        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;
        }
コード例 #13
0
ファイル: EmbedWindow.cs プロジェクト: mono/stetic
        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);
            }
        }
コード例 #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);
        }
コード例 #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;
      */
 }
コード例 #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");
    }
コード例 #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);
                }
            }
        }
コード例 #18
0
        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);
            }
        }
コード例 #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);
        }
    }
コード例 #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();
        }
コード例 #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;
            }
        }
コード例 #22
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);
 }
コード例 #23
0
 public void ScrollToBottom(object sender, Gtk.SizeAllocatedArgs e)
 {
     RecvChatWidget.ScrollToIter(RecvChatWidget.Buffer.EndIter, 0, false, 0, 0);
 }
コード例 #24
0
ファイル: ErrorListPad.cs プロジェクト: segaman/monodevelop
		void HandleSwSizeAllocated (object o, SizeAllocatedArgs args)
		{
			if (!initialLogShow && outputView.Visible) {
				var val = (double) ((double) control.Position / (double) control.Allocation.Width);
				PropertyService.Set (logSeparatorPositionPropertyName, val);
			}
		}
コード例 #25
0
 private void ScrollToEnd(object sender, Gtk.SizeAllocatedArgs e)
 {
     textviewConsole.ScrollToIter(textviewConsole.Buffer.EndIter, 0, false, 0, 0);
 }
コード例 #26
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 ();
			}
		}
コード例 #27
0
ファイル: VideoView.cs プロジェクト: GNOME/banter
 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;
 }
コード例 #28
0
 protected virtual void OnBoxInfoSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
 {
 }
コード例 #29
0
 public void ScrollToBottomOnRender(object sender, Gtk.SizeAllocatedArgs e)
 {
     _textfieldOutput.ScrollToIter(_textfieldOutput.Buffer.EndIter, 0, true, 0, 0);
 }
コード例 #30
0
ファイル: RecommendationPane.cs プロジェクト: dufoli/banshee
 private void OnSideSizeAllocated(object o, SizeAllocatedArgs args)
 {
     SetSizeRequest (-1, args.Allocation.Height + (Allocation.Height - args.Allocation.Height));
 }
コード例 #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);
                }
            }
        }
コード例 #32
0
 void SelectionSizeAllocated(object obj, Gtk.SizeAllocatedArgs args)
 {
     PlaceSelectionBoxInternal(selectionWidget);
 }
コード例 #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();
     }
 }
コード例 #34
0
 void HandleSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
 {
     AdjustPositionInEditor(Allocation);
 }
コード例 #35
0
 private void ScrollMessages(object sender, Gtk.SizeAllocatedArgs e)
 {
     messages.ScrollToIter(messages.Buffer.EndIter, 0, false, 0, 0);
 }
コード例 #36
0
 //滚轮滚动到底部
 protected void ScrollToEnd(object sender, Gtk.SizeAllocatedArgs e)
 {
     textview1.ScrollToIter(textview1.Buffer.EndIter, 0, false, 0, 0);
 }
コード例 #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 ();
		}
コード例 #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);
            }
        }
コード例 #39
0
 protected void OnTextview1SizeAllocated (object o, SizeAllocatedArgs args)
 {
     vpaned1.Position = vpaned1.Allocation.Height; //add -50 for correct size of description box
 }
コード例 #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;
			}
		}
コード例 #41
0
ファイル: list.cs プロジェクト: alfredodev/mono-tools
	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;
	}
コード例 #42
0
	static void SizeAllocatedHandler (object obj, SizeAllocatedArgs args)
	{
		rect = args.Allocation;
	}
コード例 #43
0
 private void OnSizeAllocated(object o, SizeAllocatedArgs args)
 {
     foreach(iFolderViewGroup group in viewGroups)
        {
     group.OnSizeAllocated(o, args);
        }
 }
コード例 #44
0
ファイル: DockToolbar.cs プロジェクト: hduregger/monodevelop
		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);
					});
				}
			}
		}
コード例 #45
0
ファイル: IconList.cs プロジェクト: emtees/old-code
	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);
        }
コード例 #46
0
ファイル: MainWindow.cs プロジェクト: macbernick/celltronix
 protected void onSize(object o, SizeAllocatedArgs args)
 {
     if (circuit != null)
         circuit.draw();
 }
コード例 #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;
			}
		}
コード例 #48
0
 public void Scroll2(object sender, Gtk.SizeAllocatedArgs e)
 {
     logtextview.ScrollToIter(logtextview.Buffer.EndIter, 0, false, 0, 0);
 }
コード例 #49
0
ファイル: ErrorListPad.cs プロジェクト: segaman/monodevelop
		void HandleControlSizeAllocated (object o, SizeAllocatedArgs args)
		{
			if (initialLogShow && outputView.Visible) {
				SetInitialOutputViewSize (args.Allocation.Width);
				initialLogShow = false;
			}
		}
コード例 #50
0
ファイル: ControlOverlay.cs プロジェクト: GNOME/f-spot
 private void HandleHostSizeAllocated(object o, SizeAllocatedArgs args)
 {
     Relocate ();
 }
コード例 #51
0
ファイル: DiffWidget.cs プロジェクト: xxjeng/nuxleus
			void SizeAllocatedHandler (object o, SizeAllocatedArgs args) {
				Render();
			}
コード例 #52
0
ファイル: MainWindow.cs プロジェクト: lv333ming/legacy
 protected virtual void OnTextview(object o, Gtk.SizeAllocatedArgs args)
 {
     calcwidth();
 }
コード例 #53
0
ファイル: OriginView.cs プロジェクト: sgtnasty/battle
 void HandleSizeAllocated(object o, SizeAllocatedArgs args)
 {
     this.SetSizeRequest(400, 64);
 }
コード例 #54
0
        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 ();
            }
        }