コード例 #1
0
 public iFolderApplication(string[] args)
     : base("ifolder", "1.0", Modules.UI, args)
 {
     Util.InitCatalog();
        Util.SetQuitiFolderDelegate(new QuitiFolderDelegate(QuitiFolder));
        tIcon = new TrayIcon("iFolder");
        bCollectionIsSynchronizing = false;
        currentIconAnimationDirection = 0;
        eBox = new EventBox();
        eBox.ButtonPressEvent +=
     new ButtonPressEventHandler(trayapp_clicked);
        RunningPixbuf =
      new Pixbuf(Util.ImagesPath("ifolder24.png"));
        StartingPixbuf =
      new Pixbuf(Util.ImagesPath("ifolder-startup.png"));
        StoppingPixbuf =
      new Pixbuf(Util.ImagesPath("ifolder-shutdown.png"));
        DownloadingPixbuf =
      new Gdk.PixbufAnimation(Util.ImagesPath("ifolder24.gif"));
        UploadingPixbuf =
      new Gdk.PixbufAnimation(Util.ImagesPath("ifolder24-upload.gif"));
        gAppIcon = new Gtk.Image(RunningPixbuf);
        eBox.Add(gAppIcon);
        tIcon.Add(eBox);
        tIcon.ShowAll();
        LoginDialog = null;
        collectionSynchronizing = null;
        synchronizationErrors = new Hashtable();
        iFolderStateChanged = new Gtk.ThreadNotify(
        new Gtk.ReadyEvent(OniFolderStateChanged));
        simiasManager = Util.CreateSimiasManager(args);
 }
コード例 #2
0
ファイル: DisplayDocumentItem.cs プロジェクト: GNOME/nemo
 public void set_snippet(string snippet)
 {
     snippet_wrapper = new Gtk.EventBox();
     Gtk.Label tmp = new Gtk.Label();
     tmp.Markup = snippet;
     snippet_wrapper.Add(tmp);
 }
コード例 #3
0
ファイル: PlotView.cs プロジェクト: oxyplot/oxyplot-gtksharp
        /// <summary>
        /// Shows the tracker.
        /// </summary>
        /// <param name="data">The data.</param>
        public void ShowTracker(TrackerHitResult data)
        {
            if (this.trackerLabel == null)
            {
                // Holding the tracker label inside an EventBox allows
                // us to set the background color
                Gtk.EventBox labelHolder = new Gtk.EventBox();
                this.trackerLabel = new Gtk.Label();
                this.trackerLabel.SetPadding(3, 3);
                OxyColor bgColor = OxyColors.LightSkyBlue;
                labelHolder.ModifyBg(StateType.Normal, new Gdk.Color(bgColor.R, bgColor.G, bgColor.B));
                labelHolder.Add(this.trackerLabel);
                this.Add(labelHolder);
                labelHolder.ShowAll();
            }
            this.trackerLabel.Parent.Visible = true;
            this.trackerLabel.Text           = data.ToString();
            Gtk.Requisition req  = this.trackerLabel.Parent.SizeRequest();
            int             xPos = (int)data.Position.X - req.Width / 2;
            int             yPos = (int)data.Position.Y - req.Height;

            xPos = Math.Max(0, Math.Min(xPos, this.Allocation.Width - req.Width));
            yPos = Math.Max(0, Math.Min(yPos, this.Allocation.Height - req.Height));
            this.Move(trackerLabel.Parent, xPos, yPos);
        }
コード例 #4
0
ファイル: Grid.cs プロジェクト: highattack30/monodevelop-1
            public Pair(Grid grid, string name, Widget editor, string description)
            {
                Gtk.Label l = new Label(name);
                l.UseMarkup = true;
                l.Justify   = Justification.Left;
                l.Xalign    = 0;
                l.Show();

                if (description == null)
                {
                    label = l;
                }
                else
                {
                    Gtk.EventBox ebox = new Gtk.EventBox();
                    ebox.Add(l);
                    ebox.Show();
                    ebox.TooltipText = description;
                    label            = ebox;
                }
                label.Parent = grid;

                this.editor   = editor;
                editor.Parent = grid;
                editor.Show();
            }
コード例 #5
0
ファイル: DockNotebook.cs プロジェクト: alexrp/monodevelop
		public DockNotebook ()
		{
			pagesCol = new ReadOnlyCollection<IDockNotebookTab> (pages);
			AddEvents ((Int32)(EventMask.AllEventsMask));

			tabStrip = new TabStrip (this);

			PackStart (tabStrip, false, false, 0);

			contentBox = new EventBox ();
			PackStart (contentBox, true, true, 0);

			ShowAll ();

			tabStrip.DropDownButton.Sensitive = false;

			tabStrip.DropDownButton.MenuCreator = delegate {
				Gtk.Menu menu = new Menu ();
				foreach (var tab in pages) {
					var mi = new Gtk.ImageMenuItem ("");
					menu.Insert (mi, -1);
					var label = (Gtk.AccelLabel) mi.Child;
					if (tab.Markup != null)
						label.Markup = tab.Markup;
					else
						label.Text = tab.Text;
					var locTab = tab;
					mi.Activated += delegate {
						CurrentTab = locTab;
					};
				}
				menu.ShowAll ();
				return menu;
			};
		}
コード例 #6
0
ファイル: BestTray.cs プロジェクト: ArsenShnurkov/beagle-1
		public BestTray (BestWindow bw, bool autostarted)
		{
			this.autostarted = autostarted;

			Raw = egg_tray_icon_new ("Search");

			win = bw;
			win.DeleteEvent += new DeleteEventHandler (WindowDeleteEvent);
						
			eventbox = new Gtk.EventBox ();
			eventbox.CanFocus = true;
			eventbox.ButtonPressEvent += new ButtonPressEventHandler (ButtonPress);
			
			Gdk.Pixbuf smalldog = Images.GetPixbuf ("best.png");
			eventbox.Add (new Gtk.Image (smalldog.ScaleSimple (24, 24, Gdk.InterpType.Hyper)));

			KeyBinding binding = Conf.Searching.ShowSearchWindowBinding;

			string tooltip = String.Format ("Beagle Search ({0})", binding.ToReadableString ());
			tips = new Gtk.Tooltips ();
			tips.SetTip (eventbox, tooltip, null);
			tips.Enable ();
			
			Add (eventbox);
			eventbox.ShowAll ();

			keybinder = new Beagle.Util.XKeybinder ();
			keybinder.Bind (binding.ToString (),
					new EventHandler (ShowBeaglePressed));
		}
コード例 #7
0
        public BestTray(BestWindow bw, bool autostarted)
        {
            this.autostarted = autostarted;

            Raw = egg_tray_icon_new("Search");

            win              = bw;
            win.DeleteEvent += new DeleteEventHandler(WindowDeleteEvent);

            eventbox                   = new Gtk.EventBox();
            eventbox.CanFocus          = true;
            eventbox.ButtonPressEvent += new ButtonPressEventHandler(ButtonPress);

            Gdk.Pixbuf smalldog = Images.GetPixbuf("best.png");
            eventbox.Add(new Gtk.Image(smalldog.ScaleSimple(24, 24, Gdk.InterpType.Hyper)));

            KeyBinding binding = Conf.Searching.ShowSearchWindowBinding;

            string tooltip = String.Format("Beagle Search ({0})", binding.ToReadableString());

            tips = new Gtk.Tooltips();
            tips.SetTip(eventbox, tooltip, null);
            tips.Enable();

            Add(eventbox);
            eventbox.ShowAll();

            keybinder = new Beagle.Util.XKeybinder();
            keybinder.Bind(binding.ToString(),
                           new EventHandler(ShowBeaglePressed));
        }
コード例 #8
0
        /// <summary>
        /// Constructor. Initialises the widget and will show a world
        /// map with no markers until <see cref="ShowMap" /> is called.
        /// </summary>
        /// <param name="owner">Owner view.</param>
        public MapView(ViewBase owner) : base(owner)
        {
            image = new Gtk.Image();
            var container = new Gtk.EventBox();

            container.Add(image);

            VPaned box = new VPaned();

            PropertiesGrid = new PropertyView(this);
            box.Pack1(((ViewBase)PropertiesGrid).MainWidget, true, false);
            box.Pack2(container, true, true);

            container.AddEvents(
                (int)Gdk.EventMask.ButtonPressMask
                | (int)Gdk.EventMask.ButtonReleaseMask
                | (int)Gdk.EventMask.ScrollMask);
            container.ButtonPressEvent   += OnButtonPress;
            container.ButtonReleaseEvent += OnButtonRelease;
            image.SizeAllocated          += OnSizeAllocated;
#if NETFRAMEWORK
            image.ExposeEvent += OnImageExposed;
#else
            image.Drawn += OnImageExposed;
#endif
            container.Destroyed   += OnMainWidgetDestroyed;
            container.ScrollEvent += OnMouseScroll;

            mainWidget = box;
            mainWidget.ShowAll();
        }
コード例 #9
0
ファイル: MapView.cs プロジェクト: shenyczz/ApsimX
        /// <summary>
        /// Constructor. Initialises the widget and will show a world
        /// map with no markers until <see cref="ShowMap" /> is called.
        /// </summary>
        /// <param name="owner">Owner view.</param>
        public MapView(ViewBase owner) : base(owner)
        {
            GeometryServiceProvider.Instance = new NtsGeometryServices();

            image = new Gtk.Image();
            var container = new Gtk.EventBox();

            container.Add(image);

            VPaned box = new VPaned();

            Grid = new GridView(this);
            box.Pack1(((ViewBase)Grid).MainWidget, true, false);
            box.Pack2(container, true, true);

            container.AddEvents(
                (int)Gdk.EventMask.ButtonPressMask
                | (int)Gdk.EventMask.ButtonReleaseMask
                | (int)Gdk.EventMask.ScrollMask);
            container.ButtonPressEvent   += OnButtonPress;
            container.ButtonReleaseEvent += OnButtonRelease;
            image.SizeAllocated          += OnSizeAllocated;
            image.ExposeEvent            += OnImageExposed;
            container.Destroyed          += OnMainWidgetDestroyed;
            container.ScrollEvent        += OnMouseScroll;

            mainWidget = box;
            mainWidget.ShowAll();
        }
コード例 #10
0
 public CheckBoxHandler()
 {
     Control = new Gtk.CheckButton();
     box     = new Gtk.EventBox {
         Child = Control
     };
 }
コード例 #11
0
        public DockNotebook()
        {
            pagesCol = new ReadOnlyCollection <DockNotebookTab> (pages);
            AddEvents((Int32)(EventMask.AllEventsMask));

            tabStrip = new TabStrip(this);

            PackStart(tabStrip, false, false, 0);

            contentBox = new EventBox();
            PackStart(contentBox, true, true, 0);

            ShowAll();

            contentBox.NoShowAll = true;

            tabStrip.DropDownButton.Sensitive = false;

            tabStrip.DropDownButton.MenuCreator = delegate {
                Gtk.Menu menu = new Menu();
                foreach (var tab in pages)
                {
                    var mi = new Gtk.ImageMenuItem("");
                    menu.Insert(mi, -1);
                    var label = (Gtk.AccelLabel)mi.Child;
                    if (tab.Markup != null)
                    {
                        label.Markup = tab.Markup;
                    }
                    else
                    {
                        label.Text = tab.Text;
                    }
                    var locTab = tab;
                    mi.Activated += delegate {
                        CurrentTab = locTab;
                    };
                }
                menu.ShowAll();
                return(menu);
            };

            Gtk.Drag.DestSet(this, Gtk.DestDefaults.Motion | Gtk.DestDefaults.Highlight | Gtk.DestDefaults.Drop, targetEntryTypes, Gdk.DragAction.Copy);
            DragDataReceived += new Gtk.DragDataReceivedHandler(OnDragDataReceived);

            DragMotion += delegate {
                // Bring this window to the front. Otherwise, the drop may end being done in another window that overlaps this one
                if (!Platform.IsWindows)
                {
                    var window = ((Gtk.Window)Toplevel);
                    if (window is DockWindow)
                    {
                        window.Present();
                    }
                }
            };

            allNotebooks.Add(this);
        }
コード例 #12
0
        public VideoView()
        {
            preview_pos = PreviewPos.ButtonRight;

            VBox vbox = new VBox(false, 0);

            vbox.Show();

            Frame frame = new Frame();

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

            vbox.Add(frame);

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

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

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

            frame.Add(mainView);

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

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

            Button button = new Button(Catalog.GetString("End Call"));

            button.Clicked += OnCloseVideoClicked;
            button.Show();
            vbox.PackStart(button, false, false, 5);

            this.Add(vbox);
            mainView.SizeAllocated += OnSizeAllocated;
//			this.SizeRequested += OnsizeRequested;
            this.QueueResize();
            MovePreview();
        }
コード例 #13
0
ファイル: DockNotebook.cs プロジェクト: msiyer/Pinta
		public DockNotebook ()
		{
			pagesCol = new ReadOnlyCollection<DockNotebookTab> (pages);
			AddEvents ((Int32)(EventMask.AllEventsMask));

			tabStrip = new TabStrip (this);

			PackStart (tabStrip, false, false, 0);

			contentBox = new EventBox ();
			PackStart (contentBox, true, true, 0);

			ShowAll ();

            tabStrip.Visible = DockNotebookManager.TabStripVisible;
            DockNotebookManager.TabStripVisibleChanged += (o, e) => tabStrip.Visible = DockNotebookManager.TabStripVisible;

			contentBox.NoShowAll = true;

			tabStrip.DropDownButton.Sensitive = false;

			tabStrip.DropDownButton.MenuCreator = delegate {
				Gtk.Menu menu = new Menu ();
				foreach (var tab in pages) {
					var mi = new Gtk.ImageMenuItem ("");
					menu.Insert (mi, -1);
					var label = (Gtk.AccelLabel) mi.Child;
					if (tab.Markup != null)
						label.Markup = tab.Markup;
					else
						label.Text = tab.Text;
					var locTab = tab;
					mi.Activated += delegate {
						CurrentTab = locTab;
					};
				}
				menu.ShowAll ();
				return menu;
			};

			Gtk.Drag.DestSet (this, Gtk.DestDefaults.Motion | Gtk.DestDefaults.Highlight | Gtk.DestDefaults.Drop, targetEntryTypes, Gdk.DragAction.Copy);
			DragDataReceived += new Gtk.DragDataReceivedHandler (OnDragDataReceived);

			DragMotion += delegate {
				// Bring this window to the front. Otherwise, the drop may end being done in another window that overlaps this one
				if (!Platform.IsWindows) {
					var window = ((Gtk.Window)Toplevel);
					if (window is DockWindow)
						window.Present ();
				}
			};

			allNotebooks.Add (this);
		}
コード例 #14
0
 public Gtk.EventBox AddLabelWidget(Gtk.Label label)
 {
     box.Remove(clear_button);
     statusLabelEventBox       = new Gtk.EventBox();
     statusLabelEventBox.Child = label;
     box.PackStart(statusLabelEventBox, false, false, 0);
     box.PackStart(clear_button, false, false, 0);
     UpdateStyle();
     box.ShowAll();
     return(statusLabelEventBox);
 }
コード例 #15
0
        private Task AnimatePageAsync(Container container, int from, int to)
        {
            return(new FloatAnimation(from, to, TimeSpan.FromMilliseconds(NavigationAnimationDuration), true, (x) =>
            {
                GLib.Timeout.Add(0, () =>
                {
                    container?.MoveTo(Convert.ToInt32(x), 0);

                    return false;
                });
            }).Run());
        }
コード例 #16
0
ファイル: VideoView.cs プロジェクト: GNOME/banter
        public VideoView()
        {
            preview_pos = PreviewPos.ButtonRight;

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

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

            vbox.Add(frame);

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

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

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

            frame.Add(mainView);

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

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

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

            this.Add(vbox);
            mainView.SizeAllocated += OnSizeAllocated;
            //			this.SizeRequested += OnsizeRequested;
            this.QueueResize ();
            MovePreview ();
        }
コード例 #17
0
ファイル: DockNotebook.cs プロジェクト: zcf7822/monodevelop
        public DockNotebook()
        {
            pagesCol = new ReadOnlyCollection <DockNotebookTab> (pages);
            AddEvents((Int32)(EventMask.AllEventsMask));

            tabStrip = new TabStrip(this);

            PackStart(tabStrip, false, false, 0);

            contentBox = new EventBox();
            contentBox.Accessible.SetShouldIgnore(true);
            PackStart(contentBox, true, true, 0);

            ShowAll();

            contentBox.NoShowAll = true;

            tabStrip.DropDownButton.Sensitive = false;

            tabStrip.DropDownButton.ContextMenuRequested = delegate {
                ContextMenu menu = new ContextMenu();
                foreach (var tab in pages)
                {
                    var item   = new ContextMenuItem(tab.Markup ?? tab.Text);
                    var locTab = tab;
                    item.Clicked += (object sender, ContextMenuItemClickedEventArgs e) => {
                        CurrentTab = locTab;
                    };
                    menu.Items.Add(item);
                }
                return(menu);
            };

            Gtk.Drag.DestSet(this, Gtk.DestDefaults.Motion | Gtk.DestDefaults.Highlight | Gtk.DestDefaults.Drop, targetEntryTypes, Gdk.DragAction.Copy);
            DragDataReceived += new Gtk.DragDataReceivedHandler(OnDragDataReceived);

            DragMotion += delegate {
                // Bring this window to the front. Otherwise, the drop may end being done in another window that overlaps this one
                if (!Platform.IsWindows)
                {
                    var window = ((Gtk.Window)Toplevel);
                    if (window is DockWindow)
                    {
                        window.Present();
                    }
                }
            };

            allNotebooks.Add(this);
        }
コード例 #18
0
        //
        public void Initialize(EditSession session)
        {
            prop = session.Property;

            ICollection valuesCollection = prop.Converter.GetStandardValues();

            values = new TraceLab.Core.Components.EnumValue[valuesCollection.Count];
            valuesCollection.CopyTo(values, 0);

            //values = System.Enum.GetValues (prop.PropertyType);
            Hashtable names = new Hashtable();

            foreach (FieldInfo f in prop.PropertyType.GetFields())
            {
                DescriptionAttribute att = (DescriptionAttribute)Attribute.GetCustomAttribute(f, typeof(DescriptionAttribute));
                if (att != null)
                {
                    names [f.Name] = att.Description;
                }
                else
                {
                    names [f.Name] = f.Name;
                }
            }


            ebox = new Gtk.EventBox();
            ebox.Show();
            PackStart(ebox, true, true, 0);

            combo                     = Gtk.ComboBoxEntry.NewText();
            combo.Changed            += combo_Changed;
            combo.Entry.IsEditable    = false;
            combo.Entry.CanFocus      = false;
            combo.Entry.HasFrame      = false;
            combo.Entry.HeightRequest = combo.SizeRequest().Height;
            combo.Show();
            ebox.Add(combo);

            foreach (TraceLab.Core.Components.EnumValue value in values)
            {
                string str = prop.Converter.ConvertToString(value);
                if (names.Contains(str))
                {
                    str = (string)names [str];
                }
                combo.AppendText(str);
            }
        }
コード例 #19
0
ファイル: Grid.cs プロジェクト: highattack30/monodevelop-1
 public void Append(Widget w, string description)
 {
     if ((w.WidgetFlags & WidgetFlags.NoWindow) != 0)
     {
         Gtk.EventBox ebox = new Gtk.EventBox();
         ebox.Add(w);
         ebox.Show();
         w = ebox;
     }
     w.Parent = this;
     w.Show();
     w.TooltipText = description;
     lines.Add(w);
     QueueDraw();
 }
コード例 #20
0
ファイル: Grid.cs プロジェクト: mono/stetic
        public void Append(Widget w, string description)
        {
            if ((w.WidgetFlags & WidgetFlags.NoWindow) != 0) {
                Gtk.EventBox ebox = new Gtk.EventBox ();
                ebox.Add (w);
                ebox.Show ();
                w = ebox;
            }
            w.Parent = this;
            w.Show ();

            tips.SetTip (w, description, null);

            lines.Add (w);
            QueueDraw ();
        }
コード例 #21
0
		public DockNotebook ()
		{
			pagesCol = new ReadOnlyCollection<DockNotebookTab> (pages);
			AddEvents ((Int32)(EventMask.AllEventsMask));

			tabStrip = new TabStrip (this);

			PackStart (tabStrip, false, false, 0);

			contentBox = new EventBox ();
			PackStart (contentBox, true, true, 0);

			ShowAll ();

			contentBox.NoShowAll = true;

			tabStrip.DropDownButton.Sensitive = false;

			tabStrip.DropDownButton.ContextMenuRequested = delegate {
				ContextMenu menu = new ContextMenu ();
				foreach (var tab in pages) {
					var item = new ContextMenuItem (tab.Markup ?? tab.Text);
					var locTab = tab;
					item.Clicked += (object sender, ContextMenuItemClickedEventArgs e) => {
						CurrentTab = locTab;
					};
					menu.Items.Add (item);
				}
				return menu;
			};

			Gtk.Drag.DestSet (this, Gtk.DestDefaults.Motion | Gtk.DestDefaults.Highlight | Gtk.DestDefaults.Drop, targetEntryTypes, Gdk.DragAction.Copy);
			DragDataReceived += new Gtk.DragDataReceivedHandler (OnDragDataReceived);

			DragMotion += delegate {
				// Bring this window to the front. Otherwise, the drop may end being done in another window that overlaps this one
				if (!Platform.IsWindows) {
					var window = ((Gtk.Window)Toplevel);
					if (window is DockWindow)
						window.Present ();
				}
			};

			allNotebooks.Add (this);
		}
コード例 #22
0
        protected virtual void UpdateBackgroundColor()
        {
            if (_disposed || Element == null || Control == null)
            {
                return;
            }

            Color backgroundColor = Element.BackgroundColor;

            bool isDefault = backgroundColor.IsDefaultOrTransparent();

            if (!isDefault)
            {
                Container.ModifyBg(StateType.Normal, backgroundColor.ToGtkColor());
            }

            Container.VisibleWindow = !isDefault;
        }
コード例 #23
0
		public void Initialize (EditSession session)
		{
			values = DeployService.GetDeployDirectoryInfo ();
			ebox = new Gtk.EventBox ();
			ebox.Show ();
			PackStart (ebox, true, true, 0);

			combo = Gtk.ComboBoxEntry.NewText ();
			combo.Changed += combo_Changed;
			combo.Entry.IsEditable = false;
			combo.Entry.HasFrame = false;
			combo.Entry.HeightRequest = combo.SizeRequest ().Height;
			combo.Show ();
			ebox.Add (combo);

			foreach (DeployDirectoryInfo value in values) {
				combo.AppendText (value.Description);
			}
		}
コード例 #24
0
ファイル: MainWindow.cs プロジェクト: rayros/kwejk-csharp-app
    public void LoadImages(XDocument doc)
    {
        if (posts != null)
        {
            foreach (VBox post in posts.Children)
            {
                foreach (Widget obj in post.Children)
                {
                    post.Remove(obj);
                    obj.Destroy();
                }
                posts.Remove(post);
                post.Destroy();
            }
        }
        posts = new VBox();
        vbox3.PackStart(posts, true, true, 1);
        IEnumerable <XElement> posts_list = doc.XPathSelectElements("/posts/post");

        foreach (XElement elem in posts_list)
        {
            VBox   post        = new VBox();
            string title       = elem.XPathSelectElement("title").Value;
            string description = elem.XPathSelectElement("description").Value;
            post.PackStart(new Label(title), true, true, 1);
            IEnumerable <XElement> urls_list = elem.XPathSelectElements("img/url");
            foreach (XElement urls in urls_list)
            {
                Gtk.EventBox eventBox          = new Gtk.EventBox();
                string       file_img_default  = urls.XPathSelectElement("default").Value;
                string       file_img_original = urls.XPathSelectElement("original").Value;
                Gtk.Image    new_img           = new Gtk.Image(file_img_default);
                eventBox.Add(new_img);
                eventBox.ButtonPressEvent += delegate {
                    new Project.ImgWindow(title, description, file_img_original);
                };
                post.PackEnd(eventBox, true, true, 1);
            }
            posts.PackStart(post, true, true, 1);
        }
        posts_list = null;
        ShowAll();
    }
コード例 #25
0
        public void Initialize(EditSession session)
        {
            values = DeployService.GetDeployDirectoryInfo();
            ebox   = new Gtk.EventBox();
            ebox.Show();
            PackStart(ebox, true, true, 0);

            combo                     = Gtk.ComboBoxEntry.NewText();
            combo.Changed            += combo_Changed;
            combo.Entry.IsEditable    = false;
            combo.Entry.HasFrame      = false;
            combo.Entry.HeightRequest = combo.SizeRequest().Height;
            combo.Show();
            ebox.Add(combo);

            foreach (DeployDirectoryInfo value in values)
            {
                combo.AppendText(value.Description);
            }
        }
コード例 #26
0
        public ColumnControl(VirtualListView view)
        {
            mView = view;
             GripperWidth = 8;

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

             // need an additional EventBox, because the underlaying Gtk.Fixed widget don't receive and handle some possible events
             // this is one more suspicious behaviour of GTK
             // as you can see, the mouse buttons will be received by the EventBox widget,
             // but the mouse motion received by Fixed widget enabled by the EventBox ...
             EventBox = new EventBox();
             EventBox.Events |= Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask | Gdk.EventMask.LeaveNotifyMask;
             EventBox.ButtonPressEvent += new ButtonPressEventHandler(TheButtonPressEvent);
             EventBox.ButtonReleaseEvent += new ButtonReleaseEventHandler(TheButtonReleaseEvent);
             EventBox.LeaveNotifyEvent += new LeaveNotifyEventHandler(TheLeaveNotifyEvent);
             EventBox.VisibleWindow = false; // must not drawn itself
             this.Add(EventBox);
             EventBox.ShowAll();
        }
コード例 #27
0
        public DockNotebook()
        {
            pagesCol = new ReadOnlyCollection <IDockNotebookTab> (pages);
            AddEvents((Int32)(EventMask.AllEventsMask));

            tabStrip = new TabStrip(this);

            PackStart(tabStrip, false, false, 0);

            contentBox = new EventBox();
            PackStart(contentBox, true, true, 0);

            ShowAll();

            tabStrip.DropDownButton.Sensitive = false;

            tabStrip.DropDownButton.MenuCreator = delegate {
                Gtk.Menu menu = new Menu();
                foreach (var tab in pages)
                {
                    var mi = new Gtk.ImageMenuItem("");
                    menu.Insert(mi, -1);
                    var label = (Gtk.AccelLabel)mi.Child;
                    if (tab.Markup != null)
                    {
                        label.Markup = tab.Markup;
                    }
                    else
                    {
                        label.Text = tab.Text;
                    }
                    var locTab = tab;
                    mi.Activated += delegate {
                        CurrentTab = locTab;
                    };
                }
                menu.ShowAll();
                return(menu);
            };
        }
コード例 #28
0
        public PropertiesWidget()
        {
            Stetic.WidgetPropertyTree grid = GuiBuilderService.SteticApp.PropertiesWidget;

            Notebook tabs = new Notebook();

            tabs.AppendPage(grid, new Label(GettextCatalog.GetString("Properties")));

            signalsEditor = GuiBuilderService.SteticApp.SignalsWidget;
            signalsEditor.SignalActivated += new EventHandler(OnSignalActivated);
            tabs.AppendPage(signalsEditor, new Label(GettextCatalog.GetString("Signals")));

            Gtk.EventBox infoBox = new Gtk.EventBox();
            tabs.AppendPage(infoBox, new Gtk.Label(""));

            PackStart(tabs, true, true, 0);

            ShowAll();
            infoBox.Hide();

            tabs.Page = 0;
        }
コード例 #29
0
 protected virtual void Build()
 {
     Gui.Initialize((Widget)this);
     BinContainer.Attach((Bin)this);
     this.Name                    = "Gtk.LabelLink";
     this.evtbx_root              = new EventBox();
     this.evtbx_root.Name         = "evtbx_root";
     this.label_display           = new Label();
     this.label_display.Name      = "label_display";
     this.label_display.LabelProp = Catalog.GetString("label1");
     this.evtbx_root.Add((Widget)this.label_display);
     this.Add((Widget)this.evtbx_root);
     if (this.Child != null)
     {
         this.Child.ShowAll();
     }
     this.Hide();
     this.evtbx_root.EnterNotifyEvent   += new EnterNotifyEventHandler(this.OnMouseEnter);
     this.evtbx_root.LeaveNotifyEvent   += new LeaveNotifyEventHandler(this.OnMouseLeave);
     this.evtbx_root.ButtonPressEvent   += new ButtonPressEventHandler(this.OnMousePressed);
     this.evtbx_root.ButtonReleaseEvent += new ButtonReleaseEventHandler(this.OnMouseReleased);
 }
コード例 #30
0
        /// <summary>Crea una instancia de la clase.</summary>
        /// <param name="parent">La ventana padre de este diálogo.
        /// </param>

        private DialogoAcerca(Gtk.Window parent) :
            base("", parent, Gtk.DialogFlags.DestroyWithParent)
        {
            Title        = Ventana.GetText("DialogoAcerca_Title");
            TransientFor = parent;
            Modal        = true;
            Resizable    = false;
            DeleteEvent += new DeleteEventHandler(Ventana.OcultarVentana);
            Resize(300, 300);
            BorderWidth  = 20;
            HasSeparator = false;


            VBox vbox = new VBox(false, 5);

            vbox.PackStart(
                new Gtk.Label(Ventana.GetText("Programa_Nombre") + " " +
                              String.Format(
                                  Ventana.GetText("DialogoAcerca_Version"),
                                  Assembly.GetExecutingAssembly().GetName().Version))
                );
            vbox.PackStart(
                new Gtk.Label(Ventana.GetText("Programa_descripcion")));
            vbox.PackStart(new Gtk.Label(" "));
            vbox.PackStart(new Gtk.Label(
                               Ventana.GetText("DialogoAcerca_Autores")));
            vbox.PackStart(new Gtk.Label("Montserrat Sotomayor González"));
            vbox.PackStart(new Gtk.Label("Alberto Fernández Martínez"));

            vbox.PackStart(
                new Gtk.Image(IconManager.GetPixmap("acerca.png")));

            Gtk.EventBox eventBox = new Gtk.EventBox();

            eventBox.Add(vbox);
            eventBox.ButtonPressEvent +=
                new Gtk.ButtonPressEventHandler(CerrarClick);
            VBox.Add(eventBox);
        }
コード例 #31
0
		public PropertiesWidget ()
		{
			Stetic.WidgetPropertyTree grid = GuiBuilderService.SteticApp.PropertiesWidget;
			
			Notebook tabs = new Notebook ();
			
			tabs.AppendPage (grid, new Label (GettextCatalog.GetString ("Properties")));
			
			signalsEditor = GuiBuilderService.SteticApp.SignalsWidget;
			signalsEditor.SignalActivated += new EventHandler (OnSignalActivated);
			tabs.AppendPage (signalsEditor, new Label (GettextCatalog.GetString ("Signals")));
			
			Gtk.EventBox infoBox = new Gtk.EventBox ();
			tabs.AppendPage (infoBox, new Gtk.Label (""));
			
			PackStart (tabs, true, true, 0);
			
			ShowAll ();
			infoBox.Hide ();
			
			tabs.Page = 0;
		}
コード例 #32
0
        /// <summary>
        /// Constructor. Initialises the widget and will show a world
        /// map with no markers until <see cref="ShowMap" /> is called.
        /// </summary>
        /// <param name="owner">Owner view.</param>
        public MapView(ViewBase owner) : base(owner)
        {
            image = new Gtk.Image();

            image.Halign = Align.Start;
            image.Valign = Align.Start;

            var container = new Gtk.EventBox();

            container.Add(image);

            VPaned box = new VPaned();

            PropertiesView = new PropertyView(this);
            box.Pack1(((ViewBase)PropertiesView).MainWidget, true, false);

            if (((ViewBase)PropertiesView).MainWidget is ScrolledWindow scroller)
            {
                scroller.VscrollbarPolicy = PolicyType.Never;
            }

            box.Pack2(container, true, true);

            container.AddEvents(
                (int)Gdk.EventMask.ButtonPressMask
                | (int)Gdk.EventMask.ButtonReleaseMask
                | (int)Gdk.EventMask.ScrollMask);
            container.ButtonPressEvent   += OnButtonPress;
            container.ButtonReleaseEvent += OnButtonRelease;

            image.Drawn += OnImageExposed;

            container.Destroyed   += OnMainWidgetDestroyed;
            container.ScrollEvent += OnMouseScroll;

            mainWidget = box;
            mainWidget.ShowAll();
        }
コード例 #33
0
        protected override void OnSizeAllocated(Gdk.Rectangle allocation)
        {
            base.OnSizeAllocated(allocation);

            double    width, height, translationX, translationY;
            Rectangle bounds = Element.Bounds;

            translationX = Element.TranslationX;
            translationY = Element.TranslationY;

            width  = bounds.Width >= -1 ? bounds.Width : 0;
            height = bounds.Height >= -1 ? bounds.Height : 0;

            Container.SetSize(width, height);
            Container.MoveTo((int)bounds.X + translationX, (int)bounds.Y + translationY);

            for (var i = 0; i < ElementController.LogicalChildren.Count; i++)
            {
                var child = ElementController.LogicalChildren[i] as VisualElement;

                if (child != null)
                {
                    var renderer = Platform.GetRenderer(child);

                    if (renderer != null)
                    {
                        width  = child.Bounds.Width >= -1 ? child.Bounds.Width : 0;
                        height = child.Bounds.Height >= -1 ? child.Bounds.Height : 0;

                        translationX = child.TranslationX;
                        translationY = child.TranslationY;

                        renderer.Container.SetSize(width, height);
                        renderer.Container.MoveTo(child.Bounds.X + translationX, child.Bounds.Y + translationY);
                    }
                }
            }
        }
コード例 #34
0
ファイル: GtkBackendHelper.cs プロジェクト: git-thinh/limada
        public static Gtk.Widget AllocEventBox(this Gtk.Widget widget, bool visibleWindow = false)
        {
            // Wraps the widget with an event box. Required for some
            // widgets such as Label which doesn't have its own gdk window

            if (widget is Gtk.EventBox)
            {
                ((Gtk.EventBox)widget).VisibleWindow = true;
                return(widget);
            }

            if (widget.IsNoWindow)
            {
                var eventBox = new Gtk.EventBox();
                eventBox.Visible       = widget.Visible;
                eventBox.Sensitive     = widget.Sensitive;
                eventBox.VisibleWindow = visibleWindow;
                Xwt.GtkBackend.GtkEngine.ReplaceChild(widget, eventBox);
                eventBox.Add(widget);
                return(eventBox);
            }
            return(widget);
        }
コード例 #35
0
ファイル: Grid.cs プロジェクト: FreeBSD-DotNet/monodevelop
			public Pair (Grid grid, string name, Widget editor, string description)
			{
				Gtk.Label l = new Label (name);
				l.UseMarkup = true;
				l.Justify = Justification.Left;
				l.Xalign = 0;
				l.Show ();

				if (description == null)
					label = l;
				else {
					Gtk.EventBox ebox = new Gtk.EventBox ();
					ebox.Add (l);
					ebox.Show ();
					ebox.TooltipText = description;
					label = ebox;
				}
				label.Parent = grid;

				this.editor = editor;
				editor.Parent = grid;
				editor.Show ();
			}
コード例 #36
0
ファイル: MainWindow.cs プロジェクト: rayros/kwejk-csharp-app
 public void LoadImages(XDocument doc)
 {
     if (posts != null) {
         foreach(VBox post in posts.Children){
             foreach (Widget obj in post.Children) {
                 post.Remove (obj);
                 obj.Destroy ();
             }
             posts.Remove (post);
             post.Destroy ();
         }
     }
     posts = new VBox ();
     vbox3.PackStart (posts,true,true,1);
     IEnumerable<XElement> posts_list = doc.XPathSelectElements("/posts/post");
     foreach (XElement elem in posts_list) {
         VBox post = new VBox ();
         string title = elem.XPathSelectElement ("title").Value;
         string description = elem.XPathSelectElement ("description").Value;
         post.PackStart (new Label (title), true, true, 1);
         IEnumerable<XElement> urls_list = elem.XPathSelectElements ("img/url");
         foreach (XElement urls in urls_list) {
             Gtk.EventBox eventBox = new Gtk.EventBox();
             string file_img_default = urls.XPathSelectElement ("default").Value;
             string file_img_original = urls.XPathSelectElement ("original").Value;
             Gtk.Image new_img = new Gtk.Image (	file_img_default);
             eventBox.Add (new_img);
             eventBox.ButtonPressEvent += delegate {
                 new Project.ImgWindow (title, description, file_img_original);
             };
             post.PackEnd (eventBox, true, true, 1);
         }
         posts.PackStart (post, true, true, 1);
     }
     posts_list = null;
     ShowAll ();
 }
コード例 #37
0
        public void Run()
        {
            Gtk.Application.Init();
            SetupTheme();

            ApiExtensibility.Register(typeof(Windows.UI.Core.ICoreWindowExtension), o => new GtkCoreWindowExtension(o));
            ApiExtensibility.Register <Windows.UI.Xaml.Application>(typeof(Uno.UI.Xaml.IApplicationExtension), o => new GtkApplicationExtension(o));
            ApiExtensibility.Register(typeof(Windows.UI.ViewManagement.IApplicationViewExtension), o => new GtkApplicationViewExtension(o));
            ApiExtensibility.Register(typeof(ISystemThemeHelperExtension), o => new GtkSystemThemeHelperExtension(o));
            ApiExtensibility.Register(typeof(Windows.Graphics.Display.IDisplayInformationExtension), o => _displayInformationExtension ??= new GtkDisplayInformationExtension(o, _window));
            ApiExtensibility.Register <TextBoxView>(typeof(ITextBoxViewExtension), o => new TextBoxViewExtension(o, _window));
            ApiExtensibility.Register(typeof(ILauncherExtension), o => new LauncherExtension(o));
            ApiExtensibility.Register <FileOpenPicker>(typeof(IFileOpenPickerExtension), o => new FileOpenPickerExtension(o));
            ApiExtensibility.Register <FolderPicker>(typeof(IFolderPickerExtension), o => new FolderPickerExtension(o));
            ApiExtensibility.Register(typeof(IClipboardExtension), o => new ClipboardExtensions(o));
            ApiExtensibility.Register <FileSavePicker>(typeof(IFileSavePickerExtension), o => new FileSavePickerExtension(o));

            _isDispatcherThread = true;
            _window             = new Gtk.Window("Uno Host");
            Size preferredWindowSize = ApplicationView.PreferredLaunchViewSize;

            if (preferredWindowSize != Size.Empty)
            {
                _window.SetDefaultSize((int)preferredWindowSize.Width, (int)preferredWindowSize.Height);
            }
            else
            {
                _window.SetDefaultSize(1024, 800);
            }
            _window.SetPosition(Gtk.WindowPosition.Center);

            _window.Realized += (s, e) =>
            {
                // Load the correct cursors before the window is shown
                // but after the window has been initialized.
                Cursors.Reload();
            };

            _window.DeleteEvent += delegate
            {
                Gtk.Application.Quit();
            };

            bool EnqueueNative(DispatcherQueuePriority priority, DispatcherQueueHandler callback)
            {
                Dispatch(() => callback());

                return(true);
            }

            Windows.System.DispatcherQueue.EnqueueNativeOverride = EnqueueNative;

            void Dispatch(System.Action d)
            {
                if (Gtk.Application.EventsPending())
                {
                    Gtk.Application.RunIteration(false);
                }

                GLib.Idle.Add(delegate
                {
                    if (this.Log().IsEnabled(Microsoft.Extensions.Logging.LogLevel.Trace))
                    {
                        this.Log().Trace($"Iteration");
                    }

                    try
                    {
                        d();
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e);
                    }

                    return(false);
                });
            }

            Windows.UI.Core.CoreDispatcher.DispatchOverride        = Dispatch;
            Windows.UI.Core.CoreDispatcher.HasThreadAccessOverride = () => _isDispatcherThread;

            _window.Realized += (s, e) =>
            {
                WUX.Window.Current.OnNativeSizeChanged(new Windows.Foundation.Size(_window.AllocatedWidth, _window.AllocatedHeight));
            };

            _window.SizeAllocated += (s, e) =>
            {
                WUX.Window.Current.OnNativeSizeChanged(new Windows.Foundation.Size(e.Allocation.Width, e.Allocation.Height));
            };

            _window.WindowStateEvent += OnWindowStateChanged;

            var overlay = new Overlay();

            _eventBox = new EventBox();
            _area     = new UnoDrawingArea();
            _fix      = new Fixed();
            overlay.Add(_area);
            overlay.AddOverlay(_fix);
            _eventBox.Add(overlay);
            _window.Add(_eventBox);

            /* avoids double invokes at window level */
            _area.AddEvents((int)GtkCoreWindowExtension.RequestedEvents);

            _window.ShowAll();

            void CreateApp(ApplicationInitializationCallbackParams _)
            {
                var app = _appBuilder();

                app.Host = this;
            }

            WUX.Application.Start(CreateApp, _args);

            UpdateWindowPropertiesFromPackage();

            Gtk.Application.Run();
        }
コード例 #38
0
ファイル: BaseDialog.cs プロジェクト: albfernandez/dalle
        private void InitComponents()
        {
            CloseButton = new Gtk.Button (Gtk.Stock.Close);
            FileEntry = new Gtk.Entry ();
            BrowseButton = new Gtk.Button (Catalog.GetString ("Browse..."));
            ActionButton = CreateActionButton ();
            Progress = new CustomProgressBar ();
            CheckOutputDir = new Gtk.CheckButton ();
            LabelOutputDir = new Gtk.EventBox();
            LabelOutputDir.Add(new Gtk.Label(Catalog.GetString ("Output directory")));
            LabelOutputDir.ButtonPressEvent += HandleLabelOutputDirClicked;

            FileOutputDirEntry = new Gtk.Entry ();
            CloseButton.Clicked += new EventHandler (this.CloseButtonClicked);
            ActionButton.Clicked += new EventHandler (this.ActionButtonClicked);
            BrowseButton.Clicked += new EventHandler (this.BrowseButtonClicked);
            // Targets
            TargetEntry [] te = new TargetEntry [] {
                new TargetEntry ("STRING", 0, 1),
            };
            Gtk.Drag.DestSet (this, DestDefaults.All, te, Gdk.DragAction.Copy | Gdk.DragAction.Move );

            FileEntry.DragDataReceived += new DragDataReceivedHandler(DropHandler);
            FileOutputDirEntry.DragDataReceived += new DragDataReceivedHandler(DropHandler2);
            FileOutputDirEntry.Sensitive = false;
            this.DragDataReceived += new DragDataReceivedHandler (DropHandler);
            CheckOutputDir.Toggled += HandleCheckOutputDirToggled;
        }
コード例 #39
0
ファイル: PlotView.cs プロジェクト: huoxudong125/oxyplot
 /// <summary>
 /// Shows the tracker.
 /// </summary>
 /// <param name="data">The data.</param>
 public void ShowTracker(TrackerHitResult data)
 {
     if (this.trackerLabel == null)
     {
         // Holding the tracker label inside an EventBox allows
         // us to set the background color
         Gtk.EventBox labelHolder = new Gtk.EventBox();
         this.trackerLabel = new Gtk.Label();
         this.trackerLabel.SetPadding(3, 3);
         OxyColor bgColor = OxyColors.LightSkyBlue;
         labelHolder.ModifyBg(StateType.Normal, new Gdk.Color(bgColor.R, bgColor.G, bgColor.B));
         labelHolder.Add(this.trackerLabel);
         this.Add(labelHolder);
         labelHolder.ShowAll();
     }
     this.trackerLabel.Parent.Visible = true;
     this.trackerLabel.Text = data.ToString();
     Gtk.Requisition req = this.trackerLabel.Parent.SizeRequest();
     int xPos = (int)data.Position.X - req.Width / 2;
     int yPos = (int)data.Position.Y - req.Height;
     xPos = Math.Max(0, Math.Min(xPos, this.Allocation.Width - req.Width));
     yPos = Math.Max(0, Math.Min(yPos, this.Allocation.Height - req.Height));
     this.Move(trackerLabel.Parent, xPos, yPos);
 }
コード例 #40
0
ファイル: SearchPopup.cs プロジェクト: GNOME/nemo
        private void add_link(string text, CalendarDriver.View view, System.DateTime item_modified_date, Gtk.HBox links)
        {
            Gtk.EventBox link_wrapper = new Gtk.EventBox();
            Gtk.Label link = new Gtk.Label();
            link.Markup = "<u><small>" + text + "</small></u>";

            GtkCommon.show_hand_and_tooltip(link_wrapper, text);

            link_wrapper.Add(link);
            link_wrapper.ButtonPressEvent += delegate(object sender, Gtk.ButtonPressEventArgs args) {
                set_view_callback(view, item_modified_date);
            };

            GtkCommon.set_background_color(link_wrapper, "white");
            links.PackStart(link_wrapper, false, false, 5);
        }
コード例 #41
0
ファイル: SearchPopup.cs プロジェクト: GNOME/nemo
        private void add_page_link(string text, Gtk.HBox page_navigation, int offset, int current_page)
        {
            Gtk.EventBox link_wrapper = new Gtk.EventBox();
            Gtk.Label link = new Gtk.Label();
            link.Markup = "<u><small>" + text + "</small></u>";

            GtkCommon.show_hand_and_tooltip(link_wrapper, text);

            System.Console.WriteLine("adding a page link: {0} with offset on click {1}", text, offset);

            link_wrapper.Add(link);
            link_wrapper.ButtonPressEvent += delegate {
                if (current_page != -1) { // next
                    sizes_of_last_pages.Push(current_page);
                    this.offset = offset + current_page;
                } else {
                    int last_page = sizes_of_last_pages.Pop();
                    this.offset = offset - last_page;
                }
                add_elements();
            };

            GtkCommon.set_background_color(link_wrapper, "white");
            page_navigation.PackStart(link_wrapper, false, false, 5);
        }
コード例 #42
0
ファイル: encodroyd.cs プロジェクト: cit/Encodroyd
    public static void Main(string[] args)
    {
        Application.Init();

        Gtk.Window w = new Gtk.Window("Encodroyd");
        HBox mainHBox = new HBox();
        HBox dropHBox = new HBox();
        HBox spinVideoHBox = new HBox();
        HBox spinAudioHBox = new HBox();
        HBox statusButtonHBox = new HBox();
        VBox mainVBox = new VBox();
        VBox leftVBox = new VBox();
        VBox rightVBox = new VBox();
        VBox prefVBox = new VBox();
        VBox statusVBox = new VBox();
        MenuBar mb = new MenuBar ();
        //Gtk.Frame dndFrame = new Gtk.Frame();
        Gtk.Frame prefFrame = new Gtk.Frame("Preferences");
        Gtk.Frame statusFrame = new Gtk.Frame("Status");
        icon = new Pixbuf(null, "encodroyd.png");
        Gtk.EventBox image = new Gtk.EventBox();
        Gtk.Label dropLabel = new Gtk.Label("Drop videos here\nto convert");

        highQualityRadio = new RadioButton(null, "High Quality (H.264)");
        prefVBox.PackStart(highQualityRadio, true, true, 0);
        lowQualityRadio = new RadioButton(highQualityRadio, "Low Quality (MPEG4)");
        lowQualityRadio.Active = true;
        prefVBox.PackStart(lowQualityRadio, true, true, 0);

        statusLabel = new Gtk.Label("Idle");
        pBar = new ProgressBar();
        skipCurrentButton = new Gtk.Button();

        Gtk.ScrolledWindow scrollWin = new Gtk.ScrolledWindow();
        Gtk.TreeView tree = new TreeView();
        listStore = new ListStore(typeof (String));

        // set properties
        w.Icon = icon;

        // transparence
        //if (w.Screen.RgbaColormap != null)
        //  Gtk.Widget.DefaultColormap = w.Screen.RgbaColormap;

        mainHBox.BorderWidth = 6;
        mainHBox.Spacing = 6;
        dropHBox.BorderWidth = 6;
        dropHBox.Spacing = 6;
        spinVideoHBox.BorderWidth = 6;
        spinVideoHBox.Spacing = 6;
        spinAudioHBox.BorderWidth = 6;
        spinAudioHBox.Spacing = 6;
        statusButtonHBox.BorderWidth = 0;
        statusButtonHBox.Spacing = 6;
        leftVBox.BorderWidth = 6;
        leftVBox.Spacing = 6;
        rightVBox.BorderWidth = 6;
        rightVBox.Spacing = 6;
        prefVBox.BorderWidth = 6;
        prefVBox.Spacing = 6;
        statusVBox.BorderWidth = 6;
        statusVBox.Spacing = 6;
        statusLabel.Ellipsize = Pango.EllipsizeMode.Middle;
        scrollWin.ShadowType = ShadowType.In;
        statusLabel.SetSizeRequest(120,-1);
        skipCurrentButton.Sensitive = false;
        skipCurrentButton.Label = "Skip";

        // first hbox
        image.Add(new Gtk.Image(icon));
        dropHBox.Add(image);
        dropHBox.Add(dropLabel);

        // preferences frame
        prefFrame.Add(prefVBox);
        prefVBox.Add(spinVideoHBox);
        prefVBox.Add(spinAudioHBox);

        // status frame
        statusFrame.Add(statusVBox);
        statusVBox.Add(statusButtonHBox);
        statusVBox.Add(pBar);
        statusButtonHBox.Add(statusLabel);
        statusButtonHBox.Add(skipCurrentButton);

        // leftvbox
        leftVBox.Add(dropHBox);
        leftVBox.Add(prefFrame);
        leftVBox.Add(statusFrame);

        // right
        tree.Model = listStore;
        tree.HeadersVisible = true;
        tree.AppendColumn ("Queue", new CellRendererText (), "text", 0);

        // scrolledwindow
        scrollWin.Add(tree);

        // rightvbox
        rightVBox.Add(scrollWin);
        rightVBox.SetSizeRequest(200,-1);

        // menubar
        Menu fileMenu = new Menu ();
        MenuItem exitItem = new MenuItem("Exit");
        exitItem.Activated += new EventHandler (OnExitItemActivate);
        fileMenu.Append (exitItem);
        MenuItem fileItem = new MenuItem("File");
        fileItem.Submenu = fileMenu;
        mb.Append (fileItem);
        Menu helpMenu = new Menu ();
        MenuItem aboutItem = new MenuItem("About");
        aboutItem.Activated += new EventHandler (OnAboutItemActivate);
        helpMenu.Append (aboutItem);
        MenuItem helpItem = new MenuItem("Help");
        helpItem.Submenu = helpMenu;
        mb.Append (helpItem);

        // mainHBox
        mainVBox.Add(mb);
        mainVBox.Add(mainHBox);
        mainHBox.Add(leftVBox);
        mainHBox.Add(rightVBox);

        // window
        w.Add(mainVBox);
        w.ShowAll();

        // events
        Gtk.Drag.DestSet(dropHBox, DestDefaults.All, targetTable, Gdk.DragAction.Copy);
        dropHBox.DragDataReceived += DataReceived;
        skipCurrentButton.Clicked += new EventHandler(OnSkipOneButtonClicked);
        w.DeleteEvent += OnWindowDelete;

        Application.Run();
    }
コード例 #43
0
ファイル: CategoryDrawer.cs プロジェクト: GNOME/nemo
        private Gtk.EventBox create_category_button(Category cat)
        {
            Gtk.EventBox header_wrapper = new Gtk.EventBox();
            Gtk.Alignment header_alignment = new Gtk.Alignment(0, 0, 0, 0);

            Gtk.HBox header = new Gtk.HBox();
            header.Add(CairoDrawing.create_empty_image(22, 16));
            header.Add(new Gtk.Label(" " + cat.metalabel.label));

            header_alignment.Add(header);
            header_wrapper.Name = cat.metalabel.label;
            header_wrapper.Add(header_alignment);
            header_wrapper.ButtonPressEvent += delegate (object sender, ButtonPressEventArgs args) {
                header_click(args, cat);
            };
            return header_wrapper;
        }
コード例 #44
0
ファイル: Parser.cs プロジェクト: MuffPotter/XamarinDesigner
        public static void FetchForm(Container Parent, XmlNode Nodes)
        {
            int cIndex = 0;
            string[] UFont;
            XmlNodeList original = Nodes.ChildNodes;
            XmlNodeList reverse = new ReverseXmlList(original);

            foreach (XmlNode C in reverse) {
                if (C.Name == "Object") {
                    cIndex++;
                    if (C.Attributes[0].Name == "type") {
                        if (C.Attributes["type"].Value.StartsWith("System.Windows.Forms.PictureBox") || C.Attributes["type"].Value.StartsWith("System.Windows.Forms.Button")) {
                            var PB = new Gtk.Button();
                            global::Gtk.Fixed.FixedChild PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent[PB]));
                            Parent.Add(PB);
                            foreach (XmlNode V in C.ChildNodes) {
                                if (V.Name == "Property") {
                                    switch (V.Attributes["name"].Value) {
                                        case "BorderStyle":
                                            if (V.InnerText == "Solid") {
                                                //PB.ModifierStyle =
                                            }
                                            break;
                                        case "Name":
                                            PB.Name = V.InnerText;
                                            break;
                                        case "ForeColor":
                                            var FColor = V.InnerText.GetXColor().ToNative();
                                            PB.Children[0].ModifyFg(StateType.Normal, FColor);
                                            PB.Children[0].ModifyFg(StateType.Active, FColor);
                                            PB.Children[0].ModifyFg(StateType.Prelight, FColor);
                                            PB.Children[0].ModifyFg(StateType.Selected, FColor);
                                            break;
                                        case "Caption":
                                        case "Text":
                                            PB.Label = global::Mono.Unix.Catalog.GetString(System.Environment.ExpandEnvironmentVariables(V.InnerText).Replace("%DATE%", System.DateTime.Now.ToString("dd.MM.yyyy")).Replace("%TIME%", System.DateTime.Now.ToString("hh:mm:ss")));
                                            break;
                                        case "BackColor":
                                            var BColor = V.InnerText.GetXColor().ToNative();
                                            PB.ModifyBg(StateType.Normal, BColor);
                                            PB.ModifyBg(StateType.Active, BColor);
                                            PB.ModifyBg(StateType.Insensitive, BColor);
                                            PB.ModifyBg(StateType.Prelight, BColor);
                                            PB.ModifyBg(StateType.Selected, BColor);
                                            break;
                                        case "SizeMode":
                                            //PB.SizeMode = Enum.Parse(typeof(PictureBoxSizeMode), V.InnerText);
                                            break;
                                        case "Location":
                                            PBC1.X = (int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX);
                                            PBC1.Y = (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY);
                                            break;
                                        case "Size":
                                            PB.SetSizeRequest((int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX), (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY));
                                            break;
                                        case "Font":
                                            string VC = V.InnerText;
                                            UFont = VC.Replace("style=", "").Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries);
                                            string VCFName = UFont[0];
                                            float VCSize = float.Parse(UFont[1].Replace("pt", ""));
                                            float Z = (float)(VCSize * App.ScaleFactorY);
                                            PB.Children[0].ModifyFont(Pango.FontDescription.FromString(VCFName + " " + ((int)Z).ToString()));
                                            break;
                                        case "Image":
                                            if (V.HasChildNodes) {
                                                string IMGData = V.FirstChild.InnerText;
                                                byte[] B = System.Convert.FromBase64String(IMGData);
                                                Pixbuf P = new Pixbuf(B);
                                                P=P.ScaleSimple(PB.WidthRequest-10, PB.HeightRequest, InterpType.Bilinear);
                                                PB.Image = new Gtk.Image(P);
                                            }
                                            break;
                                    }
                                } else if (V.Name == "Object") {
                                    //FetchForm(PB, V.ParentNode);
                                }
                            }
                        } else if (C.Attributes["type"].Value.StartsWith("System.Windows.Forms.Label")) {
                            var CE = new Gtk.EventBox();
                            CE.ResizeMode = ResizeMode.Parent;
                            var CC = new Gtk.Label();
                            CE.Add(CC);
                            Parent.Add(CE);
                            CC.LineWrapMode = Pango.WrapMode.Word;
                            CC.LineWrap = true;
                            CC.Wrap = true;
                            CC.Justify = Justification.Fill;
                            global::Gtk.Fixed.FixedChild PBC1;
                            if ((Parent[CE]).GetType().ToString() == "Gtk.Container+ContainerChild") {
                                var XVC = Parent[CE].Parent.Parent;
                                PBC1 = (global::Gtk.Fixed.FixedChild)(Parent[XVC]);
                            } else {
                                PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent[CE]));
                            }
                            foreach (XmlNode V in C.ChildNodes) {
                                if (V.Name == "Property") {
                                    switch (V.Attributes["name"].Value) {
                                        case "BorderStyle":
                                            if (V.InnerText == "Solid") {
                                                //PB.ModifierStyle =
                                            }
                                            break;
                                        case "Name":
                                            CC.Name = V.InnerText;
                                            break;
                                        case "Font":
                                            string VC = V.InnerText;
                                            UFont = VC.Replace("style=", "").Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries);
                                            string VCFName = UFont[0];
                                            float VCSize = float.Parse(UFont[1].Replace("pt", ""));
                                            float Z = (float)(VCSize * App.ScaleFactorY);
                                            CC.ModifyFont(Pango.FontDescription.FromString(VCFName + " " + (int)Z));
                                            break;
                                        case "ForeColor":
                                            var FColor = V.InnerText.GetXColor().ToNative();
                                            CC.ModifyFg(StateType.Normal, FColor);
                                            CC.ModifyFg(StateType.Active, FColor);
                                            CC.ModifyFg(StateType.Insensitive, FColor);
                                            CC.ModifyFg(StateType.Prelight,FColor);
                                            CC.ModifyFg(StateType.Selected, FColor);
                                            CE.ModifyFg(StateType.Normal, FColor);
                                            CE.ModifyFg(StateType.Active, FColor);
                                            CE.ModifyFg(StateType.Insensitive, FColor);
                                            CE.ModifyFg(StateType.Prelight, FColor);
                                            CE.ModifyFg(StateType.Selected, FColor);
                                            CC.Markup = "<span foreground=\"" + V.InnerText + "\">" + CC.Text + "</span>";
                                            break;
                                        case "Caption":
                                        case "Text":
                                            CC.Text = global::Mono.Unix.Catalog.GetString(System.Environment.ExpandEnvironmentVariables(V.InnerText).Replace("%DATE%", System.DateTime.Now.ToString("dd.MM.yyyy")).Replace("%TIME%", System.DateTime.Now.ToString("hh:mm:ss")).Replace("##", "\r\n"));
                                            break;
                                        case "BackColor":
                                            if (V.InnerText != "Transparent") {
                                                var BColor = V.InnerText.GetXColor().ToNative();
                                                CE.ModifyBg(StateType.Normal, BColor);
                                                CE.ModifyBg(StateType.Active, BColor);
                                                CE.ModifyBg(StateType.Insensitive, BColor);
                                                CE.ModifyBg(StateType.Prelight, BColor);
                                                CE.ModifyBg(StateType.Selected, BColor);
                                            } else {
                                                CE.Visible = false;
                                                CE.VisibleWindow = false;
                                            }
                                            break;
                                        case "SizeMode":
                                            //PB.SizeMode = Enum.Parse(typeof(PictureBoxSizeMode), V.InnerText);
                                            break;
                                        case "Location":
                                            PBC1.X = (int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX);
                                            PBC1.Y = (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY);
                                            break;
                                        case "TextAlign":
                                            CC.Justify = (V.InnerText == "MiddleCenter" || V.InnerText == "TopCenter" || V.InnerText == "BottomCenter" ? Justification.Center : (V.InnerText == "MiddleRight" || V.InnerText == "TopRight" || V.InnerText == "BottomRight" ? Justification.Right : Justification.Left));
                                            break;
                                        case "Size":
                                            CE.SetSizeRequest((int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX), (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY));
                                            CC.SetSizeRequest((int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX), (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY));
                                            break;
                                    }
                                } else if (V.Name == "Object") {
                                    var TZJE = new Fixed();

                                }
                            }
                        } else if (C.Attributes ["type"].Value.StartsWith("System.Windows.Forms.TextBox")) {
                            if (C.InnerXml.IndexOf("\"Multiline\">True") > -1)
                            {
                                var CC = new Gtk.Entry ();
                                global::Gtk.Fixed.FixedChild PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent [CC]));
                                Parent.Add (CC);
                                foreach (XmlNode V in C.ChildNodes) {
                                    {
                                        if (V.Name == "Property")
                                        {
                                            switch (V.Attributes ["name"].Value)
                                            {
                                                case "Text":
                                                    {
                                                        if (V.InnerText.Contains ("%")) {
                                                            CC.Text = System.Environment.ExpandEnvironmentVariables (V.InnerText);
                                                            CC.Position = CC.Text.Length;
                                                        }
                                                        break;
                                                    }
                                                case "Location":
                                                    PBC1.X = (int)(Convert.ToInt32 (V.InnerText.Substring (0, V.InnerText.IndexOf (",")))  * App.ScaleFactorX);
                                                    PBC1.Y = (int)(Convert.ToInt32 (V.InnerText.Substring (V.InnerText.IndexOf (",") + 1)) * App.ScaleFactorY);
                                                    break;
                                                case "Size":
                                                    CC.SetSizeRequest ((int)(Convert.ToInt32 (V.InnerText.Substring (0, V.InnerText.IndexOf (",")))* App.ScaleFactorX), (int)(Convert.ToInt32 (V.InnerText.Substring (V.InnerText.IndexOf (",") + 1))* App.ScaleFactorY));
                                                    break;
                                                case "Name":
                                                    CC.Name = V.InnerText;
                                                    break;
                                                case "Font":
                                                    string VC = V.InnerText;
                                                    UFont = VC.Replace("style=", "").Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries);
                                                    string VCFName = UFont[0];
                                                    float VCSize = float.Parse(UFont[1].Replace("pt", ""));
                                                    float Z = (float)(VCSize * App.ScaleFactorY);
                                                    CC.ModifyFont (Pango.FontDescription.FromString (VCFName+" "+((int)Z).ToString()));
                                                    System.Diagnostics.Debug.WriteLine(VCFName+" "+((int)Z).ToString());
                                                    break;
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                var CC= new Gtk.Entry();
                                global::Gtk.Fixed.FixedChild PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent [CC]));
                                Parent.Add (CC);
                                foreach (XmlNode V in C.ChildNodes) {
                                    {
                                        if (V.Name == "Property")
                                        {
                                            switch (V.Attributes ["name"].Value)
                                            {
                                                case "Name":
                                                    CC.Name = V.InnerText;
                                                    break;
                                                case "Text":
                                                    {
                                                        if (V.InnerText.Contains ("%")) {
                                                            CC.Text = System.Environment.ExpandEnvironmentVariables (V.InnerText);
                                                            CC.Position = CC.Text.Length;
                                                        }
                                                        break;
                                                    }
                                                case "Location":
                                                    PBC1.X = (int)(Convert.ToInt32 (V.InnerText.Substring (0, V.InnerText.IndexOf (",")))  * App.ScaleFactorX);
                                                    PBC1.Y = (int)(Convert.ToInt32 (V.InnerText.Substring (V.InnerText.IndexOf (",") + 1)) * App.ScaleFactorY);
                                                    break;
                                                case "Size":
                                                    CC.SetSizeRequest ((int)(Convert.ToInt32 (V.InnerText.Substring (0, V.InnerText.IndexOf (",")))* App.ScaleFactorX), (int)(Convert.ToInt32 (V.InnerText.Substring (V.InnerText.IndexOf (",") + 1))* App.ScaleFactorY));
                                                    break;
                                                case "PasswordChar":
                                                    CC.InvisibleChar = '*';
                                                    CC.Visibility = false;
                                                    break;
                                                case "Font":
                                                    string VC = V.InnerText;
                                                    UFont = VC.Replace("style=", "").Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries);
                                                    string VCFName = UFont[0];
                                                    float VCSize = float.Parse(UFont[1].Replace("pt", ""));
                                                    float Z = (float)(VCSize * App.ScaleFactorY);
                                                    CC.ModifyFont (Pango.FontDescription.FromString (VCFName+" "+((int)Z).ToString()));
                                                    System.Diagnostics.Debug.WriteLine(VCFName+" "+((int)Z).ToString());
                                                    break;
                                            }
                                        }
                                    }
                                }
                            }
                        } else if (C.Attributes ["type"].Value.StartsWith ("System.Windows.Forms.Panel")) {
                            var CP = new Gtk.Fixed ();
                            //CP.Clicked += HandleClick;
                            global::Gtk.Fixed.FixedChild PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent [CP]));
                            Parent.Add (CP);
                            foreach (XmlNode V in C.ChildNodes) {
                                if (V.Name == "Property") {
                                    switch (V.Attributes ["name"].Value) {
                                        case "Name":
                                            CP.Name = V.InnerText;
                                            break;
                                        case "BorderStyle":
                                            if (V.InnerText == "Solid") {
                                                //PB.ModifierStyle =
                                            }
                                            break;
                                        case "ForeColor":

                                            CP.Children [0].ModifyFg (StateType.Normal, V.InnerText.GetXColor ().ToNative ());
                                            break;
                                        case "BackColor":
                                            CP.ModifyBg (StateType.Normal, V.InnerText.GetXColor().ToNative ());
                                            break;
                                        case "SizeMode":
                                            //PB.SizeMode = Enum.Parse(typeof(PictureBoxSizeMode), V.InnerText);
                                            break;
                                        case "Location":
                                            PBC1.X = (int)(Convert.ToInt32 (V.InnerText.Substring (0, V.InnerText.IndexOf (",")))  * App.ScaleFactorX);
                                            PBC1.Y = (int)(Convert.ToInt32 (V.InnerText.Substring (V.InnerText.IndexOf (",") + 1)) * App.ScaleFactorY);
                                            break;
                                        case "Size":
                                            CP.SetSizeRequest ((int)(Convert.ToInt32 (V.InnerText.Substring (0, V.InnerText.IndexOf (",")))* App.ScaleFactorX), (int)(Convert.ToInt32 (V.InnerText.Substring (V.InnerText.IndexOf (",") + 1))* App.ScaleFactorY));
                                            break;
                                    }
                                } else if (V.Name == "Object") {
                                    //FetchForm(PB, V.ParentNode);
                                }
                            }
                        } else {
                            System.Diagnostics.Debug.WriteLine (C.Attributes ["type"].Value);

                        }
                    }
                }

            }
            Parent.ShowAll();
        }
コード例 #45
0
ファイル: Parser.cs プロジェクト: bhuebschen/XamarinDesigner
        public static void FetchForm(Container Parent, XmlNode Nodes)
        {
            int cIndex = 0;

            string[]    UFont;
            XmlNodeList original = Nodes.ChildNodes;
            XmlNodeList reverse  = new ReverseXmlList(original);

            foreach (XmlNode C in reverse)
            {
                if (C.Name == "Object")
                {
                    cIndex++;
                    if (C.Attributes[0].Name == "type")
                    {
                        if (C.Attributes["type"].Value.StartsWith("System.Windows.Forms.PictureBox") || C.Attributes["type"].Value.StartsWith("System.Windows.Forms.Button"))
                        {
                            var PB = new Gtk.Button();
                            global::Gtk.Fixed.FixedChild PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent[PB]));
                            Parent.Add(PB);
                            foreach (XmlNode V in C.ChildNodes)
                            {
                                if (V.Name == "Property")
                                {
                                    switch (V.Attributes["name"].Value)
                                    {
                                    case "BorderStyle":
                                        if (V.InnerText == "Solid")
                                        {
                                            //PB.ModifierStyle =
                                        }
                                        break;

                                    case "Name":
                                        PB.Name = V.InnerText;
                                        break;

                                    case "ForeColor":
                                        var FColor = V.InnerText.GetXColor().ToNative();
                                        PB.Children[0].ModifyFg(StateType.Normal, FColor);
                                        PB.Children[0].ModifyFg(StateType.Active, FColor);
                                        PB.Children[0].ModifyFg(StateType.Prelight, FColor);
                                        PB.Children[0].ModifyFg(StateType.Selected, FColor);
                                        break;

                                    case "Caption":
                                    case "Text":
                                        PB.Label = global::Mono.Unix.Catalog.GetString(System.Environment.ExpandEnvironmentVariables(V.InnerText).Replace("%DATE%", System.DateTime.Now.ToString("dd.MM.yyyy")).Replace("%TIME%", System.DateTime.Now.ToString("hh:mm:ss")));
                                        break;

                                    case "BackColor":
                                        var BColor = V.InnerText.GetXColor().ToNative();
                                        PB.ModifyBg(StateType.Normal, BColor);
                                        PB.ModifyBg(StateType.Active, BColor);
                                        PB.ModifyBg(StateType.Insensitive, BColor);
                                        PB.ModifyBg(StateType.Prelight, BColor);
                                        PB.ModifyBg(StateType.Selected, BColor);
                                        break;

                                    case "SizeMode":
                                        //PB.SizeMode = Enum.Parse(typeof(PictureBoxSizeMode), V.InnerText);
                                        break;

                                    case "Location":
                                        PBC1.X = (int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX);
                                        PBC1.Y = (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY);
                                        break;

                                    case "Size":
                                        PB.SetSizeRequest((int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX), (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY));
                                        break;

                                    case "Font":
                                        string VC = V.InnerText;
                                        UFont = VC.Replace("style=", "").Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                                        string VCFName = UFont[0];
                                        float  VCSize  = float.Parse(UFont[1].Replace("pt", ""));
                                        float  Z       = (float)(VCSize * App.ScaleFactorY);
                                        PB.Children[0].ModifyFont(Pango.FontDescription.FromString(VCFName + " " + ((int)Z).ToString()));
                                        break;

                                    case "Image":
                                        if (V.HasChildNodes)
                                        {
                                            string IMGData = V.FirstChild.InnerText;
                                            byte[] B       = System.Convert.FromBase64String(IMGData);
                                            Pixbuf P       = new Pixbuf(B);
                                            P        = P.ScaleSimple(PB.WidthRequest - 10, PB.HeightRequest, InterpType.Bilinear);
                                            PB.Image = new Gtk.Image(P);
                                        }
                                        break;
                                    }
                                }
                                else if (V.Name == "Object")
                                {
                                    //FetchForm(PB, V.ParentNode);
                                }
                            }
                        }
                        else if (C.Attributes["type"].Value.StartsWith("System.Windows.Forms.Label"))
                        {
                            var CE = new Gtk.EventBox();
                            CE.ResizeMode = ResizeMode.Parent;
                            var CC = new Gtk.Label();
                            CE.Add(CC);
                            Parent.Add(CE);
                            CC.LineWrapMode = Pango.WrapMode.Word;
                            CC.LineWrap     = true;
                            CC.Wrap         = true;
                            CC.Justify      = Justification.Fill;
                            global::Gtk.Fixed.FixedChild PBC1;
                            if ((Parent[CE]).GetType().ToString() == "Gtk.Container+ContainerChild")
                            {
                                var XVC = Parent[CE].Parent.Parent;
                                PBC1 = (global::Gtk.Fixed.FixedChild)(Parent[XVC]);
                            }
                            else
                            {
                                PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent[CE]));
                            }
                            foreach (XmlNode V in C.ChildNodes)
                            {
                                if (V.Name == "Property")
                                {
                                    switch (V.Attributes["name"].Value)
                                    {
                                    case "BorderStyle":
                                        if (V.InnerText == "Solid")
                                        {
                                            //PB.ModifierStyle =
                                        }
                                        break;

                                    case "Name":
                                        CC.Name = V.InnerText;
                                        break;

                                    case "Font":
                                        string VC = V.InnerText;
                                        UFont = VC.Replace("style=", "").Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                                        string VCFName = UFont[0];
                                        float  VCSize  = float.Parse(UFont[1].Replace("pt", ""));
                                        float  Z       = (float)(VCSize * App.ScaleFactorY);
                                        CC.ModifyFont(Pango.FontDescription.FromString(VCFName + " " + (int)Z));
                                        break;

                                    case "ForeColor":
                                        var FColor = V.InnerText.GetXColor().ToNative();
                                        CC.ModifyFg(StateType.Normal, FColor);
                                        CC.ModifyFg(StateType.Active, FColor);
                                        CC.ModifyFg(StateType.Insensitive, FColor);
                                        CC.ModifyFg(StateType.Prelight, FColor);
                                        CC.ModifyFg(StateType.Selected, FColor);
                                        CE.ModifyFg(StateType.Normal, FColor);
                                        CE.ModifyFg(StateType.Active, FColor);
                                        CE.ModifyFg(StateType.Insensitive, FColor);
                                        CE.ModifyFg(StateType.Prelight, FColor);
                                        CE.ModifyFg(StateType.Selected, FColor);
                                        CC.Markup = "<span foreground=\"" + V.InnerText + "\">" + CC.Text + "</span>";
                                        break;

                                    case "Caption":
                                    case "Text":
                                        CC.Text = global::Mono.Unix.Catalog.GetString(System.Environment.ExpandEnvironmentVariables(V.InnerText).Replace("%DATE%", System.DateTime.Now.ToString("dd.MM.yyyy")).Replace("%TIME%", System.DateTime.Now.ToString("hh:mm:ss")).Replace("##", "\r\n"));
                                        break;

                                    case "BackColor":
                                        if (V.InnerText != "Transparent")
                                        {
                                            var BColor = V.InnerText.GetXColor().ToNative();
                                            CE.ModifyBg(StateType.Normal, BColor);
                                            CE.ModifyBg(StateType.Active, BColor);
                                            CE.ModifyBg(StateType.Insensitive, BColor);
                                            CE.ModifyBg(StateType.Prelight, BColor);
                                            CE.ModifyBg(StateType.Selected, BColor);
                                        }
                                        else
                                        {
                                            CE.Visible       = false;
                                            CE.VisibleWindow = false;
                                        }
                                        break;

                                    case "SizeMode":
                                        //PB.SizeMode = Enum.Parse(typeof(PictureBoxSizeMode), V.InnerText);
                                        break;

                                    case "Location":
                                        PBC1.X = (int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX);
                                        PBC1.Y = (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY);
                                        break;

                                    case "TextAlign":
                                        CC.Justify = (V.InnerText == "MiddleCenter" || V.InnerText == "TopCenter" || V.InnerText == "BottomCenter" ? Justification.Center : (V.InnerText == "MiddleRight" || V.InnerText == "TopRight" || V.InnerText == "BottomRight" ? Justification.Right : Justification.Left));
                                        break;

                                    case "Size":
                                        CE.SetSizeRequest((int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX), (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY));
                                        CC.SetSizeRequest((int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX), (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY));
                                        break;
                                    }
                                }
                                else if (V.Name == "Object")
                                {
                                    var TZJE = new Fixed();
                                }
                            }
                        }
                        else if (C.Attributes ["type"].Value.StartsWith("System.Windows.Forms.TextBox"))
                        {
                            if (C.InnerXml.IndexOf("\"Multiline\">True") > -1)
                            {
                                var CC = new Gtk.Entry();
                                global::Gtk.Fixed.FixedChild PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent [CC]));
                                Parent.Add(CC);
                                foreach (XmlNode V in C.ChildNodes)
                                {
                                    {
                                        if (V.Name == "Property")
                                        {
                                            switch (V.Attributes ["name"].Value)
                                            {
                                            case "Text":
                                            {
                                                if (V.InnerText.Contains("%"))
                                                {
                                                    CC.Text     = System.Environment.ExpandEnvironmentVariables(V.InnerText);
                                                    CC.Position = CC.Text.Length;
                                                }
                                                break;
                                            }

                                            case "Location":
                                                PBC1.X = (int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX);
                                                PBC1.Y = (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY);
                                                break;

                                            case "Size":
                                                CC.SetSizeRequest((int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX), (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY));
                                                break;

                                            case "Name":
                                                CC.Name = V.InnerText;
                                                break;

                                            case "Font":
                                                string VC = V.InnerText;
                                                UFont = VC.Replace("style=", "").Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                                                string VCFName = UFont[0];
                                                float  VCSize  = float.Parse(UFont[1].Replace("pt", ""));
                                                float  Z       = (float)(VCSize * App.ScaleFactorY);
                                                CC.ModifyFont(Pango.FontDescription.FromString(VCFName + " " + ((int)Z).ToString()));
                                                System.Diagnostics.Debug.WriteLine(VCFName + " " + ((int)Z).ToString());
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                var CC = new Gtk.Entry();
                                global::Gtk.Fixed.FixedChild PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent [CC]));
                                Parent.Add(CC);
                                foreach (XmlNode V in C.ChildNodes)
                                {
                                    {
                                        if (V.Name == "Property")
                                        {
                                            switch (V.Attributes ["name"].Value)
                                            {
                                            case "Name":
                                                CC.Name = V.InnerText;
                                                break;

                                            case "Text":
                                            {
                                                if (V.InnerText.Contains("%"))
                                                {
                                                    CC.Text     = System.Environment.ExpandEnvironmentVariables(V.InnerText);
                                                    CC.Position = CC.Text.Length;
                                                }
                                                break;
                                            }

                                            case "Location":
                                                PBC1.X = (int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX);
                                                PBC1.Y = (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY);
                                                break;

                                            case "Size":
                                                CC.SetSizeRequest((int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX), (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY));
                                                break;

                                            case "PasswordChar":
                                                CC.InvisibleChar = '*';
                                                CC.Visibility    = false;
                                                break;

                                            case "Font":
                                                string VC = V.InnerText;
                                                UFont = VC.Replace("style=", "").Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                                                string VCFName = UFont[0];
                                                float  VCSize  = float.Parse(UFont[1].Replace("pt", ""));
                                                float  Z       = (float)(VCSize * App.ScaleFactorY);
                                                CC.ModifyFont(Pango.FontDescription.FromString(VCFName + " " + ((int)Z).ToString()));
                                                System.Diagnostics.Debug.WriteLine(VCFName + " " + ((int)Z).ToString());
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        else if (C.Attributes ["type"].Value.StartsWith("System.Windows.Forms.Panel"))
                        {
                            var CP = new Gtk.Fixed();
                            //CP.Clicked += HandleClick;
                            global::Gtk.Fixed.FixedChild PBC1 = ((global::Gtk.Fixed.FixedChild)(Parent [CP]));
                            Parent.Add(CP);
                            foreach (XmlNode V in C.ChildNodes)
                            {
                                if (V.Name == "Property")
                                {
                                    switch (V.Attributes ["name"].Value)
                                    {
                                    case "Name":
                                        CP.Name = V.InnerText;
                                        break;

                                    case "BorderStyle":
                                        if (V.InnerText == "Solid")
                                        {
                                            //PB.ModifierStyle =
                                        }
                                        break;

                                    case "ForeColor":

                                        CP.Children [0].ModifyFg(StateType.Normal, V.InnerText.GetXColor().ToNative());
                                        break;

                                    case "BackColor":
                                        CP.ModifyBg(StateType.Normal, V.InnerText.GetXColor().ToNative());
                                        break;

                                    case "SizeMode":
                                        //PB.SizeMode = Enum.Parse(typeof(PictureBoxSizeMode), V.InnerText);
                                        break;

                                    case "Location":
                                        PBC1.X = (int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX);
                                        PBC1.Y = (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY);
                                        break;

                                    case "Size":
                                        CP.SetSizeRequest((int)(Convert.ToInt32(V.InnerText.Substring(0, V.InnerText.IndexOf(","))) * App.ScaleFactorX), (int)(Convert.ToInt32(V.InnerText.Substring(V.InnerText.IndexOf(",") + 1)) * App.ScaleFactorY));
                                        break;
                                    }
                                }
                                else if (V.Name == "Object")
                                {
                                    //FetchForm(PB, V.ParentNode);
                                }
                            }
                        }
                        else
                        {
                            System.Diagnostics.Debug.WriteLine(C.Attributes ["type"].Value);
                        }
                    }
                }
            }
            Parent.ShowAll();
        }
コード例 #46
0
ファイル: DisplayItem.cs プロジェクト: GNOME/nemo
        protected void create_representation(List<KeyValuePair<string, string>> new_fields)
        {
            box = new VBox();

            set_picture_path();

            try {
                if (item.file.starred)
                picture = CairoDrawing.create_big_starred_image(pic_path);
                else
                picture = CairoDrawing.create_image_with_border(pic_path);
            } catch (Exception e) {
                System.Console.WriteLine("failed to generate thumbnail, error: {0}", e.Message);
            }

            Gtk.Table picture_resizer = new Table(1,1, true); // for size
            picture_wrapper = new EventBox(); // for events
            GtkCommon.set_background_color(picture_wrapper, "white");
            picture_wrapper.Add(picture);
            picture_resizer.Attach(picture_wrapper, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

            Gtk.Alignment picture_alignment = new Gtk.Alignment(0.5f, 0.5f, 0, 0);

            picture_alignment.Add(picture_resizer);

            GtkCommon.show_hand_and_tooltip(picture_wrapper, Mono.Unix.Catalog.GetString("Open"));

            box.PackStart(picture_alignment, true, true, 3);

            string image = Singleton<Types>.Instance.get_type((int)item.file.type.category).icon;
            if (!String.IsNullOrEmpty(image))
            {
                Gtk.HBox tmp = new Gtk.HBox();

                Gtk.Alignment img_alignment = new Gtk.Alignment(1F, 0.5F, 0F, 0.5F);
                img_alignment.RightPadding = 5;
                Gtk.Image img = new Gtk.Image(null, image);
                img_alignment.Add(img);

                tmp.PackStart(img_alignment, true, true, 0);

                Gtk.Alignment label_alignment = new Gtk.Alignment(0F, 0.5F, 0F, 0.5F);
                Gtk.Label tmp_label = new Gtk.Label();
                tmp_label.Markup = "<b>" + item.name(35) + "</b>";
                tmp_label.UseUnderline = false;
                label_alignment.Add(tmp_label);
                tmp.PackStart(label_alignment, true, true, 0);

                box.PackStart(tmp, false, true, 3);

            } else {

                Gtk.Label title = new Gtk.Label();
                title.Markup = "<b>" + item.name(35) + "</b>";

                box.PackStart(title, true, true, 3);
            }

            Gtk.Alignment labels_alignment = new Gtk.Alignment(0.5f, 0.5f, 0f, 0f);

            labels = new Gtk.HBox();

            create_labels();

            labels_alignment.Add(labels);

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

            extra_info = new Gtk.Table((uint)(3 + new_fields.Count), 2, false);

            row = 0;

            foreach (KeyValuePair<string, string> kvp in new_fields)
                add_line(kvp.Key, kvp.Value);

            string path = item.path;

            string homedir = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);

            if (path.StartsWith(homedir))
                path = path.Replace(homedir, "~");

            int index = -1;
            if ((index = path.LastIndexOf('/')) != -1)
                if (index > 27) {
                    path = path.Substring(0, 25);
                    path += "...";
                } else
                    path = path.Substring(0, index+1);

            add_line(Mono.Unix.Catalog.GetString("Path:"), path);
            add_line(Mono.Unix.Catalog.GetString("Size:"), item.size);
            add_line(Mono.Unix.Catalog.GetString("Last modified:"), item.accessed);
            add_line(Mono.Unix.Catalog.GetString("Last accessed:"), item.modify);

            box.PackStart(extra_info, false, false, 3);

            Gtk.Alignment box_alignment = new Alignment(0.5f, 1f, 0, 0);
            box_alignment.BottomPadding = 12;
            box_alignment.TopPadding = 12;
            box_alignment.LeftPadding = 12;
            box_alignment.RightPadding = 12;

            box_alignment.Add(box);

            box_wrapper = new EventBox(); // for bg color
            box_wrapper.Add(box_alignment);
            GtkCommon.set_background_color(box_wrapper, "white");

            box_wrapper.ButtonPressEvent += GtkCommon.ButtonPressEventWrapper(item);

            representation = new Frame();
            representation.Add(box_wrapper);

            representation.ShowAll();
        }
コード例 #47
0
ファイル: CategoriesDrawer.cs プロジェクト: GNOME/nemo
 public CategoriesDrawer(Gtk.EventBox box)
 {
     outer_event_box = box;
     category_drawers = new List<CategoryDrawer>();
 }
コード例 #48
0
        public DockItemContainer(DockFrame frame, DockItem item)
        {
            this.frame = frame;
            this.item  = item;

            ResizeMode = Gtk.ResizeMode.Queue;
            Spacing    = 0;

            title           = new Gtk.Label();
            title.Xalign    = 0;
            title.Xpad      = 3;
            title.UseMarkup = true;
            title.Ellipsize = Pango.EllipsizeMode.End;

            btnDock              = new Button(new Gtk.Image(pixAutoHide));
            btnDock.Relief       = ReliefStyle.None;
            btnDock.CanFocus     = false;
            btnDock.WidthRequest = btnDock.HeightRequest = 17;
            btnDock.Clicked     += OnClickDock;

            btnClose              = new Button(new Gtk.Image(pixClose));
            btnClose.TooltipText  = Catalog.GetString("Hide");
            btnClose.Relief       = ReliefStyle.None;
            btnClose.CanFocus     = false;
            btnClose.WidthRequest = btnClose.HeightRequest = 17;
            btnClose.Clicked     += delegate {
                item.Visible = false;
            };

            HBox box = new HBox(false, 0);

            box.PackStart(title, true, true, 0);
            box.PackEnd(btnClose, false, false, 0);
            box.PackEnd(btnDock, false, false, 0);

            headerAlign            = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            headerAlign.TopPadding = headerAlign.BottomPadding = headerAlign.RightPadding = headerAlign.LeftPadding = 1;
            headerAlign.Add(box);

            header                     = new EventBox();
            header.Events             |= Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask;
            header.ButtonPressEvent   += HeaderButtonPress;
            header.ButtonReleaseEvent += HeaderButtonRelease;
            header.MotionNotifyEvent  += HeaderMotion;
            header.KeyPressEvent      += HeaderKeyPress;
            header.KeyReleaseEvent    += HeaderKeyRelease;
            header.Add(headerAlign);
            header.ExposeEvent += HeaderExpose;
            header.Realized    += delegate {
                header.GdkWindow.Cursor = handCursor;
            };

            foreach (Widget w in new Widget [] { header, btnDock, btnClose })
            {
                w.EnterNotifyEvent += HeaderEnterNotify;
                w.LeaveNotifyEvent += HeaderLeaveNotify;
            }

            PackStart(header, false, false, 0);
            ShowAll();

            PackStart(item.GetToolbar(PositionType.Top).Container, false, false, 0);

            HBox hbox = new HBox();

            hbox.Show();
            hbox.PackStart(item.GetToolbar(PositionType.Left).Container, false, false, 0);

            contentBox = new HBox();
            contentBox.Show();
            hbox.PackStart(contentBox, true, true, 0);

            hbox.PackStart(item.GetToolbar(PositionType.Right).Container, false, false, 0);

            PackStart(hbox, true, true, 0);

            PackStart(item.GetToolbar(PositionType.Bottom).Container, false, false, 0);

            UpdateBehavior();
        }
コード例 #49
0
        // 
		public void Initialize (EditSession session)
		{
            prop = session.Property;
           
            ICollection valuesCollection = prop.Converter.GetStandardValues();
            values = new TraceLab.Core.Components.EnumValue[valuesCollection.Count];
            valuesCollection.CopyTo(values, 0);

			//values = System.Enum.GetValues (prop.PropertyType);
			Hashtable names = new Hashtable ();
			foreach (FieldInfo f in prop.PropertyType.GetFields ()) {
				DescriptionAttribute att = (DescriptionAttribute) Attribute.GetCustomAttribute (f, typeof(DescriptionAttribute));
				if (att != null)
					names [f.Name] = att.Description;
				else
					names [f.Name] = f.Name;
			}
				       
			
			ebox = new Gtk.EventBox ();
			ebox.Show ();
			PackStart (ebox, true, true, 0);

			combo = Gtk.ComboBoxEntry.NewText ();
			combo.Changed += combo_Changed;
			combo.Entry.IsEditable = false;
			combo.Entry.CanFocus = false;
			combo.Entry.HasFrame = false;
			combo.Entry.HeightRequest = combo.SizeRequest ().Height;
			combo.Show ();
			ebox.Add (combo);

            foreach (TraceLab.Core.Components.EnumValue value in values) {
				string str = prop.Converter.ConvertToString (value);
				if (names.Contains (str))
					str = (string) names [str];
				combo.AppendText (str);
			}
		}
コード例 #50
0
        public DockItemContainer(DockFrame dockframe, Widget widget)
        {
            this.Expand        = true;
            this.FadeOutHeader = true;
            //initIcons();

            frame            = dockframe;
            CurrentContainer = null;

            ResizeMode = Gtk.ResizeMode.Queue;
            Spacing    = 0;

            title         = new Gtk.Label();
            title.Justify = Justification.Left;

            Gtk.Image img1 = new Gtk.Image("gtk-zoom-out", IconSize.Menu);
            btnDock                   = new Button(img1);
            btnDock.Relief            = ReliefStyle.None;
            btnDock.Clicked          += HandleBtnDockClicked;
            btnDock.EnterNotifyEvent += HandleButtonEnterNotifyEvent;

            Gtk.Image img = new Gtk.Image("gtk-close", IconSize.SmallToolbar);
            btnClose                   = new Button(img);
            btnClose.Visible           = true;
            btnClose.Clicked          += HandleBtnCloseClicked;
            btnClose.Relief            = ReliefStyle.None;
            btnClose.EnterNotifyEvent += HandleButtonEnterNotifyEvent;

            HeaderBox = new HBox(false, 0);
            HeaderBox.PackStart(title, true, false, 0);
            HeaderBox.PackEnd(btnClose, false, false, 0);
            HeaderBox.PackEnd(btnDock, false, false, 0);

            headerAlign            = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            headerAlign.TopPadding = headerAlign.BottomPadding = headerAlign.RightPadding = headerAlign.LeftPadding = 0;
            headerAlign.Add(HeaderBox);

            header                     = new EventBox();
            header.Events             |= Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask;
            header.ButtonPressEvent   += HeaderButtonPress;
            header.ButtonReleaseEvent += HeaderButtonRelease;


//			header.MotionNotifyEvent += HeaderMotion;
//			header.KeyPressEvent += HeaderKeyPress;
//			header.KeyReleaseEvent += HeaderKeyRelease;
            header.Add(headerAlign);
            //header.Drawn += HandleHeaderDrawn;

            //header.Add(new Gtk.Button("gtk-close"));

            header.Realized += delegate {
                header.Window.Cursor = handCursor;
            };

            foreach (Widget w in new Widget [] { header, btnDock, btnClose })
            {
                w.EnterNotifyEvent += HeaderEnterNotify;
                w.LeaveNotifyEvent += HeaderLeaveNotify;
            }

            PackStart(header, false, false, 0);
            ShowAll();

            if (widget != null)
            {
                CurrentWidget  = widget;
                widget.Visible = true;
                PackEnd(widget, true, true, 0);

                if (widget is CustomWidget)
                {
                    title.Text = (widget as DockableWidget).Title;
                }
            }

            doRemove = true;
            GLib.Timeout.Add(5000, new GLib.TimeoutHandler(removeHeader));
        }
コード例 #51
0
 public iFolderApplication(string[] args)
     : base("ifolder", "1.0", Modules.UI, args)
 {
     Util.InitCatalog();
        Util.SetQuitiFolderDelegate(new QuitiFolderDelegate(QuitiFolder));
        tIcon = new Egg.TrayIcon("iFolder");
        currentIconAnimationDirection = 0;
        this.ClientUpgradeStatus = null;
        this.NewClientVersion = null;
        this.NewClientDomainID = null;
        eBox = new EventBox();
        eBox.ButtonPressEvent +=
     new ButtonPressEventHandler(trayapp_clicked);
                 quitDlg = new iFolderMsgDialog(
                 null,
                 iFolderMsgDialog.DialogType.Question,
                 iFolderMsgDialog.ButtonSet.YesNo,
                 Util.GS("Exit Novell iFolder"),
                  Util.GS("If you exit the Novell iFolder application, changes in your iFolder will no longer be tracked.\nThe next time you login, Novell iFolder will reconcile any differences between your iFolder and Server.\n\nAre you sure you want to exit the Application ?"),
                 " ");
                  quitDlg.Response += new ResponseHandler(YesNo_Clicked);
        RunningPixbuf =
      new Pixbuf(Util.ImagesPath("ifolder16.png"));
        StartingPixbuf =
      new Pixbuf(Util.ImagesPath("ifolder-waiting16.png"));
        StoppingPixbuf =
      new Pixbuf(Util.ImagesPath("ifolder-waiting16.png"));
        DownloadingPixbuf =
      new Pixbuf(Util.ImagesPath("ifolder-download16.png"));
        UploadingPixbuf =
      new Pixbuf(Util.ImagesPath("ifolder-upload16.png"));
        gAppIcon = new Gtk.Image(RunningPixbuf);
        eBox.Add(gAppIcon);
        tIcon.Add(eBox);
        tIcon.ShowAll();
        LoginDialog = null;
        collectionSynchronizing = null;
        synchronizationErrors = new Hashtable();
        iFolderAppStateChanged = new Gtk.ThreadNotify(
        new Gtk.ReadyEvent(OniFolderAppStateChanged));
        simiasManager = Util.CreateSimiasManager(args);
        startingUpNotifyWindow = null;
        shuttingDownNotifyWindow = null;
        forceShutdown = false;
        ClientUpgradeDialog = null;
 }
コード例 #52
0
		public DockItemContainer (DockFrame frame, DockItem item)
		{
			this.frame = frame;
			this.item = item;
			
			ResizeMode = Gtk.ResizeMode.Queue;
			Spacing = 0;
			
			title = new Gtk.Label ();
			title.Xalign = 0;
			title.Xpad = 3;
			title.UseMarkup = true;
			title.Ellipsize = Pango.EllipsizeMode.End;
			
			btnDock = new Button (new Gtk.Image (pixAutoHide));
			btnDock.Relief = ReliefStyle.None;
			btnDock.CanFocus = false;
			btnDock.WidthRequest = btnDock.HeightRequest = 17;
			btnDock.Clicked += OnClickDock;
			
			btnClose = new Button (new Gtk.Image (pixClose));
			btnClose.TooltipText = Catalog.GetString ("Hide");
			btnClose.Relief = ReliefStyle.None;
			btnClose.CanFocus = false;
			btnClose.WidthRequest = btnClose.HeightRequest = 17;
			btnClose.Clicked += delegate {
				item.Visible = false;
			};
			
			HBox box = new HBox (false, 0);
			box.PackStart (title, true, true, 0);
			box.PackEnd (btnClose, false, false, 0);
			box.PackEnd (btnDock, false, false, 0);
			
			headerAlign = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
			headerAlign.TopPadding = headerAlign.BottomPadding = headerAlign.RightPadding = headerAlign.LeftPadding = 1;
			headerAlign.Add (box);
			
			header = new EventBox ();
			header.Events |= Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask;
			header.ButtonPressEvent += HeaderButtonPress;
			header.ButtonReleaseEvent += HeaderButtonRelease;
			header.MotionNotifyEvent += HeaderMotion;
			header.KeyPressEvent += HeaderKeyPress;
			header.KeyReleaseEvent += HeaderKeyRelease;
			header.Add (headerAlign);
			header.ExposeEvent += HeaderExpose;
			header.Realized += delegate {
				header.GdkWindow.Cursor = handCursor;
			};
			
			foreach (Widget w in new Widget [] { header, btnDock, btnClose }) {
				w.EnterNotifyEvent += HeaderEnterNotify;
				w.LeaveNotifyEvent += HeaderLeaveNotify;
			}
			
			PackStart (header, false, false, 0);
			ShowAll ();
			
			PackStart (item.GetToolbar (PositionType.Top).Container, false, false, 0);
			
			HBox hbox = new HBox ();
			hbox.Show ();
			hbox.PackStart (item.GetToolbar (PositionType.Left).Container, false, false, 0);
			
			contentBox = new HBox ();
			contentBox.Show ();
			hbox.PackStart (contentBox, true, true, 0);
			
			hbox.PackStart (item.GetToolbar (PositionType.Right).Container, false, false, 0);
			
			PackStart (hbox, true, true, 0);
			
			PackStart (item.GetToolbar (PositionType.Bottom).Container, false, false, 0);
			
			UpdateBehavior ();
		}
コード例 #53
0
        public DockItemContainer(DockFrame dockframe, Widget widget)
        {
            this.Expand = true;
            this.FadeOutHeader = true;
            //initIcons();

            frame = dockframe;
            CurrentContainer = null;

            ResizeMode = Gtk.ResizeMode.Queue;
            Spacing = 0;

            title = new Gtk.Label();
            title.Justify = Justification.Left;

            Gtk.Image img1 = new Gtk.Image("gtk-zoom-out",IconSize.Menu);
            btnDock = new Button(img1);
            btnDock.Relief = ReliefStyle.None;
            btnDock.Clicked += HandleBtnDockClicked;
            btnDock.EnterNotifyEvent += HandleButtonEnterNotifyEvent;

            Gtk.Image img = new Gtk.Image("gtk-close",IconSize.SmallToolbar);
            btnClose = new Button(img);
            btnClose.Visible = true;
            btnClose.Clicked += HandleBtnCloseClicked;
            btnClose.Relief = ReliefStyle.None;
            btnClose.EnterNotifyEvent += HandleButtonEnterNotifyEvent;

            HeaderBox = new HBox (false, 0);
            HeaderBox.PackStart (title, true, false, 0);
            HeaderBox.PackEnd (btnClose, false, false, 0);
            HeaderBox.PackEnd (btnDock, false, false, 0);

            headerAlign = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            headerAlign.TopPadding = headerAlign.BottomPadding = headerAlign.RightPadding = headerAlign.LeftPadding = 0;
            headerAlign.Add (HeaderBox);

            header = new EventBox ();
            header.Events |= Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask;
            header.ButtonPressEvent += HeaderButtonPress;
            header.ButtonReleaseEvent += HeaderButtonRelease;

            //			header.MotionNotifyEvent += HeaderMotion;
            //			header.KeyPressEvent += HeaderKeyPress;
            //			header.KeyReleaseEvent += HeaderKeyRelease;
            header.Add (headerAlign);
            //header.Drawn += HandleHeaderDrawn;

            //header.Add(new Gtk.Button("gtk-close"));

            header.Realized += delegate {
                header.Window.Cursor = handCursor;
            };

            foreach (Widget w in new Widget [] { header, btnDock, btnClose }) {
                w.EnterNotifyEvent += HeaderEnterNotify;
                w.LeaveNotifyEvent += HeaderLeaveNotify;
            }

            PackStart (header, false, false, 0);
            ShowAll ();

            if (widget != null)
            {
                CurrentWidget = widget;
                widget.Visible = true;
                PackEnd(widget,true,true,0);

                if (widget is CustomWidget)
                {
                    title.Text = (widget as DockableWidget).Title;
                }
            }

            doRemove = true;
            GLib.Timeout.Add(5000,new GLib.TimeoutHandler(removeHeader));
        }
コード例 #54
0
		public Gtk.EventBox AddLabelWidget (Gtk.Label label)
		{
			box.Remove (clear_button);
			statusLabelEventBox = new Gtk.EventBox ();
			statusLabelEventBox.Child = label;
			box.PackStart (statusLabelEventBox, false, false, 0);
			box.PackStart (clear_button, false, false, 0);
			UpdateStyle ();
			box.ShowAll ();
			return statusLabelEventBox;
		}
コード例 #55
0
ファイル: SearchPopup.cs プロジェクト: GNOME/nemo
        private void create_window(string search_text, int x, int y)
        {
            System.Console.WriteLine("creating search window");

            if (popup == null) {
                popup = new Gtk.Window(Gtk.WindowType.Popup);
                elements = new VBox();
            } else {
                foreach (Widget w in popup.Children)
                    w.Destroy();
            }

            Gtk.Alignment alignment = new Gtk.Alignment(1F, 0.5F, 0F, 0F);
            Gtk.EventBox image_wrapper = new EventBox();
            Gtk.Image close_image = new Gtk.Image(null, "close.png");
            image_wrapper.Add(close_image);

            if (String.IsNullOrEmpty(name))
                throw new Exception("name for an overlay cannot be empty");

            image_wrapper.ButtonPressEvent += delegate {
                Singleton<OverlayTracker>.Instance.hide_and_die(name);
            };
            GtkCommon.set_background_color(image_wrapper, "white");
            alignment.Add(image_wrapper);
            elements.PackStart(alignment, false, false, 0);

            Gtk.Label header = new Gtk.Label();
            header.Markup = "<big>" + String.Format(Mono.Unix.Catalog.GetString("Search results for: {0}"),  "<b>" + search_text + "</b></big>");

            elements.PackStart(header, false, false, 0);
            elements.PackStart(new Gtk.HSeparator(), false, false, 0);

            Gtk.EventBox border_wrapper = new Gtk.EventBox();

            Gtk.Frame border = new Gtk.Frame();

            Gtk.Alignment border_alignment = new Gtk.Alignment(1, 1, 1, 1);
            border_alignment.BottomPadding = 5;
            border_alignment.TopPadding = 5;
            border_alignment.LeftPadding = 5;
            border_alignment.RightPadding = 5;

            border_alignment.Add(elements);

            border.Add(border_alignment);

            border_wrapper.Add(border);

            GtkCommon.set_background_color(border_wrapper, "white");

            popup.Add(border_wrapper);
        }
コード例 #56
0
ファイル: SearchPopup.cs プロジェクト: GNOME/nemo
        private Gtk.HBox create_element(Item item, string search_text, string snippet_text, VoidFunction update)
        {
            Gtk.HBox element = new Gtk.HBox();
            Gtk.VBox lines = new Gtk.VBox();
            Gtk.HBox title_date = new Gtk.HBox();

            Gtk.EventBox title_wrapper = new Gtk.EventBox();
            Gtk.Label title = new Gtk.Label();

            string str_title = item.name(40);

            string capitalized = search_text.Substring(0, 1).ToUpper() + search_text.Substring(1);

            if (str_title.Contains(search_text)) {
                int index = str_title.IndexOf(search_text);
                str_title = str_title.Substring(0, index) + "<b>" + search_text + "</b>" + str_title.Substring(index+search_text.Length);
            } else if (str_title.Contains(capitalized)) {
                int index = str_title.IndexOf(capitalized);
                str_title = str_title.Substring(0, index) + "<b>" + capitalized + "</b>" + str_title.Substring(index+capitalized.Length);
            }

            title.Markup = "<big>" + str_title + "</big>";
            title.UseUnderline = false;
            title.SetAlignment(0, 0); // left aligned
            title_wrapper.ButtonPressEvent += delegate(object sender, Gtk.ButtonPressEventArgs args) {
                if (args.Event.Button == 1)
                    item.open();
            };
            title_wrapper.Add(title);
            GtkCommon.set_background_color(title_wrapper, "white");

            GtkCommon.show_hand_and_tooltip(title_wrapper, String.Format(Mono.Unix.Catalog.GetString("Open: {0}"), item.long_name));

            GtkCommon.create_preview(item, lines, title_wrapper);

            title_date.PackStart(title_wrapper, true, true, 0);

            Gtk.Alignment date_alignment = new Gtk.Alignment(1, 0, 0, 0);
            Gtk.Label date = new Gtk.Label();
            date.Markup = "<big>" + String.Format("{0:dd/MM/yy}", item.last_modify) + "</big>";
            date_alignment.Add(date);
            date_alignment.LeftPadding = 10;
            title_date.PackStart(date_alignment, true, true, 0);

            lines.PackStart(title_date, true, true, 0);

            try {
                DocumentItem doc_item = item as DocumentItem;

                if (doc_item != null) {
                    doc_item.on_snippet_callback = delegate (string snippet) {
                        if (!String.IsNullOrEmpty(snippet)) {

                            System.Console.WriteLine("got snippet: {0}", snippet);

                            Gtk.Label snippet_label = new Gtk.Label();
                            snippet_label.SetAlignment(0, 0); // left aligned
                            snippet_label.Markup = snippet;
                            lines.PackStart(snippet_label, true, true, 2);
                            lines.ReorderChild(snippet_label, 1);

                            update();
                        }
                    };
                    if (!String.IsNullOrEmpty(doc_item.snippet))
                        doc_item.on_snippet_callback(doc_item.snippet);
                }
            } catch (Exception) { // not document item
            }

            Gtk.HBox label_links = new Gtk.HBox();

            Gtk.HBox bubbles = new Gtk.HBox();

            foreach (UserLabel label in item.labels)
                bubbles.Add(label.dot());

            label_links.PackStart(bubbles, false, false, 0);

            item.on_labels_callback = delegate() {
                foreach (Widget w in bubbles)
                    w.Destroy();

                foreach (UserLabel label in item.labels)
                    bubbles.Add(label.dot());

                element.ShowAll();
            };

            Gtk.Alignment links_alignment = new Gtk.Alignment(1,1,0,0);
            Gtk.HBox links = new Gtk.HBox();

            add_link(Mono.Unix.Catalog.GetString("Go to week"), CalendarDriver.View.Week, item.last_modify, links);
            add_link(Mono.Unix.Catalog.GetString("Go to month"), CalendarDriver.View.Month, item.last_modify, links);
            add_link(Mono.Unix.Catalog.GetString("Go to year"), CalendarDriver.View.Year, item.last_modify, links);

            links_alignment.Add(links);

            label_links.PackStart(links_alignment, true, true, 0);

            lines.PackStart(label_links, true, true, 2);

            string image = String.Empty;

            if (item.file != null)
                image = Singleton<Types>.Instance.get_type((int)item.file.type.category).icon;

            Gtk.Alignment img_alignment = new Gtk.Alignment(0, (float)0.05, 0,0);

            if (!String.IsNullOrEmpty(image))
            {
                Gtk.Image img;

                if (item.file.starred)
                    img = CairoDrawing.create_small_starred_image(image);
                else
                    img = new Gtk.Image(null, image);

                item.register_small_starred_change(delegate(bool starred) {
                    foreach (Widget w in img_alignment)
                        w.Destroy();
                    if (starred)
                        img = CairoDrawing.create_small_starred_image(image);
                    else
                        img = new Gtk.Image(null, image);
                    img_alignment.Add(img);
                    img_alignment.ShowAll();
                });

                img_alignment.Add(img);
                img_alignment.ShowAll();
            }

            element.PackStart(img_alignment, false, false, 5);

            element.PackStart(lines, true, true, 0);

            return element;
        }
コード例 #57
0
 private void InitializeGtkObjects(Gtk.Builder b) {
   m_adjustmentAudioPaddingAfter = (Gtk.Adjustment) b.GetObject("adjustment_audio_padding_after");
   m_adjustmentAudioPaddingBefore = (Gtk.Adjustment) b.GetObject("adjustment_audio_padding_before");
   m_adjustmentMaxImageHeight = (Gtk.Adjustment) b.GetObject("adjustment_max_image_height");
   m_adjustmentMaxImageWidth = (Gtk.Adjustment) b.GetObject("adjustment_max_image_width");
   m_episodeAdjustment = (Gtk.Adjustment) b.GetObject("episode_adjustment");
   m_image1 = (Gtk.Image) b.GetObject("image1");
   m_liststoreImageRescaleOptions = (Gtk.ListStore) b.GetObject("liststore_image_rescale_options");
   m_liststoreLanguages = (Gtk.ListStore) b.GetObject("liststore_languages");
   m_liststoreLines = (Gtk.ListStore) b.GetObject("liststore_lines");
   m_previewWindow = (Gtk.Window) b.GetObject("preview_window");
   m_box5 = (Gtk.Box) b.GetObject("box5");
   m_toolbarPreview = (Gtk.Toolbar) b.GetObject("toolbar_preview");
   m_toolbuttonGo = (Gtk.ToolButton) b.GetObject("toolbutton_go");
   m_toolbuttonRefresh = (Gtk.ToolButton) b.GetObject("toolbutton_refresh");
   m_toolbuttonSeparator1 = (Gtk.SeparatorToolItem) b.GetObject("toolbutton_separator1");
   m_toolbuttonSelectAll = (Gtk.ToolButton) b.GetObject("toolbutton_select_all");
   m_toolbuttonSelectNone = (Gtk.ToolButton) b.GetObject("toolbutton_select_none");
   m_toolbuttonInvert = (Gtk.ToolButton) b.GetObject("toolbutton_invert");
   m_toolbuttonSeparator2 = (Gtk.SeparatorToolItem) b.GetObject("toolbutton_separator2");
   m_toolbuttonToggleActivation = (Gtk.ToolButton) b.GetObject("toolbutton_toggle_activation");
   m_toolbuttonMerge = (Gtk.ToolButton) b.GetObject("toolbutton_merge");
   m_scrolledwindow1 = (Gtk.ScrolledWindow) b.GetObject("scrolledwindow1");
   m_treeviewLines = (Gtk.TreeView) b.GetObject("treeview_lines");
   m_treeviewSelectionLines = (Gtk.TreeSelection) b.GetObject("treeview-selection_lines");
   m_treeviewcolumnTargetLanguage = (Gtk.TreeViewColumn) b.GetObject("treeviewcolumn_target_language");
   m_cellrenderertextTargetLanguage = (Gtk.CellRendererText) b.GetObject("cellrenderertext_target_language");
   m_treeviewcolumnNativeLanguage = (Gtk.TreeViewColumn) b.GetObject("treeviewcolumn_native_language");
   m_cellrenderertextNativeLanguage = (Gtk.CellRendererText) b.GetObject("cellrenderertext_native_language");
   m_treeviewcolumnActors = (Gtk.TreeViewColumn) b.GetObject("treeviewcolumn_actors");
   m_cellrenderertextActors = (Gtk.CellRendererText) b.GetObject("cellrenderertext_actors");
   m_treeviewcolumnStart = (Gtk.TreeViewColumn) b.GetObject("treeviewcolumn_start");
   m_cellrendertextStart = (Gtk.CellRendererText) b.GetObject("cellrendertext_start");
   m_cellrendertextDuration = (Gtk.CellRendererText) b.GetObject("cellrendertext_duration");
   m_frame10 = (Gtk.Frame) b.GetObject("frame10");
   m_alignment10 = (Gtk.Alignment) b.GetObject("alignment10");
   m_grid4 = (Gtk.Grid) b.GetObject("grid4");
   m_buttonReplaceInSub2 = (Gtk.Button) b.GetObject("button_replace_in_sub2");
   m_buttonSelectLinesBySearch = (Gtk.Button) b.GetObject("button_select_lines_by_search");
   m_buttonReplaceInSub1 = (Gtk.Button) b.GetObject("button_replace_in_sub1");
   m_entryLinesSearch = (Gtk.Entry) b.GetObject("entry_lines_search");
   m_entryReplaceRegexTo = (Gtk.Entry) b.GetObject("entry_replace_regex_to");
   m_entryReplaceRegexFrom = (Gtk.Entry) b.GetObject("entry_replace_regex_from");
   m_label5 = (Gtk.Label) b.GetObject("label5");
   m_label17 = (Gtk.Label) b.GetObject("label17");
   m_labelNumCardsSelected = (Gtk.Label) b.GetObject("label_num_cards_selected");
   m_frame11 = (Gtk.Frame) b.GetObject("frame11");
   m_alignment11 = (Gtk.Alignment) b.GetObject("alignment11");
   m_box7 = (Gtk.Box) b.GetObject("box7");
   m_frame12 = (Gtk.Frame) b.GetObject("frame12");
   m_box11 = (Gtk.Box) b.GetObject("box11");
   m_eventboxImagePreview = (Gtk.EventBox) b.GetObject("eventbox_image_preview");
   m_imagePreview = (Gtk.Image) b.GetObject("image_preview");
   m_buttonPlayContent = (Gtk.Button) b.GetObject("button_play_content");
   m_label23 = (Gtk.Label) b.GetObject("label23");
   m_frame13 = (Gtk.Frame) b.GetObject("frame13");
   m_box12 = (Gtk.Box) b.GetObject("box12");
   m_scrolledwindow2 = (Gtk.ScrolledWindow) b.GetObject("scrolledwindow2");
   m_textviewTargetLanguage = (Gtk.TextView) b.GetObject("textview_target_language");
   m_scrolledwindow3 = (Gtk.ScrolledWindow) b.GetObject("scrolledwindow3");
   m_textviewNativeLanguage = (Gtk.TextView) b.GetObject("textview_native_language");
   m_label24 = (Gtk.Label) b.GetObject("label24");
   m_label22 = (Gtk.Label) b.GetObject("label22");
   m_liststoreSubEncoding = (Gtk.ListStore) b.GetObject("liststore_sub_encoding");
   m_liststoreSubStreams = (Gtk.ListStore) b.GetObject("liststore_sub_streams");
   m_subtitleOptionsWindow = (Gtk.Window) b.GetObject("subtitle_options_window");
   m_box13 = (Gtk.Box) b.GetObject("box13");
   m_frame14 = (Gtk.Frame) b.GetObject("frame14");
   m_comboboxSubEncoding = (Gtk.ComboBox) b.GetObject("combobox_sub_encoding");
   m_cellrenderertextSubEncoding = (Gtk.CellRendererText) b.GetObject("cellrenderertext_sub_encoding");
   m_label3 = (Gtk.Label) b.GetObject("label3");
   m_frame15 = (Gtk.Frame) b.GetObject("frame15");
   m_comboboxSubStream = (Gtk.ComboBox) b.GetObject("combobox_sub_stream");
   m_cellrendertextSubStreams = (Gtk.CellRendererText) b.GetObject("cellrendertext_sub_streams");
   m_label4 = (Gtk.Label) b.GetObject("label4");
   m_buttonSubOptionsApply = (Gtk.Button) b.GetObject("button_sub_options_apply");
   m_numericalAdjustmentSub1 = (Gtk.Adjustment) b.GetObject("numerical_adjustment_sub1");
   m_numericalAdjustmentSub2 = (Gtk.Adjustment) b.GetObject("numerical_adjustment_sub2");
   m_mainWindow = (Gtk.Window) b.GetObject("main_window");
   m_box1 = (Gtk.Box) b.GetObject("box1");
   m_menubar1 = (Gtk.MenuBar) b.GetObject("menubar1");
   m_menuitem1 = (Gtk.MenuItem) b.GetObject("menuitem1");
   m_menu1 = (Gtk.Menu) b.GetObject("menu1");
   m_imagemenuitemNew = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem_new");
   m_imagemenuitemOpen = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem_open");
   m_imagemenuitemSave = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem_save");
   m_imagemenuitemSaveAs = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem_save_as");
   m_separatormenuitem1 = (Gtk.SeparatorMenuItem) b.GetObject("separatormenuitem1");
   m_imagemenuitemClose = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem_close");
   m_menuitem3 = (Gtk.MenuItem) b.GetObject("menuitem3");
   m_menu3 = (Gtk.Menu) b.GetObject("menu3");
   m_imagemenuitem10 = (Gtk.ImageMenuItem) b.GetObject("imagemenuitem10");
   m_infobar1 = (Gtk.InfoBar) b.GetObject("infobar1");
   m_infobarActionArea = (Gtk.ButtonBox) b.GetObject("infobar-action_area");
   m_infobarContentArea = (Gtk.Box) b.GetObject("infobar-content_area");
   m_labelInInfobar = (Gtk.Label) b.GetObject("label_in_infobar");
   m_box2 = (Gtk.Box) b.GetObject("box2");
   m_frame1 = (Gtk.Frame) b.GetObject("frame1");
   m_alignment1 = (Gtk.Alignment) b.GetObject("alignment1");
   m_grid1 = (Gtk.Grid) b.GetObject("grid1");
   m_entryTargetLanguage = (Gtk.Entry) b.GetObject("entry_target_language");
   m_entryOutputDirectory = (Gtk.Entry) b.GetObject("entry_output_directory");
   m_entryNativeLanguage = (Gtk.Entry) b.GetObject("entry_native_language");
   m_entryVideoFile = (Gtk.Entry) b.GetObject("entry_video_file");
   m_buttonTargetLanguageChoose = (Gtk.Button) b.GetObject("button_target_language_choose");
   m_buttonDirectoryChoose = (Gtk.Button) b.GetObject("button_directory_choose");
   m_buttonNativeLanguageChoose = (Gtk.Button) b.GetObject("button_native_language_choose");
   m_buttonVideoFileChoose = (Gtk.Button) b.GetObject("button_video_file_choose");
   m_buttonTargetLanguageOptions = (Gtk.Button) b.GetObject("button_target_language_options");
   m_buttonNativeLanguageOptions = (Gtk.Button) b.GetObject("button_native_language_options");
   m_buttonVideoOptions = (Gtk.Button) b.GetObject("button_video_options");
   m_buttonAudioChoose = (Gtk.Button) b.GetObject("button_audio_choose");
   m_entryAudioFile = (Gtk.Entry) b.GetObject("entry_audio_file");
   m_label1 = (Gtk.Label) b.GetObject("label1");
   m_frame2 = (Gtk.Frame) b.GetObject("frame2");
   m_alignment2 = (Gtk.Alignment) b.GetObject("alignment2");
   m_grid5 = (Gtk.Grid) b.GetObject("grid5");
   m_expanderSubtitleOptions = (Gtk.Expander) b.GetObject("expander_subtitle_options");
   m_box9 = (Gtk.Box) b.GetObject("box9");
   m_frame4 = (Gtk.Frame) b.GetObject("frame4");
   m_alignment4 = (Gtk.Alignment) b.GetObject("alignment4");
   m_grid2 = (Gtk.Grid) b.GetObject("grid2");
   m_label8 = (Gtk.Label) b.GetObject("label8");
   m_label9 = (Gtk.Label) b.GetObject("label9");
   m_comboboxtextCorrectTimingsModeSub1 = (Gtk.ComboBoxText) b.GetObject("comboboxtext_correct_timings_mode_sub1");
   m_spinbuttonSub1TimeShift = (Gtk.SpinButton) b.GetObject("spinbutton_sub1_time_shift");
   m_label6 = (Gtk.Label) b.GetObject("label6");
   m_frame5 = (Gtk.Frame) b.GetObject("frame5");
   m_alignment5 = (Gtk.Alignment) b.GetObject("alignment5");
   m_grid3 = (Gtk.Grid) b.GetObject("grid3");
   m_label7 = (Gtk.Label) b.GetObject("label7");
   m_label10 = (Gtk.Label) b.GetObject("label10");
   m_comboboxtextCorrectTimingsModeSub2 = (Gtk.ComboBoxText) b.GetObject("comboboxtext_correct_timings_mode_sub2");
   m_spinbuttonSub2TimeShift = (Gtk.SpinButton) b.GetObject("spinbutton_sub2_time_shift");
   m_label12 = (Gtk.Label) b.GetObject("label12");
   m_frame3 = (Gtk.Frame) b.GetObject("frame3");
   m_alignment3 = (Gtk.Alignment) b.GetObject("alignment3");
   m_box3 = (Gtk.Box) b.GetObject("box3");
   m_checkbuttonUseSub1Timings = (Gtk.CheckButton) b.GetObject("checkbutton_use_sub1_timings");
   m_checkbuttonUseSub2Timings = (Gtk.CheckButton) b.GetObject("checkbutton_use_sub2_timings");
   m_label11 = (Gtk.Label) b.GetObject("label11");
   m_label20 = (Gtk.Label) b.GetObject("label20");
   m_expanderAudioOptions = (Gtk.Expander) b.GetObject("expander_audio_options");
   m_box15 = (Gtk.Box) b.GetObject("box15");
   m_frame17 = (Gtk.Frame) b.GetObject("frame17");
   m_alignment14 = (Gtk.Alignment) b.GetObject("alignment14");
   m_box16 = (Gtk.Box) b.GetObject("box16");
   m_checkbuttonNormalizeAudio = (Gtk.CheckButton) b.GetObject("checkbutton_normalize_audio");
   m_checkbuttonDeactivateAudioClips = (Gtk.CheckButton) b.GetObject("checkbutton_deactivate_audio_clips");
   m_label26 = (Gtk.Label) b.GetObject("label26");
   m_frame16 = (Gtk.Frame) b.GetObject("frame16");
   m_alignment13 = (Gtk.Alignment) b.GetObject("alignment13");
   m_grid6 = (Gtk.Grid) b.GetObject("grid6");
   m_label28 = (Gtk.Label) b.GetObject("label28");
   m_label29 = (Gtk.Label) b.GetObject("label29");
   m_spinbuttonAudioPaddingBefore = (Gtk.SpinButton) b.GetObject("spinbutton_audio_padding_before");
   m_spinbuttonAudioPaddingAfter = (Gtk.SpinButton) b.GetObject("spinbutton_audio_padding_after");
   m_label27 = (Gtk.Label) b.GetObject("label27");
   m_label53 = (Gtk.Label) b.GetObject("label53");
   m_expanderImageOptions = (Gtk.Expander) b.GetObject("expander_image_options");
   m_box17 = (Gtk.Box) b.GetObject("box17");
   m_frame19 = (Gtk.Frame) b.GetObject("frame19");
   m_alignment16 = (Gtk.Alignment) b.GetObject("alignment16");
   m_spinbuttonMaxImageWidth = (Gtk.SpinButton) b.GetObject("spinbutton_max_image_width");
   m_spinbuttonMaxImageHeight = (Gtk.SpinButton) b.GetObject("spinbutton_max_image_height");
   m_comboboxtextRescaleMode = (Gtk.ComboBox) b.GetObject("comboboxtext_rescale_mode");
   m_label13 = (Gtk.Label) b.GetObject("label13");
   m_label2 = (Gtk.Label) b.GetObject("label2");
   m_frame7 = (Gtk.Frame) b.GetObject("frame7");
   m_alignment7 = (Gtk.Alignment) b.GetObject("alignment7");
   m_label16 = (Gtk.Label) b.GetObject("label16");
   m_spinbuttonEpisodeNumber = (Gtk.SpinButton) b.GetObject("spinbutton_episode_number");
   m_entryDeckName = (Gtk.Entry) b.GetObject("entry_deck_name");
   m_label15 = (Gtk.Label) b.GetObject("label15");
   m_buttonPreview = (Gtk.Button) b.GetObject("button_preview");
   m_label18 = (Gtk.Label) b.GetObject("label18");
   m_label19 = (Gtk.Label) b.GetObject("label19");
   m_comboboxTargetLanguage = (Gtk.ComboBox) b.GetObject("combobox_target_language");
   m_label14 = (Gtk.Label) b.GetObject("label14");
   m_windowProgressInfo = (Gtk.Window) b.GetObject("window_progress_info");
   m_alignment12 = (Gtk.Alignment) b.GetObject("alignment12");
   m_box14 = (Gtk.Box) b.GetObject("box14");
   m_progressbarProgressInfo = (Gtk.ProgressBar) b.GetObject("progressbar_progress_info");
   m_buttonCancelOperation = (Gtk.Button) b.GetObject("button_cancel_operation");
 }