Example #1
0
        protected void AllocEventBox(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 (!NeedsEventBox)
            {
                return;
            }

            if (eventBox == null && !EventsRootWidget.GetHasWindow())
            {
                if (EventsRootWidget is Gtk.EventBox)
                {
                    ((Gtk.EventBox)EventsRootWidget).VisibleWindow = true;
                    return;
                }
                eventBox               = new Gtk.EventBox();
                eventBox.Visible       = Widget.Visible;
                eventBox.Sensitive     = Widget.Sensitive;
                eventBox.VisibleWindow = visibleWindow;
                GtkEngine.ReplaceChild(Widget, eventBox);
                eventBox.Add(Widget);
            }
        }
Example #2
0
        public ActionGroupEditor()
        {
            changedEvent = new ObjectWrapperEventHandler (OnActionChanged);

            Gtk.Fixed fx = new Gtk.Fixed ();
            table = new Gtk.Table (0, 0, false);
            table.RowSpacing = 8;
            table.ColumnSpacing = 8;
            table.BorderWidth = 12;

            Gtk.EventBox ebox = new Gtk.EventBox ();
            ebox.ModifyBg (Gtk.StateType.Normal, this.Style.Backgrounds [0]);
            headerLabel = new EditableLabel ();
            headerLabel.MarkupTemplate = "<b>$TEXT</b>";
            headerLabel.Changed += OnGroupNameChanged;
            Gtk.VBox vbox = new Gtk.VBox ();
            Gtk.Label grpLabel = new Gtk.Label ();
            grpLabel.Xalign = 0;
            grpLabel.Markup = "<small><i>Action Group</i></small>";
            //			vbox.PackStart (grpLabel, false, false, 0);
            vbox.PackStart (headerLabel, false, false, 3);
            vbox.BorderWidth = 12;
            ebox.Add (vbox);

            Gtk.VBox box = new Gtk.VBox ();
            box.Spacing = 6;
            box.PackStart (ebox, false, false, 0);
            box.PackStart (table, false, false, 0);

            fx.Put (box, 0, 0);
            Add (fx);
            ShowAll ();
        }
Example #3
0
        public ActionGroupEditor()
        {
            changedEvent = new ObjectWrapperEventHandler(OnActionChanged);

            Gtk.Fixed fx = new Gtk.Fixed();
            table               = new Gtk.Table(0, 0, false);
            table.RowSpacing    = 8;
            table.ColumnSpacing = 8;
            table.BorderWidth   = 12;

            Gtk.EventBox ebox = new Gtk.EventBox();
            ebox.ModifyBg(Gtk.StateType.Normal, this.Style.Backgrounds [0]);
            headerLabel = new EditableLabel();
            headerLabel.MarkupTemplate = "<b>$TEXT</b>";
            headerLabel.Changed       += OnGroupNameChanged;
            Gtk.VBox  vbox     = new Gtk.VBox();
            Gtk.Label grpLabel = new Gtk.Label();
            grpLabel.Xalign = 0;
            grpLabel.Markup = string.Format("<small><i>{0}</i></small>", Catalog.GetString("Action Group"));
//			vbox.PackStart (grpLabel, false, false, 0);
            vbox.PackStart(headerLabel, false, false, 3);
            vbox.BorderWidth = 12;
            ebox.Add(vbox);

            Gtk.VBox box = new Gtk.VBox();
            box.Spacing = 6;
            box.PackStart(ebox, false, false, 0);
            box.PackStart(table, false, false, 0);

            fx.Put(box, 0, 0);
            Add(fx);
            ShowAll();
        }
Example #4
0
        public void Initialize(PropertyDescriptor prop)
        {
            if (!prop.PropertyType.IsEnum)
            {
                throw new ApplicationException("Enumeration editor does not support editing values of type " + prop.PropertyType);
            }

            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;                     // The combo does not set the entry to the correct size when it does not have a frame
            combo.Show();
            ebox.Add(combo);

            tips = new Gtk.Tooltips();

            enm = Registry.LookupEnum(prop.PropertyType.FullName);
            foreach (Enum value in enm.Values)
            {
                combo.AppendText(enm[value].Label);
            }
        }
        //Add the shows to the table
        //Each one is stored in an eventbox
        protected void populateTable()
        {
            int curShow;

            if (isSearch)
            {
                curShow = start;
            }
            else
            {
                curShow = 0;
            }

            for (uint i = 0; i < 5; i++)
            {
                if (curShow >= shows.Count)
                {
                    break;
                }

                for (uint j = 0; j < 5; j++)
                {
                    if (curShow >= shows.Count)
                    {
                        break;
                    }

                    //show item
                    Gtk.Image img = new Gtk.Image();
                    if (shows[curShow].thumb != null)
                    {
                        img.Pixbuf = shows[curShow].thumb;
                    }

                    Gtk.Label lbl = new Gtk.Label(shows[curShow].title);
                    lbl.ModifyFont(Pango.FontDescription.FromString("12"));
                    Gtk.VBox box = new Gtk.VBox();
                    box.Add(img);
                    box.Add(lbl);
                    Gtk.EventBox eventbox = new Gtk.EventBox();
                    eventbox.Add(box);

                    //create event for clicking show
                    Func <Show, Gtk.ButtonPressEventHandler> ButtonPressWrapper = ((show) => ((s, e) => { OnShowSelected(s, e, show); }));
                    eventbox.ButtonPressEvent += ButtonPressWrapper(shows[curShow]);

                    //create hover events
                    Func <Gtk.EventBox, Gtk.EnterNotifyEventHandler> EnterNotifyWrapper = ((Gtk.EventBox eBox) => ((s, e) => { OnHoverEnter(s, e, eBox); }));
                    eventbox.EnterNotifyEvent += EnterNotifyWrapper(eventbox);

                    Func <Gtk.EventBox, Gtk.LeaveNotifyEventHandler> LeaveNotifyWrapper = ((Gtk.EventBox eBox) => ((s, e) => { OnHoverLeave(s, e, eBox); }));
                    eventbox.LeaveNotifyEvent += LeaveNotifyWrapper(eventbox);

                    table.Attach(eventbox, j, j + 1, i, i + 1);

                    curShow++;
                }
            }
        }
Example #6
0
        public NoteDialog(Gtk.Window parentWindow, ITask task)
            : base()
        {
            this.ParentWindow = parentWindow.GdkWindow;
            this.task = task;
            this.Title = String.Format(Catalog.GetString("Notes for: {0:s}"), task.Text);
            this.HasSeparator = false;
            this.SetSizeRequest(500,320);
            this.Icon = Utilities.GetIcon ("tasque", 16);
            //this.Flags = Gtk.DialogFlags.DestroyWithParent;

            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.HscrollbarPolicy = Gtk.PolicyType.Never;

            sw.BorderWidth = 0;
            sw.CanFocus = true;
            sw.Show ();

            Gtk.EventBox innerEb = new Gtk.EventBox();
            innerEb.BorderWidth = 0;

            targetVBox = new Gtk.VBox();
            targetVBox.BorderWidth = 5;
            targetVBox.Show ();
            innerEb.Add(targetVBox);
            innerEb.Show ();

            if(task.Notes != null) {
                foreach (var note in task.Notes) {
                    NoteWidget noteWidget = new NoteWidget (note);
                    noteWidget.TextChanged += OnNoteTextChanged;
                    noteWidget.DeleteButtonClicked += OnDeleteButtonClicked;
                    noteWidget.EditCanceled += OnEditCanceled;
                    noteWidget.Show ();
                    targetVBox.PackStart (noteWidget, false, false, 0);
                }
            }

            sw.AddWithViewport(innerEb);
            sw.Show ();

            VBox.PackStart (sw, true, true, 0);

            if(task.NoteSupport == NoteSupport.Multiple) {
                addButton = new Gtk.Button(Gtk.Stock.Add);
                addButton.Show();
                this.ActionArea.PackStart(addButton);
                addButton.Clicked += OnAddButtonClicked;
            }

            AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close);

            Response += delegate (object sender, Gtk.ResponseArgs args) {
                // Hide the window.  The TaskWindow watches for when the
                // dialog is hidden and will take care of the rest.
                Hide ();
            };
        }
Example #7
0
        void SetErrorMode()
        {
            Gtk.Label lab = new Gtk.Label();
            lab.Markup = "<b>" + Catalog.GetString("The form designer could not be loaded") + "</b>";
            Gtk.EventBox box = new Gtk.EventBox();
            box.Add(lab);

            widget     = Stetic.UserInterface.CreateWidgetDesigner(box, 100, 100);
            rootWidget = null;

            OnRootWidgetChanged();
        }
        //Add the seasons to the table
        //Each one is stored in an eventbox
        protected void populateTable()
        {
            int curSeason = start;

            for (uint i = 0; i < 5; i++)
            {
                if (curSeason >= show.numOfSeasons)
                {
                    break;
                }

                for (uint j = 0; j < 5; j++)
                {
                    if (curSeason >= show.numOfSeasons)
                    {
                        break;
                    }

                    //season item
                    Gtk.Image img = new Gtk.Image();
                    if (show.thumb != null)
                    {
                        img.Pixbuf = show.thumb;
                    }

                    Gtk.Label lbl = new Gtk.Label("Season " + (curSeason + 1).ToString());
                    lbl.ModifyFont(Pango.FontDescription.FromString("12"));

                    Gtk.VBox box = new Gtk.VBox();
                    box.Add(img);
                    box.Add(lbl);
                    Gtk.EventBox eventbox = new Gtk.EventBox();
                    eventbox.Add(box);

                    //create event for clicking season
                    Func <int, Gtk.ButtonPressEventHandler> ButtonPressWrapper = ((season) => ((s, e) => { OnSeasonSelected(s, e, season); }));
                    eventbox.ButtonPressEvent += ButtonPressWrapper(curSeason);

                    //create hover events
                    Func <Gtk.EventBox, Gtk.EnterNotifyEventHandler> EnterNotifyWrapper = ((Gtk.EventBox eBox) => ((s, e) => { OnHoverEnter(s, e, eBox); }));
                    eventbox.EnterNotifyEvent += EnterNotifyWrapper(eventbox);

                    Func <Gtk.EventBox, Gtk.LeaveNotifyEventHandler> LeaveNotifyWrapper = ((Gtk.EventBox eBox) => ((s, e) => { OnHoverLeave(s, e, eBox); }));
                    eventbox.LeaveNotifyEvent += LeaveNotifyWrapper(eventbox);

                    table.Attach(eventbox, j, j + 1, i, i + 1);

                    curSeason++;
                }
            }
        }
Example #9
0
        public void Initialize(EditSession session)
        {
            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);
            }
        }
        //Add the seasons to the table
        //Each one is stored in an eventbox
        protected void populateTable()
        {
            int curEpisode = start;

            for (uint i = 0; i < 5; i++)
            {
                if (curEpisode >= season.episodes.Count)
                {
                    break;
                }

                for (uint j = 0; j < 5; j++)
                {
                    if (curEpisode >= season.episodes.Count)
                    {
                        break;
                    }

                    //episode item
                    Gtk.Image img = new Gtk.Image();
                    if (season.episodes[curEpisode].thumb != null)
                    {
                        img.Pixbuf = season.episodes[curEpisode].thumb;
                    }

                    Gtk.Label lbl = new Gtk.Label((curEpisode + 1).ToString() + ". " + season.episodes[curEpisode].title);
                    lbl.ModifyFont(Pango.FontDescription.FromString("12"));
                    Gtk.VBox box = new Gtk.VBox();
                    box.Add(img);
                    box.Add(lbl);
                    Gtk.EventBox eventbox = new Gtk.EventBox();
                    eventbox.Add(box);

                    //create event for clicking an episode
                    Func <Episode, Gtk.ButtonPressEventHandler> ButtonPressWrapper = ((ep) => ((s, e) => { OnEpisodeSelected(s, e, ep); }));
                    eventbox.ButtonPressEvent += ButtonPressWrapper(season.episodes[curEpisode]);

                    //create hover events
                    Func <Gtk.EventBox, Gtk.EnterNotifyEventHandler> EnterNotifyWrapper = ((Gtk.EventBox eBox) => ((s, e) => { OnHoverEnter(s, e, eBox); }));
                    eventbox.EnterNotifyEvent += EnterNotifyWrapper(eventbox);

                    Func <Gtk.EventBox, Gtk.LeaveNotifyEventHandler> LeaveNotifyWrapper = ((Gtk.EventBox eBox) => ((s, e) => { OnHoverLeave(s, e, eBox); }));
                    eventbox.LeaveNotifyEvent += LeaveNotifyWrapper(eventbox);

                    table.Attach(eventbox, j, j + 1, i, i + 1);

                    curEpisode++;
                }
            }
        }
Example #11
0
        public void Initialize(EditSession session)
        {
            PropertyDescriptor prop = session.Property;

            if (!prop.PropertyType.IsEnum)
            {
                throw new ApplicationException("Enumeration editor does not support editing values of type " + prop.PropertyType);
            }

            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 (object value in values)
            {
                string str = prop.Converter.ConvertToString(value);
                if (names.Contains(str))
                {
                    str = (string)names [str];
                }
                combo.AppendText(str);
            }
        }
Example #12
0
        void AllocEventBox(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 (eventBox == null && EventsRootWidget.IsNoWindow)
            {
                eventBox               = new Gtk.EventBox();
                eventBox.Visible       = Widget.Visible;
                eventBox.Sensitive     = Widget.Sensitive;
                eventBox.VisibleWindow = visibleWindow;
                GtkEngine.ReplaceChild(Widget, eventBox);
                eventBox.Add(Widget);
            }
        }
Example #13
0
        void PlaceAddLabel(int n)
        {
            HideAddLabel();

            uint r = (uint)n / columns;
            uint c = (uint)(n % columns) * 3;

            emptyLabel = new Gtk.EventBox();
            emptyLabel.VisibleWindow = false;
            Gtk.Label label = new Gtk.Label();
            label.Xalign = 0;
            label.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString("Click to create action") + "</span></i>";
            emptyLabel.Add(label);
            emptyLabel.ButtonPressEvent += OnAddClicked;
            table.Attach(emptyLabel, c, c + 3, r, r + 1);
        }
Example #14
0
        private void AddToTable(uint row, uint col, Gtk.Widget control, uint colSpan = 1)
        {
            var box = new Gtk.EventBox();
            var al  = new Gtk.Alignment(0, 0, control.GetType() == typeof(Gtk.Entry) ? 1 : 0, 1);

            al.SetPadding(0, 0, 5, 5);
            al.Add(control);
            box.Add(al);

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

            tblContainer.Attach(box, col, col + colSpan, row, row + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);
        }
        void Fill()
        {
            menuItems.Clear();

            uint           n        = 0;
            ActionMenuItem editItem = null;

            if (nodes.Count > 0)
            {
                foreach (ActionTreeNode node in nodes)
                {
                    ActionMenuItem item = new ActionMenuItem(wrapper, this, node);
                    item.KeyPressEvent += OnItemKeyPress;
                    item.Attach(table, n++, 0);
                    menuItems.Add(item);
                    // If adding an action with an empty name, select and start editing it
//					if (node.Action != null && node.Action.Name.Length == 0)
//						editItem = item;
                }
            }

            emptyLabel = new Gtk.EventBox();
            emptyLabel.VisibleWindow = false;
            Gtk.Label label = new Gtk.Label();
            label.Xalign = 0;
            label.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString("Click to create action") + "</span></i>";
            emptyLabel.Add(label);
            emptyLabel.ButtonPressEvent += OnAddClicked;
            table.Attach(emptyLabel, 1, 2, n, n + 1);

            ShowAll();

            if (editItem != null)
            {
                // If there is an item with an empty action, it means that it was an item that was
                // being edited. Restart the editing now.
                GLib.Timeout.Add(200, delegate
                {
                    editItem.Select();
                    editItem.EditingDone += OnEditingDone;
                    editItem.StartEditing();
                    return(false);
                });
            }
        }
Example #16
0
        public DamageControlTrayIcon()
        {
            Gtk.Application.Init();
            this.icon = new TrayIcon("DamageControl Monitor");

            InitializeSettings();
            Gtk.EventBox eb = new Gtk.EventBox();

            eb.ButtonPressEvent += new Gtk.ButtonPressEventHandler(IconClicked);
            pixbuf = new Gdk.Pixbuf(null, "gray-24.png");
            image  = new Gtk.Image(pixbuf);
            eb.Add(image);

            this.menu     = new Gtk.Menu();
            this.projects = MonoTray.LoadSettings();

            foreach (Project p in this.projects)
            {
                p.StartPolling();
            }

            Gtk.AccelGroup    ac_quit = new Gtk.AccelGroup();
            Gtk.ImageMenuItem it_quit = new Gtk.ImageMenuItem(Gtk.Stock.Quit, ac_quit);
            it_quit.Activated += new EventHandler(QuitSelected);


            Gtk.AccelGroup    ac_settings = new Gtk.AccelGroup();
            Gtk.ImageMenuItem it_settings = new Gtk.ImageMenuItem(Gtk.Stock.Preferences, ac_settings);
            it_settings.Activated += new EventHandler(SettingsSelected);

            menu.Append(it_settings);
            menu.Append(it_quit);


            this.icon.Add(eb);

            this.icon.ShowAll();

            UpdateProxy();
            UpdateProjectList();

            Gtk.Application.Run();
        }
Example #17
0
        public void AddMessage(Message msg)
        {
            if (msg.messageType == Message.Type.TEXT)
            {
                string header = msg.src.Username + ": ";
                string main   = msg.content + "\n";

                Gtk.Application.Invoke(delegate
                {
                    Gtk.TextIter iter = chatview.Buffer.EndIter;

                    chatview.Buffer.InsertWithTagsByName(ref iter, header, msg.src.Username);
                    chatview.Buffer.InsertWithTagsByName(ref iter, main, "default");
                });
            }
            else
            {
                Console.WriteLine("[Received File] {0}", msg.fileName);
                string header = msg.src.Username + ": ";

                Gtk.Application.Invoke(delegate
                {
                    Gtk.TextIter iter = chatview.Buffer.EndIter;

                    chatview.Buffer.InsertWithTagsByName(ref iter, header, msg.src.Username);
                    string a = "Received File: ";
                    if (msg.src == src)
                    {
                        a = "Sent File: ";
                    }
                    chatview.Buffer.InsertWithTagsByName(ref iter, a, "default");
                    Gtk.EventBox eb      = new Gtk.EventBox();
                    eb.ButtonPressEvent += (s, e) => SaveFile(msg);
                    Gtk.Label label      = new Gtk.Label(msg.fileName);
                    eb.Add(label);
                    Gtk.TextChildAnchor anchor = chatview.Buffer.CreateChildAnchor(ref iter);
                    chatview.AddChildAtAnchor(eb, anchor);
                    eb.ShowAll();
                    chatview.Buffer.InsertWithTagsByName(ref iter, "\n", "default");
                });
            }
        }
Example #18
0
		void AddCreateItemLabel ()
		{
			HideSpacerItem ();
			Gtk.EventBox ebox = new Gtk.EventBox ();
			ebox.VisibleWindow = false;
			Gtk.Label emptyLabel = new Gtk.Label ();
			emptyLabel.Xalign = 0;
			if (this.Orientation == Gtk.Orientation.Vertical)
				emptyLabel.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString ("New\nbutton") + "</span></i>";
			else
				emptyLabel.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString ("New button") + "</span></i>";
			ebox.BorderWidth = 3;
			ebox.Add (emptyLabel);
			Gtk.ToolItem mit = new Gtk.ToolItem ();
			mit.Child = ebox;
			ebox.ButtonPressEvent += OnNewItemPress;
			Insert (mit, -1);
			mit.ShowAll ();
			addLabel = mit;
		}
Example #19
0
		public void Initialize (PropertyDescriptor prop)
		{
			if (!prop.PropertyType.IsEnum)
				throw new ApplicationException ("Enumeration editor does not support editing values of type " + prop.PropertyType);
				
			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;	// The combo does not set the entry to the correct size when it does not have a frame
			combo.Show ();
			ebox.Add (combo);

			enm = Registry.LookupEnum (prop.PropertyType.FullName);
			foreach (Enum value in enm.Values)
				combo.AppendText (enm[value].Label);
		}
Example #20
0
        void AllocEventBox()
        {
            // Wraps the widget with an event box. Required for some
            // widgets such as Label which doesn't have its own gdk window

            if (eventBox == null && EventsRootWidget.IsNoWindow)
            {
                eventBox           = new Gtk.EventBox();
                eventBox.Visible   = Widget.Visible;
                eventBox.Sensitive = Widget.Sensitive;
                if (alignment != null)
                {
                    alignment.Remove(alignment.Child);
                    alignment.Add(eventBox);
                }
                else
                {
                    GtkEngine.ReplaceChild(Widget, eventBox);
                }
                eventBox.Add(Widget);
            }
        }
Example #21
0
        public Gtk.Widget AllocEventBox(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;
                GtkEngine.ReplaceChild(widget, eventBox);
                eventBox.Add(widget);
                return(eventBox);
            }
            return(widget);
        }
 void AddCreateItemLabel()
 {
     HideSpacerItem();
     Gtk.EventBox ebox = new Gtk.EventBox();
     ebox.VisibleWindow = false;
     Gtk.Label emptyLabel = new Gtk.Label();
     emptyLabel.Xalign = 0;
     if (this.Orientation == Gtk.Orientation.Vertical)
     {
         emptyLabel.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString("New\nbutton") + "</span></i>";
     }
     else
     {
         emptyLabel.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString("New button") + "</span></i>";
     }
     ebox.BorderWidth = 3;
     ebox.Add(emptyLabel);
     Gtk.ToolItem mit = new Gtk.ToolItem();
     mit.Child              = ebox;
     ebox.ButtonPressEvent += OnNewItemPress;
     Insert(mit, -1);
     mit.ShowAll();
     addLabel = mit;
 }
Example #23
0
        public ChatView(ChatModel chat)
        {
            Trace.Call(chat);

            _ChatModel = chat;
            _Name = _ChatModel.Name;
            Name = _Name;

            // TextTags
            Gtk.TextTagTable ttt = new Gtk.TextTagTable();
            _OutputTextTagTable = ttt;
            Gtk.TextTag tt;
            Pango.FontDescription fd;

            tt = new Gtk.TextTag("bold");
            fd = new Pango.FontDescription();
            fd.Weight = Pango.Weight.Bold;
            tt.FontDesc = fd;
            ttt.Add(tt);

            tt = new Gtk.TextTag("italic");
            fd = new Pango.FontDescription();
            fd.Style = Pango.Style.Italic;
            tt.FontDesc = fd;
            ttt.Add(tt);

            tt = new Gtk.TextTag("underline");
            tt.Underline = Pango.Underline.Single;
            ttt.Add(tt);

            tt = new Gtk.TextTag("url");
            tt.Underline = Pango.Underline.Single;
            tt.Foreground = "darkblue";
            tt.TextEvent += new Gtk.TextEventHandler(_OnTextTagUrlTextEvent);
            fd = new Pango.FontDescription();
            tt.FontDesc = fd;
            ttt.Add(tt);

            Gtk.TextView tv = new Gtk.TextView();
            tv.Buffer = new Gtk.TextBuffer(ttt);
            _EndMark = tv.Buffer.CreateMark("end", tv.Buffer.EndIter, false);
            tv.Editable = false;
            //tv.CursorVisible = false;
            tv.CursorVisible = true;
            tv.WrapMode = Gtk.WrapMode.Char;
            tv.Buffer.Changed += new EventHandler(_OnTextBufferChanged);
            tv.MotionNotifyEvent += new Gtk.MotionNotifyEventHandler(_OnMotionNotifyEvent);
            _OutputTextView = tv;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            //sw.HscrollbarPolicy = Gtk.PolicyType.Never;
            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Always;
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Add(_OutputTextView);
            _OutputScrolledWindow = sw;

            // popup menu
            _TabMenu = new Gtk.Menu();

            Gtk.ImageMenuItem close_item = new Gtk.ImageMenuItem(Gtk.Stock.Close, null);
            close_item.Activated += new EventHandler(OnTabMenuCloseActivated);
            _TabMenu.Append(close_item);

            //FocusChild = _OutputTextView;
            //CanFocus = false;

            _TabLabel = new Gtk.Label();
            _TabLabel.Text = _Name;

            _TabHBox = new Gtk.HBox();
            _TabHBox.PackEnd(new Gtk.Fixed(), true, true, 0);
            _TabHBox.PackEnd(_TabLabel, false, false, 0);
            _TabHBox.ShowAll();

            _TabEventBox = new Gtk.EventBox();
            _TabEventBox.VisibleWindow = false;
            _TabEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnTabButtonPress);
            _TabEventBox.Add(_TabHBox);
            _TabEventBox.ShowAll();
        }
Example #24
0
        public ChatView(ChatModel chat)
        {
            Trace.Call(chat);

            _ChatModel = chat;

            IsAutoScrolling = true;
            MessageTextView tv = new MessageTextView();

            _EndMark               = tv.Buffer.CreateMark("end", tv.Buffer.EndIter, false);
            tv.ShowTimestamps      = true;
            tv.ShowMarkerline      = true;
            tv.Editable            = false;
            tv.CursorVisible       = true;
            tv.WrapMode            = Gtk.WrapMode.Char;
            tv.MessageAdded       += OnMessageTextViewMessageAdded;
            tv.MessageHighlighted += OnMessageTextViewMessageHighlighted;
            tv.PopulatePopup      += OnMessageTextViewPopulatePopup;
            tv.SizeRequested      += delegate {
                AutoScroll();
            };
            _OutputMessageTextView = tv;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            _OutputScrolledWindow = sw;
            //sw.HscrollbarPolicy = Gtk.PolicyType.Never;
            sw.HscrollbarPolicy          = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy          = Gtk.PolicyType.Always;
            sw.ShadowType                = Gtk.ShadowType.In;
            sw.Vadjustment.ValueChanged += delegate {
                CheckAutoScroll();
            };
            sw.Add(_OutputMessageTextView);

            // popup menu
            _TabMenu = new Gtk.Menu();

            Gtk.ImageMenuItem close_item = new Gtk.ImageMenuItem(Gtk.Stock.Close, null);
            close_item.Activated += new EventHandler(OnTabMenuCloseActivated);
            _TabMenu.Append(close_item);
            _TabMenu.ShowAll();

            //FocusChild = _OutputTextView;
            //CanFocus = false;

            _TabLabel = new Gtk.Label();

            TabImage = DefaultTabImage;
            _TabHBox = new Gtk.HBox();
            _TabHBox.PackEnd(new Gtk.Fixed(), true, true, 0);
            _TabHBox.PackEnd(_TabLabel, false, false, 0);
            _TabHBox.PackStart(TabImage, false, false, 2);
            _TabHBox.ShowAll();

            _TabEventBox = new Gtk.EventBox();
            _TabEventBox.VisibleWindow     = false;
            _TabEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnTabButtonPress);
            _TabEventBox.Add(_TabHBox);
            _TabEventBox.ShowAll();

            _ThemeSettings = new ThemeSettings();

            // OPT-TODO: this should use a TaskStack instead of TaskQueue
            _LastSeenHighlightQueue = new TaskQueue("LastSeenHighlightQueue(" + ID + ")");
            _LastSeenHighlightQueue.AbortedEvent   += OnLastSeenHighlightQueueAbortedEvent;
            _LastSeenHighlightQueue.ExceptionEvent += OnLastSeenHighlightQueueExceptionEvent;
        }
		public void Initialize (EditSession session)
		{
            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);
			}
		}
Example #26
0
        private void BuildCard()
        {
            var eventBoxEmail1     = new Gtk.EventBox();
            var eventBoxEmail2     = new Gtk.EventBox();
            var eventBoxAddress    = new Gtk.EventBox();
            var vbCardMain         = new Gtk.VBox(false, 5);
            var hbName             = new Gtk.HBox(false, 0);
            var hbAddress          = new Gtk.HBox(false, 0);
            var hbMainContact      = new Gtk.HBox(false, 0);
            var hbSecondaryContact = new Gtk.HBox(false, 0);

            // Frame
            this.frmCard             = new Gtk.Frame();
            this.frmCard.LabelWidget = new Gtk.Label()
            {
                Markup = "<b>Contact</b>"
            };

            // Name
            this.lblName    = new Gtk.Label(EtqNotAvailable);
            this.lblSurname = new Gtk.Label(EtqNotAvailable);
            vbCardMain.PackStart(hbName, false, false, 0);
            hbName.PackStart(this.lblSurname, false, false, 5);
            hbName.PackStart(this.lblName, false, false, 5);

            // Address
            this.lblAddress = new Gtk.Label(EtqNotAvailable);
            eventBoxAddress.Add(this.lblAddress);
            eventBoxAddress.ButtonPressEvent += (o, args) => this.OnAddressClicked();
            this.lblHomePhone = new Gtk.Label(EtqNotAvailable);
            vbCardMain.PackStart(hbAddress, false, false, 0);
            hbAddress.PackStart(eventBoxAddress, false, false, 5);
            hbAddress.PackStart(new Gtk.VSeparator(), false, false, 5);
            hbAddress.PackStart(this.lblHomePhone, false, false, 5);

            // Main contact
            this.lblMobilePhone = new Gtk.Label(EtqNotAvailable);
            this.lblEmail       = new Gtk.Label(EtqNotAvailable);
            eventBoxEmail1.Add(this.lblEmail);
            eventBoxEmail1.ButtonPressEvent += (o, args) => this.OnLblEmail1Clicked();
            vbCardMain.PackStart(hbMainContact, false, false, 0);
            hbMainContact.PackStart(this.lblMobilePhone, false, false, 5);
            hbMainContact.PackStart(new Gtk.VSeparator(), false, false, 5);
            hbMainContact.PackStart(eventBoxEmail1, false, false, 5);

            // Secondary contact
            this.lblWorkPhone = new Gtk.Label(EtqNotAvailable);
            this.lblEmail2    = new Gtk.Label(EtqNotAvailable);
            eventBoxEmail2.Add(this.lblEmail2);
            eventBoxEmail2.ButtonPressEvent += (o, args) => this.OnLblEmail2Clicked();
            vbCardMain.PackStart(hbSecondaryContact, false, false, 0);
            hbSecondaryContact.PackStart(this.lblWorkPhone, false, false, 5);
            hbSecondaryContact.PackStart(new Gtk.VSeparator(), false, false, 5);
            hbSecondaryContact.PackStart(eventBoxEmail2, false, false, 5);

            this.frmCard.Add(vbCardMain);
            this.vbMain.PackStart(this.frmCard, false, false, 5);

            // Card labels
            this.lblSurname.ModifyFont(
                Pango.FontDescription.FromString("Times 18")
                );

            this.lblName.ModifyFont(
                Pango.FontDescription.FromString("Times 18")
                );

            this.lblMobilePhone.ModifyFont(
                Pango.FontDescription.FromString("Times 14")
                );

            this.lblWorkPhone.ModifyFont(
                Pango.FontDescription.FromString("Times 14")
                );

            this.lblAddress.ModifyFont(
                Pango.FontDescription.FromString("Times 14")
                );

            this.lblMobilePhone.ModifyFont(
                Pango.FontDescription.FromString("Times 14")
                );

            this.lblEmail.ModifyFont(
                Pango.FontDescription.FromString("Mono 14")
                );

            this.lblEmail2.ModifyFont(
                Pango.FontDescription.FromString("Mono 14")
                );
        }
Example #27
0
        void PlaceAddLabel(int n)
        {
            HideAddLabel ();

            uint r = (uint) n / columns;
            uint c = (uint) (n % columns) * 3;

            emptyLabel = new Gtk.EventBox ();
            emptyLabel.VisibleWindow = false;
            Gtk.Label label = new Gtk.Label ();
            label.Xalign = 0;
            label.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString ("Click to create action") + "</span></i>";
            emptyLabel.Add (label);
            emptyLabel.ButtonPressEvent += OnAddClicked;
            table.Attach (emptyLabel, c, c+3, r, r+1);
        }
Example #28
0
 private void Build()
 {
     global::Stetic.Gui.Initialize(this);
     // Widget Client.Forms.Notification
     this.Name = "notification";
     this.Title = "Notification";
     this.TypeHint = Gdk.WindowTypeHint.Normal;
     this.WindowPosition = ((global::Gtk.WindowPosition)(4));
     // Container child Client.Forms.Notification.Gtk.Container+ContainerChild
     this.vbox1 = new global::Gtk.VBox();
     this.vbox1.Name = "vbox1";
     this.Icon = Gdk.Pixbuf.LoadFromResource("Client.Resources.pigeon_clip_art_hight.ico");
     this.vbox1.Spacing = 6;
     // Container child vbox1.Gtk.Box+BoxChild
     this.label1 = new global::Gtk.Label();
     this.label1.HeightRequest = 20;
     this.label1.Name = "label1";
     this.label1.LabelProp = "Notification";
     this.vbox1.Add(this.label1);
     global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.label1]));
     w1.Position = 0;
     w1.Expand = false;
     w1.Fill = false;
     // Container child vbox1.Gtk.Box+BoxChild
     this.hbox1 = new global::Gtk.HBox();
     this.hbox1.Name = "hbox1";
     this.hbox1.Spacing = 6;
     // Container child hbox1.Gtk.Box+BoxChild
     this.image1 = new global::Gtk.Image();
     this.image1.Name = "image1";
     this.image1.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("Client.Resources.icon.png");
     this.hbox1.Add(this.image1);
     global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.image1]));
     w2.Position = 0;
     w2.Expand = false;
     w2.Fill = false;
     // Container child hbox1.Gtk.Box+BoxChild
     this.label2 = new global::Gtk.Label();
     this.label2.Name = "label2";
     this.label2.WidthRequest = 260;
     this.label2.Wrap = true;
     this.label2.LabelProp = "Description";
     this.hbox1.Add(this.label2);
     global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.label2]));
     w3.Position = 1;
     w3.Expand = false;
     w3.Fill = false;
     this.vbox1.Add(this.hbox1);
     global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox1]));
     w4.Position = 1;
     w4.Expand = false;
     w4.Fill = false;
     root = new Gtk.EventBox();
     root.ModifyBg(Gtk.StateType.Normal, Core.FromColor(System.Drawing.Color.Orange));
     root.Add(this.vbox1);
     this.Decorated = false;
     this.Add(root);
     if ((this.Child != null))
     {
         this.Child.ShowAll();
     }
     this.DefaultWidth = 460;
     this.DefaultHeight = 220;
 }
Example #29
0
        public void Load(Widget w)
        {
            var wb = (IGtkWidgetBackend)WidgetRegistry.GetBackend(w);

            box.Add(wb.Widget);
        }
        public void Initialize(EditSession session)
        {
            PropertyDescriptor prop = session.Property;

            if (!prop.PropertyType.IsEnum)
                throw new ApplicationException (Catalog.GetString("Enumeration editor does not support editing values of type ") + prop.PropertyType);

            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 (object value in values) {
                string str = prop.Converter.ConvertToString (value);
                if (names.Contains (str))
                    str = (string) names [str];
                combo.AppendText (str);
            }
        }
Example #31
0
		void Fill ()
		{
			menuItems.Clear ();

			uint n = 0;
			ActionMenuItem editItem = null;
			
			if (nodes.Count > 0) {
				foreach (ActionTreeNode node in nodes) {
					ActionMenuItem item = new ActionMenuItem (wrapper, this, node);
					item.KeyPressEvent += OnItemKeyPress;
					item.Attach (table, n++, 0);
					menuItems.Add (item);
					// If adding an action with an empty name, select and start editing it
//					if (node.Action != null && node.Action.Name.Length == 0)
//						editItem = item;
				}
			}
			
			emptyLabel = new Gtk.EventBox ();
			emptyLabel.VisibleWindow = false;
			Gtk.Label label = new Gtk.Label ();
			label.Xalign = 0;
			label.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString ("Click to create action") + "</span></i>";
			emptyLabel.Add (label);
			emptyLabel.ButtonPressEvent += OnAddClicked;
			table.Attach (emptyLabel, 1, 2, n, n + 1);
			
			ShowAll ();
			
			if (editItem != null) {
				// If there is an item with an empty action, it means that it was an item that was
				// being edited. Restart the editing now.
				GLib.Timeout.Add (200, delegate {
					editItem.Select ();
					editItem.EditingDone += OnEditingDone;
					editItem.StartEditing ();
					return false;
				});
			}
		}
Example #32
0
        //populate the table with the sources
        //each source is in an eventbox
        protected void populateTable()
        {
            List <string> srcs = sources.Keys.ToList();

            //change what will be displayed based on the active source
            switch (activeSource)
            {
            case Source.All:
                break;

            case Source.Hulu:
                if (srcs.Contains("Hulu"))
                {
                    srcs = new List <string> {
                        "Hulu"
                    }
                }
                ;
                else
                {
                    srcs = new List <string> ();
                }
                break;

            case Source.Amazon:
                if (srcs.Contains("Amazon"))
                {
                    srcs = new List <string> {
                        "Amazon"
                    }
                }
                ;
                else
                {
                    srcs = new List <string> ();
                }
                break;

            case Source.YouTube:
                if (srcs.Contains("YouTube"))
                {
                    srcs = new List <string> {
                        "YouTube"
                    }
                }
                ;
                else
                {
                    srcs = new List <string> ();
                }
                break;
            }

            //loop through table
            int curSource = 0;

            for (uint i = 0; i < 1; i++)
            {
                if (curSource >= srcs.Count)
                {
                    break;
                }

                for (uint j = 0; j < 3; j++)
                {
                    if (curSource >= srcs.Count)
                    {
                        break;
                    }

                    //image for the sources are stored in the MainWindow
                    Gtk.Image img = new Gtk.Image();
                    if (srcs [curSource] == "Hulu")
                    {
                        img.Pixbuf = MainWindow.huluLogo;
                    }
                    else if ((srcs[curSource] == "Amazon"))
                    {
                        img.Pixbuf = MainWindow.amazonLogo;
                    }
                    else if ((srcs[curSource] == "YouTube"))
                    {
                        img.Pixbuf = MainWindow.youtubeLogo;
                    }


                    //source item
                    Gtk.Label lbl = new Gtk.Label(srcs[curSource]);
                    lbl.ModifyFont(Pango.FontDescription.FromString("12"));
                    Gtk.VBox box = new Gtk.VBox();
                    box.Add(img);
                    box.Add(lbl);
                    Gtk.EventBox eventbox = new Gtk.EventBox();
                    eventbox.Add(box);

                    //create event for clicking a source
                    Func <string, Gtk.ButtonPressEventHandler> ButtonPressWrapper = ((src) => ((s, e) => { OnSourceSelected(s, e, src); }));
                    eventbox.ButtonPressEvent += ButtonPressWrapper(srcs[curSource]);

                    //create hover events
                    Func <Gtk.EventBox, Gtk.EnterNotifyEventHandler> EnterNotifyWrapper = ((Gtk.EventBox eBox) => ((s, e) => { OnHoverEnter(s, e, eBox); }));
                    eventbox.EnterNotifyEvent += EnterNotifyWrapper(eventbox);

                    Func <Gtk.EventBox, Gtk.LeaveNotifyEventHandler> LeaveNotifyWrapper = ((Gtk.EventBox eBox) => ((s, e) => { OnHoverLeave(s, e, eBox); }));
                    eventbox.LeaveNotifyEvent += LeaveNotifyWrapper(eventbox);


                    table.Attach(eventbox, j, j + 1, i, i + 1);

                    curSource++;
                    if (curSource >= sources.Keys.Count)
                    {
                        break;
                    }
                }
            }
        }
Example #33
0
        public NoteDialog(Gtk.Window parentWindow, ITask task)
            : base()
        {
            this.ParentWindow = parentWindow.GdkWindow;
            this.task         = task;
            this.Title        = String.Format(Catalog.GetString("Notes for: {0:s}"), task.Text);
            this.HasSeparator = false;
            this.SetSizeRequest(500, 320);
            this.Icon = Utilities.GetIcon("tasque", 16);
            //this.Flags = Gtk.DialogFlags.DestroyWithParent;


            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.HscrollbarPolicy = Gtk.PolicyType.Never;

            sw.BorderWidth = 0;
            sw.CanFocus    = true;
            sw.Show();

            Gtk.EventBox innerEb = new Gtk.EventBox();
            innerEb.BorderWidth = 0;


            targetVBox             = new Gtk.VBox();
            targetVBox.BorderWidth = 5;
            targetVBox.Show();
            innerEb.Add(targetVBox);
            innerEb.Show();

            if (task.Notes != null)
            {
                foreach (var note in task.Notes)
                {
                    NoteWidget noteWidget = new NoteWidget(note);
                    noteWidget.TextChanged         += OnNoteTextChanged;
                    noteWidget.DeleteButtonClicked += OnDeleteButtonClicked;
                    noteWidget.EditCanceled        += OnEditCanceled;
                    noteWidget.Show();
                    targetVBox.PackStart(noteWidget, false, false, 0);
                }
            }

            sw.AddWithViewport(innerEb);
            sw.Show();

            VBox.PackStart(sw, true, true, 0);

            if (task.NoteSupport == NoteSupport.Multiple)
            {
                addButton = new Gtk.Button(Gtk.Stock.Add);
                addButton.Show();
                this.ActionArea.PackStart(addButton);
                addButton.Clicked += OnAddButtonClicked;
            }

            AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close);

            Response += delegate(object sender, Gtk.ResponseArgs args) {
                // Hide the window.  The TaskWindow watches for when the
                // dialog is hidden and will take care of the rest.
                Hide();
            };
        }
Example #34
0
        public void Load(Widget w)
        {
            var wb = (IGtkWidgetBackend)Toolkit.GetBackend(w);

            box.Add(wb.Widget);
        }
Example #35
0
        public ChatView(ChatModel chat)
        {
            Trace.Call(chat);

            _ChatModel = chat;
            _Name = _ChatModel.Name;
            ID = _ChatModel.ID;
            Name = _Name;

            MessageTextView tv = new MessageTextView();
            _EndMark = tv.Buffer.CreateMark("end", tv.Buffer.EndIter, false);
            tv.ShowTimestamps = true;
            tv.ShowMarkerline = true;
            tv.Editable = false;
            tv.CursorVisible = true;
            tv.WrapMode = Gtk.WrapMode.Char;
            tv.MessageAdded += OnMessageTextViewMessageAdded;
            tv.MessageHighlighted += OnMessageTextViewMessageHighlighted;
            tv.PopulatePopup += OnMessageTextViewPopulatePopup;
            _OutputMessageTextView = tv;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            //sw.HscrollbarPolicy = Gtk.PolicyType.Never;
            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Always;
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Add(_OutputMessageTextView);
            _OutputScrolledWindow = sw;

            // popup menu
            _TabMenu = new Gtk.Menu();

            Gtk.ImageMenuItem close_item = new Gtk.ImageMenuItem(Gtk.Stock.Close, null);
            close_item.Activated += new EventHandler(OnTabMenuCloseActivated);
            _TabMenu.Append(close_item);
            _TabMenu.ShowAll();

            //FocusChild = _OutputTextView;
            //CanFocus = false;

            _TabLabel = new Gtk.Label();
            _TabLabel.Text = _Name;

            _TabHBox = new Gtk.HBox();
            _TabHBox.PackEnd(new Gtk.Fixed(), true, true, 0);
            _TabHBox.PackEnd(_TabLabel, false, false, 0);
            _TabHBox.ShowAll();

            _TabEventBox = new Gtk.EventBox();
            _TabEventBox.VisibleWindow = false;
            _TabEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnTabButtonPress);
            _TabEventBox.Add(_TabHBox);
            _TabEventBox.ShowAll();

            _ThemeSettings = new ThemeSettings();

            // OPT-TODO: this should use a TaskStack instead of TaskQueue
            _LastSeenHighlightQueue = new TaskQueue("LastSeenHighlightQueue("+_Name+")");
            _LastSeenHighlightQueue.AbortedEvent += OnLastSeenHighlightQueueAbortedEvent;
            _LastSeenHighlightQueue.ExceptionEvent += OnLastSeenHighlightQueueExceptionEvent;
        }
Example #36
0
        void AllocEventBox()
        {
            // Wraps the widget with an event box. Required for some
            // widgets such as Label which doesn't have its own gdk window

            if (eventBox == null && Widget.IsNoWindow) {
                eventBox = new Gtk.EventBox ();
                eventBox.Visible = Widget.Visible;
                eventBox.Sensitive = Widget.Sensitive;
                if (alignment != null) {
                    alignment.Remove (alignment.Child);
                    alignment.Add (eventBox);
                } else
                    GtkEngine.ReplaceChild (Widget, eventBox);
                eventBox.Add (Widget);
            }
        }
Example #37
0
		void SetErrorMode ()
		{
			Gtk.Label lab = new Gtk.Label ();
			lab.Markup = "<b>" + Catalog.GetString ("The form designer could not be loaded") + "</b>";
			Gtk.EventBox box = new Gtk.EventBox ();
			box.Add (lab);
			
			widget = Stetic.UserInterface.CreateWidgetDesigner (box, 100, 100);
			rootWidget = null;
			
			OnRootWidgetChanged ();
		}
Example #38
0
 private void Build()
 {
     global::Stetic.Gui.Initialize(this);
     // Widget Client.Forms.Help
     this.WidthRequest = 520;
     this.HeightRequest = 600;
     this.Name = "Client.Forms.Help";
     this.Title = "Help";
     this.Icon = global::Gdk.Pixbuf.LoadFromResource("Client.Resources.pigeon_clip_art_hight.ico");
     this.WindowPosition = ((global::Gtk.WindowPosition)(1));
     this.Resizable = false;
     this.AllowGrow = false;
     // Container child Client.Forms.Help.Gtk.Container+ContainerChild
     this.fixed1 = new global::Gtk.Fixed();
     this.fixed1.Name = "fixed1";
     this.fixed1.HasWindow = false;
     // Container child fixed1.Gtk.Fixed+FixedChild
     this.label2 = new global::Gtk.Label();
     this.label2.Name = "label2";
     this.label2.LabelProp = "Made by: Petr Bena";
     this.fixed1.Add(this.label2);
     global::Gtk.Fixed.FixedChild w1 = ((global::Gtk.Fixed.FixedChild)(this.fixed1[this.label2]));
     w1.X = 20;
     w1.Y = 61;
     // Container child fixed1.Gtk.Fixed+FixedChild
     Gtk.EventBox eb = new Gtk.EventBox();
     eb.ButtonPressEvent += new Gtk.ButtonPressEventHandler(Link);
     this.label3 = new global::Gtk.Label();
     this.label3.Name = "label3";
     this.label3.UseUnderline = true;
     this.label3.ModifyFg(Gtk.StateType.Normal, Core.FromColor(System.Drawing.Color.Blue));
     this.label3.Markup = "<a href=\"\">http://pidgeonclient.org/wiki/</a>";
     this.label3.UseUnderline = true;
     eb.Add(this.label3);
     this.fixed1.Add(eb);
     global::Gtk.Fixed.FixedChild w2 = ((global::Gtk.Fixed.FixedChild)(this.fixed1[eb]));
     w2.X = 20;
     w2.Y = 87;
     // Container child fixed1.Gtk.Fixed+FixedChild
     this.label4 = new global::Gtk.Label();
     this.label4.Name = "label4";
     this.fixed1.Add(this.label4);
     global::Gtk.Fixed.FixedChild w3 = ((global::Gtk.Fixed.FixedChild)(this.fixed1[this.label4]));
     w3.X = 20;
     w3.Y = 127;
     // Container child fixed1.Gtk.Fixed+FixedChild
     this.image2 = new global::Gtk.Image();
     this.image2.Name = "image2";
     this.image2.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("Client.Resources.Pigeon_clip_art_hight_mini.png");
     this.fixed1.Add(this.image2);
     global::Gtk.Fixed.FixedChild w4 = ((global::Gtk.Fixed.FixedChild)(this.fixed1[this.image2]));
     w4.X = 342;
     w4.Y = 47;
     // Container child fixed1.Gtk.Fixed+FixedChild
     this.label1 = new global::Gtk.Label();
     this.label1.Name = "label1";
     this.label1.LabelProp = "Pidgeon";
     this.fixed1.Add(this.label1);
     global::Gtk.Fixed.FixedChild w5 = ((global::Gtk.Fixed.FixedChild)(this.fixed1[this.label1]));
     w5.X = 220;
     w5.Y = 14;
     // Container child fixed1.Gtk.Fixed+FixedChild
     this.GtkScrolledWindow = new global::Gtk.ScrolledWindow();
     this.GtkScrolledWindow.Name = "GtkScrolledWindow";
     this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
     // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
     this.textview1 = new global::Gtk.TextView();
     this.textview1.Buffer.Text = "About:\n\nThe pidgeon project was established as an open source which anyone can edit or improve, or even suggest new features to. The source code is located at gitorious (link is available on wiki), but in order to submit patches, you don't need to be a member of the project.\n\nThat means:\nEveryone who wants to contribute to this project, is welcome and definitely should be able to do that, there is no need to request any permissions to modify the core sources or to develop plugins. If you like this project and you want to contribute to make pidgeon even better, please see our website\n\nLicense:\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or  (at your option) version 3.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of\n\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.";
     this.textview1.WidthRequest = 500;
     this.textview1.HeightRequest = 400;
     this.textview1.CanFocus = true;
     this.textview1.Name = "textview1";
     this.textview1.Editable = false;
     this.textview1.WrapMode = ((global::Gtk.WrapMode)(2));
     this.GtkScrolledWindow.Add(this.textview1);
     this.fixed1.Add(this.GtkScrolledWindow);
     global::Gtk.Fixed.FixedChild w7 = ((global::Gtk.Fixed.FixedChild)(this.fixed1[this.GtkScrolledWindow]));
     w7.X = 8;
     w7.Y = 171;
     this.Add(this.fixed1);
     if ((this.Child != null))
     {
         this.Child.ShowAll();
     }
     this.DefaultWidth = 579;
     this.DefaultHeight = 629;
     this.Show();
 }
Example #39
0
        protected void AllocEventBox(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 (eventBox == null && EventsRootWidget.IsNoWindow) {
                if (EventsRootWidget is Gtk.EventBox) {
                    ((Gtk.EventBox)EventsRootWidget).VisibleWindow = true;
                    return;
                }
                eventBox = new Gtk.EventBox ();
                eventBox.Visible = Widget.Visible;
                eventBox.Sensitive = Widget.Sensitive;
                eventBox.VisibleWindow = visibleWindow;
                GtkEngine.ReplaceChild (Widget, eventBox);
                eventBox.Add (Widget);
            }
        }
Example #40
0
        void InitializeWidget()
        {
            _viewModel.Init();

            // one row per option and one per group
            tblContainer.NRows         = (uint)(_viewModel.GroupedOptions.Sum(x => x.Count()) + _viewModel.GroupedOptions.Count()) + 1;
            tblContainer.NColumns      = 2;
            tblContainer.RowSpacing    = 0;
            tblContainer.ColumnSpacing = 0;
            tblContainer.BorderWidth   = 0;

            uint r = 0;

            var btn = new Gtk.Button();

            btn.Label        = "Reset to defaults";
            btn.WidthRequest = 150;
            btn.Clicked     += (sender, e) =>
            {
                _viewModel.ResetToDefaults();

                foreach (var item in tblContainer.Children)
                {
                    item.Destroy();
                }

                InitializeWidget();
            };
            tblContainer.Attach(btn, 0, 2, r, r + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);
            r++;

            foreach (var optionGroup in _viewModel.GroupedOptions)
            {
                // group label
                var grouplbl = new Gtk.Label();
                grouplbl.SetAlignment(0f, 0.5f);
                grouplbl.HeightRequest = 40;
                grouplbl.Markup        = $"<b> {optionGroup.Key}</b>";

                var box = new Gtk.EventBox();
                box.ModifyBg(Gtk.StateType.Normal, _groupHeaderColor);
                box.Add(grouplbl);
                tblContainer.Attach(box, 0, 2, r, r + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);
                r++;

                foreach (var option in optionGroup)
                {
                    // name label
                    var lbl = new Gtk.Label(option.Name)
                    {
                        TooltipText = option.Description
                    };
                    lbl.SetAlignment(0f, 0.5f);
                    lbl.HeightRequest = 30;
                    AddToTable(r, 0, lbl);

                    var type = option.PropertyType;
                    if (type == typeof(bool))
                    {
                        var chk = new Gtk.CheckButton {
                            Active = (bool)option.Property.GetValue(_viewModel.Options)
                        };
                        chk.Clicked += (sender, e) =>
                        {
                            option.Property.SetValue(_viewModel.Options, chk.Active);
                            _viewModel.IsDirty = true;
                        };
                        AddToTable(r, 1, chk);
                    }
                    else if (type == typeof(int))
                    {
                        var val  = (int)option.Property.GetValue(_viewModel.Options);
                        var spin = new Gtk.SpinButton(0, 10, 1)
                        {
                            Value = val, WidthChars = 3
                        };
                        spin.ValueChanged += (sender, e) =>
                        {
                            option.Property.SetValue(_viewModel.Options, (int)spin.Value);
                            _viewModel.IsDirty = true;
                        };
                        AddToTable(r, 1, spin);
                    }
                    else if (type == typeof(byte))
                    {
                        var val  = (byte)option.Property.GetValue(_viewModel.Options);
                        var spin = new Gtk.SpinButton(0, 10, 1)
                        {
                            Value = val, WidthChars = 3
                        };
                        spin.ValueChanged += (sender, e) =>
                        {
                            option.Property.SetValue(_viewModel.Options, (byte)spin.Value);
                            _viewModel.IsDirty = true;
                        };
                        AddToTable(r, 1, spin);
                    }
                    else if (type == typeof(string))
                    {
                        var val = (string)option.Property.GetValue(_viewModel.Options);
                        var txt = new Gtk.Entry(val);
                        txt.Alignment = 0;
                        txt.Changed  += (sender, e) =>
                        {
                            option.Property.SetValue(_viewModel.Options, txt.Text);
                            _viewModel.IsDirty = true;
                        };
                        AddToTable(r, 1, txt);
                    }
                    else if (type == typeof(string[]))
                    {
                        var vals = (string[])option.Property.GetValue(_viewModel.Options);
                        var val  = string.Join(Environment.NewLine, vals);
                        var txt  = new Gtk.TextView(new Gtk.TextBuffer(new Gtk.TextTagTable()));
                        txt.LeftMargin  = 5;
                        txt.RightMargin = 5;
                        txt.BorderWidth = 1;
                        txt.SetSizeRequest(320, 150);
                        txt.Buffer.Text     = val;
                        txt.Buffer.Changed += (sender, e) =>
                        {
                            var newVals = txt.Buffer.Text.Split(Environment.NewLine.ToCharArray());
                            option.Property.SetValue(_viewModel.Options, newVals);
                            _viewModel.IsDirty = true;
                        };

                        var frame = new Gtk.Frame();
                        frame.Shadow      = Gtk.ShadowType.In;
                        frame.BorderWidth = 5;
                        frame.Child       = txt;

                        AddToTable(r, 1, frame);
                    }
                    else if (type.IsEnum)
                    {
                        var val    = option.Property.GetValue(_viewModel.Options);
                        var values = Enum.GetNames(type);
                        var cmb    = new Gtk.ComboBox(values);
                        cmb.Active   = Array.IndexOf(values, val.ToString());
                        cmb.Changed += (sender, e) =>
                        {
                            option.Property.SetValue(_viewModel.Options, Enum.Parse(type, cmb.ActiveText));
                            _viewModel.IsDirty = true;
                        };
                        AddToTable(r, 1, cmb);
                    }

                    r++;
                }
            }

            alContainer.ShowAll();
        }
Example #41
0
        private void BuildCard()
        {
            var eventBoxEmail1 = new Gtk.EventBox();
            var eventBoxEmail2 = new Gtk.EventBox();
            var eventBoxAddress = new Gtk.EventBox();
            var vbCardMain = new Gtk.VBox( false, 5 );
            var hbName = new Gtk.HBox( false, 0 );
            var hbAddress = new Gtk.HBox( false, 0 );
            var hbMainContact = new Gtk.HBox( false, 0 );
            var hbSecondaryContact = new Gtk.HBox( false, 0 );

            // Frame
            this.frmCard = new Gtk.Frame();
            this.frmCard.LabelWidget = new Gtk.Label() { Markup = "<b>Contact</b>" };

            // Name
            this.lblName = new Gtk.Label( EtqNotAvailable );
            this.lblSurname = new Gtk.Label( EtqNotAvailable );
            vbCardMain.PackStart( hbName, false, false, 0 );
            hbName.PackStart( this.lblSurname, false, false, 5 );
            hbName.PackStart( this.lblName, false, false, 5 );

            // Address
            this.lblAddress = new Gtk.Label( EtqNotAvailable );
            eventBoxAddress.Add( this.lblAddress );
            eventBoxAddress.ButtonPressEvent += (o, args) => this.OnAddressClicked();
            this.lblHomePhone = new Gtk.Label( EtqNotAvailable );
            vbCardMain.PackStart( hbAddress, false, false, 0 );
            hbAddress.PackStart( eventBoxAddress, false, false, 5 );
            hbAddress.PackStart( new Gtk.VSeparator(), false, false, 5 );
            hbAddress.PackStart( this.lblHomePhone, false, false, 5 );

            // Main contact
            this.lblMobilePhone = new Gtk.Label( EtqNotAvailable );
            this.lblEmail = new Gtk.Label( EtqNotAvailable );
            eventBoxEmail1.Add( this.lblEmail );
            eventBoxEmail1.ButtonPressEvent += (o, args) => this.OnLblEmail1Clicked();
            vbCardMain.PackStart( hbMainContact, false, false, 0 );
            hbMainContact.PackStart( this.lblMobilePhone, false, false, 5 );
            hbMainContact.PackStart( new Gtk.VSeparator(), false, false, 5 );
            hbMainContact.PackStart( eventBoxEmail1, false, false, 5 );

            // Secondary contact
            this.lblWorkPhone = new Gtk.Label( EtqNotAvailable );
            this.lblEmail2 = new Gtk.Label( EtqNotAvailable );
            eventBoxEmail2.Add( this.lblEmail2 );
            eventBoxEmail2.ButtonPressEvent += (o, args) => this.OnLblEmail2Clicked();
            vbCardMain.PackStart( hbSecondaryContact, false, false, 0 );
            hbSecondaryContact.PackStart( this.lblWorkPhone, false, false, 5 );
            hbSecondaryContact.PackStart( new Gtk.VSeparator(), false, false, 5 );
            hbSecondaryContact.PackStart( eventBoxEmail2, false, false, 5 );

            this.frmCard.Add( vbCardMain );
            this.vbMain.PackStart( this.frmCard, false, false, 5 );

            // Card labels
            this.lblSurname.ModifyFont(
                Pango.FontDescription.FromString( "Times 18" )
            );

            this.lblName.ModifyFont(
                Pango.FontDescription.FromString( "Times 18" )
            );

            this.lblMobilePhone.ModifyFont(
                Pango.FontDescription.FromString( "Times 14" )
            );

            this.lblWorkPhone.ModifyFont(
                Pango.FontDescription.FromString( "Times 14" )
            );

            this.lblAddress.ModifyFont(
                Pango.FontDescription.FromString( "Times 14" )
            );

            this.lblMobilePhone.ModifyFont(
                Pango.FontDescription.FromString( "Times 14" )
            );

            this.lblEmail.ModifyFont(
                Pango.FontDescription.FromString( "Mono 14" )
            );

            this.lblEmail2.ModifyFont(
                Pango.FontDescription.FromString( "Mono 14" )
            );
        }
Example #42
0
        public ChatView(ChatModel chat)
        {
            Trace.Call(chat);

            _ChatModel = chat;

            IsAutoScrolling = true;
            MessageTextView tv = new MessageTextView();
            _EndMark = tv.Buffer.CreateMark("end", tv.Buffer.EndIter, false);
            tv.ShowTimestamps = true;
            tv.ShowMarkerline = true;
            tv.Editable = false;
            tv.CursorVisible = true;
            tv.WrapMode = Gtk.WrapMode.Char;
            tv.MessageAdded += OnMessageTextViewMessageAdded;
            tv.MessageHighlighted += OnMessageTextViewMessageHighlighted;
            tv.PopulatePopup += OnMessageTextViewPopulatePopup;
            tv.SizeRequested += delegate {
                AutoScroll();
            };
            tv.PersonClicked += OnMessageTextViewPersonClicked;
            _OutputMessageTextView = tv;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            _OutputScrolledWindow = sw;
            //sw.HscrollbarPolicy = Gtk.PolicyType.Never;
            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Always;
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Vadjustment.ValueChanged += OnVadjustmentValueChanged;
            sw.Add(_OutputMessageTextView);

            // popup menu
            _TabMenu = new Gtk.Menu();
            _TabMenu.Shown += OnTabMenuShown;

            //FocusChild = _OutputTextView;
            //CanFocus = false;

            _TabLabel = new Gtk.Label();

            TabImage = DefaultTabImage;
            _TabHBox = new Gtk.HBox();
            _TabHBox.PackEnd(new Gtk.Fixed(), true, true, 0);
            _TabHBox.PackEnd(_TabLabel, false, false, 0);
            _TabHBox.PackStart(TabImage, false, false, 2);
            _TabHBox.ShowAll();

            _TabEventBox = new Gtk.EventBox();
            _TabEventBox.VisibleWindow = false;
            _TabEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnTabButtonPress);
            _TabEventBox.Add(_TabHBox);
            _TabEventBox.ShowAll();

            _ThemeSettings = new ThemeSettings();

            // OPT-TODO: this should use a TaskStack instead of TaskQueue
            _LastSeenHighlightQueue = new TaskQueue("LastSeenHighlightQueue("+ID+")");
            _LastSeenHighlightQueue.AbortedEvent += OnLastSeenHighlightQueueAbortedEvent;
            _LastSeenHighlightQueue.ExceptionEvent += OnLastSeenHighlightQueueExceptionEvent;
        }
		protected virtual void Build()
		{
			global::Stetic.Gui.Initialize(this);
			// Widget OpenGraal.LevelEditor.MainWindow
			this.UIManager = new global::Gtk.UIManager();
			global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup("Default");
			this.UIManager.InsertActionGroup(w1, 0);
			this.AddAccelGroup(this.UIManager.AccelGroup);
			this.Name = "OpenGraal.LevelEditor.MainWindow";
			this.Title = global::Mono.Unix.Catalog.GetString("MainWindow");
			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
			// Container child OpenGraal.LevelEditor.MainWindow.Gtk.Container+ContainerChild
			this.vbox1 = new global::Gtk.VBox();
			this.vbox1.Name = "vbox1";
			this.vbox1.Spacing = 6;
			// Container child vbox1.Gtk.Box+BoxChild
			this.UIManager.AddUiFromString("<ui><menubar name=\'menubar1\'/></ui>");
			this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget("/menubar1")));
			this.menubar1.Name = "menubar1";
			this.vbox1.Add(this.menubar1);

			Gtk.MenuItem fileMenu = new Gtk.MenuItem ("File");

			Gtk.ImageMenuItem fileMenuNew = new Gtk.ImageMenuItem (Gtk.Stock.New);
			fileMenu.Add (fileMenuNew);

			menubar1.Append (fileMenu);

			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.menubar1]));
			w2.Position = 0;
			w2.Expand = false;
			w2.Fill = false;
			// Container child vbox1.Gtk.Box+BoxChild
			this.hpaned1 = new global::Gtk.HPaned();
			this.hpaned1.CanFocus = true;
			this.hpaned1.Name = "hpaned1";
			this.hpaned1.Position = 597;
			// Container child hpaned1.Gtk.Paned+PanedChild
			this._levelScrollPane = new global::Gtk.ScrolledWindow();
			this._levelScrollPane.CanFocus = true;
			this._levelScrollPane.Name = "levelScrollPane";
			this._levelScrollPane.ShadowType = ((global::Gtk.ShadowType)(1));
			// Container child _levelScrollPane.Gtk.Container+ContainerChild
			global::Gtk.Viewport w3 = new global::Gtk.Viewport();
			w3.ShadowType = ((global::Gtk.ShadowType)(0));
			// Container child GtkViewport.Gtk.Container+ContainerChild
			this.levelDrawPane = new global::Gtk.Image();
			this.levelDrawPane.Name = "levelDrawPane";

			_levelEventBox = new Gtk.EventBox ();
			_levelEventBox.Add (levelDrawPane);

			w3.Add(_levelEventBox);
			this._levelScrollPane.Add(w3);
			this.hpaned1.Add(this._levelScrollPane);

			_levelEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler (onLevelClick);
			_levelEventBox.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler (onLevelRelease);
			_levelEventBox.MotionNotifyEvent += new Gtk.MotionNotifyEventHandler (onLevelMove);

			global::Gtk.Paned.PanedChild w6 = ((global::Gtk.Paned.PanedChild)(this.hpaned1[this._levelScrollPane]));
			w6.Resize = false;
			// Container child hpaned1.Gtk.Paned+PanedChild
			this.notebook1 = new global::Gtk.Notebook();
			this.notebook1.CanFocus = true;
			this.notebook1.Name = "notebook1";
			this.notebook1.CurrentPage = 0;
			// Container child notebook1.Gtk.Notebook+NotebookChild
			this._tilesetScrollPane = new global::Gtk.ScrolledWindow();
			this._tilesetScrollPane.CanFocus = true;
			this._tilesetScrollPane.Name = "tilesetScrollPane";
			this._tilesetScrollPane.ShadowType = ((global::Gtk.ShadowType)(1));
			// Container child scrolledwindow2.Gtk.Container+ContainerChild
			global::Gtk.Viewport w7 = new global::Gtk.Viewport();
			w7.ShadowType = ((global::Gtk.ShadowType)(0));
			// Container child GtkViewport1.Gtk.Container+ContainerChild
			this.tilesetDrawPane = new global::Gtk.Image();
			this.tilesetDrawPane.Name = "tilesetDrawPane";
			this._tilesetEventBox = new global::Gtk.EventBox();
			this._tilesetEventBox.Add(tilesetDrawPane);
			this._tilesetEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler (onTilesetClick);
			this._tilesetEventBox.MotionNotifyEvent += new Gtk.MotionNotifyEventHandler (onTilesetDrag);
			this._tilesetEventBox.ButtonReleaseEvent += new Gtk.ButtonReleaseEventHandler (onTilesetRelease);
			w7.Add(this._tilesetEventBox);
			this._tilesetScrollPane.Add(w7);
			this.notebook1.Add(this._tilesetScrollPane);

			// Notebook tab
			this.tilesetLbl = new global::Gtk.Label();
			this.tilesetLbl.Name = "tilesetLbl";
			this.tilesetLbl.LabelProp = global::Mono.Unix.Catalog.GetString("Tileset");
			this.notebook1.SetTabLabel(this._tilesetScrollPane, this.tilesetLbl);
			this.tilesetLbl.ShowAll();
			// Notebook tab
			global::Gtk.Label w11 = new global::Gtk.Label();
			w11.Visible = true;
			this.notebook1.Add(w11);
			this.layersLbl = new global::Gtk.Label();
			this.layersLbl.Name = "layersLbl";
			this.layersLbl.LabelProp = global::Mono.Unix.Catalog.GetString("Layers");
			this.notebook1.SetTabLabel(w11, this.layersLbl);
			this.layersLbl.ShowAll();
			this.hpaned1.Add(this.notebook1);
			this.vbox1.Add(this.hpaned1);
			global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hpaned1]));
			w13.Position = 1;
			// Container child vbox1.Gtk.Box+BoxChild
			this.reportLbl = new global::Gtk.Label();
			this.reportLbl.Name = "reportLbl";
			this.reportLbl.LabelProp = global::Mono.Unix.Catalog.GetString("label1");
			this.reportLbl.Justify = ((global::Gtk.Justification)(1));
			this.vbox1.Add(this.reportLbl);
			global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.reportLbl]));
			w14.Position = 2;
			w14.Expand = false;
			w14.Fill = false;
			this.Add(this.vbox1);
			if ((this.Child != null))
			{
				this.Child.ShowAll();
			}
			this.DefaultWidth = 850;
			this.DefaultHeight = 434;
			this.Show();
			this.DeleteEvent += new global::Gtk.DeleteEventHandler(this.OnDeleteEvent);

			tilesetDrawPane.GdkWindow = notebook1.GdkWindow;
		}