当前位置: 首页>>代码示例>>C#>>正文


C# DrawingArea.ModifyBg方法代码示例

本文整理汇总了C#中Gtk.DrawingArea.ModifyBg方法的典型用法代码示例。如果您正苦于以下问题:C# DrawingArea.ModifyBg方法的具体用法?C# DrawingArea.ModifyBg怎么用?C# DrawingArea.ModifyBg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.DrawingArea的用法示例。


在下文中一共展示了DrawingArea.ModifyBg方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VideoView

        public VideoView()
        {
            preview_pos = PreviewPos.ButtonRight;

            VBox vbox = new VBox(false, 0);
            vbox.Show();

            Frame frame = new Frame();
            //frame.BorderWidth = 5;
            frame.Show();

            vbox.Add(frame);

            mainView = new Gtk.EventBox();
            mainView.WidthRequest = 400;
            mainView.HeightRequest = 300;
            mainView.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255,255,255));
            mainView.ModifyBg (Gtk.StateType.Active, new Gdk.Color (255,255,255));
            mainView.Show();

            //this.WidthRequest = 333; // 500; //250;
            //this.HeightRequest = 250; // 375; //187; 250
            preview = new Gtk.DrawingArea ();
            preview.WidthRequest = 120; // 75; //150;
            preview.HeightRequest = 90; // 56; //112;
            preview.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (0,0,0));
            preview.ModifyBg (Gtk.StateType.Active, new Gdk.Color (0,0,0));
            preview.Show();

            fix = new Gtk.Fixed ();
            fix.Put (preview, space, space);
            fix.Show();
            mainView.Add(fix);

            frame.Add(mainView);

            //			Label label = new Label(Catalog.GetString("Video Chat in progress..."));

            //			label.Show();
            //			vbox.PackStart(label, false, true, 0);

            Button button = new Button(Catalog.GetString("End Call"));
            button.Clicked += OnCloseVideoClicked;
            button.Show();
            vbox.PackStart(button, false, false, 5);

            this.Add(vbox);
            mainView.SizeAllocated += OnSizeAllocated;
            //			this.SizeRequested += OnsizeRequested;
            this.QueueResize ();
            MovePreview ();
        }
开发者ID:GNOME,项目名称:banter,代码行数:52,代码来源:VideoView.cs

示例2: DemoColorSelection

		public DemoColorSelection () : base ("Color Selection")
		{
			BorderWidth = 8;
			VBox vbox = new VBox (false,8);
			vbox.BorderWidth = 8;
			Add (vbox);

			// Create the color swatch area
			Frame frame = new Frame ();
			frame.ShadowType = ShadowType.In;
			vbox.PackStart (frame, true, true, 0);

			drawingArea = new DrawingArea ();
			drawingArea.ExposeEvent += new ExposeEventHandler (ExposeEventCallback);
			// set a minimum size
			drawingArea.SetSizeRequest (200,200);
			// set the color
			color = new Gdk.Color (0, 0, 0xff);
			drawingArea.ModifyBg (StateType.Normal, color);
			frame.Add (drawingArea);

			Alignment alignment = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
			Button button = new Button ("_Change the above color");
			button.Clicked += new EventHandler (ChangeColorCallback);
			alignment.Add (button);
			vbox.PackStart (alignment);

			ShowAll ();
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:29,代码来源:DemoColorSelection.cs

示例3: GetDisplayWidget

        public override Gtk.Widget GetDisplayWidget()
        {
            DrawingArea colorPreview = new DrawingArea ();

            colorPreview.ModifyBg(StateType.Normal, GetColor ());
            colorPreview.WidthRequest = 15;

            Alignment colorPreviewAlign = new Alignment (0, 0, 0, 1);
            colorPreviewAlign.SetPadding (2, 2, 2, 2);
            colorPreviewAlign.Add (colorPreview);

            string labelText;

            System.Drawing.Color color = (System.Drawing.Color) parentRow.PropertyValue;
            //TODO: dropdown known color selector so this does something
            if (color.IsKnownColor)
                labelText = color.Name;
            else if (color.IsEmpty)
                labelText = "[empty]";
            else
                labelText = String.Format("#{0:x2}{1:x2}{2:x2}", color.R, color.G, color.B);

            //we use StringValue as it auto-bolds the text for non-default values
            Label theLabel = (Label) base.StringValue (labelText);
            theLabel.Xalign = 0;
            theLabel.Xpad = 3;

            HBox hbox = new HBox ();
            hbox.PackStart (colorPreviewAlign, false, false, 0);
            hbox.PackStart (theLabel, true, true, 0);

            return hbox;
        }
开发者ID:mono,项目名称:aspeditor,代码行数:33,代码来源:ColorEditor.cs

示例4: DemoRotatedText

		public DemoRotatedText () : base ("Rotated text")
		{
			DrawingArea drawingArea = new DrawingArea ();
			Gdk.Color white = new Gdk.Color (0xff, 0xff, 0xff);

			// This overrides the background color from the theme
			drawingArea.ModifyBg (StateType.Normal, white);
			drawingArea.ExposeEvent += new ExposeEventHandler (RotatedTextExposeEvent);

			this.Add (drawingArea);
			this.DeleteEvent += new DeleteEventHandler (OnWinDelete);
			this.SetDefaultSize (2 * RADIUS, 2 * RADIUS);
			this.ShowAll ();
		}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:14,代码来源:DemoRotatedText.cs

示例5: MainWindow

        public MainWindow()
            : base("Overlaytest")
        {
            VBox vBox = new VBox ();

            _da = new DrawingArea ();
            _da.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (0, 0, 0));
            _da.SetSizeRequest (400, 300);
            _da.DoubleBuffered = false;
            vBox.PackStart (_da, false, false, 0);

            _scale = new HScale (0, 1, 0.01);
            _scale.DrawValue = false;
            _scale.ValueChanged += ScaleValueChanged;
            vBox.PackStart (_scale, false, false, 0);

            HBox hBox = new HBox ();

            Button btnOpen = new Button ();
            btnOpen.Label = "Open";
            btnOpen.Clicked += ButtonOpenClicked;

            hBox.PackStart (btnOpen, false, false, 0);

            Button btnPlay = new Button ();
            btnPlay.Label = "Play";
            btnPlay.Clicked += ButtonPlayClicked;

            hBox.PackStart (btnPlay, false, false, 0);

            Button btnPause = new Button ();
            btnPause.Label = "Pause";
            btnPause.Clicked += ButtonPauseClicked;

            hBox.PackStart (btnPause, false, false, 0);

            _lbl = new Label ();
            _lbl.Text = "00:00 / 00:00";

            hBox.PackEnd (_lbl, false, false, 0);

            vBox.PackStart (hBox, false, false, 3);

            Add (vBox);

            WindowPosition = Gtk.WindowPosition.Center;
            DeleteEvent += OnDeleteEvent;

            GLib.Timeout.Add (1000, new GLib.TimeoutHandler (UpdatePos));
        }
开发者ID:knocte,项目名称:gstreamer-sharp-1,代码行数:50,代码来源:VideoOverlay.cs

示例6: BackGroundColorChangeMenuBar

		public void BackGroundColorChangeMenuBar()
		{
			try {

				da1 = new DrawingArea ();
				da1.ExposeEvent += OnExposed1;

				Gdk.Color col = new Gdk.Color ();
				Gdk.Color.Parse ("#3b5998", ref col);

				ModifyBg (StateType.Normal, col);
				da1.ModifyBg (StateType.Normal, col);



			} catch (Exception ex) {
				Console.Write (ex.Message);
			}
		}
开发者ID:sumitglobussoft,项目名称:pinDominator-3.0,代码行数:19,代码来源:FanPage.cs

示例7: BackGroundColorChange

	public void BackGroundColorChange()
	{
		try {
				da = new DrawingArea ();
				da.ExposeEvent += OnExposed1;

				Gdk.Color col = new Gdk.Color ();
				Gdk.Color.Parse ("#6d84b4", ref col);
		

				Gdk.Color col1 = new Gdk.Color ();
				Gdk.Color.Parse ("#dfe3ee", ref col1);

				Gdk.Color col2 = new Gdk.Color ();
				Gdk.Color.Parse ("#f7f7f7", ref col2);

				da.ModifyBg (StateType.Normal, col);
		} 
		catch (Exception ex) 
		{
			Console.Write (ex.Message);
		}
	}
开发者ID:sumitglobussoft,项目名称:pinDominator-3.0,代码行数:23,代码来源:MainWindow.cs

示例8: SetButtonColor

 void SetButtonColor(DrawingArea area, Color color)
 {
     Gdk.Color gcolor = Misc.ToGdkColor (color);
     area.ModifyBg (StateType.Normal, gcolor);
     area.ModifyBg (StateType.Active, gcolor);
     area.ModifyBg (StateType.Insensitive, gcolor);
     area.ModifyBg (StateType.Prelight, gcolor);
     area.ModifyBg (StateType.Selected, gcolor);
 }
开发者ID:GNOME,项目名称:longomatch,代码行数:9,代码来源:NewProjectPanel.cs

示例9: initDrawingArea

 // }}}
 // MainWindow::initDrawingArea() {{{
 /// <summary>Init the drawing area and put some layout's property</summary>
 /// <param name="area">The drawing area</param> 
 /// <returns>void</returns>
 public void initDrawingArea(DrawingArea area)
 {
     area.SetSizeRequest(this.pref.mainWindowWidth, this.pref.mainWindowHeight);
     area.ExposeEvent += onExposeEvent;
     // define some colors
     Gdk.Color white = new Gdk.Color();
     Gdk.Color black = new Gdk.Color();
     Gdk.Color.Parse("white", ref white);
     Gdk.Color.Parse("black", ref black);
     // define area colors
     area.ModifyBg(StateType.Normal, white);
     area.ModifyBase(StateType.Normal, black);
     // XXX move out ?
     this.layout.Width = Pango.Units.FromPixels(this.pref.mainWindowWidth);
     this.layout.Wrap = Pango.WrapMode.Word;
     this.layout.Alignment = Pango.Alignment.Left;
 }
开发者ID:geelweb,项目名称:iplviewer,代码行数:22,代码来源:MainWindow.cs

示例10: Display_Result

		static void Display_Result (Gdk.Color color)
		{
			dialog = new Dialog ();
			dialog.Title = "Selected Color: " + HexFormat (color);
			dialog.HasSeparator = true;

			DrawingArea da = new DrawingArea ();

			da.ModifyBg (StateType.Normal, color);

			dialog.VBox.BorderWidth = 10;
			dialog.VBox.PackStart (da, true, true, 10);
			dialog.SetDefaultSize (200, 200);

			Button button = new Button (Stock.Ok);
			button.Clicked += new EventHandler (Dialog_Ok);
			button.CanDefault = true;
			dialog.ActionArea.PackStart (button, true, true, 0);
			button.GrabDefault ();

			dialog.ShowAll ();
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:22,代码来源:TestColorSelection.cs

示例11: AddExtraControlsSeparator

		void AddExtraControlsSeparator ()
		{
			projectConfigurationTable.NRows++;

			extraControlsSeparator = new DrawingArea ();
			extraControlsSeparator.HeightRequest = 1;
			extraControlsSeparator.ModifyBg (StateType.Normal, separatorColor);
			projectConfigurationTable.Attach (
				extraControlsSeparator,
				0,
				3,
				defaultTableRows,
				defaultTableRows + 1,
				AttachOptions.Fill,
				(AttachOptions)0,
				0,
				10);
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:18,代码来源:GtkProjectConfigurationWidget.cs

示例12: Init

        private static void Init()
        {
            _random = new Random();

            InitializeLua();

            Application.Init();
            if (!GLib.Thread.Supported)
                GLib.Thread.Init();
            Gdk.Threads.Init();

            Gdk.Threads.Enter();

            _window = new Gtk.Window(Globals.WINDOW_NAME);
            _window.SetDefaultSize(Globals.WIDTH, Globals.HEIGHT);
            _window.AppPaintable = true;
            _window.DoubleBuffered = false;
            _window.DeleteEvent += OnWinDelete;
            _window.KeyPressEvent += OnKeyPress;
            _window.KeyReleaseEvent += OnKeyRelease;
            //_window.ConfigureEvent += OnWindowConfigure;

            DrawingArea da = new DrawingArea();
            da.ExposeEvent += OnExposed;

            Gdk.Color col = new Gdk.Color(0, 0, 0);
            _window.ModifyBg(StateType.Normal, col);
            da.ModifyBg(StateType.Normal, col);

            GLib.Timeout.Add(33, new GLib.TimeoutHandler(Graphics.TimedDraw));

            _window.Add(da);
            _window.ShowAll();

            Gdk.Threads.Leave();

            Graphics.Init();    // depends on _window being initialized
            Item.Init();
            Enemy.Init();       // depends on Globals ctor
            Weapon.Init();      // depends on Globals ctor
            Armor.Init();       // depends on Globals ctor
            Accessory.Init();   // depends on Globals ctor
            Materia.Init();     // depends on Globals ctor
            Character.Init();   // depends on [Weapons|Armor|Materia].Init()
            Globals.Init();     // depends on Character.Init()
            MenuScreen.Init();  // depends on Globals.Init()
            Inventory.Init();   // depends on a whole lot of things
            Spell.Init();       // depends on Globals ctor
            Materiatory.Init(); // depends on Materia.Init()

            int time = Int32.Parse(Globals.SaveGame.SelectSingleNode("//time").InnerText);
            _clock = new Clock(time); // depends on Globals ctor

            // Go to Main Menu
            _state = MainMenu;

            // Go to new Battle
            //GoToBattleState();

            // Go to Post-Battle
            //List<IItem> i = new List<IItem>();
            //i.Add(Item.ItemTable["powersource"]);
            //i.Add(Item.ItemTable["powersource"]);
            //i.Add(Item.ItemTable["potion"]);
            //PostBattle = new PostBattleState(234, 12, 1200, i);
            //_state = PostBattle;

            _state.Init();

            if (Globals.Party[0] == null && Globals.Party[1] == null && Globals.Party[2] == null)
                throw new GamedataException("No character in party!");

            // Level-up demo
            //using (StreamWriter w = new StreamWriter(@"c:\scripts\test.txt"))
            //{
            //    while (Character.Cloud.Level < 98)
            //    {
            //        Character.Cloud.GainExperience(Character.Cloud.ToNextLevel + 10);
            //        w.WriteLine(Character.Cloud.ToString());
            //    }
            //    w.Flush();
            //}
        }
开发者ID:skinitimski,项目名称:Reverence,代码行数:83,代码来源:Game.cs


注:本文中的Gtk.DrawingArea.ModifyBg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。