public FloatingDock(DockToolbarFrame frame)
     : base(Gtk.WindowType.Toplevel)
 {
     SkipTaskbarHint = true;
     Decorated = false;
     TransientFor = frame.TopWindow;
 }
        public ArrowWindow(DockToolbarFrame frame, Direction dir)
            : base(Gtk.WindowType.Popup)
        {
            SkipTaskbarHint = true;
            Decorated = false;
            TransientFor = frame.TopWindow;

            direction = dir;
            arrow = CreateArrow ();
            if (direction == Direction.Up || direction == Direction.Down) {
                 width = PointerWidth;
                 height = LineLength + PointerLength + 1;
            } else {
                 height = PointerWidth;
                 width = LineLength + PointerLength + 1;
            }

            // Create the mask for the arrow

            Gdk.Color black, white;
            black = new Gdk.Color (0, 0, 0);
            black.Pixel = 1;
            white = new Gdk.Color (255, 255, 255);
            white.Pixel = 0;

            Gdk.Pixmap pm = new Pixmap (this.GdkWindow, width, height, 1);
            Gdk.GC gc = new Gdk.GC (pm);
            gc.Background = white;
            gc.Foreground = white;
            pm.DrawRectangle (gc, true, 0, 0, width, height);

            gc.Foreground = black;
            pm.DrawPolygon (gc, false, arrow);
            pm.DrawPolygon (gc, true, arrow);

            this.ShapeCombineMask (pm, 0, 0);

            Realize ();

            redgc = new Gdk.GC (GdkWindow);
               		redgc.RgbFgColor = new Gdk.Color (255, 0, 0);

            Resize (width, height);
        }
 internal override void RestorePosition(DockToolbarFrame frame, DockToolbar bar)
 {
     frame.FloatBar (bar, orientation, x, y);
 }
        public void Attach(IWorkbench wb)
        {
            DefaultWorkbench workbench = (DefaultWorkbench) wb;

            this.workbench = workbench;
            wbWindow = (Window) workbench;

            Gtk.VBox vbox = new VBox (false, 0);
            rootWidget = vbox;

            vbox.PackStart (workbench.TopMenu, false, false, 0);

            toolbarFrame = new CommandFrame (Runtime.Gui.CommandService.CommandManager);
            vbox.PackStart (toolbarFrame, true, true, 0);

            if (workbench.ToolBars != null) {
                for (int i = 0; i < workbench.ToolBars.Length; i++) {
                    toolbarFrame.AddBar ((DockToolbar)workbench.ToolBars[i]);
                }
            }

            // Create the docking widget and add it to the window.
            dock = new Dock ();
            DockBar dockBar = new DockBar (dock);
            Gtk.HBox dockBox = new HBox (false, 5);
            dockBox.PackStart (dockBar, false, true, 0);
            dockBox.PackStart (dock, true, true, 0);
            toolbarFrame.AddContent (dockBox);

            // Create the notebook for the various documents.
            tabControl = new DragNotebook ();
            tabControl.Scrollable = true;
            tabControl.SwitchPage += new SwitchPageHandler (ActiveMdiChanged);
            tabControl.TabsReordered += new TabsReorderedHandler (OnTabsReordered);
            DockItem item = new DockItem ("Documents", "Documents",
                              DockItemBehavior.Locked | DockItemBehavior.NoGrip);
            item.PreferredWidth = -2;
            item.PreferredHeight = -2;
            item.Add (tabControl);
            item.Show ();
            dock.AddItem (item, DockPlacement.Center);

            workbench.Add (vbox);

            vbox.PackEnd (Runtime.Gui.StatusBar.Control, false, true, 0);
            workbench.ShowAll ();

            foreach (IViewContent content in workbench.ViewContentCollection)
                ShowView (content);

            // by default, the active pad collection is the full set
            // will be overriden in CreateDefaultLayout() below
            activePadCollection = workbench.PadContentCollection;

            // create DockItems for all the pads
            foreach (IPadContent content in workbench.PadContentCollection)
            {
                AddPad (content, content.DefaultPlacement);
            }

            CreateDefaultLayout();
            //RedrawAllComponents();
            wbWindow.Show ();

            workbench.ContextChanged += contextChangedHandler;
        }
 internal void SetParentFrame(DockToolbarFrame frame)
 {
     parentFrame = frame;
 }
        public DockToolbarPanel(DockToolbarFrame parentFrame, Placement placement)
        {
            //		ResizeMode = ResizeMode.Immediate;
            Placement = placement;
            switch (placement) {
                case Placement.Top:
                    this.orientation = Orientation.Horizontal;
                    break;
                case Placement.Bottom:
                    this.orientation = Orientation.Horizontal;
                    break;
                case Placement.Left:
                    this.orientation = Orientation.Vertical;
                    break;
                case Placement.Right:
                    this.orientation = Orientation.Vertical;
                    break;
            }

            this.parentFrame = parentFrame;
        }
 internal override void RestorePosition(DockToolbarFrame frame, DockToolbar bar)
 {
     frame.DockToolbar (bar, placement, dockOffset, dockRow);
 }
 internal virtual void RestorePosition(DockToolbarFrame frame, DockToolbar bar)
 {
 }