コード例 #1
0
ファイル: SetupWindow.cs プロジェクト: Rud5G/SparkleShare
        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);
        }
コード例 #2
0
ファイル: TIcon.cs プロジェクト: sonicwang1989/lphant
        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 ();
        }
コード例 #3
0
ファイル: eventBox.cs プロジェクト: BackupTheBerlios/genaro
    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();
    }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: ImageWindow.cs プロジェクト: niwakazoider/unicast
        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();
        }
コード例 #6
0
        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;
        }
コード例 #7
0
		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 ();
		}
コード例 #8
0
        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);
        }
コード例 #9
0
ファイル: AutoHideBox.cs プロジェクト: JamesChan/monodevelop
		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 (); };
		}
コード例 #10
0
		public TreeViewCellContainer (Gtk.Widget child)
		{
			box = new EventBox ();
			box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);
			box.Add (child);
			child.Show ();
			Show ();
		}
コード例 #11
0
		/// <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;
		}
コード例 #12
0
		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 ();
		}
コード例 #13
0
 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;
 }
コード例 #14
0
ファイル: ChatsPage.cs プロジェクト: codebutler/meshwork
        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)
                );
        }
コード例 #15
0
ファイル: StatusBar.cs プロジェクト: gsterjov/fusemc
        // 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);
        }
コード例 #16
0
ファイル: ColorPanelWidget.cs プロジェクト: msiyer/Pinta
        private void Build ()
        {
            HeightRequest = 24;

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

            Add (eventbox);
        }
コード例 #17
0
        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);
        }
コード例 #18
0
ファイル: Tray.cs プロジェクト: klessou/monognomeart
 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 ();
 }
コード例 #19
0
ファイル: ViewContainer.cs プロジェクト: gclark916/banshee
        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);
        }
コード例 #20
0
        // ============================================
        // 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();
        }
コード例 #21
0
        public SparkleSetupWindow () : base ("SparkleShare Setup")
        {
            SetWmclass ("SparkleShare", "SparkleShare");

            IconName       = "sparkleshare";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;
            Deletable      = false;
            TypeHint       = Gdk.WindowTypeHint.Dialog;


            SetSizeRequest (680, 400);

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

            Gdk.Color color = SparkleUIHelpers.RGBAToColor (StyleContext.GetColor (StateFlags.Insensitive));
            SecondaryTextColor = SparkleUIHelpers.ColorToHex (color);
                    
            color = MixColors (
                SparkleUIHelpers.RGBAToColor (new TreeView ().StyleContext.GetColor (StateFlags.Selected)),
                SparkleUIHelpers.RGBAToColor (new TreeView ().StyleContext.GetBackgroundColor (StateFlags.Selected)),
                0.39);
    
            SecondaryTextColorSelected = SparkleUIHelpers.ColorToHex (color);

            HBox layout_horizontal = new HBox (false, 0);

                VBox layout_vertical = new VBox (false, 0);

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

                    this.buttons = CreateButtonBox ();

                HBox layout_actions = new HBox (false , 48);

                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, 15);

                Image side_splash = SparkleUIHelpers.GetImage ("side-splash.png");
                side_splash.Yalign = 1;

            layout_horizontal.PackStart (side_splash, false, false, 0);
            layout_horizontal.PackStart (layout_vertical, true, true, 30);

            base.Add (layout_horizontal);
        }
コード例 #22
0
ファイル: SparkleWindow.cs プロジェクト: keamas/SparkleShare
        public SparkleWindow()
            : base("")
        {
            Title          = "SparkleShare Setup";
            BorderWidth    = 0;
            IconName       = "folder-sparkleshare";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;

            SetSizeRequest (680, 440);

            DeleteEvent += delegate (object o, DeleteEventArgs args) {

                args.RetVal = true;
                Close ();

            };

            HBox = new HBox (false, 6);

                VBox = new VBox (false, 0);

                    Wrapper = new VBox (false, 0) {
                        BorderWidth = 30
                    };

                    Buttons = CreateButtonBox ();

                VBox.PackStart (Wrapper, true, true, 0);
                VBox.PackStart (Buttons, false, false, 0);

                EventBox box = new EventBox ();
                Gdk.Color bg_color = new Gdk.Color ();
                Gdk.Color.Parse ("#2e3336", ref bg_color);
                box.ModifyBg (StateType.Normal, bg_color);

                    string image_path = SparkleHelpers.CombineMore (Defines.DATAROOTDIR, "sparkleshare",
                        "pixmaps", "side-splash.png");

                    Image side_splash = new Image (image_path) {
                        Yalign = 1
                    };

                box.Add (side_splash);

            HBox.PackStart (box, false, false, 0);
            HBox.PackStart (VBox, true, true, 0);

            base.Add (HBox);
        }
コード例 #23
0
        private void buildWindow()
        {
            //prevent resize on home screen
            this.Resizable = false;

            EventBox labelContainer = new EventBox ();
            Label confirmLoadLabel = new Label (Constants.Constants.confirmFileReloadText);
            //set the style of the label
            Style labelStyle = confirmLoadLabel.Style.Copy();
            labelStyle.FontDescription.Family = Constants.Constants.welcomeWindowFontFamily;
            labelStyle.FontDescription.Size = Constants.Constants.CONFIRM_RELOAD_MESSAGE_SIZE;
            confirmLoadLabel.Style = labelStyle.Copy();

            labelContainer.Add (confirmLoadLabel);
            labelContainer.WidthRequest = 100;

            Button yesButton = new Button (Constants.Constants.YES);
            yesButton.Clicked += new EventHandler (LoadFile);

            Button noButton = new Button (Constants.Constants.NO);
            noButton.Clicked += new EventHandler (CancelRequest);

            //set the style of buttons
            Style buttonStyle = yesButton.Style.Copy ();
            buttonStyle.FontDescription.Family = Constants.Constants.welcomeWindowFontFamily;
            buttonStyle.FontDescription.Size = Constants.Constants.WELCOME_BUTTON_FONT_SIZE;

            yesButton.Style = buttonStyle.Copy();
            noButton.Style = buttonStyle.Copy();

            labelContainer.SetSizeRequest (100, 100);
            yesButton.SetSizeRequest (50, 50);
            noButton.SetSizeRequest (50, 50);

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

            HBox buttonContainer = new HBox ();

            buttonContainer.PackStart (yesButton, false, false, 50);
            buttonContainer.PackStart (noButton, false, false, 50);

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

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

            this.Add (masterContainer);
        }
コード例 #24
0
        public ScrolledView()
            : base()
        {
            scroll = new ScrolledWindow  (null, null);
            this.Put (scroll, 0, 0);
            scroll.Show ();

            //ebox = new BlendBox ();
            ebox = new EventBox ();
            this.Put (ebox, 0, 0);
            ebox.ShowAll ();

            hide = new Delay (2000, new GLib.IdleHandler (HideControls));
            this.Destroyed += HandleDestroyed;
        }
コード例 #25
0
ファイル: ExternalWindow.cs プロジェクト: GNOME/longomatch
        public ExternalWindow()
            : base(WindowType.Toplevel)
        {
            Icon = LongoMatch.Gui.Helpers.Misc.LoadIcon ("longomatch", IconSize.Menu);

            box = new EventBox ();
            box.Name = "lightbackgroundeventbox";
            box.KeyPressEvent += (o, args) => {
                Config.EventsBroker.EmitKeyPressed (this, Keyboard.ParseEvent (args.Event));
            };
            base.Add (box);
            box.CanFocus = true;
            Focus = box;
            box.Show ();
        }
コード例 #26
0
ファイル: ScrolledView.cs プロジェクト: Yetangitu/f-spot
        public ScrolledView()
            : base()
        {
            ScrolledWindow = new ScrolledWindow  (null, null);
            this.Put (ScrolledWindow, 0, 0);
            ScrolledWindow.Show ();

            //ebox = new BlendBox ();
            ControlBox = new EventBox ();
            this.Put (ControlBox, 0, 0);
            ControlBox.ShowAll ();

            hide = new DelayedOperation (2000, new GLib.IdleHandler (HideControls));
            this.Destroyed += HandleDestroyed;
        }
コード例 #27
0
ファイル: ComplexMenuItem.cs プロジェクト: tcausby/giver
 protected Widget RegisterWidget(Widget widget)
 {
     if(widget is Button) {
         ((Button)widget).Relief = ReliefStyle.None;
     }
 
     EventBox box = new EventBox();
     box.AppPaintable = true;
     box.Add(widget);
     ConnectChildExpose(box);
     if(!(widget is Label)) {
         input_children.Add(box);
     }
     
     return box;
 }
コード例 #28
0
		internal WidgetDesignerBackend (Gtk.Container container, int designWidth, int designHeight)
		{
			ShadowType = ShadowType.None;
			HscrollbarPolicy = PolicyType.Automatic;
			VscrollbarPolicy = PolicyType.Automatic;
			
			resizableFixed = new ResizableFixed ();
			resizableFixed.ObjectViewer = defaultObjectViewer;
			
			wrapper = ObjectWrapper.Lookup (container);
			TopLevelWindow window = container as TopLevelWindow;
			
			if (window != null) {
				preview = Stetic.Metacity.Preview.Create (window);
				if (preview == null)
					preview = Stetic.Windows.Preview.Create (window);
				if (preview == null) {
					// Use a regular box.
					EventBox eventBox = new EventBox ();
					eventBox.Add (container);
					preview = eventBox;
				}
			} else {
				EventBox eventBox = new EventBox ();
				eventBox.Add (container);
				preview = eventBox;
			}
			
			resizableFixed.Put (preview, container);

			if (designWidth != -1) {
				preview.WidthRequest = designWidth;
				preview.HeightRequest = designHeight;
				resizableFixed.AllowResize = true;
			} else {
				resizableFixed.AllowResize = false;
			}

			preview.SizeAllocated += new Gtk.SizeAllocatedHandler (OnResized);

			AddWithViewport (resizableFixed);
			
			if (wrapper != null)
				wrapper.AttachDesigner (resizableFixed);
				
			resizableFixed.SelectionChanged += OnSelectionChanged;
		}
コード例 #29
0
ファイル: TrayIcon.cs プロジェクト: ArsenShnurkov/beagle-1
		public TrayIcon ()
		{
			notification_area = new NotificationArea (Catalog.GetString ("Desktop Search"));

			eventbox = new EventBox ();
			eventbox.ButtonPressEvent += OnClick;

			Gdk.Pixbuf pixbuf = Beagle.Util.WidgetFu.LoadThemeIcon ("system-search", 24);
			eventbox.Add (new Gtk.Image (pixbuf));
			
			notification_area.Add (eventbox);
			notification_area.ShowAll ();

			recent_searches = new ArrayList ();

			popup = MakeMenu (eventbox);
		}
コード例 #30
0
        public SparkleSetupWindow()
            : base("")
        {
            Title          = Catalog.GetString ("SparkleShare Setup");
            BorderWidth    = 0;
            IconName       = "folder-sparkleshare";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;
            Deletable      = false;

            SetSizeRequest (680, 440);

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

            HBox = new HBox (false, 6);

                VBox = new VBox (false, 0);

                    Wrapper = new VBox (false, 0) {
                        BorderWidth = 30
                    };

                    Buttons = CreateButtonBox ();

                VBox.PackStart (Wrapper, true, true, 0);
                VBox.PackStart (Buttons, false, false, 0);

                EventBox box = new EventBox ();
                Gdk.Color bg_color = new Gdk.Color ();
                Gdk.Color.Parse ("#000", ref bg_color);
                box.ModifyBg (StateType.Normal, bg_color);

                Image side_splash = SparkleUIHelpers.GetImage ("side-splash.png");
                side_splash.Yalign = 1;

            box.Add (side_splash);

            HBox.PackStart (box, false, false, 0);
            HBox.PackStart (VBox, true, true, 0);

            base.Add (HBox);
        }
コード例 #31
0
ファイル: StatusArea.cs プロジェクト: vonchenplus/monodevelop
            public StatusIcon(StatusArea statusBar, Xwt.Drawing.Image icon)
            {
                if (!icon.HasFixedSize)
                {
                    icon = icon.WithSize(IconSize.Menu);
                }

                this.statusBar        = statusBar;
                this.icon             = icon;
                box                   = new EventBox();
                box.VisibleWindow     = false;
                image                 = new Xwt.ImageView(icon);
                box.Child             = image.ToGtkWidget();
                box.Events           |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
                box.EnterNotifyEvent += HandleEnterNotifyEvent;
                box.LeaveNotifyEvent += HandleLeaveNotifyEvent;
                box.ButtonPressEvent += (o, e) => {
                    // TODO: Refactor this in Xwt as an extension method.
                    var m = Xwt.ModifierKeys.None;
                    if ((e.Event.State & Gdk.ModifierType.ShiftMask) != 0)
                    {
                        m |= Xwt.ModifierKeys.Shift;
                    }
                    if ((e.Event.State & Gdk.ModifierType.ControlMask) != 0)
                    {
                        m |= Xwt.ModifierKeys.Control;
                    }
                    if ((e.Event.State & Gdk.ModifierType.Mod1Mask) != 0)
                    {
                        m |= Xwt.ModifierKeys.Alt;
                    }
                    // TODO: Backport this one.
                    if ((e.Event.State & Gdk.ModifierType.Mod2Mask) != 0)
                    {
                        m |= Xwt.ModifierKeys.Command;
                    }

                    Clicked(o, new StatusBarIconClickedEventArgs {
                        Button    = (Xwt.PointerButton)e.Event.Button,
                        Modifiers = m,
                    });
                };
            }
コード例 #32
0
        public override Control CreateWidget()
        {
            var box = new EventBox();

            box.VisibleWindow = false;
            var icon = Xwt.Drawing.Image.FromResource("lightning-16.png");

            box.Add(new Xwt.ImageView(icon).ToGtkWidget());
            box.ButtonPressEvent += (o, e) => dlg.ShowButton();
            var eb = new PopoverWidget();

            eb.Theme.Padding   = 2;
            eb.ShowArrow       = true;
            eb.EnableAnimation = true;
            eb.PopupPosition   = PopupPosition.Left;
            eb.ContentBox.Add(box);
            eb.ShowAll();
            return(eb);
        }
コード例 #33
0
        protected Widget RegisterWidget(Widget widget)
        {
            if (widget is Button)
            {
                ((Button)widget).Relief = ReliefStyle.None;
            }

            EventBox box = new EventBox();

            box.AppPaintable = true;
            box.Add(widget);
            ConnectChildExpose(box);
            if (!(widget is Label))
            {
                input_children.Add(box);
            }

            return(box);
        }
コード例 #34
0
        public FolderMonitor(string folder)
        {
            this.path = folder;
            icon      = new TrayIcon("FolderMonitor");
            image     = new Image(new Gdk.Pixbuf(null, "dropbox-changed.png"));
            eBox      = new EventBox();
            eBox.Add(image);
            eBox.ButtonPressEvent += ButtonPressed;
            icon.Add(eBox);

            FileSystemWatcher mon = new FileSystemWatcher(folder);

            mon.IncludeSubdirectories = true;
            mon.EnableRaisingEvents   = true;
            mon.Changed += OnChanged;
            mon.Created += OnChanged;
            mon.Deleted += OnChanged;
            mon.Renamed += OnRenamed;
        }
コード例 #35
0
        // Methods
        // Methods :: Public
        // Methods :: Public :: Init
        public void Init()
        {
            icon = new NotificationArea(string_program);

            icon.DestroyEvent += OnDestroyEvent;

            ebox = new EventBox();
            ebox.ButtonPressEvent += OnButtonPressEvent;

            image = new Gtk.Image();

            ebox.Add(image);
            icon.Add(ebox);

            UpdateImage();
            UpdateTooltip();

            icon.ShowAll();
        }
コード例 #36
0
        public GtkShellDocumentViewContainerTabs()
        {
            rootTabsBox = new VBox();
            rootTabsBox.Accessible.SetShouldIgnore(true);

            bottomBarBox = new HBox(false, 0);
            bottomBarBox.Show();
            rootTabsBox.PackEnd(bottomBarBox, false, false, 0);

            notebook = new EventBox();
            notebook.Show();
            rootTabsBox.PackStart(notebook, true, true, 0);

            tabstrip = new Tabstrip();
            //tabstrip.Show ();
            bottomBarBox.PackStart(tabstrip, true, true, 0);

            rootTabsBox.Show();
        }
コード例 #37
0
ファイル: MainView.cs プロジェクト: peter-devoil/ApsimX
        /// <summary>Add a tab form to the tab control. Optionally select the tab if SelectTab is true.</summary>
        /// <param name="text">Text for tab.</param>
        /// <param name="image">Image for tab.</param>
        /// <param name="control">Control for tab.</param>
        /// <param name="onLeftTabControl">If true a tab will be added to the left hand tab control.</param>
        public void AddTab(string text, Gtk.Image image, Widget control, bool onLeftTabControl)
        {
            Label tabLabel = new Label();

            // If the tab text passed in is a filename then only show the filename (no path)
            // on the tab. The ToolTipText will still have the full path and name.
            if (text.Contains(Path.DirectorySeparatorChar.ToString()))
            {
                tabLabel.Text = Path.GetFileNameWithoutExtension(text);
            }
            else
            {
                tabLabel.Text = text;
            }
            HBox   headerBox = new HBox();
            Button closeBtn  = new Button();

            Gtk.Image closeImg = new Gtk.Image(new Gdk.Pixbuf(null, "ApsimNG.Resources.Close.png", 12, 12));

            closeBtn.Image    = closeImg;
            closeBtn.Relief   = ReliefStyle.None;
            closeBtn.Clicked += OnCloseBtnClick;

            headerBox.PackStart(tabLabel, true, true, 0);
            headerBox.PackEnd(closeBtn, true, true, 0);

            // Wrap the whole thing inside an event box, so we can respond to a right-button or center-button click
            EventBox eventbox = new EventBox();

            eventbox.HasTooltip        = text.Contains(Path.DirectorySeparatorChar.ToString());
            eventbox.TooltipText       = text;
            eventbox.ButtonPressEvent += OnEventbox1ButtonPress;
            eventbox.Add(headerBox);
            Notebook notebook = onLeftTabControl ? notebook1 : notebook2;
            // Attach an icon to the context menu
            Widget iconLabel = LabelWithIcon(tabLabel.Text, null);

            notebook.CurrentPage = notebook.AppendPageMenu(control, eventbox, iconLabel);
            // For reasons that I do not understand at all, with Release builds we must delay calling ShowAll until
            // after the page has been added. This is not the case with Debug builds.
            eventbox.ShowAll();
        }
コード例 #38
0
ファイル: InfobarPlugin.cs プロジェクト: switsys/bless
        public Infobar(DataBook db)
        {
            dataBook = db;

            MessageLabel           = new Label();
            MessageLabel.Ellipsize = Pango.EllipsizeMode.End;
            MessageLabel.SetAlignment(0.0f, 0.5f);
            OffsetLabel    = new Label();
            SelectionLabel = new Label();
            OverwriteLabel = new Label();

            EventBox OffsetEB = new EventBox();

            OffsetEB.Add(OffsetLabel);
            OffsetEB.ButtonPressEvent += ChangeNumberBase;

            EventBox SelectionEB = new EventBox();

            SelectionEB.Add(SelectionLabel);
            SelectionEB.ButtonPressEvent += ChangeNumberBase;

            EventBox OverwriteEB = new EventBox();

            OverwriteEB.Add(OverwriteLabel);
            OverwriteEB.ButtonPressEvent += OnOverwriteLabelPressed;

            this.PackStart(MessageLabel, true, true, 20);
            this.PackStart(OffsetEB, false, false, 20);
            this.PackStart(SelectionEB, false, false, 20);
            this.PackStart(OverwriteEB, false, false, 20);

            this.NumberBase = 16;

            PreferencesChangedHandler handler = new PreferencesChangedHandler(OnPreferencesChanged);

            Preferences.Proxy.Subscribe("View.Statusbar.Show", "ib2", handler);
            Preferences.Proxy.Subscribe("View.Statusbar.Selection", "ib2", handler);
            Preferences.Proxy.Subscribe("View.Statusbar.Overwrite", "ib2", handler);
            Preferences.Proxy.Subscribe("View.Statusbar.Offset", "ib2", handler);

            this.ShowAll();
        }
コード例 #39
0
        private void BuildFooter()
        {
            if (PlatformDetection.IsMeeGo)
            {
                return;
            }

            footer_toolbar = new HBox()
            {
                BorderWidth = 2
            };

            task_status = new Banshee.Gui.Widgets.TaskStatusIcon();

            EventBox status_event_box = new EventBox();

            status_event_box.ButtonPressEvent += OnStatusBoxButtonPress;

            status_label = new Label();
            status_event_box.Add(status_label);

            HBox status_hbox = new HBox(true, 0);

            status_hbox.PackStart(status_event_box, false, false, 0);

            Alignment status_align = new Alignment(0.5f, 0.5f, 1.0f, 1.0f);

            status_align.Add(status_hbox);

            RepeatActionButton repeat_button = new RepeatActionButton();

            repeat_button.SizeAllocated += delegate(object o, Gtk.SizeAllocatedArgs args) {
                status_align.LeftPadding = (uint)args.Allocation.Width;
            };

            footer_toolbar.PackStart(task_status, false, false, 0);
            footer_toolbar.PackStart(status_align, true, true, 0);
            footer_toolbar.PackStart(repeat_button, false, false, 0);

            footer_toolbar.ShowAll();
            primary_vbox.PackStart(footer_toolbar, false, true, 0);
        }
コード例 #40
0
ファイル: CheckButtonBoxGroup.cs プロジェクト: sciux/logicPOS
        public CheckButtonBoxGroup(string pLabelText, Dictionary <string, bool> pButtonGroup)
            : base(pLabelText)
        {
            VBox vbox = new VBox()
            {
                BorderWidth = 5
            };
            EventBox eventBox = new EventBox()
            {
                BorderWidth = 2
            };

            int key = -1;

            foreach (var item in pButtonGroup)
            {
                key++;

                //CheckButtonExtended
                CheckButtonExtended checkButtonExtended = new CheckButtonExtended(item.Key)
                {
                    Active = item.Value, Index = key
                };
                checkButtonExtended.Child.ModifyFont(_fontDescription);
                checkButtonExtended.Clicked += checkButtonExtended_Clicked;
                //Pack in local Vbox
                vbox.PackStart(checkButtonExtended);
                //Add to value List
                _buttons.Add(checkButtonExtended);
                //Add checkButton to items
                if (item.Value)
                {
                    _items.Add(key, checkButtonExtended);
                }
            }

            //Put in White EventBox
            eventBox.Add(vbox);

            //Pack in Base VBox
            Vbox.PackStart(eventBox);
        }
コード例 #41
0
ファイル: TouchButtonBase.cs プロジェクト: sciux/logicPOS
 public void SetBackgroundColor(System.Drawing.Color pColor, EventBox pTargetEventBox)
 {
     if (pColor == System.Drawing.Color.Transparent)
     {
         pTargetEventBox.VisibleWindow = false;
     }
     else
     {
         Color colNormal      = pColor;
         Color colPrelight    = Utils.Lighten(colNormal);
         Color colActive      = Utils.Lighten(colPrelight);
         Color colInsensitive = Utils.Darken(colNormal);
         Color colSelected    = Color.FromArgb(125, 0, 0);
         pTargetEventBox.ModifyBg(StateType.Normal, Utils.ColorToGdkColor(colNormal));
         pTargetEventBox.ModifyBg(StateType.Selected, Utils.ColorToGdkColor(colSelected));
         pTargetEventBox.ModifyBg(StateType.Prelight, Utils.ColorToGdkColor(colPrelight));
         pTargetEventBox.ModifyBg(StateType.Active, Utils.ColorToGdkColor(colActive));
         pTargetEventBox.ModifyBg(StateType.Insensitive, Utils.ColorToGdkColor(colInsensitive));
     }
 }
コード例 #42
0
        public ExternalWindow() : base(WindowType.Toplevel)
        {
            // Configure window icon
            Icon = Misc.LoadIcon(App.Current.SoftwareIconName, IconSize.Dialog);

            box                = new EventBox();
            box.Name           = "lightbackgroundeventbox";
            box.KeyPressEvent += (o, args) => {
                App.Current.EventsBroker.Publish <KeyPressedEvent> (
                    new KeyPressedEvent {
                    Sender = this,
                    Key    = App.Current.Keyboard.ParseEvent(args.Event)
                }
                    );
            };
            base.Add(box);
            box.CanFocus = true;
            Focus        = box;
            box.Show();
        }
コード例 #43
0
 //Function resets all vital properties and sets necessary handlers for the elements of the Control Storage
 void ActivateImages()
 {
     foreach (Storage s in ControlStorage)
     {
         //Visual representation
         var       imagecontrol = (Image)s.widget;
         EventBox  eb           = (EventBox)imagecontrol.Parent;
         Alignment align        = (Alignment)eb.Parent;
         align.Xscale     = align.Yscale = imagecontrol.Xalign = imagecontrol.Yalign = 0;
         eb.VisibleWindow = false;
         //Handlers configuration
         eb.Parent.Events       = play.Events;
         eb.ButtonPressEvent   += new ButtonPressEventHandler(HandleImages);
         eb.ButtonReleaseEvent += new ButtonReleaseEventHandler(HandleReleases);
         eb.EnterNotifyEvent   += new EnterNotifyEventHandler(HandleEnters);
         eb.LeaveNotifyEvent   += new LeaveNotifyEventHandler(HandleAutumn);
         //Redraw Image
         DrawActiveImage(eb, 0);
     }
 }
コード例 #44
0
        public ColumnControl()
        {
            GripperWidth = 8;

            this.HasWindow    = false;
            this.ExposeEvent += new ExposeEventHandler(TheExposeEvent);

            // need an additional EventBox, because the underlaying Gtk.Fixed widget don't receive and handle some possible events
            // this is one more suspicious behaviour of GTK
            // as you can see, the mouse buttons will be received by the EventBox widget,
            // but the mouse motion received by Fixed widget enabled by the EventBox ...
            EventBox                     = new EventBox();
            EventBox.Events             |= Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask | Gdk.EventMask.LeaveNotifyMask;
            EventBox.ButtonPressEvent   += new ButtonPressEventHandler(TheButtonPressEvent);
            EventBox.ButtonReleaseEvent += new ButtonReleaseEventHandler(TheButtonReleaseEvent);
            EventBox.LeaveNotifyEvent   += new LeaveNotifyEventHandler(TheLeaveNotifyEvent);
            EventBox.VisibleWindow       = false; // must not drawn itself
            this.Add(EventBox);
            EventBox.ShowAll();
        }
コード例 #45
0
        public EntryWrapper()
        {
            _table = new Table(1, 1, true);
            _entry = new Gtk.Entry();
            _entry.FocusOutEvent += EntryFocusedOut;
            _entry.Changed       += EntryChanged;
            _placeholder          = new Gtk.Label();

            _placeholderContainer             = new EventBox();
            _placeholderContainer.BorderWidth = 2;
            _placeholderContainer.Add(_placeholder);
            _placeholderContainer.ButtonPressEvent += PlaceHolderContainerPressed;

            SetBackgroundColor(_entry.Style.BaseColors[(int)StateType.Normal]);

            Add(_table);

            _table.Attach(_entry, 0, 1, 0, 1);
            _table.Attach(_placeholderContainer, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
        }
コード例 #46
0
        void AddColumn(string title, int ncol, string desc)
        {
            Gtk.TreeViewColumn col = new Gtk.TreeViewColumn();
            Gtk.Label          lab = new Gtk.Label(title);
            lab.Xalign = 1;
            EventBox bx = new EventBox();

            bx.Add(lab);
            bx.ShowAll();
            col.Widget = bx;

            CellRendererText crt = new CellRendererText();

            crt.Xalign = 1;
            col.PackStart(crt, true);
            col.AddAttribute(crt, "text", ncol);

            treeview.AppendColumn(col);
            tips.SetTip(bx, desc, desc);
        }
コード例 #47
0
        public ScrolledTextView()
        {
            _table = new Table(1, 1, true);

            TextView = new TextView
            {
                AcceptsTab = false,
                WrapMode   = WrapMode.WordChar
            };

            TextView.Buffer.InsertText += InsertText;
            TextView.FocusOutEvent     += FocusedOut;

            _scrolledWindow = new ScrolledWindow
            {
                ShadowType       = ShadowType.In,
                HscrollbarPolicy = PolicyType.Never,
                VscrollbarPolicy = PolicyType.Automatic
            };

            _scrolledWindow.Add(TextView);

            _placeholder = new Gtk.Label();
            _placeholder.SetAlignment(0, 0);

            _placeholderContainer = new EventBox
            {
                BorderWidth = 2
            };

            _placeholderContainer.Add(_placeholder);

            _placeholderContainer.ButtonPressEvent += PlaceHolderContainerPressed;

            SetBackgroundColor(TextView.Style.BaseColors[(int)StateType.Normal]);

            Add(_table);

            _table.Attach(_placeholderContainer, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            _table.Attach(_scrolledWindow, 0, 1, 0, 1);
        }
コード例 #48
0
        public void ApplySkill(Vector3 position, SkillData skillData)
        {
            EntityComponent component = componentsHolder.GetComponent(ComponentDefs.Body);

            if (!component.IsPlaying(AnimationDefs.Idle.ToString().ToLower()))
            {
                return;
            }

            if (skillData.state == PrototypeState.Frozen)
            {
                return;
            }

            weaponLauncher.Unload();

            if (position.x > transform.position.x)
            {
                if (this.componentsHolder.transform.localScale.x > 0f)
                {
                    Flip();
                }
            }
            else
            {
                if (this.componentsHolder.transform.localScale.x < 0f)
                {
                    Flip();
                }
            }

            component.Play(AnimationDefs.Focus.ToString().ToLower());

            skillLauncher.Load(skillData);

            skillLauncher.Apply(position);

            EventBox.Send(CustomEvent.USER_APPLY_SKILL, skillData);

            EventBox.Send(CustomEvent.TROPHY_UPDATE, new KeyValuePair <TrophyType, float>(TrophyType.GirlSkill, 1));
        }
コード例 #49
0
        public Annotation() : base(0, 0, 1, 1)
        {
            d_vbox = new VBox(false, 6);
            d_vbox.Show();

            SetPadding(6, 6, 6, 6);

            d_eventBox = new EventBox();
            d_eventBox.Show();
            d_eventBox.AddEvents((int)Gdk.EventMask.AllEventsMask);

            d_labelInfo = new Label();
            d_labelInfo.Show();
            d_labelInfo.SetAlignment(0, 0);
            d_labelInfo.Wrap         = true;
            d_labelInfo.LineWrapMode = Pango.WrapMode.WordChar;

            d_eventBox.Add(d_labelInfo);
            d_vbox.PackStart(d_eventBox, true, true, 0);

            d_editorWindow = new ScrolledWindow();
            d_editorWindow.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            d_editorWindow.ShadowType = ShadowType.EtchedIn;

            d_editor          = new TextView();
            d_editor.WrapMode = WrapMode.WordChar;
            d_editor.Show();

            d_editorWindow.Add(d_editor);

            d_vbox.PackStart(d_editorWindow, true, true, 0);

            d_eventBox.ButtonPressEvent += OnEventBoxButtonPress;

            d_editor.KeyPressEvent += OnEditorKeyPressEvent;
            d_editor.FocusOutEvent += OnEditorFocusOutEvent;

            Update(null);

            Add(d_vbox);
        }
        public NowPlayingContents() : base(1, 1, false)
        {
            NoShowAll = true;

            CreateVideoDisplay();

            video_event = new EventBox();
            video_event.VisibleWindow = false;
            video_event.CanFocus      = true;
            video_event.AboveChild    = true;
            video_event.Add(video_display);
            video_event.Events |= Gdk.EventMask.PointerMotionMask |
                                  Gdk.EventMask.ButtonPressMask |
                                  Gdk.EventMask.ButtonMotionMask |
                                  Gdk.EventMask.KeyPressMask |
                                  Gdk.EventMask.KeyReleaseMask;

            //TODO stop tracking mouse when no more in menu
            video_event.ButtonPressEvent   += OnButtonPress;
            video_event.ButtonReleaseEvent += OnButtonRelease;
            video_event.MotionNotifyEvent  += OnMouseMove;
            video_event.KeyPressEvent      += OnKeyPress;

            IVideoDisplay ivideo_display = video_display as IVideoDisplay;

            if (ivideo_display != null)
            {
                ivideo_display.IdleStateChanged += OnVideoDisplayIdleStateChanged;
            }

            Attach(video_event, 0, 1, 0, 1,
                   AttachOptions.Expand | AttachOptions.Fill,
                   AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            track_info_display = new NowPlayingTrackInfoDisplay();
            Attach(track_info_display, 0, 1, 0, 1,
                   AttachOptions.Expand | AttachOptions.Fill,
                   AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            video_event.ShowAll();
        }
コード例 #51
0
        public SparkleSetupWindow() : base("SparkleShare Setup")
        {
            SetWmclass("SparkleShare", "SparkleShare");

            IconName       = "sparkleshare";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;
            Deletable      = false;
            TypeHint       = Gdk.WindowTypeHint.Dialog;


            SetSizeRequest(680, 400);

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

            HBox layout_horizontal = new HBox(false, 0);

            VBox layout_vertical = new VBox(false, 0);

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

            this.buttons = CreateButtonBox();

            HBox layout_actions = new HBox(false, 48);

            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, 15);

            Image side_splash = SparkleUIHelpers.GetImage("side-splash.png");

            side_splash.Yalign = 1;

            layout_horizontal.PackStart(side_splash, false, false, 0);
            layout_horizontal.PackStart(layout_vertical, true, true, 30);

            base.Add(layout_horizontal);
        }
コード例 #52
0
        Widget CreateInnerExceptionsTree()
        {
            innerExceptionsTreeView = new InnerExceptionsTree();
            innerExceptionsTreeView.ModifyBase(StateType.Normal, Styles.ExceptionCaughtDialog.TreeBackgroundColor.ToGdkColor());               // background
            innerExceptionsTreeView.ModifyBase(StateType.Selected, Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.ToGdkColor());     // selected
            innerExceptionsTreeView.HeadersVisible = false;
            innerExceptionsStore = new TreeStore(typeof(ExceptionInfo));

            FillInnerExceptionsStore(innerExceptionsStore, exception);
            innerExceptionsTreeView.AppendColumn("Exception", new CellRendererInnerException(), new TreeCellDataFunc((tree_column, cell, tree_model, iter) => {
                var c  = (CellRendererInnerException)cell;
                c.Text = ((ExceptionInfo)tree_model.GetValue(iter, 0)).Type;
            }));
            innerExceptionsTreeView.ShowExpanders    = false;
            innerExceptionsTreeView.LevelIndentation = 10;
            innerExceptionsTreeView.Model            = innerExceptionsStore;
            innerExceptionsTreeView.ExpandAll();
            innerExceptionsTreeView.Selection.Changed += (sender, e) => {
                TreeIter selectedIter;
                if (innerExceptionsTreeView.Selection.GetSelected(out selectedIter))
                {
                    UpdateSelectedException((ExceptionInfo)innerExceptionsTreeView.Model.GetValue(selectedIter, 0));
                }
            };
            innerExceptionsTreeView.SetCommonAccessibilityAttributes(
                "ExceptionCaughtDialog.InnerExceptionsTreeView",
                GettextCatalog.GetString("Inner Exceptions"),
                null);
            var eventBox = new EventBox();

            eventBox.ModifyBg(StateType.Normal, Styles.ExceptionCaughtDialog.TreeBackgroundColor.ToGdkColor());               // top and bottom padders
            var vbox   = new VBox();
            var scroll = new ScrolledWindow();

            scroll.WidthRequest = 200;
            scroll.Child        = innerExceptionsTreeView;
            vbox.PackStart(scroll, true, true, 12);
            eventBox.Add(vbox);
            eventBox.ShowAll();
            return(eventBox);
        }
コード例 #53
0
        protected override void Activate()
        {
            base.Activate();

            Transform mountPoint = owner.GetMountPoint(ComponentDefs.Foot);

            if (mountPoint != null)
            {
                effector = ResourceUtils.GetComponent <tk2dSpriteAnimator>(GlobalDefinitions.RESOURCE_PATH_BUFF + data.resourceID);
                effector.transform.SetParent(mountPoint);
                effector.transform.localPosition = Vector3.zero;

                effector.AnimationEventTriggered = (tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip, int frame) =>
                {
                    ValidatePayload payload = owner.data.attributeBox.ValidateDirect(ValidateType.Injured, AttributeKeys.HP, AttributeSetTypes.BaseValue, data.parameter2);
                    payload.hitPoint = owner.gameObject.transform.position;

                    EventBox.Send(CustomEvent.DUNGEON_MONSTER_DAMAGE, new object[] { owner, payload });
                };
            }
        }
コード例 #54
0
ファイル: MainView.cs プロジェクト: peter-devoil/ApsimX
        /// <summary>Change the text of a tab.</summary>
        /// <param name="ownerView">An <see cref="ExplorerView" /> instance whose tab text should be changed.</param>
        /// <param name="newTabName">New text of the tab.</param>
        /// <param name="tooltip">Optional tooltip text on the tab to be shown on mouseover.</param>
        public void ChangeTabText(object ownerView, string newTabName, string tooltip)
        {
            if (ownerView is ExplorerView)
            {
                Widget   tab      = (ownerView as ExplorerView).MainWidget;
                Notebook notebook = tab.IsAncestor(notebook1) ? notebook1 : notebook2;

                // The top level of the "label" is an EventBox
                EventBox ebox = (EventBox)notebook.GetTabLabel(tab);
                ebox.TooltipText = tooltip;
                ebox.HasTooltip  = !String.IsNullOrEmpty(tooltip);
                // The EventBox holds an HBox
                HBox hbox = (HBox)ebox.Child;
                // And the HBox has the actual label as its first child
                Label tabLabel = (Label)hbox.Children[0];
                tabLabel.Text = newTabName;
                // Update the context menu label
                Widget label = LabelWithIcon(newTabName, null);
                notebook.SetMenuLabel(tab, label);
            }
        }
コード例 #55
0
ファイル: Main.cs プロジェクト: kristiandamian/db4oserver
        public TrayTest()
        {
            /* in order to receive signals, we need a eventbox,
             * because Gtk.Image doesn't receive signals */
            eb = new EventBox();

            //Stock.No para corriendo
            //Stock.Yes para detenido
            //
            Nel = new Image(Stock.No
                            , IconSize.Menu);
            Simon = new Image(Stock.Yes
                              , IconSize.Menu);
            eb.Add(Nel);             // using stock icon
            // hooking event
            eb.ButtonPressEvent += new ButtonPressEventHandler(this.OnImageClick);
            icon = new TrayIcon("Test");
            icon.Add(eb);
            // showing the trayicon
            icon.ShowAll();
        }
コード例 #56
0
ファイル: MainWindow.cs プロジェクト: semirs1991/CellAO
        private void EventBox_DragDrop(object sender, DragEventArgs e)
        {
            if (dragsource != sender)
            {
                ChangeStatelSelection();
                return;
            }
            Point p = new Point(e.X, e.Y);

            p = ((ListBox)sender).PointToClient(p);

            int indexOfItem = EventBox.IndexFromPoint(p.X, p.Y);

            if ((indexOfItem >= 0) && (indexOfItem < EventBox.Items.Count))
            {
                StatelEvent se = events.ElementAt(indexOfItem);
                se.changeid(selectedstatel, evdrag.eventid);
                ChangeStatelSelection();
            }
            Setline(null, false, null);
        }
コード例 #57
0
        private void AddToTable(uint row, uint column, Widget control, uint columnSpan = 1)
        {
            var alignmentXScale = control is Entry ? 1 : 0;
            var alignment       = new Alignment(0, 0, alignmentXScale, 1)
            {
                control
            };

            alignment.SetPadding(0, 0, 5, 5);

            var box = new EventBox {
                alignment
            };

            if (row % 2 is 1)
            {
                box.ModifyBg(StateType.Normal, _altRowColor);
            }

            SettingsTable.Attach(box, column, column + columnSpan, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
        }
コード例 #58
0
            public PopupWindow()
            {
                Color bg = new Color(85, 87, 83);
                Color fg = new Color(211, 215, 207);

                EventBox box = new EventBox();

                vbox = new VBox();

                box.ButtonPressEvent += HandleButtonEvent;

                box.Add(vbox);

                win.Decorated   = false;
                win.BorderWidth = 6;

                win.SetPosition(WindowPosition.CenterAlways);

                image             = new Gtk.Image();
                label             = new Label();
                label.CanFocus    = false;
                label.Wrap        = true;
                urlLabel          = new LinkLabel();
                urlLabel.Clicked += HandleClick;

                win.Add(box);

                win.ModifyBg(StateType.Normal, bg);
                label.ModifyFg(StateType.Normal, fg);
                box.ModifyBg(StateType.Normal, bg);
                urlLabel.ModifyBg(StateType.Selected, bg);
                urlLabel.ModifyBg(StateType.Normal, bg);

                vbox.PackStart(image, true, true, 0);
                vbox.PackStart(label, false, false, 0);
                vbox.PackStart(urlLabel, false, false, 0);

                vbox.Spacing = 6;
                box.ShowAll();
            }
コード例 #59
0
ファイル: Program.cs プロジェクト: curiousTauseef/ownshot
        public static void Main(string[] args)
        {
            configpath = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "/";
            Application.Init();
            win = new MainWindow();
            var eventbox = new EventBox();

            //win.ExposeEvent += OnExposed;

            var chars       = "abcdefghijklmnopqrstuvwxyz0123456789";       //ABCDEFGHIJKLMNOPQRSTUVWXYZ
            var stringChars = new char[ssnamelength];
            var random      = new Random();

            for (int i = 0; i < stringChars.Length; i++)
            {
                stringChars[i] = chars[random.Next(chars.Length)];
            }
            finalString = new string(stringChars) + ".png";

            win.Hide();
            TakeScreenshot(configpath + finalString.Replace(".png", "_pre.png"));
            win.Show();
            win.Decorated = false;

            img = new Gtk.Image(configpath + finalString.Replace(".png", "_pre.png"));
            eventbox.ButtonPressEvent   += (ButtonPressHandler);
            eventbox.ButtonReleaseEvent += (ButtonReleaseHandler);

            img.Xalign = 0.5f;
            img.Yalign = 0.5f;

            eventbox.Add(img);
            eventbox.ShowAll();
            win.Add(eventbox);
            win.ShowAll();

            win.Move(0, 0);

            Application.Run();
        }
コード例 #60
0
        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();
            optionMenu.Menu = currentMenu;
            int firstPage = list.IndexOf("WikiHome");

            if (firstPage != -1)
            {
                optionMenu.SetHistory((uint)firstPage);
            }

            Add(mainBox);
        }