void AddPad(PadCodon padCodon, string placement, DockItemStatus defaultStatus)
        {
            RegisterPad (padCodon);

            PadWindow window = new PadWindow (this, padCodon);
            window.Icon = padCodon.Icon;
            padWindows [padCodon] = window;
            padCodons [window] = padCodon;

            window.StatusChanged += new EventHandler (UpdatePad);

            string location = ToDockLocation (placement);

            DockItem item = dock.AddItem (padCodon.PadId);
            item.Label = GettextCatalog.GetString (padCodon.Label);
            item.Icon = ImageService.GetIcon (padCodon.Icon).WithSize (IconSize.Menu);
            item.DefaultLocation = location;
            item.DefaultVisible = false;
            item.DefaultStatus = defaultStatus;
            item.DockLabelProvider = padCodon;
            window.Item = item;

            if (padCodon.Initialized) {
                CreatePadContent (true, padCodon, window, item);
            } else {
                item.ContentRequired += delegate {
                    CreatePadContent (false, padCodon, window, item);
                };
            }

            item.VisibleChanged += delegate {
                if (item.Visible)
                    window.NotifyShown ();
                else
                    window.NotifyHidden ();
            };

            item.ContentVisibleChanged += delegate {
                if (item.ContentVisible)
                    window.NotifyContentShown ();
                else
                    window.NotifyContentHidden ();
            };
        }
 public PadCommandRouterContainer(PadWindow window, Gtk.Widget child, object target, bool continueToParent)
     : base(child, target, continueToParent)
 {
 }
Example #3
0
		void CreatePadContent (bool force, PadCodon padCodon, PadWindow window, DockItem item)
		{
			if (force || item.Content == null) {
				PadContent newContent = padCodon.InitializePadContent (window);

				Gtk.Widget crc = new PadCommandRouterContainer (window, newContent.Control, newContent, true);
				crc.Show ();

				Gtk.Widget router = new PadCommandRouterContainer (window, crc, toolbarFrame, false);
				router.Show ();
				item.Content = router;
			}
		}
        void CreatePadContent(bool force, PadCodon padCodon, PadWindow window, DockItem item)
        {
            if (force || item.Content == null) {
                IPadContent newContent = padCodon.InitializePadContent (window);

                Gtk.Widget pcontent;
                if (newContent is Widget) {
                    pcontent = newContent.Control;
                } else {
                    PadCommandRouterContainer crc = new PadCommandRouterContainer (window, newContent.Control, newContent, true);
                    crc.Show ();
                    pcontent = crc;
                }

                PadCommandRouterContainer router = new PadCommandRouterContainer (window, pcontent, toolbarFrame, false);
                router.Show ();
                item.Content = router;
            }
        }
Example #5
0
        internal IMementoCapable GetMementoCapable()
        {
            PadWindow pw = (PadWindow)window;

            return(pw.GetMementoCapable());
        }