Ejemplo n.º 1
0
        void RunDialog(string message)
        {
            if (disposed)
            {
                return;
            }

            dialog = new Gtk.Dialog()
            {
                Title = "Waiting for debugger"
            };

            var label = new Gtk.Alignment(0.5f, 0.5f, 1f, 1f)
            {
                Child       = new Gtk.Label(message),
                BorderWidth = 12
            };

            dialog.VBox.PackStart(label);
            label.ShowAll();

            dialog.AddButton("Cancel", Gtk.ResponseType.Cancel);

            int response = MonoDevelop.Ide.MessageService.ShowCustomDialog(dialog);

            dialog.Destroy();
            dialog = null;

            if (!disposed && response != (int)Gtk.ResponseType.Ok && UserCancelled != null)
            {
                UserCancelled(null, null);
            }
        }
		public DocumentOutlinePad ()
		{
			box = new Gtk.Alignment (0, 0, 1, 1);
			box.BorderWidth = 0;
			SetEmptyWidget ();
			box.ShowAll ();
		}
 public DocumentOutlinePad()
 {
     box             = new Gtk.Alignment(0, 0, 1, 1);
     box.BorderWidth = 0;
     SetEmptyWidget();
     box.ShowAll();
 }
        void ShowListenDialog(RemoteDebuggerStartInfo dsi)
        {
            string message = GetListenMessage(dsi);

            Gtk.Application.Invoke(delegate {
                if (VirtualMachine != null || Exited)
                {
                    return;
                }

                dialog = new Gtk.Dialog()
                {
                    Title = "Waiting for debugger"
                };

                var label = new Gtk.Alignment(0.5f, 0.5f, 1f, 1f)
                {
                    Child       = new Gtk.Label(message),
                    BorderWidth = 12
                };
                dialog.VBox.PackStart(label);
                label.ShowAll();

                dialog.AddButton("Cancel", Gtk.ResponseType.Cancel);

                int response = MonoDevelop.Ide.MessageService.ShowCustomDialog(dialog);

                if (response != (int)Gtk.ResponseType.Ok)
                {
                    EndSession();
                }
                dialog = null;
            });
        }
Ejemplo n.º 5
0
		void AddLabel ()
		{
			if (label == null) {
				Gtk.Alignment al = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f);
				al.SetPadding (6, 6, 6, 6);
				label = new Gtk.Label ();
				al.Add (label);
				ContentBox.Add (al);
				al.ShowAll ();
			}
		}
Ejemplo n.º 6
0
 void AddLabel()
 {
     if (label == null)
     {
         alignment = new Gtk.Alignment(0.5f, 0.5f, 1f, 1f);
         alignment.SetPadding(6, 6, 6, 6);
         label = new Gtk.Label();
         alignment.Add(label);
         ContentBox.Add(alignment);
         alignment.ShowAll();
     }
 }
Ejemplo n.º 7
0
 void AddLabel()
 {
     if (label == null)
     {
         alignment = new Gtk.Alignment(0.5f, 0.5f, 1f, 1f);
         alignment.SetPadding(4, 5, 4, 4);
         label = new Gtk.Label();
         label.ModifyFont(Theme.Font);
         alignment.Add(label);
         ContentBox.Add(alignment);
         alignment.ShowAll();
     }
 }
Ejemplo n.º 8
0
        void ConstructContents()
        {
            if (button.Child != null)
            {
                button.Remove(button.Child);
            }

            if (useUnderline)
            {
                labelWidget = new Gtk.Label(label);
                labelWidget.MnemonicWidget = button;
            }
            else
            {
                labelWidget = Gtk.Label.New(label);
            }

            Gtk.Image imageWidget  = (Gtk.Image)Registry.NewInstance("Gtk.Image", proj);
            Image     imageWrapper = (Image)Widget.Lookup(imageWidget);

            imageWrapper.Unselectable = true;
            if (type != ButtonType.StockItem)
            {
                imageWrapper.Pixbuf = imageInfo;
            }

            Gtk.HBox box = new Gtk.HBox(false, 2);
            box.PackStart(imageWidget, false, false, 0);
            box.PackEnd(labelWidget, false, false, 0);

            Gtk.Alignment alignment = new Gtk.Alignment(button.Xalign, button.Yalign, 0.0f, 0.0f);
            alignment.Add(box);

            ObjectWrapper buttonWrapper = ObjectWrapper.Lookup(this);
            Widget        wrapper       = (Widget)ObjectWrapper.Create(proj, labelWidget, buttonWrapper);

            wrapper.Unselectable = true;
            wrapper = (Widget)ObjectWrapper.Create(proj, box, buttonWrapper);
            wrapper.Unselectable = true;
            wrapper = (Widget)ObjectWrapper.Create(proj, alignment, buttonWrapper);
            wrapper.Unselectable = true;

            alignment.ShowAll();
            button.Add(alignment);
        }
        private void BuildWidget()
        {
            alignment = new Gtk.Alignment(0.5f, 0.5f, 1f, 0f);
            alignment.SetPadding(1, 1, 3, 3);
            VisibleWindow = false;

            box           = new Gtk.HBox();
            entry         = new FramelessEntry(this);
            filter_button = new HoverImageButton(searchImage);
            clear_button  = new HoverImageButton(clearImage);

            entryAlignment = new Gtk.Alignment(0.5f, 0.5f, 1f, 1f);
            alignment.SetPadding(0, 0, 3, 3);
            entryAlignment.Add(entry);
            box.PackStart(filter_button, false, false, 0);
            box.PackStart(entryAlignment, true, true, 0);
            box.PackStart(clear_button, false, false, 0);
            alignment.Add(box);
            Add(alignment);
            alignment.ShowAll();

            entry.StyleSet      += OnInnerEntryStyleSet;
            entry.StateChanged  += OnInnerEntryStateChanged;
            entry.FocusInEvent  += OnInnerEntryFocusEvent;
            entry.FocusOutEvent += OnInnerEntryFocusEvent;
            entry.Changed       += OnInnerEntryChanged;
            entry.Activated     += delegate {
                NotifyActivated();
            };

            filter_button.CanFocus = false;
            clear_button.CanFocus  = false;

            filter_button.ButtonReleaseEvent += OnButtonReleaseEvent;
            clear_button.ButtonReleaseEvent  += OnButtonReleaseEvent;
            clear_button.Clicked             += OnClearButtonClicked;

            ShowHideButtons();
        }
Ejemplo n.º 10
0
		void RunDialog (string message)
		{
			if (disposed)
				return;
			
			dialog = new Gtk.Dialog () {
				Title = "Waiting for debugger"
			};
			
			var label = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f) {
				Child = new Gtk.Label (message),
				BorderWidth = 12
			};
			dialog.VBox.PackStart (label);
			label.ShowAll ();
			
			dialog.AddButton ("Cancel", Gtk.ResponseType.Cancel);
			
			int response = MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog);
			dialog.Destroy ();
			dialog = null;
			
			if (!disposed && response != (int) Gtk.ResponseType.Ok && UserCancelled != null) {
				UserCancelled (null, null);
			}
		}
Ejemplo n.º 11
0
        private void BuildWidget()
        {
            alignment = new Gtk.Alignment (0.5f, 0.5f, 1f, 0f);
            alignment.SetPadding (1, 1, 3, 3);
            VisibleWindow = false;

            box = new Gtk.HBox ();
            entry = new FramelessEntry (this);
            filter_button = new HoverImageButton (searchImage);
            clear_button = new HoverImageButton (clearImage);

            entryAlignment = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f);
            alignment.SetPadding (0, 0, 3, 3);
            entryAlignment.Add (entry);
            box.PackStart (filter_button, false, false, 0);
            box.PackStart (entryAlignment, true, true, 0);
            box.PackStart (clear_button, false, false, 0);
            alignment.Add (box);
            Add (alignment);
            alignment.ShowAll ();

            entry.StyleSet += OnInnerEntryStyleSet;
            entry.StateChanged += OnInnerEntryStateChanged;
            entry.FocusInEvent += OnInnerEntryFocusEvent;
            entry.FocusOutEvent += OnInnerEntryFocusEvent;
            entry.Changed += OnInnerEntryChanged;
            entry.Activated += delegate {
                NotifyActivated ();
            };

            filter_button.CanFocus = false;
            clear_button.CanFocus = false;

            filter_button.ButtonReleaseEvent += OnButtonReleaseEvent;
            clear_button.ButtonReleaseEvent += OnButtonReleaseEvent;
            clear_button.Clicked += OnClearButtonClicked;

            ShowHideButtons ();
        }
Ejemplo n.º 12
0
		void ConstructContents ()
		{
			if (button.Child != null)
				button.Remove (button.Child);

			if (useUnderline) {
				labelWidget = new Gtk.Label (label);
				labelWidget.MnemonicWidget = button;
			} else
				labelWidget = Gtk.Label.New (label);

			Gtk.Image imageWidget = (Gtk.Image)Registry.NewInstance ("Gtk.Image", proj);
			Image imageWrapper = (Image)Widget.Lookup (imageWidget);
			imageWrapper.Unselectable = true;
			if (type != ButtonType.StockItem) {
				imageWrapper.Pixbuf = imageInfo;
			}

			Gtk.HBox box = new Gtk.HBox (false, 2);
			box.PackStart (imageWidget, false, false, 0);
			box.PackEnd (labelWidget, false, false, 0);

			Gtk.Alignment alignment = new Gtk.Alignment (button.Xalign, button.Yalign, 0.0f, 0.0f);
			alignment.Add (box);

			ObjectWrapper buttonWrapper = ObjectWrapper.Lookup (this);
			Widget wrapper = (Widget)ObjectWrapper.Create (proj, labelWidget, buttonWrapper);
			wrapper.Unselectable = true;
			wrapper = (Widget)ObjectWrapper.Create (proj, box, buttonWrapper);
			wrapper.Unselectable = true;
			wrapper = (Widget)ObjectWrapper.Create (proj, alignment, buttonWrapper);
			wrapper.Unselectable = true;

			alignment.ShowAll ();
			button.Add (alignment);
		}
		void ShowListenDialog (RemoteDebuggerStartInfo dsi)
		{
			string message = GetListenMessage (dsi);
			
			Gtk.Application.Invoke (delegate {
				if (VirtualMachine != null || Exited)
					return;
				
				dialog = new Gtk.Dialog () {
					Title = "Waiting for debugger"
				};
				
				var label = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f) {
					Child = new Gtk.Label (message),
					BorderWidth = 12
				};
				dialog.VBox.PackStart (label);
				label.ShowAll ();	
				
				dialog.AddButton ("Cancel", Gtk.ResponseType.Cancel);
				
				int response = MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog);
				
				if (response != (int) Gtk.ResponseType.Ok) {
					EndSession ();
				}
				dialog = null;
			});
		}
		void AddLabel ()
		{
			if (label == null) {
				alignment = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f);
				alignment.SetPadding (4, 5, 4, 4);
				label = new Gtk.Label ();
				label.ModifyFont (Theme.Font);
				alignment.Add (label);
				ContentBox.Add (alignment);
				alignment.ShowAll ();
			}
		}
Ejemplo n.º 15
0
        public MapleEditorImplementation(PluginManager manager)
        {
            this.manager = manager;

            minimap = new MyMinimap();

            var minimapContainer = new Gtk.Alignment(1.0f, 1.0f, 1.0f, 1.0f);

            var list = new List <string>(new string[] {
                "Present (Ricky)",
                "Present (Dimitri)",
                "Present (Moosh)"
            });

            if (Project.Game == Game.Ages)
            {
                list.Add("Past");
            }

            Gtk.ComboBox comboBox = new Gtk.ComboBox(list.ToArray());

            comboBox.Changed += (a, b) => {
                int  i = comboBox.Active;
                Data data;
                Map  map;

                if (i == 3)
                {
                    data = Project.GetData("maplePastLocations");
                    map  = Project.GetWorldMap(1, manager.GetActiveRoomLayout().Season);
                }
                else
                {
                    data = Project.GetData(Project.GetData("maplePresentLocationsTable", i * 2).GetValue(0));
                    map  = Project.GetWorldMap(0, manager.GetActiveRoomLayout().Season);
                }

                minimap.Width  = map.MapWidth;
                minimap.Height = map.MapHeight;

                minimap.SetData(data);
                minimap.SetMap(map);
                minimap.Selectable = false;

                minimapContainer.Foreach((c) => minimapContainer.Remove(c));
                minimapContainer.Add(minimap);
                minimapContainer.ShowAll();
            };
            if (manager.GetActiveMap().MainGroup == 1)
            {
                comboBox.Active = 3;
            }
            else
            {
                comboBox.Active = 0;
            }

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.Add(comboBox);
            vbox.Add(minimapContainer);

            this.Add(vbox);
            ShowAll();
        }