public ElementChooserDialog(Type requestedType, string title) { base.Modal = true; base.HeightRequest = 400; base.WidthRequest = 250; //TODO: i18n base.Title = title; base.AddButton (GettextCatalog.GetString ("_Cancel"), Gtk.ResponseType.Cancel); base.AddButton (GettextCatalog.GetString ("_Accept"), Gtk.ResponseType.Accept); base.Response += new Gtk.ResponseHandler(OnResponse); base.SetResponseSensitive(Gtk.ResponseType.Accept, false); _requestedType = requestedType; Tree tree = new Tree(); tree.IsReadOnly = true; tree.Draw(_elementList); tree.Show(); _tree = tree; _tree.SetBroadcaster(this); Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow(); sw.Add(tree); base.VBox.Add(sw); sw.Show(); }
// Builds the handlers for the dettachable widgets private void BuildProperties() { System.Console.WriteLine ("BuildProperties"); _canvasArea = new Widgets.CanvasArea (); _mainVPaned.Add1 (_canvasArea); _propertiesNotebook = new Notebook (); _mainVPaned.Add2 (_propertiesNotebook); _tree = new Widgets.Tree(); _scrolledwindowTree.Add(_tree); _umlPropertiesTab = new Widgets.UMLPropertiesTab(); // Push tab into a scrolledwindow Viewport propertiesViewport = new Viewport (); propertiesViewport.ShadowType = ShadowType.None; propertiesViewport.BorderWidth = 3; propertiesViewport.Add (_umlPropertiesTab); _propertiesScroll = new ScrolledWindow (); _propertiesScroll.HscrollbarPolicy = PolicyType.Automatic; _propertiesScroll.VscrollbarPolicy = PolicyType.Automatic; _propertiesScroll.ShadowType = ShadowType.In; _propertiesScroll.BorderWidth = 3; _propertiesScroll.Add (propertiesViewport); _propertiesNotebook.AppendPage( _propertiesScroll, new Gtk.Label (GettextCatalog.GetString ("UML Properties")) ); _hub = Widgets.Hub.Instance; _hub.AddView (_tree); _hub.AddView (_canvasArea.NoteBook); _hub.AddView (_umlPropertiesTab); }