コード例 #1
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);
        }
コード例 #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
ファイル: 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();
        }
コード例 #4
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);
        }
コード例 #5
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();
    }
コード例 #6
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 ();
		}
コード例 #7
0
		public TreeViewCellContainer (Gtk.Widget child)
		{
			box = new EventBox ();
			box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);
			box.Add (child);
			child.Show ();
			Show ();
		}
コード例 #8
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 ();
		}
コード例 #9
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;
 }
コード例 #10
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)
                );
        }
コード例 #11
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);
        }
コード例 #12
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 ();
 }
コード例 #13
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);
        }
コード例 #14
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;
 }
コード例 #15
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;
		}
コード例 #16
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);
		}
コード例 #17
0
        /**
         *  Add in all needed components to our welcome window
         * */
        private void buildWindow()
        {
            //prevent resize on home screen
            this.Resizable = false;

            //create label and import button - put label in event box to allow setting of background
            EventBox labelContainer = new EventBox ();

            Label welcomeLabel = new Label (Constants.Constants.homeWindowWelcomeText);

            //set the style of the label
            Style labelStyle = welcomeLabel.Style.Copy();
            labelStyle.FontDescription.Family = Constants.Constants.welcomeWindowFontFamily;
            labelStyle.FontDescription.Size = Constants.Constants.WELCOME_MESSAGE_FONT_SIZE;
            welcomeLabel.Style = labelStyle.Copy();

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

            importDataButton = new Button (Constants.Constants.homeWindowImportButtonText);
            importDataButton.Clicked += new EventHandler(OpenFileTree);

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

            welcomeLabel.SetSizeRequest (100, 100);
            importDataButton.SetSizeRequest (100, 100);

            //create container for import button
            HBox masterContainer = new HBox ();
            VBox homeWindowContainer = new VBox (false, 100);

            homeWindowContainer.PackStart (labelContainer, false, false, 50);
            homeWindowContainer.PackStart (importDataButton, false, false, 50);

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

            //set size of containers
            masterContainer.SetSizeRequest (1000, 1000);
            this.SetSizeRequest (1000, 500);
            this.Add (masterContainer);
        }
コード例 #18
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;
        }
コード例 #19
0
ファイル: AuthoringPaneView.cs プロジェクト: GNOME/mistelix
        public AuthoringPaneView(Gtk.VBox parent, Project project)
        {
            Project = project;
            active_item = -1;
            DragDataReceived += new DragDataReceivedHandler (HandleTargetDragDataReceived);

            EventBox eb = new EventBox (); // Provides a window for this windowless widget
            parent.Add (eb);

            eb.Add (this);
            Gtk.Drag.DestSet (this, DestDefaults.All, tag_dest_target_table,
                      DragAction.Copy | DragAction.Move);

            eb.ButtonPressEvent += HandleButtonPress;
            eb.ButtonReleaseEvent += HandleButtonRelease;
            eb.MotionNotifyEvent += HandleMotionNotify;

            UpdateTheme ();
        }
コード例 #20
0
ファイル: eventbox.cs プロジェクト: Jimmyscene/Random
    public SharpApp()
        : base("EventBox Example")
    {
        SetDefaultSize(230,150);
        SetPosition(WindowPosition.Center);
        DeleteEvent += delegate {Application.Quit();};

        EventBox ebox = new EventBox();
        Add(ebox);
        ebox.Show();
        Label label = new Label("Do Not Touch");
        ebox.Add(label);
        label.Show();
        label.SetSizeRequest(110,20);

        ebox.ButtonPressEvent += delegate{ System.Console.WriteLine("Hello");};
        ebox.Realize();

        Show();
    }
コード例 #21
0
ファイル: NowPlayingContents.cs プロジェクト: knocte/banshee
        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 ();
        }
コード例 #22
0
ファイル: Program.cs プロジェクト: ardaozkal/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();
        }
コード例 #23
0
        public X11NotificationAreaBox () : base (Catalog.GetString ("Banshee"))
        {
            // NOTE: this is a dummy call to ensure we're actually on X11,
            // otherwise X11 calls won't get made until we are realized,
            // at which point it is too late to fall back to xplat GTK tray
            gdk_x11_get_default_screen ();

            event_box = new EventBox ();
            Add (event_box);
            icon = new Image ();

            // Load a 16x16-sized icon to ensure we don't end up with a 1x1 pixel.
            panel_size = 16;
            event_box.Add (icon);

            event_box.ButtonPressEvent += OnButtonPressEvent;
            event_box.EnterNotifyEvent += OnEnterNotifyEvent;
            event_box.LeaveNotifyEvent += OnLeaveNotifyEvent;
            event_box.ScrollEvent += OnMouseScroll;

            event_box.ShowAll ();
        }
コード例 #24
0
ファイル: TrayPopup.cs プロジェクト: gsterjov/fusemc
        // creates the notification window
        public TrayPopup(Widget parent, Widget widget)
        {
            this.parent = parent;

            window = new Window (WindowType.Popup);
            window.TypeHint = Gdk.WindowTypeHint.Notification;
            window.SkipTaskbarHint = true;
            window.SkipPagerHint = true;

            eb = new EventBox ();
            eb.Add (widget);

            timer.Elapsed += timer_count;

            eb.ExposeEvent += expose_window;
            eb.ButtonReleaseEvent += mouse_clicked;
            eb.EnterNotifyEvent += mouse_enter;
            eb.LeaveNotifyEvent += mouse_leave;
            eb.Realized += box_realized;

            window.Add (eb);
        }
コード例 #25
0
        public SparkleWindow()
            : base("")
        {
            Title          = "SparkleShare Setup";
            BorderWidth    = 0;
            IconName       = "folder-sparkleshare";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;

            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);
        }
コード例 #26
0
 private Widget CreateiFolderContentArea()
 {
     ContentEventBox = new EventBox();
        ContentEventBox.ModifyBg(StateType.Normal, this.Style.Background(StateType.Active));
        VBox vbox = new VBox(false, 0);
        ContentEventBox.Add(vbox);
        HBox hbox = new HBox(false, 0);
        hbox.PackStart(CreateActions(), false, false, 12);
        hbox.PackStart(CreateIconViewPane(), true, true, 0);
        vbox.PackStart(hbox, true, true, 0);
        return ContentEventBox;
 }
コード例 #27
0
ファイル: TestPad.cs プロジェクト: wzq0621/monodevelop
        public override void Initialize(NodeBuilder[] builders, TreePadOption[] options, string menuPath)
        {
            base.Initialize(builders, options, menuPath);

            UnitTestService.TestSuiteChanged += OnTestSuiteChanged;
            paned = new VPaned();

            VBox            vbox       = new VBox();
            DockItemToolbar topToolbar = Window.GetToolbar(DockPositionType.Top);

            var hbox = new HBox {
                Spacing = 6
            };

            hbox.PackStart(new ImageView(ImageService.GetIcon("md-execute-all", IconSize.Menu)), false, false, 0);
            hbox.PackStart(new Label(GettextCatalog.GetString("Run All")), false, false, 0);
            buttonRunAll = new Button(hbox);
            buttonRunAll.Accessible.Name        = "TestPad.RunAll";
            buttonRunAll.Accessible.Description = GettextCatalog.GetString("Start a test run and run all the tests");
            buttonRunAll.Clicked    += new EventHandler(OnRunAllClicked);
            buttonRunAll.Sensitive   = true;
            buttonRunAll.TooltipText = GettextCatalog.GetString("Run all tests");
            topToolbar.Add(buttonRunAll);

            buttonStop                 = new Button(new ImageView(Ide.Gui.Stock.Stop, IconSize.Menu));
            buttonStop.Clicked        += new EventHandler(OnStopClicked);
            buttonStop.Sensitive       = false;
            buttonStop.TooltipText     = GettextCatalog.GetString("Cancel running test");
            buttonStop.Accessible.Name = "TestPad.StopAll";
            buttonStop.Accessible.SetTitle(GettextCatalog.GetString(("Cancel")));
            buttonStop.Accessible.Description = GettextCatalog.GetString("Stops the current test run");
            topToolbar.Add(buttonStop);
            topToolbar.ShowAll();

            vbox.PackEnd(base.Control, true, true, 0);
            vbox.FocusChain = new Gtk.Widget [] { base.Control };

            paned.Pack1(vbox, true, true);

            detailsPad = new VBox();

            EventBox eb     = new EventBox();
            HBox     header = new HBox();

            eb.Add(header);

            detailLabel         = new HeaderLabel();
            detailLabel.Padding = 6;

            Button hb = new Button(new ImageView("gtk-close", IconSize.SmallToolbar));

            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnCloseDetails);
            header.PackEnd(hb, false, false, 0);

            hb          = new Button(new ImageView("gtk-go-back", IconSize.SmallToolbar));
            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnGoBackTest);
            header.PackEnd(hb, false, false, 0);

            header.Add(detailLabel);
            Gdk.Color hcol = eb.Style.Background(StateType.Normal);
            hcol.Red   = (ushort)(((double)hcol.Red) * 0.9);
            hcol.Green = (ushort)(((double)hcol.Green) * 0.9);
            hcol.Blue  = (ushort)(((double)hcol.Blue) * 0.9);
            //	eb.ModifyBg (StateType.Normal, hcol);

            detailsPad.PackStart(eb, false, false, 0);

            VPaned panedDetails = new VPaned();

            panedDetails.BorderWidth = 3;
            VBox boxPaned1 = new VBox();

            chart = new TestChart();
            chart.SelectionChanged += new EventHandler(OnChartDateChanged);

            var chartWidget = chart.GetNativeWidget <Widget> ();

            chartWidget.ButtonPressEvent += OnChartButtonPress;
            chartWidget.HeightRequest     = 50;

            Toolbar toolbar = new Toolbar();

            toolbar.IconSize     = IconSize.SmallToolbar;
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.ShowArrow    = false;
            ToolButton but = new ToolButton("gtk-zoom-in");

            but.Clicked += new EventHandler(OnZoomIn);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-zoom-out");
            but.Clicked += new EventHandler(OnZoomOut);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-back");
            but.Clicked += new EventHandler(OnChartBack);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-forward");
            but.Clicked += new EventHandler(OnChartForward);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-goto-last");
            but.Clicked += new EventHandler(OnChartLast);
            toolbar.Insert(but, -1);

            boxPaned1.PackStart(toolbar, false, false, 0);
            boxPaned1.PackStart(chart, true, true, 0);

            panedDetails.Pack1(boxPaned1, false, false);

            // Detailed test information --------

            infoBook = new ButtonNotebook();
            infoBook.PageLoadRequired += new EventHandler(OnPageLoadRequired);

            // Info - Group summary

            Frame          tf = new Frame();
            ScrolledWindow sw = new ScrolledWindow();

            detailsTree = new TreeView {
                Name = "testPadDetailsTree"
            };

            detailsTree.HeadersVisible = true;
            detailsTree.RulesHint      = true;
            detailsStore = new ListStore(typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__UnitTest", "store__Name", "store__Passed",
                                                                          "store__ErrorsAndFailures", "store__Ignored");

            SCM.TypeDescriptor.AddAttributes(detailsStore, modelAttr);

            CellRendererText trtest = new CellRendererText();
            CellRendererText tr;

            TreeViewColumn col3 = new TreeViewColumn();

            col3.Expand = false;
//			col3.Alignment = 0.5f;
            col3.Widget = new ImageView(TestStatusIcon.Success);
            col3.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col3.PackStart(tr, false);
            col3.AddAttribute(tr, "markup", 2);
            detailsTree.AppendColumn(col3);

            TreeViewColumn col4 = new TreeViewColumn();

            col4.Expand = false;
//			col4.Alignment = 0.5f;
            col4.Widget = new ImageView(TestStatusIcon.Failure);
            col4.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col4.PackStart(tr, false);
            col4.AddAttribute(tr, "markup", 3);
            detailsTree.AppendColumn(col4);

            TreeViewColumn col5 = new TreeViewColumn();

            col5.Expand = false;
//			col5.Alignment = 0.5f;
            col5.Widget = new ImageView(TestStatusIcon.NotRun);
            col5.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col5.PackStart(tr, false);
            col5.AddAttribute(tr, "markup", 4);
            detailsTree.AppendColumn(col5);

            TreeViewColumn col1 = new TreeViewColumn();

//			col1.Resizable = true;
//			col1.Expand = true;
            col1.Title = "Test";
            col1.PackStart(trtest, true);
            col1.AddAttribute(trtest, "markup", 1);
            detailsTree.AppendColumn(col1);

            detailsTree.Model = detailsStore;

            sw.Add(detailsTree);
            tf.Add(sw);
            tf.ShowAll();

            TestSummaryPage = infoBook.AddPage(GettextCatalog.GetString("Summary"), tf);

            // Info - Regressions list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            regressionTree = new TreeView {
                Name = "testPadRegressionTree"
            };
            regressionTree.HeadersVisible = false;
            regressionTree.RulesHint      = true;
            regressionStore = new ListStore(typeof(object), typeof(string), typeof(Xwt.Drawing.Image));
            SemanticModelAttribute regressionModelAttr = new SemanticModelAttribute("store__UnitTest", "store__Name", "store__Icon");

            SCM.TypeDescriptor.AddAttributes(detailsStore, regressionModelAttr);

            CellRendererText trtest2 = new CellRendererText();
            var pr = new CellRendererImage();

            TreeViewColumn col = new TreeViewColumn();

            col.PackStart(pr, false);
            col.AddAttribute(pr, "image", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            regressionTree.AppendColumn(col);
            regressionTree.Model = regressionStore;
            sw.Add(regressionTree);
            tf.ShowAll();

            TestRegressionsPage = infoBook.AddPage(GettextCatalog.GetString("Regressions"), tf);

            // Info - Failed tests list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            failedTree = new TreeView();
            failedTree.HeadersVisible = false;
            failedTree.RulesHint      = true;
            failedStore = new ListStore(typeof(object), typeof(string), typeof(Xwt.Drawing.Image));
            SemanticModelAttribute failedModelAttr = new SemanticModelAttribute("store__UnitTest", "store__Name", "store__Icon");

            SCM.TypeDescriptor.AddAttributes(failedStore, failedModelAttr);

            trtest2 = new CellRendererText();
            pr      = new CellRendererImage();

            col = new TreeViewColumn();
            col.PackStart(pr, false);
            col.AddAttribute(pr, "image", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            failedTree.AppendColumn(col);
            failedTree.Model = failedStore;
            sw.Add(failedTree);
            tf.ShowAll();

            TestFailuresPage = infoBook.AddPage(GettextCatalog.GetString("Failed tests"), tf);

            // Info - results

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            resultView          = new TextView();
            resultView.Editable = false;
            sw.Add(resultView);
            tf.ShowAll();
            TestResultPage = infoBook.AddPage(GettextCatalog.GetString("Result"), tf);

            // Info - Output

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            outputView          = new TextView();
            outputView.Editable = false;
            sw.Add(outputView);
            tf.ShowAll();
            TestOutputPage = infoBook.AddPage(GettextCatalog.GetString("Output"), tf);

            panedDetails.Pack2(infoBook, true, true);
            detailsPad.PackStart(panedDetails, true, true, 0);
            paned.Pack2(detailsPad, true, true);

            paned.ShowAll();

            infoBook.HidePage(TestResultPage);
            infoBook.HidePage(TestOutputPage);
            infoBook.HidePage(TestSummaryPage);
            infoBook.HidePage(TestRegressionsPage);
            infoBook.HidePage(TestFailuresPage);

            detailsPad.Sensitive = false;
            detailsPad.Hide();

            detailsTree.RowActivated    += new Gtk.RowActivatedHandler(OnTestActivated);
            regressionTree.RowActivated += new Gtk.RowActivatedHandler(OnRegressionTestActivated);
            failedTree.RowActivated     += new Gtk.RowActivatedHandler(OnFailedTestActivated);

            foreach (UnitTest t in UnitTestService.RootTests)
            {
                TreeView.AddChild(t);
            }

            base.TreeView.Tree.Name = "unitTestBrowserTree";
        }
コード例 #28
0
		public override Widget CreateWidget ()
		{
			Gtk.EventBox box = new EventBox ();
			box.VisibleWindow = false;
			var icon = Gdk.Pixbuf.LoadFromResource ("lightning.png");
			box.Add (new Gtk.Image (icon));
			box.ButtonPressEvent += (o,e) => dlg.ShowButton ();
			PopoverWidget 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;
		}
コード例 #29
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);
        }
コード例 #30
0
        void Build()
        {
            BorderWidth   = 0;
            DefaultWidth  = 901;
            DefaultHeight = 632;

            Name  = "wizard_dialog";
            Title = GettextCatalog.GetString("New Project");
            if (IdeApp.Workbench.RootWindow.Visible)
            {
                WindowPosition = WindowPosition.CenterOnParent;
                TransientFor   = IdeApp.Workbench.RootWindow;
            }
            else
            {
                // FIXME: align on a native toplevel if available
                WindowPosition = WindowPosition.Center;
            }

            projectConfigurationWidget      = new GtkProjectConfigurationWidget();
            projectConfigurationWidget.Name = "projectConfigurationWidget";

            // Top banner of dialog.
            var topLabelEventBox = new EventBox();

            topLabelEventBox.Accessible.SetShouldIgnore(true);
            topLabelEventBox.Name          = "topLabelEventBox";
            topLabelEventBox.HeightRequest = 52;
            topLabelEventBox.ModifyBg(StateType.Normal, bannerBackgroundColor);
            topLabelEventBox.ModifyFg(StateType.Normal, whiteColor);
            topLabelEventBox.BorderWidth = 0;

            var topBannerBottomEdgeLineEventBox = new EventBox();

            topBannerBottomEdgeLineEventBox.Accessible.SetShouldIgnore(true);
            topBannerBottomEdgeLineEventBox.Name          = "topBannerBottomEdgeLineEventBox";
            topBannerBottomEdgeLineEventBox.HeightRequest = 1;
            topBannerBottomEdgeLineEventBox.ModifyBg(StateType.Normal, bannerLineColor);
            topBannerBottomEdgeLineEventBox.BorderWidth = 0;

            topBannerLabel                 = new Label();
            topBannerLabel.Name            = "topBannerLabel";
            topBannerLabel.Accessible.Name = "topBannerLabel";
            Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy();              // UNDONE: VV: Use FontService?
            font.Size   = (int)(font.Size * 2.0);
            font.Weight = Pango.Weight.Bold;
            topBannerLabel.ModifyFont(font);
            topBannerLabel.ModifyFg(StateType.Normal, whiteColor);
            var topLabelHBox = new HBox();

            topLabelHBox.Accessible.SetShouldIgnore(true);
            topLabelHBox.Name = "topLabelHBox";
            topLabelHBox.PackStart(topBannerLabel, false, false, 20);
            topLabelEventBox.Add(topLabelHBox);

            VBox.PackStart(topLabelEventBox, false, false, 0);
            VBox.PackStart(topBannerBottomEdgeLineEventBox, false, false, 0);

            // Main templates section.
            centreVBox = new VBox();
            centreVBox.Accessible.SetShouldIgnore(true);
            centreVBox.Name = "centreVBox";
            VBox.PackStart(centreVBox, true, true, 0);
            templatesHBox = new HBox();
            templatesHBox.Accessible.SetShouldIgnore(true);
            templatesHBox.Name = "templatesHBox";
            centreVBox.PackEnd(templatesHBox, true, true, 0);

            // Template categories.
            var templateCategoriesBgBox = new EventBox();

            templateCategoriesBgBox.Accessible.SetShouldIgnore(true);
            templateCategoriesBgBox.Name        = "templateCategoriesVBox";
            templateCategoriesBgBox.BorderWidth = 0;
            templateCategoriesBgBox.ModifyBg(StateType.Normal, categoriesBackgroundColor);
            templateCategoriesBgBox.WidthRequest = 220;
            var templateCategoriesScrolledWindow = new ScrolledWindow();

            templateCategoriesScrolledWindow.Name             = "templateCategoriesScrolledWindow";
            templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Template categories tree view.
            templateCategoriesTreeView                 = new TreeView();
            templateCategoriesTreeView.Name            = "templateCategoriesTreeView";
            templateCategoriesTreeView.Accessible.Name = "templateCategoriesTreeView";
            templateCategoriesTreeView.Accessible.SetTitle(GettextCatalog.GetString("Project Categories"));
            templateCategoriesTreeView.Accessible.Description = GettextCatalog.GetString("Select the project category to see all possible project templates");
            templateCategoriesTreeView.BorderWidth            = 0;
            templateCategoriesTreeView.HeadersVisible         = false;
            templateCategoriesTreeView.Model         = templateCategoriesTreeStore;
            templateCategoriesTreeView.SearchColumn  = -1;            // disable the interactive search
            templateCategoriesTreeView.ShowExpanders = false;

            templateCategoriesTreeView.AppendColumn(CreateTemplateCategoriesTreeViewColumn());
            templateCategoriesScrolledWindow.Add(templateCategoriesTreeView);
            templateCategoriesBgBox.Add(templateCategoriesScrolledWindow);
            templatesHBox.PackStart(templateCategoriesBgBox, false, false, 0);

            // Templates.
            var templatesBgBox = new EventBox();

            templatesBgBox.Accessible.SetShouldIgnore(true);
            templatesBgBox.ModifyBg(StateType.Normal, templateListBackgroundColor);
            templatesBgBox.Name         = "templatesVBox";
            templatesBgBox.WidthRequest = 400;
            templatesHBox.PackStart(templatesBgBox, false, false, 0);
            var templatesScrolledWindow = new ScrolledWindow();

            templatesScrolledWindow.Name             = "templatesScrolledWindow";
            templatesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Templates tree view.
            templatesTreeView                 = new TreeView();
            templatesTreeView.Name            = "templatesTreeView";
            templatesTreeView.Accessible.Name = "templatesTreeView";
            templatesTreeView.Accessible.SetTitle(GettextCatalog.GetString("Project Templates"));
            templatesTreeView.Accessible.Description = GettextCatalog.GetString("Select the project template");
            templatesTreeView.HeadersVisible         = false;
            templatesTreeView.Model         = templatesTreeStore;
            templatesTreeView.SearchColumn  = -1;            // disable the interactive search
            templatesTreeView.ShowExpanders = false;
            templatesTreeView.AppendColumn(CreateTemplateListTreeViewColumn());
            templatesScrolledWindow.Add(templatesTreeView);
            templatesBgBox.Add(templatesScrolledWindow);

            // Accessibilityy
            templateCategoriesTreeView.Accessible.AddLinkedUIElement(templatesTreeView.Accessible);

            // Template
            var templateEventBox = new EventBox();

            templateEventBox.Accessible.SetShouldIgnore(true);
            templateEventBox.Name = "templateEventBox";
            templateEventBox.ModifyBg(StateType.Normal, templateBackgroundColor);
            templatesHBox.PackStart(templateEventBox, true, true, 0);
            templateVBox = new VBox();
            templateVBox.Accessible.SetShouldIgnore(true);
            templateVBox.Visible     = false;
            templateVBox.BorderWidth = 20;
            templateVBox.Spacing     = 10;
            templateEventBox.Add(templateVBox);

            // Template large image.
            templateImage = new ImageView();
            templateImage.Accessible.SetShouldIgnore(true);
            templateImage.Name          = "templateImage";
            templateImage.HeightRequest = 140;
            templateImage.WidthRequest  = 240;
            templateVBox.PackStart(templateImage, false, false, 10);

            // Template description.
            templateNameLabel                        = new Label();
            templateNameLabel.Name                   = "templateNameLabel";
            templateNameLabel.Accessible.Name        = "templateNameLabel";
            templateNameLabel.Accessible.Description = GettextCatalog.GetString("The name of the selected template");
            templateNameLabel.WidthRequest           = 240;
            templateNameLabel.Wrap                   = true;
            templateNameLabel.Xalign                 = 0;
            templateNameLabel.Markup                 = MarkupTemplateName("TemplateName");
            templateVBox.PackStart(templateNameLabel, false, false, 0);
            templateDescriptionLabel                 = new Label();
            templateDescriptionLabel.Name            = "templateDescriptionLabel";
            templateDescriptionLabel.Accessible.Name = "templateDescriptionLabel";
            templateDescriptionLabel.Accessible.SetLabel(GettextCatalog.GetString("The description of the selected template"));
            templateDescriptionLabel.WidthRequest = 240;
            templateDescriptionLabel.Wrap         = true;
            templateDescriptionLabel.Xalign       = 0;
            templateVBox.PackStart(templateDescriptionLabel, false, false, 0);

            var tempLabel = new Label();

            tempLabel.Accessible.SetShouldIgnore(true);
            templateVBox.PackStart(tempLabel, true, true, 0);

            templatesTreeView.Accessible.AddLinkedUIElement(templateNameLabel.Accessible);
            templatesTreeView.Accessible.AddLinkedUIElement(templateDescriptionLabel.Accessible);

            // Template - button separator.
            var templateSectionSeparatorEventBox = new EventBox();

            templateSectionSeparatorEventBox.Accessible.SetShouldIgnore(true);
            templateSectionSeparatorEventBox.Name          = "templateSectionSeparatorEventBox";
            templateSectionSeparatorEventBox.HeightRequest = 1;
            templateSectionSeparatorEventBox.ModifyBg(StateType.Normal, templateSectionSeparatorColor);
            VBox.PackStart(templateSectionSeparatorEventBox, false, false, 0);

            // Buttons at bottom of dialog.
            var bottomHBox = new HBox();

            bottomHBox.Accessible.SetShouldIgnore(true);
            bottomHBox.Name = "bottomHBox";
            VBox.PackStart(bottomHBox, false, false, 0);

            // Cancel button - bottom left.
            var cancelButtonBox = new HButtonBox();

            cancelButtonBox.Accessible.SetShouldIgnore(true);
            cancelButtonBox.Name        = "cancelButtonBox";
            cancelButtonBox.BorderWidth = 16;
            cancelButton                        = new Button();
            cancelButton.Name                   = "cancelButton";
            cancelButton.Accessible.Name        = "cancelButton";
            cancelButton.Accessible.Description = GettextCatalog.GetString("Cancel the dialog");
            cancelButton.Label                  = GettextCatalog.GetString("Cancel");
            cancelButton.UseStock               = true;
            cancelButtonBox.PackStart(cancelButton, false, false, 0);
            bottomHBox.PackStart(cancelButtonBox, false, false, 0);

            // Previous button - bottom right.
            var previousNextButtonBox = new HButtonBox();

            previousNextButtonBox.Accessible.SetShouldIgnore(true);
            previousNextButtonBox.Name        = "previousNextButtonBox";
            previousNextButtonBox.BorderWidth = 16;
            previousNextButtonBox.Spacing     = 9;
            bottomHBox.PackStart(previousNextButtonBox);
            previousNextButtonBox.Layout = ButtonBoxStyle.End;

            previousButton                        = new Button();
            previousButton.Name                   = "previousButton";
            previousButton.Accessible.Name        = "previousButton";
            previousButton.Accessible.Description = GettextCatalog.GetString("Return to the previous page");
            previousButton.Label                  = GettextCatalog.GetString("Previous");
            previousButton.Sensitive              = false;
            previousNextButtonBox.PackEnd(previousButton);

            // Next button - bottom right.
            nextButton                        = new Button();
            nextButton.Name                   = "nextButton";
            nextButton.Accessible.Name        = "nextButton";
            nextButton.Accessible.Description = GettextCatalog.GetString("Move to the next page");
            nextButton.Label                  = GettextCatalog.GetString("Next");
            previousNextButtonBox.PackEnd(nextButton);

            // Remove default button action area.
            VBox.Remove(ActionArea);

            if (Child != null)
            {
                Child.ShowAll();
            }

            Show();

            templatesTreeView.HasFocus = true;
            Resizable = false;
        }
コード例 #31
0
        private void Initalize(ThemeMode currentMode)
        {
            foreach (var widget in Children)
            {
                Remove(widget);
            }
            this.CurrentMode = currentMode;
            BashHandler bashHandler = BashHandler.Instance;

#if DEBUG
            Console.WriteLine(bashHandler.UserThemeExtensionExists);
#endif

            if (currentMode == ThemeMode.ShellTheme && !bashHandler.CheckUserThemeExtExists())
            {
                VBox vBox = new VBox
                {
                    new Label("Please Install The User Themes Extension"
                              + Environment.NewLine
                              + " to Use This Feature On Gnome")
                };
                Add(vBox);
                vBox.ShowAll();
                Show();
            }
            else
            {
                switch (currentMode)
                {
                case ThemeMode.GtkTheme:
                    currentArray = bashHandler.ThemeList;
                    currentTheme = bashHandler.GetTheme();
                    break;

                case ThemeMode.IconTheme:
                    currentArray = bashHandler.IconList;
                    currentTheme = bashHandler.GetIconTheme();
                    break;

                case ThemeMode.ShellTheme:
                    currentArray = bashHandler.ShellList;
                    currentTheme = bashHandler.GetShellTheme();
                    break;

                case ThemeMode.CursorTheme:
                    currentArray = bashHandler.CursorList;
                    currentTheme = bashHandler.GetCursorTheme();
                    break;
                }

                ListBox box = new ListBox();

                RadioButton radioButton = new RadioButton("");
                box.SelectionMode = SelectionMode.None;

                foreach (var theme in currentArray)
                {
                    ListBoxRow row      = new ListBoxRow();
                    EventBox   eventBox = new EventBox();
                    BoxItem    boxItem  = new BoxItem(theme, radioButton);

                    row.Child = boxItem;
                    eventBox.Add(row);

                    if (currentTheme == boxItem.ItemName)
                    {
                        box.UnselectAll();
                        box.SelectionMode          = SelectionMode.Single;
                        boxItem.RadioButton.Active = true;
#if DEBUG
                        Console.WriteLine(boxItem.ItemName);
#endif
                    }

                    eventBox.ButtonPressEvent += (o, args) =>
                    {
                        box.UnselectAll();

#if DEBUG
                        Console.WriteLine(boxItem.ItemName);
#endif

                        boxItem.RadioButton.Active = true;
                        switch (currentMode)
                        {
                        case ThemeMode.GtkTheme:
                            bashHandler.ChangeTheme(boxItem.ItemName);
                            break;

                        case ThemeMode.IconTheme:
                            bashHandler.ChangeIcon(boxItem.ItemName);
                            break;

                        case ThemeMode.ShellTheme:
                            bashHandler.ChangeShell(boxItem.ItemName);
                            break;

                        case ThemeMode.CursorTheme:
                            bashHandler.ChangeCursor(boxItem.ItemName);
                            break;
                        }
                    };
                    box.Add(eventBox);
                }
                box.ShowAll();
                Add(box);
                Show();
            }
        }
コード例 #32
0
        void Build()
        {
            Title         = GettextCatalog.GetString("Exception Caught");
            DefaultWidth  = 500;
            DefaultHeight = 500;
            HeightRequest = 350;
            WidthRequest  = 350;
            VBox.Foreach(VBox.Remove);
            VBox.PackStart(CreateExceptionHeader(), false, true, 0);
            paned = new VPanedThin();
            paned.GrabAreaSize = 10;
            paned.Pack1(CreateStackTraceTreeView(), true, false);
            paned.Pack2(CreateExceptionValueTreeView(), true, false);
            paned.Show();
            var vbox            = new VBox(false, 0);
            var whiteBackground = new EventBox();

            whiteBackground.Show();
            whiteBackground.ModifyBg(StateType.Normal, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor());
            whiteBackground.Add(vbox);
            hadInnerException = HasInnerException();
            if (hadInnerException)
            {
                vbox.PackStart(new VBox(), false, false, 6);
                vbox.PackStart(CreateInnerExceptionMessage(), false, true, 0);
                vbox.ShowAll();
            }
            vbox.PackStart(paned, true, true, 0);
            vbox.Show();

            if (hadInnerException)
            {
                var box = new HBox();
                box.PackStart(CreateInnerExceptionsTree(), false, false, 0);
                box.PackStart(whiteBackground, true, true, 0);
                box.Show();
                VBox.PackStart(box, true, true, 0);
                DefaultWidth  = 900;
                DefaultHeight = 700;
                WidthRequest  = 550;
                HeightRequest = 450;
            }
            else
            {
                VBox.PackStart(whiteBackground, true, true, 0);
            }
            var actionArea = new HBox(false, 0)
            {
                BorderWidth = 14
            };

            OnlyShowMyCodeCheckbox          = new CheckButton(GettextCatalog.GetString("_Only show my code."));
            OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
            OnlyShowMyCodeCheckbox.Show();
            OnlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions().ProjectAssembliesOnly;

            var alignment = new Alignment(0.0f, 0.5f, 0.0f, 0.0f)
            {
                Child = OnlyShowMyCodeCheckbox
            };

            alignment.Show();

            actionArea.PackStart(alignment, true, true, 0);
            actionArea.PackStart(CreateButtonBox(), false, true, 0);
            actionArea.PackStart(new VBox(), false, true, 3);               // dummy just to take extra 6px at end to make it 20pixels
            actionArea.ShowAll();

            VBox.PackStart(actionArea, false, true, 0);
        }
コード例 #33
0
ファイル: SeriesView.cs プロジェクト: BrianCollinss/ApsimNG
        /// <summary>Initializes a new instance of the <see cref="SeriesView" /> class</summary>
        public SeriesView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.SeriesView.glade");

            vbox1      = (VBox)builder.GetObject("vbox1");
            table1     = (Table)builder.GetObject("table1");
            label4     = (Label)builder.GetObject("label4");
            label5     = (Label)builder.GetObject("label5");
            mainWidget = vbox1;

            graphView1 = new GraphView(this);
            vbox1.PackStart(graphView1.MainWidget, true, true, 0);

            dataSourceDropDown    = new DropDownView(this);
            xDropDown             = new DropDownView(this);
            yDropDown             = new DropDownView(this);
            x2DropDown            = new DropDownView(this);
            y2DropDown            = new DropDownView(this);
            seriesDropDown        = new DropDownView(this);
            lineTypeDropDown      = new DropDownView(this);
            markerTypeDropDown    = new DropDownView(this);
            colourDropDown        = new ColourDropDownView(this);
            lineThicknessDropDown = new DropDownView(this);
            markerSizeDropDown    = new DropDownView(this);

            checkBoxView1             = new CheckBoxView(this);
            checkBoxView1.TextOfLabel = "on top?";
            checkBoxView2             = new CheckBoxView(this);
            checkBoxView2.TextOfLabel = "on right?";
            checkBoxView3             = new CheckBoxView(this);
            checkBoxView3.TextOfLabel = "cumulative?";
            checkBoxView4             = new CheckBoxView(this);
            checkBoxView4.TextOfLabel = "cumulative?";
            checkBoxView5             = new CheckBoxView(this);
            checkBoxView5.TextOfLabel = "Show in legend?";
            checkBoxView6             = new CheckBoxView(this);
            checkBoxView6.TextOfLabel = "Include series name in legend?";

            editView1 = new EditView(this);

            table1.Attach(dataSourceDropDown.MainWidget, 1, 2, 0, 1, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(xDropDown.MainWidget, 1, 2, 1, 2, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(yDropDown.MainWidget, 1, 2, 2, 3, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(y2DropDown.MainWidget, 1, 2, 3, 4, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(x2DropDown.MainWidget, 1, 2, 4, 5, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(seriesDropDown.MainWidget, 1, 2, 5, 6, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(lineTypeDropDown.MainWidget, 1, 2, 6, 7, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(markerTypeDropDown.MainWidget, 1, 2, 7, 8, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(colourDropDown.MainWidget, 1, 2, 8, 9, AttachOptions.Fill, 0, 10, 2);

            Image helpImage = new Image(null, "ApsimNG.Resources.help.png");

            helpBox = new EventBox();
            helpBox.Add(helpImage);
            helpBox.ButtonReleaseEvent += Help_ButtonPressEvent;
            HBox filterBox = new HBox();

            filterBox.PackStart(editView1.MainWidget, true, true, 0);
            filterBox.PackEnd(helpBox, false, true, 0);

            //table1.Attach(editView1.MainWidget, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(filterBox, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);

            table1.Attach(checkBoxView1.MainWidget, 2, 3, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView2.MainWidget, 2, 3, 2, 3, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView3.MainWidget, 3, 4, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView4.MainWidget, 3, 4, 2, 3, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(checkBoxView5.MainWidget, 2, 4, 8, 9, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView6.MainWidget, 2, 4, 9, 10, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(lineThicknessDropDown.MainWidget, 3, 4, 6, 7, AttachOptions.Fill, 0, 0, 5);
            table1.Attach(markerSizeDropDown.MainWidget, 3, 4, 7, 8, AttachOptions.Fill, 0, 0, 5);
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
コード例 #34
0
        void Build()
        {
            BorderWidth   = 0;
            WidthRequest  = GtkWorkarounds.ConvertToPixelScale(901);
            HeightRequest = GtkWorkarounds.ConvertToPixelScale(632);

            Name           = "wizard_dialog";
            Title          = GettextCatalog.GetString("New Project");
            WindowPosition = WindowPosition.CenterOnParent;
            TransientFor   = IdeApp.Workbench.RootWindow;

            projectConfigurationWidget      = new GtkProjectConfigurationWidget();
            projectConfigurationWidget.Name = "projectConfigurationWidget";

            // Top banner of dialog.
            var topLabelEventBox = new EventBox();

            topLabelEventBox.Name          = "topLabelEventBox";
            topLabelEventBox.HeightRequest = GtkWorkarounds.ConvertToPixelScale(52);
            topLabelEventBox.ModifyBg(StateType.Normal, bannerBackgroundColor);
            topLabelEventBox.ModifyFg(StateType.Normal, whiteColor);
            topLabelEventBox.BorderWidth = 0;

            var topBannerTopEdgeLineEventBox = new EventBox();

            topBannerTopEdgeLineEventBox.Name          = "topBannerTopEdgeLineEventBox";
            topBannerTopEdgeLineEventBox.HeightRequest = 1;
            topBannerTopEdgeLineEventBox.ModifyBg(StateType.Normal, bannerLineColor);
            topBannerTopEdgeLineEventBox.BorderWidth = 0;

            var topBannerBottomEdgeLineEventBox = new EventBox();

            topBannerBottomEdgeLineEventBox.Name          = "topBannerBottomEdgeLineEventBox";
            topBannerBottomEdgeLineEventBox.HeightRequest = 1;
            topBannerBottomEdgeLineEventBox.ModifyBg(StateType.Normal, bannerLineColor);
            topBannerBottomEdgeLineEventBox.BorderWidth = 0;

            topBannerLabel      = new Label();
            topBannerLabel.Name = "topBannerLabel";
            Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy();
            font.Size = (int)(font.Size * 1.8);
            topBannerLabel.ModifyFont(font);
            topBannerLabel.ModifyFg(StateType.Normal, whiteColor);
            var topLabelHBox = new HBox();

            topLabelHBox.Name = "topLabelHBox";
            topLabelHBox.PackStart(topBannerLabel, false, false, 20);
            topLabelEventBox.Add(topLabelHBox);

            VBox.PackStart(topBannerTopEdgeLineEventBox, false, false, 0);
            VBox.PackStart(topLabelEventBox, false, false, 0);
            VBox.PackStart(topBannerBottomEdgeLineEventBox, false, false, 0);

            // Main templates section.
            centreVBox      = new VBox();
            centreVBox.Name = "centreVBox";
            VBox.PackStart(centreVBox, true, true, 0);
            templatesHBox      = new HBox();
            templatesHBox.Name = "templatesHBox";
            centreVBox.PackEnd(templatesHBox, true, true, 0);

            // Template categories.
            var templateCategoriesVBox = new VBox();

            templateCategoriesVBox.Name         = "templateCategoriesVBox";
            templateCategoriesVBox.BorderWidth  = 0;
            templateCategoriesVBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale(220);
            var templateCategoriesScrolledWindow = new ScrolledWindow();

            templateCategoriesScrolledWindow.Name             = "templateCategoriesScrolledWindow";
            templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Template categories tree view.
            templateCategoriesTreeView                = new TreeView();
            templateCategoriesTreeView.Name           = "templateCategoriesTreeView";
            templateCategoriesTreeView.BorderWidth    = 0;
            templateCategoriesTreeView.HeadersVisible = false;
            templateCategoriesTreeView.Model          = templateCategoriesListStore;
            templateCategoriesTreeView.ModifyBase(StateType.Normal, categoriesBackgroundColor);
            templateCategoriesTreeView.AppendColumn(CreateTemplateCategoriesTreeViewColumn());
            templateCategoriesScrolledWindow.Add(templateCategoriesTreeView);
            templateCategoriesVBox.PackStart(templateCategoriesScrolledWindow, true, true, 0);
            templatesHBox.PackStart(templateCategoriesVBox, false, false, 0);

            // Templates.
            var templatesVBox = new VBox();

            templatesVBox.Name         = "templatesVBox";
            templatesVBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale(400);
            templatesHBox.PackStart(templatesVBox, false, false, 0);
            var templatesScrolledWindow = new ScrolledWindow();

            templatesScrolledWindow.Name             = "templatesScrolledWindow";
            templatesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Templates tree view.
            templatesTreeView                = new TreeView();
            templatesTreeView.Name           = "templatesTreeView";
            templatesTreeView.HeadersVisible = false;
            templatesTreeView.Model          = templatesListStore;
            templatesTreeView.ModifyBase(StateType.Normal, templateListBackgroundColor);
            templatesTreeView.AppendColumn(CreateTemplateListTreeViewColumn());
            templatesScrolledWindow.Add(templatesTreeView);
            templatesVBox.PackStart(templatesScrolledWindow, true, true, 0);

            // Template
            var templateEventBox = new EventBox();

            templateEventBox.Name = "templateEventBox";
            templateEventBox.ModifyBg(StateType.Normal, templateBackgroundColor);
            templatesHBox.PackStart(templateEventBox, true, true, 0);
            templateVBox             = new VBox();
            templateVBox.Visible     = false;
            templateVBox.BorderWidth = 20;
            templateVBox.Spacing     = 10;
            templateEventBox.Add(templateVBox);

            // Template large image.
            templateImage               = new ImageView();
            templateImage.Name          = "templateImage";
            templateImage.HeightRequest = GtkWorkarounds.ConvertToPixelScale(140);
            templateImage.WidthRequest  = GtkWorkarounds.ConvertToPixelScale(240);
            templateVBox.PackStart(templateImage, false, false, 10);

            // Template description.
            templateNameLabel              = new Label();
            templateNameLabel.Name         = "templateNameLabel";
            templateNameLabel.WidthRequest = GtkWorkarounds.ConvertToPixelScale(240);
            templateNameLabel.Wrap         = true;
            templateNameLabel.Xalign       = 0;
            templateNameLabel.Markup       = MarkupTemplateName("TemplateName");
            templateVBox.PackStart(templateNameLabel, false, false, 0);
            templateDescriptionLabel              = new Label();
            templateDescriptionLabel.Name         = "templateDescriptionLabel";
            templateDescriptionLabel.WidthRequest = GtkWorkarounds.ConvertToPixelScale(240);
            templateDescriptionLabel.Wrap         = true;
            templateDescriptionLabel.Xalign       = 0;
            templateVBox.PackStart(templateDescriptionLabel, false, false, 0);
            templateVBox.PackStart(new Label(), true, true, 0);

            // Template - button separator.
            var templateSectionSeparatorEventBox = new EventBox();

            templateSectionSeparatorEventBox.Name          = "templateSectionSeparatorEventBox";
            templateSectionSeparatorEventBox.HeightRequest = 1;
            templateSectionSeparatorEventBox.ModifyBg(StateType.Normal, templateSectionSeparatorColor);
            VBox.PackStart(templateSectionSeparatorEventBox, false, false, 0);

            // Buttons at bottom of dialog.
            var bottomHBox = new HBox();

            bottomHBox.Name = "bottomHBox";
            VBox.PackStart(bottomHBox, false, false, 0);

            // Cancel button - bottom left.
            var cancelButtonBox = new HButtonBox();

            cancelButtonBox.Name        = "cancelButtonBox";
            cancelButtonBox.BorderWidth = 16;
            cancelButton          = new Button();
            cancelButton.Name     = "cancelButton";
            cancelButton.Label    = "gtk-cancel";
            cancelButton.UseStock = true;
            cancelButtonBox.PackStart(cancelButton, false, false, 0);
            bottomHBox.PackStart(cancelButtonBox, false, false, 0);

            // Previous button - bottom right.
            var previousNextButtonBox = new HButtonBox();

            previousNextButtonBox.Name        = "previousNextButtonBox";
            previousNextButtonBox.BorderWidth = 16;
            previousNextButtonBox.Spacing     = 9;
            bottomHBox.PackStart(previousNextButtonBox);
            previousNextButtonBox.Layout = ButtonBoxStyle.End;

            previousButton           = new Button();
            previousButton.Name      = "previousButton";
            previousButton.Label     = GettextCatalog.GetString("Previous");
            previousButton.Sensitive = false;
            previousNextButtonBox.PackEnd(previousButton);

            // Next button - bottom right.
            nextButton       = new Button();
            nextButton.Name  = "nextButton";
            nextButton.Label = GettextCatalog.GetString("Next");
            previousNextButtonBox.PackEnd(nextButton);

            // Remove default button action area.
            VBox.Remove(ActionArea);

            if (Child != null)
            {
                Child.ShowAll();
            }

            Show();

            templatesTreeView.HasFocus = true;
            Resizable = false;
        }
コード例 #35
0
        private NetworkOverviewPage()
        {
            /* Build the UI */

            CreateUserList();

            /* Create mainbar */

            Widget mapWidget = null;

            try {
                map = new ZoomableNetworkMap();
                map.SelectedNodeChanged += map_SelectedNodeChanged;
                map.NodeDoubleClicked   += map_NodeDoubleClicked;
                mapWidget = map;
            } catch (Exception ex) {
                Core.LoggingService.LogError("Failed to load map !!!", ex);
                mapWidget = new Label("Error loading map.");
            }

            this.Pack1(mapWidget, true, true);

            /* Create sidebar */
            sidebar = new EventBox();
            sidebar.WidthRequest = 190;

            var sidebarBox = new Gtk.VBox();

            sidebar.Add(sidebarBox);

            var headerAlign = new Banshee.Widgets.FadingAlignment();

            sidebarBox.PackStart(headerAlign, false, false, 0);

            var headerLabel = new Gtk.Label();

            headerLabel.Markup = "<b>Users</b>";
            headerLabel.Xalign = 0;
            headerLabel.Ypad   = 6;
            headerLabel.Xpad   = 6;
            headerAlign.Add(headerLabel);

            sidebarBox.PackStart(AddScrolledWindow(userList), true, true, 0);

            this.Pack2(sidebar, false, true);

            sidebar.ShowAll();

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

            Core.TransportManager.TransportError +=
                (EventHandler <ErrorEventArgs>)DispatchService.GuiDispatch(
                    new EventHandler <ErrorEventArgs>(Core_TransportError)
                    );

            Core.NetworkAdded +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkAdded)
                    );

            Core.NetworkRemoved +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkRemoved)
                    );

            Core.AvatarManager.AvatarsChanged +=
                (EventHandler)DispatchService.GuiDispatch(
                    new EventHandler(AvatarManager_AvatarsChanged)
                    );

            this.ShowAll();
        }
コード例 #36
0
        private void CreateAbout()
        {
            Gdk.Color color = Style.Foreground(StateType.Insensitive);
            string    secondary_text_color = SparkleUIHelpers.GdkColorToHex(color);


            EventBox box = new EventBox();

            box.ModifyBg(StateType.Normal, new TreeView().Style.Base(StateType.Normal));

            Label header = new Label()
            {
                Markup = "<span font_size='xx-large'>SparkleShare</span>\n<span fgcolor='" + secondary_text_color + "'><small>" + Defines.VERSION + "</small></span>",
                Xalign = 0,
                Xpad   = 18,
                Ypad   = 18
            };

            box.Add(header);


            Version = new Label()
            {
                Markup = "<small>Checking for updates...</small>",
                Xalign = 0,
                Xpad   = 18,
                Ypad   = 22,
            };

            Label license = new Label()
            {
                Xalign       = 0,
                Xpad         = 18,
                Ypad         = 22,
                LineWrap     = true,
                Wrap         = true,
                LineWrapMode = Pango.WrapMode.Word,

                Markup = "<small>Copyright © 2010–" + DateTime.Now.Year + " Hylke Bons and others\n" +
                         "\n" +
                         "SparkleShare is Free and Open Source Software. " +
                         "You are free to use, modify, and redistribute it " +
                         "under the terms of the GNU General Public License version 3 or later.</small>"
            };

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

            HButtonBox button_bar = new HButtonBox()
            {
                BorderWidth = 12
            };

            Button credits_button = new Button(_("_Show Credits"))
            {
                UseUnderline = true
            };

            credits_button.Clicked += delegate {
                Process process = new Process();
                process.StartInfo.FileName  = "xdg-open";
                process.StartInfo.Arguments = "http://www.sparkleshare.org/credits";
                process.Start();
            };

            Button website_button = new Button(_("_Visit Website"))
            {
                UseUnderline = true
            };

            website_button.Clicked += delegate {
                Process process = new Process();
                process.StartInfo.FileName  = "xdg-open";
                process.StartInfo.Arguments = "http://www.sparkleshare.org/";
                process.Start();
            };

            button_bar.Add(website_button);
            button_bar.Add(credits_button);

            vbox.PackStart(box, true, true, 0);
            vbox.PackStart(Version, false, false, 0);
            vbox.PackStart(license, true, true, 0);
            vbox.PackStart(button_bar, false, false, 0);

            Add(vbox);
        }
コード例 #37
0
ファイル: TestPad.cs プロジェクト: llucenic/monodevelop
		public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string menuPath)
		{
			base.Initialize (builders, options, menuPath);
			
			testChangedHandler = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnDetailsTestChanged));
			testService.TestSuiteChanged += (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnTestSuiteChanged));
			paned = new VPaned ();
			
			VBox vbox = new VBox ();
			DockItemToolbar topToolbar = Window.GetToolbar (PositionType.Top);
			
			buttonRunAll = new Button (new Gtk.Image (Gtk.Stock.GoUp, IconSize.Menu));
			buttonRunAll.Clicked += new EventHandler (OnRunAllClicked);
			buttonRunAll.Sensitive = true;
			buttonRunAll.TooltipText = GettextCatalog.GetString ("Run all tests");
			topToolbar.Add (buttonRunAll);
			
			buttonRun = new Button (new Gtk.Image (Gtk.Stock.Execute, IconSize.Menu));
			buttonRun.Clicked += new EventHandler (OnRunClicked);
			buttonRun.Sensitive = true;
			buttonRun.TooltipText = GettextCatalog.GetString ("Run test");
			topToolbar.Add (buttonRun);
			
			buttonStop = new Button (new Gtk.Image (Gtk.Stock.Stop, IconSize.Menu));
			buttonStop.Clicked += new EventHandler (OnStopClicked);
			buttonStop.Sensitive = false;
			buttonStop.TooltipText = GettextCatalog.GetString ("Cancel running test");
			topToolbar.Add (buttonStop);
			topToolbar.ShowAll ();
			
			vbox.PackEnd (base.Control, true, true, 0);
			vbox.FocusChain = new Gtk.Widget [] { base.Control };
			
			paned.Pack1 (vbox, true, true);
			
			detailsPad = new VBox ();
			
			EventBox eb = new EventBox ();
			HBox header = new HBox ();
			eb.Add (header);

			detailLabel = new HeaderLabel ();
			detailLabel.Padding = 6;
			
			Button hb = new Button (new Gtk.Image ("gtk-close", IconSize.SmallToolbar));
			hb.Relief = ReliefStyle.None;
			hb.Clicked += new EventHandler (OnCloseDetails);
			header.PackEnd (hb, false, false, 0);
			
			hb = new Button (new Gtk.Image ("gtk-go-back", IconSize.SmallToolbar));
			hb.Relief = ReliefStyle.None;
			hb.Clicked += new EventHandler (OnGoBackTest);
			header.PackEnd (hb, false, false, 0);
			
			header.Add (detailLabel);
			Gdk.Color hcol = eb.Style.Background (StateType.Normal);
			hcol.Red = (ushort) (((double)hcol.Red) * 0.9);
			hcol.Green = (ushort) (((double)hcol.Green) * 0.9);
			hcol.Blue = (ushort) (((double)hcol.Blue) * 0.9);
		//	eb.ModifyBg (StateType.Normal, hcol);
			
			detailsPad.PackStart (eb, false, false, 0);
			
			VPaned panedDetails = new VPaned ();
			panedDetails.BorderWidth = 3;
			VBox boxPaned1 = new VBox ();
			
			chart = new TestChart ();
			chart.ButtonPressEvent += OnChartButtonPress;
			chart.SelectionChanged += new EventHandler (OnChartDateChanged);
			chart.HeightRequest = 50;
			
			Toolbar toolbar = new Toolbar ();
			toolbar.IconSize = IconSize.SmallToolbar;
			toolbar.ToolbarStyle = ToolbarStyle.Icons;
			toolbar.ShowArrow = false;
			ToolButton but = new ToolButton ("gtk-zoom-in");
			but.Clicked += new EventHandler (OnZoomIn);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-zoom-out");
			but.Clicked += new EventHandler (OnZoomOut);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-go-back");
			but.Clicked += new EventHandler (OnChartBack);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-go-forward");
			but.Clicked += new EventHandler (OnChartForward);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-goto-last");
			but.Clicked += new EventHandler (OnChartLast);
			toolbar.Insert (but, -1);
			
			boxPaned1.PackStart (toolbar, false, false, 0);
			boxPaned1.PackStart (chart, true, true, 0);
			
			panedDetails.Pack1 (boxPaned1, false, false);
			
			// Detailed test information --------
			
			infoBook = new ButtonNotebook ();
			infoBook.PageLoadRequired += new EventHandler (OnPageLoadRequired);
			
			// Info - Group summary
			
			Frame tf = new Frame ();
			ScrolledWindow sw = new ScrolledWindow ();
			detailsTree = new TreeView ();
			
			detailsTree.HeadersVisible = true;
			detailsTree.RulesHint = true;
			detailsStore = new ListStore (typeof(object), typeof(string), typeof (string), typeof (string), typeof (string));
			
			CellRendererText trtest = new CellRendererText ();
			CellRendererText tr;
			
			TreeViewColumn col3 = new TreeViewColumn ();
			col3.Expand = false;
//			col3.Alignment = 0.5f;
			col3.Widget = new Gtk.Image (CircleImage.Success);
			col3.Widget.Show ();
			tr = new CellRendererText ();
//			tr.Xalign = 0.5f;
			col3.PackStart (tr, false);
			col3.AddAttribute (tr, "markup", 2);
			detailsTree.AppendColumn (col3);
			
			TreeViewColumn col4 = new TreeViewColumn ();
			col4.Expand = false;
//			col4.Alignment = 0.5f;
			col4.Widget = new Gtk.Image (CircleImage.Failure);
			col4.Widget.Show ();
			tr = new CellRendererText ();
//			tr.Xalign = 0.5f;
			col4.PackStart (tr, false);
			col4.AddAttribute (tr, "markup", 3);
			detailsTree.AppendColumn (col4);
			
			TreeViewColumn col5 = new TreeViewColumn ();
			col5.Expand = false;
//			col5.Alignment = 0.5f;
			col5.Widget = new Gtk.Image (CircleImage.NotRun);
			col5.Widget.Show ();
			tr = new CellRendererText ();
//			tr.Xalign = 0.5f;
			col5.PackStart (tr, false);
			col5.AddAttribute (tr, "markup", 4);
			detailsTree.AppendColumn (col5);
			
			TreeViewColumn col1 = new TreeViewColumn ();
//			col1.Resizable = true;
//			col1.Expand = true;
			col1.Title = "Test";
			col1.PackStart (trtest, true);
			col1.AddAttribute (trtest, "markup", 1);
			detailsTree.AppendColumn (col1);
			
			detailsTree.Model = detailsStore;
			
			sw.Add (detailsTree);
			tf.Add (sw);
			tf.ShowAll ();
			
			TestSummaryPage = infoBook.AddPage (GettextCatalog.GetString ("Summary"), tf);
			
			// Info - Regressions list
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			regressionTree = new TreeView ();
			regressionTree.HeadersVisible = false;
			regressionTree.RulesHint = true;
			regressionStore = new ListStore (typeof(object), typeof(string), typeof (Pixbuf));
			
			CellRendererText trtest2 = new CellRendererText ();
			var pr = new CellRendererPixbuf ();
			
			TreeViewColumn col = new TreeViewColumn ();
			col.PackStart (pr, false);
			col.AddAttribute (pr, "pixbuf", 2);
			col.PackStart (trtest2, false);
			col.AddAttribute (trtest2, "markup", 1);
			regressionTree.AppendColumn (col);
			regressionTree.Model = regressionStore;
			sw.Add (regressionTree);
			tf.ShowAll ();
			
			TestRegressionsPage = infoBook.AddPage (GettextCatalog.GetString ("Regressions"), tf);
			
			// Info - Failed tests list
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			failedTree = new TreeView ();
			failedTree.HeadersVisible = false;
			failedTree.RulesHint = true;
			failedStore = new ListStore (typeof(object), typeof(string), typeof (Pixbuf));
			
			trtest2 = new CellRendererText ();
			pr = new CellRendererPixbuf ();
			
			col = new TreeViewColumn ();
			col.PackStart (pr, false);
			col.AddAttribute (pr, "pixbuf", 2);
			col.PackStart (trtest2, false);
			col.AddAttribute (trtest2, "markup", 1);
			failedTree.AppendColumn (col);
			failedTree.Model = failedStore;
			sw.Add (failedTree);
			tf.ShowAll ();
			
			TestFailuresPage = infoBook.AddPage (GettextCatalog.GetString ("Failed tests"), tf);
			
			// Info - results
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			resultView = new TextView ();
			resultView.Editable = false;
			sw.Add (resultView);
			tf.ShowAll ();
			TestResultPage = infoBook.AddPage (GettextCatalog.GetString ("Result"), tf);
			
			// Info - Output
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			outputView = new TextView ();
			outputView.Editable = false;
			sw.Add (outputView);
			tf.ShowAll ();
			TestOutputPage = infoBook.AddPage (GettextCatalog.GetString ("Output"), tf);
			
			panedDetails.Pack2 (infoBook, true, true);
			detailsPad.PackStart (panedDetails, true, true, 0);
			paned.Pack2 (detailsPad, true, true);
			
			paned.ShowAll ();
			
			infoBook.HidePage (TestResultPage);
			infoBook.HidePage (TestOutputPage);
			infoBook.HidePage (TestSummaryPage);
			infoBook.HidePage (TestRegressionsPage);
			infoBook.HidePage (TestFailuresPage);
			
			detailsPad.Sensitive = false;
			detailsPad.Hide ();
			
			detailsTree.RowActivated += new Gtk.RowActivatedHandler (OnTestActivated);
			regressionTree.RowActivated += new Gtk.RowActivatedHandler (OnRegressionTestActivated);
			failedTree.RowActivated += new Gtk.RowActivatedHandler (OnFailedTestActivated);
			
			foreach (UnitTest t in testService.RootTests)
				TreeView.AddChild (t);
		}
コード例 #38
0
ファイル: StatusArea.cs プロジェクト: leculver/monodevelop
        public Widget CreateBuildResultsWidget(Orientation orientation)
        {
            EventBox ebox = new EventBox();

            Gtk.Box box;
            if (orientation == Orientation.Horizontal)
            {
                box = new HBox();
            }
            else
            {
                box = new VBox();
            }
            box.Spacing = 3;

            var errorIcon   = ImageService.GetIcon(StockIcons.Error).WithSize(Xwt.IconSize.Small);
            var warningIcon = ImageService.GetIcon(StockIcons.Warning).WithSize(Xwt.IconSize.Small);

            var errorImage   = new Xwt.ImageView(errorIcon);
            var warningImage = new Xwt.ImageView(warningIcon);

            box.PackStart(errorImage.ToGtkWidget(), false, false, 0);
            Label errors = new Gtk.Label();

            box.PackStart(errors, false, false, 0);

            box.PackStart(warningImage.ToGtkWidget(), false, false, 0);
            Label warnings = new Gtk.Label();

            box.PackStart(warnings, false, false, 0);
            box.NoShowAll = true;
            box.Show();

            TaskEventHandler updateHandler = delegate {
                int ec = 0, wc = 0;

                foreach (TaskListEntry t in IdeServices.TaskService.Errors)
                {
                    if (t.Severity == TaskSeverity.Error)
                    {
                        ec++;
                    }
                    else if (t.Severity == TaskSeverity.Warning)
                    {
                        wc++;
                    }
                }


                using (var font = IdeServices.FontService.SansFont.CopyModified(MonoDevelop.Ide.Gui.Styles.FontScale11)) {
                    errors.Visible = ec > 0;
                    errors.ModifyFont(font);
                    errors.Text        = ec.ToString();
                    errorImage.Visible = ec > 0;

                    warnings.Visible = wc > 0;
                    warnings.ModifyFont(font);
                    warnings.Text        = wc.ToString();
                    warningImage.Visible = wc > 0;
                }

                ebox.Visible = ec > 0 || wc > 0;

                UpdateSeparators();
            };

            updateHandler(null, null);

            IdeServices.TaskService.Errors.TasksAdded   += updateHandler;
            IdeServices.TaskService.Errors.TasksRemoved += updateHandler;

            currentApplicationName = BrandingService.ApplicationLongName;
            BrandingService.ApplicationNameChanged += ApplicationNameChanged;

            box.Destroyed += delegate {
                IdeServices.TaskService.Errors.TasksAdded   -= updateHandler;
                IdeServices.TaskService.Errors.TasksRemoved -= updateHandler;
                BrandingService.ApplicationNameChanged      -= ApplicationNameChanged;
            };

            ebox.VisibleWindow = false;
            ebox.Add(box);
            ebox.ShowAll();
            ebox.ButtonReleaseEvent += delegate {
                var pad = IdeApp.Workbench.GetPad <MonoDevelop.Ide.Gui.Pads.ErrorListPad> ();
                pad.BringToFront();
            };

            errors.Visible       = false;
            errorImage.Visible   = false;
            warnings.Visible     = false;
            warningImage.Visible = false;

            return(ebox);
        }
コード例 #39
0
ファイル: NotifyWindow.cs プロジェクト: RoDaniel/featurehouse
  public NotifyWindow(Gtk.Widget parent, string message, string details,
 Gtk.MessageType messageType, uint timeout)
      : base(Gtk.WindowType.Popup)
  {
      this.AppPaintable = true;
         parentWidget = parent;
         this.timeout = timeout;
         activeBackgroundColor = new Gdk.Color(249, 253, 202);
         inactiveBackgroundColor = new Gdk.Color(255, 255, 255);
         Gtk.HBox outBox = new HBox();
         this.Add(outBox);
         outBox.BorderWidth = (uint)wbsize;
         Gtk.VBox closeBox = new VBox();
         closeBox.BorderWidth = 3;
         outBox.PackEnd(closeBox, true, true, 0);
         EventBox eBox = new EventBox();
         eBox.ButtonPressEvent +=
      new ButtonPressEventHandler(OnCloseEvent);
         Gtk.Image closeImg = new Gtk.Image();
         closeImg.SetFromStock(Gtk.Stock.Close,
         IconSize.Menu);
         eBox.Add(closeImg);
         closeBox.PackStart(eBox, false, false, 0);
         Label padder = new Label("");
         outBox.PackStart(padder, false, false, 5);
         Gtk.VBox vbox = new VBox();
         outBox.PackStart(vbox, true, true, 0);
         vbox.BorderWidth = 10;
         Gtk.HBox hbox = new HBox();
         hbox.Spacing = 5;
         vbox.PackStart(hbox, false, false, 0);
         VBox iconVBox = new VBox();
         hbox.PackStart(iconVBox, false, false, 0);
         Gtk.Image msgImage = new Gtk.Image();
         switch(messageType)
         {
      case Gtk.MessageType.Info:
       msgImage.SetFromStock(Gtk.Stock.DialogInfo,
         IconSize.Button);
       break;
      case Gtk.MessageType.Warning:
       msgImage.SetFromStock(Gtk.Stock.DialogWarning,
         IconSize.Button);
       break;
      case Gtk.MessageType.Question:
       msgImage.SetFromStock(Gtk.Stock.DialogQuestion,
         IconSize.Button);
       break;
      case Gtk.MessageType.Error:
       msgImage.SetFromStock(Gtk.Stock.DialogError,
         IconSize.Button);
       break;
         }
         iconVBox.PackStart(msgImage, false, false, 0);
         VBox messageVBox = new VBox();
         hbox.PackStart(messageVBox, true, true, 0);
         Label l = new Label();
         l.Markup = "<span size=\"small\" weight=\"bold\">" + message + "</span>";
         l.LineWrap = false;
         l.UseMarkup = true;
         l.Selectable = false;
         l.Xalign = 0;
         l.Yalign = 0;
         l.LineWrap = true;
         l.Wrap = true;
         l.WidthRequest = messageTextWidth;
         messageVBox.PackStart(l, false, true, 0);
         detailsTextView = new LinkTextView(details);
         detailsTextView.Editable = false;
         detailsTextView.CursorVisible = false;
         detailsTextView.WrapMode = WrapMode.Word;
         detailsTextView.SizeAllocate(new Gdk.Rectangle(0, 0, messageTextWidth, 600));
         detailsTextView.LinkClicked +=
      new LinkClickedEventHandler(OnLinkClicked);
         messageVBox.PackStart(detailsTextView, false, false, 3);
         Label spacer = new Label();
         spacer.UseMarkup = true;
         spacer.Markup = "<span size=\"xx-small\"> </span>";
         messageVBox.PackEnd(spacer, false, false, 0);
         closeWindowTimeoutID = 0;
  }
コード例 #40
0
        public PhotoView(IBrowsableCollection query)
            : base()
        {
            Query = query;

            commit_delay    = new DelayedOperation(1000, new GLib.IdleHandler(CommitPendingChanges));
            this.Destroyed += HandleDestroy;

            Name = "ImageContainer";
            Box vbox = new VBox(false, 6);

            Add(vbox);

            background = new EventBox();
            Frame frame = new Frame();

            background.Add(frame);

            frame.ShadowType = ShadowType.In;
            vbox.PackStart(background, true, true, 0);

            inner_vbox = new VBox(false, 2);
            inner_hbox = new HBox(false, 2);

            frame.Add(inner_hbox);

            BrowsablePointer bp = new BrowsablePointer(query, -1);

            View = new PhotoImageView(bp);

            filmstrip             = new Filmstrip(bp);
            filmstrip.ThumbOffset = 1;
            filmstrip.Spacing     = 4;
            filmstrip.ThumbSize   = 75;
            PlaceFilmstrip((Orientation)Preferences.Get <int> (Preferences.FILMSTRIP_ORIENTATION), true);

            View.PhotoChanged += HandlePhotoChanged;

            photo_view_scrolled = new ScrolledWindow(null, null);

            photo_view_scrolled.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            photo_view_scrolled.ShadowType = ShadowType.None;
            photo_view_scrolled.Add(View);
            photo_view_scrolled.Child.ButtonPressEvent += HandleButtonPressEvent;
            View.AddEvents((int)EventMask.KeyPressMask);
            inner_vbox.PackStart(photo_view_scrolled, true, true, 0);
            inner_hbox.PackStart(inner_vbox, true, true, 0);

            HBox lower_hbox = new HBox(false, 2);

            //inner_hbox.BorderWidth = 6;

            tag_view = new Widgets.TagView();
            lower_hbox.PackStart(tag_view, false, true, 0);

            Label comment = new Label(Catalog.GetString("Description:"));

            lower_hbox.PackStart(comment, false, false, 0);
            description_entry = new Entry();
            lower_hbox.PackStart(description_entry, true, true, 0);
            description_entry.Changed += HandleDescriptionChanged;

            rating = new RatingEntry()
            {
                HasFrame             = false,
                AlwaysShowEmptyStars = true
            };
            lower_hbox.PackStart(rating, false, false, 0);
            rating.Changed += HandleRatingChanged;

            SetColors();

            inner_vbox.PackStart(lower_hbox, false, true, 0);

            vbox.ShowAll();

            Realized += (o, e) => SetColors();
            Preferences.SettingChanged += OnPreferencesChanged;
        }