• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# EventBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中EventBox的典型用法代码示例。如果您正苦于以下问题:C# EventBox类的具体用法?C# EventBox怎么用?C# EventBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EventBox类属于命名空间,在下文中一共展示了EventBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Main

    public static void Main(string[] args)
    {
        Gtk.Window window;
          EventBox eventbox;
          Label label;

          Application.Init();

          window = new Gtk.Window ("Eventbox");
          window.DeleteEvent += new DeleteEventHandler (delete_event);

          window.BorderWidth = 10;
          window.Resize(400,300);

          eventbox = new EventBox ();
          window.Add (eventbox);
          eventbox.Show();

          label = new Label ("Click here to quit");
          eventbox.Add(label);
          label.Show();

          label.SetSizeRequest(110, 20);

          eventbox.ButtonPressEvent += new ButtonPressEventHandler (exitbutton_event);

          eventbox.Realize();

          window.Show();

          Application.Run();
    }
开发者ID:BackupTheBerlios,项目名称:genaro,代码行数:32,代码来源:eventBox.cs


示例2: TIcon

        public TIcon(CInterfaceGateway in_krnGateway, Gtk.Window mwindow)
        {
            krnGateway = in_krnGateway;
            mainwindow = mwindow;

             	menu = new Gtk.Menu ();
               		EventBox eb = new EventBox ();
            eb.ButtonPressEvent += new ButtonPressEventHandler (TIconClicked);
            eb.Add (new Gtk.Image (new Gdk.Pixbuf (null, "lPhant.png")));

            MenuItem it_show = new MenuItem ("Show");
            it_show.Activated += new EventHandler (TIconShow);

            MenuItem it_options = new MenuItem ("Options");
            it_options.Activated += new EventHandler (TIconOptions);

            ImageMenuItem it_quit = new ImageMenuItem("Quit");
            it_quit.Activated += new EventHandler (TIconQuit);

            menu.Append (it_show);
            menu.Append (it_options);
            menu.Append (it_quit);

               	   t = new TrayIcon ("eLePhantGTK");
               	   t.Add (eb);
               	   t.ShowAll ();
        }
开发者ID:sonicwang1989,项目名称:lphant,代码行数:27,代码来源:TIcon.cs


示例3: buildWindow

        private void buildWindow()
        {
            this.Resizable = false;

            EventBox labelContainer = new EventBox ();

            Label badFileLabel = new Label (Constants.Constants.badFilePathPopupText);
            //set the style of the label
            Style labelStyle = badFileLabel.Style.Copy();
            labelStyle.FontDescription.Family = Constants.Constants.welcomeWindowFontFamily;
            labelStyle.FontDescription.Size = Constants.Constants.CONFIRM_RELOAD_MESSAGE_SIZE;
            badFileLabel.Style = labelStyle.Copy();

            labelContainer.Add (badFileLabel);

            closeButton = new Button (Constants.Constants.closeButtonText);
            closeButton.Clicked += new EventHandler (dismissDialog);

            //set the style of close button
            Style buttonStyle = closeButton.Style.Copy ();
            buttonStyle.FontDescription.Family = Constants.Constants.welcomeWindowFontFamily;
            buttonStyle.FontDescription.Size = Constants.Constants.WELCOME_BUTTON_FONT_SIZE;
            closeButton.Style = buttonStyle.Copy ();

            HBox masterContainer = new HBox ();
            VBox mainContainer = new VBox ();

            mainContainer.PackStart (labelContainer, false, false, 50);
            mainContainer.PackStart (closeButton, false, false, 50);

            masterContainer.PackStart (mainContainer, true, true, 100);

            this.Add (masterContainer);
        }
开发者ID:gnikonorov,项目名称:MemoryVisualizer,代码行数:34,代码来源:InvalidFilePopup.cs


示例4: TabLabel

		public TabLabel (Label label, Gtk.Image icon) : base (false, 0)
		{
			this.title = label;
			this.icon = icon;
			icon.Xpad = 2;

			EventBox eventBox = new EventBox ();
			eventBox.BorderWidth = 0;
			eventBox.VisibleWindow = false;
			eventBox.Add (icon);
			this.PackStart (eventBox, false, true, 0);

			titleBox = new EventBox ();
			titleBox.VisibleWindow = false;
			titleBox.Add (title);
			this.PackStart (titleBox, true, true, 0);

			Gtk.Rc.ParseString ("style \"MonoDevelop.TabLabel.CloseButton\" {\n GtkButton::inner-border = {0,0,0,0}\n }\n");
			Gtk.Rc.ParseString ("widget \"*.MonoDevelop.TabLabel.CloseButton\" style  \"MonoDevelop.TabLabel.CloseButton\"\n");
			Button button = new Button ();
			button.CanDefault = false;
			var closeIcon = new Xwt.ImageView (closeImage).ToGtkWidget ();
			button.Image = closeIcon;
			button.Relief = ReliefStyle.None;
			button.BorderWidth = 0;
			button.Clicked += new EventHandler(ButtonClicked);
			button.Name = "MonoDevelop.TabLabel.CloseButton";
			this.PackStart (button, false, true, 0);
			this.ClearFlag (WidgetFlags.CanFocus);
			this.BorderWidth = 0;

			this.ShowAll ();
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:33,代码来源:TabLabel.cs


示例5: SetupWindow

        public SetupWindow()
            : base("SparkleShare Setup")
        {
            SetWmclass ("SparkleShare", "SparkleShare");

            IconName       = "org.sparkleshare.SparkleShare";
            Resizable      = false;
            WindowPosition = WindowPosition.CenterAlways;
            Deletable      = false;
            TypeHint       = Gdk.WindowTypeHint.Dialog;

            SetSizeRequest (400, 400);

            DeleteEvent += delegate (object sender, DeleteEventArgs args) { args.RetVal = true; };

                VBox layout_vertical = new VBox (false, 16);
            layout_vertical.BorderWidth = 16;

                    this.content_area    = new EventBox ();
                    this.option_area = new EventBox ();

                    this.buttons = CreateButtonBox ();

                HBox layout_actions = new HBox (false , 16);

                layout_actions.PackStart (this.option_area, true, true, 0);
                layout_actions.PackStart (this.buttons, false, false, 0);

                layout_vertical.PackStart (this.content_area, true, true, 0);
                layout_vertical.PackStart (layout_actions, false, false, 0);

            base.Add (layout_vertical);
        }
开发者ID:Rud5G,项目名称:SparkleShare,代码行数:33,代码来源:SetupWindow.cs


示例6: PlainSurfaceItem

        public PlainSurfaceItem(int maxWidth, int maxHeight, int widthRequest = 0, int heightRequest = 0, string label = null)
        {
            //Console.WriteLine ("PlainSurfaceItem");
            _label = label;
            this._evtBox = new EventBox ();
            this._draw = new global::Gtk.DrawingArea ();
            if(widthRequest > 0) {
                _draw.WidthRequest = widthRequest;
            }
            if(heightRequest > 0) {
                _draw.HeightRequest = heightRequest;
            }

            this._evtBox.Add (this._draw);

            maxWidth = Math.Max (maxWidth, widthRequest);
            maxHeight = Math.Max (maxHeight, heightRequest);
            this._height = Math.Max(_draw.Allocation.Height, heightRequest);
            this._width = Math.Max(_draw.Allocation.Width, widthRequest);
            this._mode = DisplayMode.Snapshot;
            this._surface = new ImageSurface(Format.Argb32, maxWidth, maxHeight);
            this._button = MouseButton.None;
            this._background = new Color (1.0, 1.0, 1.0);

            _draw.ExposeEvent += DrawExpose;
            _evtBox.ButtonPressEvent += DrawButtonPressEvent;
            _evtBox.ButtonReleaseEvent += DrawButtonReleaseEvent;
            _evtBox.MotionNotifyEvent += DrawMotionNotifyEvent;
        }
开发者ID:codingcave,项目名称:CoupledOdeViewer,代码行数:29,代码来源:PlainSurfaceItem.cs


示例7: AutoHideBox

		public AutoHideBox (DockFrame frame, DockItem item, Gtk.PositionType pos, int size)
		{
			this.position = pos;
			this.frame = frame;
			this.targetSize = size;
			horiz = pos == PositionType.Left || pos == PositionType.Right;
			startPos = pos == PositionType.Top || pos == PositionType.Left;
			Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
			
			Box fr;
			CustomFrame cframe = new CustomFrame ();
			switch (pos) {
				case PositionType.Left: cframe.SetMargins (1, 1, 0, 1); break;
				case PositionType.Right: cframe.SetMargins (1, 1, 1, 0); break;
				case PositionType.Top: cframe.SetMargins (0, 1, 1, 1); break;
				case PositionType.Bottom: cframe.SetMargins (1, 0, 1, 1); break;
			}
			EventBox sepBox = new EventBox ();
			cframe.Add (sepBox);
			
			if (horiz) {
				fr = new HBox ();
				sepBox.Realized += delegate { sepBox.GdkWindow.Cursor = resizeCursorW; };
				sepBox.WidthRequest = gripSize;
			} else {
				fr = new VBox ();
				sepBox.Realized += delegate { sepBox.GdkWindow.Cursor = resizeCursorH; };
				sepBox.HeightRequest = gripSize;
			}
			
			sepBox.Events = EventMask.AllEventsMask;
			
			if (pos == PositionType.Left || pos == PositionType.Top)
				fr.PackEnd (cframe, false, false, 0);
			else
				fr.PackStart (cframe, false, false, 0);

			Add (fr);
			ShowAll ();
			Hide ();
			
			scrollable = new ScrollableContainer ();
			scrollable.ScrollMode = false;
			scrollable.Show ();

			if (item.Widget.Parent != null) {
				((Gtk.Container)item.Widget.Parent).Remove (item.Widget);
			}

			item.Widget.Show ();
			scrollable.Add (item.Widget);
			fr.PackStart (scrollable, true, true, 0);
			
			sepBox.ButtonPressEvent += OnSizeButtonPress;
			sepBox.ButtonReleaseEvent += OnSizeButtonRelease;
			sepBox.MotionNotifyEvent += OnSizeMotion;
			sepBox.ExposeEvent += OnGripExpose;
			sepBox.EnterNotifyEvent += delegate { insideGrip = true; sepBox.QueueDraw (); };
			sepBox.LeaveNotifyEvent += delegate { insideGrip = false; sepBox.QueueDraw (); };
		}
开发者ID:JamesChan,项目名称:monodevelop,代码行数:60,代码来源:AutoHideBox.cs


示例8: WebViewer

        public WebViewer()
            : base(WindowType.Toplevel)
        {
            xml = new XML (null, "MainWindow.glade", "mainBox", null);
            xml.Autoconnect (this);
            Gdk.Pixbuf pix = new Gdk.Pixbuf (null, "webnotes-16.png");

            //Window settings
            Title = "WebNotes";
            WindowPosition = WindowPosition.Center;
            Icon = pix;
            Resize (650,600);

            //Trayicon stuff
            trayIcon = new TrayIcon ("WebNotes");
            EventBox ebox = new EventBox ();
            ebox.ButtonPressEvent += ButtonPressed;
            Image image = new Image (pix);
            ebox.Add (image);
            trayIcon.Add (ebox);
            trayIcon.ShowAll ();

            //Gecko webcontrol
            wc = new WebControl ();
            wc.LoadUrl ("http://localhost:8000");
            geckoBox.Add (wc);

            optionMenu.Changed += OptionChanged;
            BuildMenu ();
            int firstPage = list.IndexOf ("WikiHome");
            if (firstPage != -1)
            optionMenu.SetHistory ((uint)firstPage);

            Add (mainBox);
        }
开发者ID:BackupTheBerlios,项目名称:mspace-svn,代码行数:35,代码来源:WebViewer.cs


示例9: ImageWindow

        public ImageWindow(string src)
            : base(src)
        {
            Decorated = false;
            KeepAbove = true;
            Resize (640, 240);
            Move (100, 100);
            //Opacity = 1.0;

            pixbuf = new Pixbuf (src);

            Gtk.Image image = new Gtk.Image ();
            image.Pixbuf = pixbuf;

            EventBox box = new EventBox ();
            box.Add (image);
            box.ButtonPressEvent += new ButtonPressEventHandler (WindowController.OnButtonDragPress);
            box.ExposeEvent += HandleMyWinExposeEvent;

            Add (box);

            WindowController.HandleMyWinScreenChanged(this, null);
            WindowController.SetWindowShapeFromPixbuf (this, image.Pixbuf);

            DestroyEvent += new DestroyEventHandler (delegate(object o, DestroyEventArgs args) {
                if(cr!=null){
                    ((IDisposable)cr).Dispose();
                }
            });

            ShowAll();
        }
开发者ID:niwakazoider,项目名称:unicast,代码行数:32,代码来源:ImageWindow.cs


示例10: TreeViewCellContainer

		public TreeViewCellContainer (Gtk.Widget child)
		{
			box = new EventBox ();
			box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);
			box.Add (child);
			child.Show ();
			Show ();
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:8,代码来源:TreeViewCellContainer.cs


示例11: EventBoxTooltip

		/// <summary>
		/// The EventBox should have Visible set to false otherwise the tooltip pop window
		/// will have the wrong location.
		/// </summary>
		public EventBoxTooltip (EventBox eventBox)
		{
			this.eventBox = eventBox;

			eventBox.EnterNotifyEvent += HandleEnterNotifyEvent;
			eventBox.LeaveNotifyEvent += HandleLeaveNotifyEvent;

			Position = PopupPosition.TopLeft;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:13,代码来源:EventBoxTooltip.cs


示例12: CreateColorBox

 private Widget CreateColorBox(string name, Gdk.Color color)
 {
     EventBox eb = new EventBox();
        eb.ModifyBg(StateType.Normal, color);
        Label l = new Label(name);
        eb.Add(l);
        l.Show();
        return eb;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:9,代码来源:iFolderWindow.cs


示例13: TreeViewCellContainer

		public TreeViewCellContainer (Gtk.Widget child)
		{
			box = new EventBox ();
			box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);
			box.ModifyBg (StateType.Normal, Style.White);
			box.Add (child);
			child.Show ();
			Show ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:9,代码来源:TreeViewCellContainer.cs


示例14: ChatsPage

        private ChatsPage()
        {
            base.FocusGrabbed += base_FocusGrabbed;

            closePixbuf = new Gdk.Pixbuf(null, "FileFind.Meshwork.GtkClient.smallclose.png");

            tabLabelPages = new Dictionary<Widget, ChatSubpageBase>();

            notebook = new Notebook();
            notebook.TabPos = PositionType.Bottom;
            notebook.SwitchPage += notebook_SwitchPage;
            notebook.PageReordered += notebook_PageReordered;

            ScrolledWindow swindow = new ScrolledWindow();
            swindow.HscrollbarPolicy = PolicyType.Automatic;
            swindow.VscrollbarPolicy = PolicyType.Automatic;
            chatList = new TreeView ();
            swindow.Add(chatList);

            chatTreeStore = new NetworkGroupedTreeStore<ChatRoom>(chatList);
            chatList.Model = chatTreeStore;

            TreeViewColumn column;

            column = chatList.AppendColumn("Room Name", new CellRendererText(), new TreeCellDataFunc (NameDataFunc));
            column.Expand = true;
            column.Sizing = TreeViewColumnSizing.Autosize;

            var pixbufCell = new CellRendererPixbuf();
            column.PackStart(pixbufCell, false);
            column.SetCellDataFunc(pixbufCell, new TreeCellDataFunc(RoomSecureDataFunc));

            column = chatList.AppendColumn("Users", new CellRendererText(), new TreeCellDataFunc (RoomUsersDataFunc));
            column.Sizing = TreeViewColumnSizing.Autosize;

            chatList.RowActivated += chatList_RowActivated;
            chatList.ButtonPressEvent += chatList_ButtonPressEvent;

            EventBox box = new EventBox();
            box.Add(new Label("Chatroom List"));
            box.ButtonPressEvent += HandleTabButtonPressEvent;
            box.ShowAll();
            notebook.AppendPage(swindow, box);

            this.PackStart(notebook, true, true, 0);
            notebook.ShowAll();

            foreach (Network network in Core.Networks) {
                Core_NetworkAdded (network);
            }

            Core.NetworkAdded +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkAdded)
                );
        }
开发者ID:codebutler,项目名称:meshwork,代码行数:56,代码来源:ChatsPage.cs


示例15: Build

        private void Build ()
        {
            HeightRequest = 24;

            eventbox = new EventBox ();
            eventbox.Events = (Gdk.EventMask)256;
            eventbox.VisibleWindow = false;

            Add (eventbox);
        }
开发者ID:msiyer,项目名称:Pinta,代码行数:10,代码来源:ColorPanelWidget.cs


示例16: StatusBar

        // create the status bar
        public StatusBar(FuseApp fuse, VBox box)
        {
            this.fuse = fuse;
            this.box = box;

            EventBox eb = new EventBox ();
            eb.Add (image);
            eb.ButtonReleaseEvent += notify_clicked;
            this.PackStart (eb, false, false, 2);
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:11,代码来源:StatusBar.cs


示例17: RecommendationPane

        public RecommendationPane()
        {
            Visible = false;

            EventBox event_box = new EventBox ();
            event_box.ModifyBg(StateType.Normal, new Gdk.Color(0xff,0xff,0xff));

            main_box = new HBox ();
            main_box.BorderWidth = 5;

            similar_box = new VBox (false, 3);
            tracks_box = new VBox (false, 3);
            albums_box = new VBox (false, 3);

            Label similar_header = new Label ();
            similar_header.Xalign = 0;
            similar_header.Ellipsize = Pango.EllipsizeMode.End;
            similar_header.Markup = String.Format ("<b>{0}</b>", Catalog.GetString ("Recommended Artists"));
            similar_box.PackStart (similar_header, false, false, 0);

            tracks_header = new Label ();
            tracks_header.Xalign = 0;
            tracks_header.WidthChars = 25;
            tracks_header.Ellipsize = Pango.EllipsizeMode.End;
            tracks_box.PackStart (tracks_header, false, false, 0);

            albums_header = new Label ();
            albums_header.Xalign = 0;
            albums_header.WidthChars = 25;
            albums_header.Ellipsize = Pango.EllipsizeMode.End;
            albums_box.PackStart (albums_header, false, false, 0);

            similar_items_table = new Table (DEFAULT_SIMILAR_TABLE_ROWS, DEFAULT_SIMILAR_TABLE_COLS, false);
            similar_items_table.SizeAllocated += OnSizeAllocated;
            similar_box.PackEnd (similar_items_table, true, true, 0);

            tracks_items_box = new VBox (false, 0);
            tracks_box.PackEnd (tracks_items_box, true, true, 0);

            albums_items_box = new VBox (false, 0);
            albums_box.PackEnd (albums_items_box, true, true, 0);

            main_box.PackStart (similar_box, true, true, 5);
            main_box.PackStart (new VSeparator (), false, false, 0);
            main_box.PackStart (tracks_box, false, false, 5);
            main_box.PackStart (new VSeparator (), false, false, 0);
            main_box.PackStart (albums_box, false, false, 5);

            event_box.Add (main_box);
            Add (event_box);

            if (!Directory.Exists (CACHE_PATH))
                Directory.CreateDirectory (CACHE_PATH);
        }
开发者ID:jrmuizel,项目名称:banshee-unofficial-plugins,代码行数:54,代码来源:RecommendationPane.cs


示例18: Tray

 public Tray(MainWindow win)
 {
     _mainwin = win;
     // we need a eventbox, because Gtk.Image doesn't receive signals
     EventBox eb = new EventBox ();
     eb.Add (new Image (Stock.Network, IconSize.Menu)); // using stock icon
     eb.ButtonPressEvent += new ButtonPressEventHandler (this.OnImageClick);
     TrayIcon icon = new TrayIcon ("MonoGnomeArt");
     icon.Add (eb);
     // showing the trayicon
     icon.ShowAll ();
 }
开发者ID:klessou,项目名称:monognomeart,代码行数:12,代码来源:Tray.cs


示例19: BuildHeader

        private void BuildHeader ()
        {
            source_actions_align = new Gtk.Alignment (0f, .5f, 1f, 0f) {
                RightPadding = 0,
                LeftPadding = 0,
                NoShowAll = true
            };

            if (Hyena.PlatformDetection.IsMeeGo) {
                source_actions_align.RightPadding = 5;
                source_actions_align.TopPadding = 5;
            }

            footer = new VBox ();

            source_actions_box = new EventBox () { Visible = true };

            BuildSearchEntry ();

            InterfaceActionService uia = ServiceManager.Get<InterfaceActionService> ();
            if (uia != null) {
                Gtk.Action action = uia.GlobalActions["WikiSearchHelpAction"];
                if (action != null) {
                    MenuItem item = new SeparatorMenuItem ();
                    item.Show ();
                    search_entry.Menu.Append (item);

                    item = new ImageMenuItem (Stock.Help, null);
                    item.Activated += delegate { action.Activate (); };
                    item.Show ();
                    search_entry.Menu.Append (item);
                }
            }

            source_actions_box.ShowAll ();
            source_actions_align.Add (source_actions_box);
            source_actions_align.Hide ();
            search_entry.Show ();


            context_pane = new Banshee.ContextPane.ContextPane ();
            context_pane.ExpandHandler = b => {
                SetChildPacking (content.Widget, !b, true, 0, PackType.Start);
                SetChildPacking (context_pane, b, b, 0, PackType.End);
            };

            // Top to bottom, their order is reverse of this:
            PackEnd (footer, false, false, 0);
            PackEnd (context_pane, false, false, 0);
            PackEnd (source_actions_align, false, false, 0);
            PackEnd (new ConnectedMessageBar (), false, true, 0);
        }
开发者ID:gclark916,项目名称:banshee,代码行数:52,代码来源:ViewContainer.cs


示例20: OnMainWindowStarted

        // ============================================
        // PROTECTED (Methods) Event Handlers
        // ============================================
        protected void OnMainWindowStarted(object sender)
        {
            EventBox eb = new EventBox();
            eb.Add(new Image("NyFolderIcon", IconSize.Menu));

            // hooking event
            eb.ButtonPressEvent += new ButtonPressEventHandler(OnImageClick);
            notificationArea = new NotificationArea("NyFolder");
            notificationArea.Add(eb);

            // showing the trayicon
            notificationArea.ShowAll();
        }
开发者ID:BackupTheBerlios,项目名称:nyfolder-svn,代码行数:16,代码来源:TrayIcon.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# EventContext类代码示例发布时间:2022-05-24
下一篇:
C# EventAttributes类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap