public ListWidget(DropDownBoxListWindow win)
 {
     this.win    = win;
     this.Events = Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.KeyPressMask;
     layout      = new Pango.Layout(this.PangoContext);
     CalcRowHeight();
 }
Exemple #2
0
 protected override bool OnButtonPressEvent(Gdk.EventButton e)
 {
     if (e.TriggersContextMenu())
     {
         return(base.OnButtonPressEvent(e));
     }
     if (e.Type == Gdk.EventType.ButtonPress)
     {
         if (window != null)
         {
             DestroyWindow();
         }
         else
         {
             this.GrabFocus();
             if (DataProvider != null)
             {
                 DataProvider.Reset();
                 if (DataProvider.IconCount > 0)
                 {
                     window = new DropDownBoxListWindow(DataProvider, WindowType.Popup);
                     window.list.SelectItem += delegate {
                         SetItem(window.list.Selection);
                     };
                     PositionListWindow();
                     window.SelectItem(CurrentItem);
                 }
             }
         }
     }
     return(base.OnButtonPressEvent(e));
 }
Exemple #3
0
 internal void DestroyWindow()
 {
     if (window != null)
     {
         window.Destroy();
         window = null;
         QueueDraw();
     }
 }
            public ListWidget(DropDownBoxListWindow win)
            {
                Accessible.Role = Atk.Role.List;
                this.win        = win;
                this.Events     = Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask | Gdk.EventMask.LeaveNotifyMask;
                this.CanFocus   = true;
                UpdateStyle();

                CalcAccessibility();
            }
Exemple #5
0
            public ListWidget(DropDownBoxListWindow win)
            {
                Accessible.Role = Atk.Role.List;
                this.win        = win;
                this.Events     = Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask | Gdk.EventMask.LeaveNotifyMask;
                this.CanFocus   = true;
                layout          = new Pango.Layout(this.PangoContext);
                CalcRowHeight();
                CalcVisibleRows();

                CalcAccessibility();
            }
        public Gtk.Widget CreatePathWidget(int index)
        {
            PathEntry[] path = CurrentPath;
            if (null == path || 0 > index || path.Length <= index)
            {
                return null;
            }

            object tag = path[index].Tag;
            DropDownBoxListWindow.IListDataProvider provider = null;
            if (!((tag is D_Parser.Dom.IBlockNode) || (tag is DEnumValue) || (tag is NoSelectionCustomNode)))
            {
                return null;
            }
            provider = new EditorPathbarProvider(Document, tag);

            var window = new DropDownBoxListWindow(provider);
            window.SelectItem(tag);
            return window;
        }
		public Gtk.Widget CreatePathWidget (int index)
		{
			PathEntry[] path = CurrentPath;
			if (path == null || index < 0 || index >= path.Length)
				return null;
			var tag = path [index].Tag;
			var window = new DropDownBoxListWindow (tag == null ? (DropDownBoxListWindow.IListDataProvider)new CompilationUnitDataProvider (Document) : new DataProvider (this, tag));
			window.SelectItem (path [index].Tag);
			return window;
		}
		public Widget CreatePathWidget (int index)
		{
			if (ownerProjects.Count > 1 && index == 0) {
				var window = new DropDownBoxListWindow (new DataProvider (this));
				window.FixedRowHeight = 22;
				window.MaxVisibleRows = 14;
				window.SelectItem (currentPath [index].Tag);
				return window;
			} else {
				if (ownerProjects.Count > 1)
					index--;
				var menu = new Menu ();
				var mi = new MenuItem (GettextCatalog.GetString ("Select"));
				mi.Activated += delegate {
					SelectPath (index);
				};
				menu.Add (mi);
				mi = new MenuItem (GettextCatalog.GetString ("Select contents"));
				mi.Activated += delegate {
					SelectPathContents (index);
				};
				menu.Add (mi);
				menu.ShowAll ();
				return menu;
			}
		}
		Gtk.Window CreateComboBoxSelector (DropDownBox box)
		{
			DropDownBoxListWindow window = new DropDownBoxListWindow (new ComboBoxSelector (this, box));
			return window;
		}
		public Gtk.Widget CreatePathWidget (int index)
		{
			PathEntry[] path = CurrentPath;
			if (path == null || index < 0 || index >= path.Length)
				return null;
			var tag = path [index].Tag;
			DropDownBoxListWindow.IListDataProvider provider;
			if (tag is ICompilationUnit) {
				provider = new CompilationUnitDataProvider (Document);
				tag = Document.ParsedDocument.GetUserRegion (document.Editor.Caret.Line, document.Editor.Caret.Column);
			} else {
				provider = new DataProvider (Document, tag, GetAmbience ());
			}
			
			DropDownBoxListWindow window = new DropDownBoxListWindow (provider);
			window.SelectItem (tag);
			return window;
		}
			public ListWidget (DropDownBoxListWindow win)
			{
				this.win = win;
				this.Events = Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask | Gdk.EventMask.LeaveNotifyMask;
				layout = new Pango.Layout (this.PangoContext);
				CalcRowHeight ();
			}
		public Gtk.Widget CreatePathWidget (int index)
		{
			PathEntry[] path = CurrentPath;
			if (null == path || 0 > index || path.Length <= index) {
				return null;
			}
			
			object tag = path[index].Tag;
			DropDownBoxListWindow.IListDataProvider provider = null;
			if (tag is ICompilationUnit) {
				provider = new CompilationUnitDataProvider (Document);
			} else {
				provider = new DataProvider (Document, tag, GetAmbience ());
			}
			
			DropDownBoxListWindow window = new DropDownBoxListWindow (provider);
			window.SelectItem (tag);
			return window;
		}
Exemple #13
0
		protected override bool OnButtonPressEvent (Gdk.EventButton e)
		{
			if (e.Button == 3) {
				return true;
			}
			if (e.Type == Gdk.EventType.ButtonPress) {
				if (window != null) {
					DestroyWindow ();
				} else {
					this.GrabFocus ();
					if (DataProvider != null) {
						DataProvider.Reset ();
						if (DataProvider.IconCount > 0) {
							window = new DropDownBoxListWindow (DataProvider);
							window.list.SelectItem += delegate {
								SetItem (window.list.Selection);
							};
							PositionListWindow ();
							window.SelectItem (CurrentItem);
						}
					}
				}
			}
			return base.OnButtonPressEvent (e);
		}
Exemple #14
0
		internal void DestroyWindow ()
		{
			if (window != null) {
				window.Destroy ();
				window = null;
				QueueDraw ();
			}
		}
		public Control CreatePathWidget (int index)
		{
			PathEntry[] path = CurrentPath;
			if (path == null || index < 0 || index >= path.Length)
				return null;
			var tag = path [index].Tag;
			var window = new DropDownBoxListWindow (tag == null ? (DropDownBoxListWindow.IListDataProvider)new CompilationUnitDataProvider (Editor, DocumentContext) : new DataProvider (this, tag));
			window.FixedRowHeight = 22;
			window.MaxVisibleRows = 14;
			window.SelectItem (path [index].Tag);
			return window;
		}
		public Control CreatePathWidget (int index)
		{
			PathEntry[] path = CurrentPath;
			if (null == path || 0 > index || path.Length <= index) {
				return null;
			}
			
			object tag = path[index].Tag;
			DropDownBoxListWindow.IListDataProvider provider = null;
			if (tag is ParsedDocument) {
				provider = new CompilationUnitDataProvider (Editor, DocumentContext);
			} else {
				// TODO: Roslyn port
				//provider = new DataProvider (Editor, DocumentContext, tag, new NetAmbience ());
			}
			
			DropDownBoxListWindow window = new DropDownBoxListWindow (provider);
			window.SelectItem (tag);
			return window;
		}