// "Coming Soon: Profile, Friends, Events etc")
        public LastfmSourceContents() : base()
        {
            HscrollbarPolicy = PolicyType.Never;
            VscrollbarPolicy = PolicyType.Automatic;

            viewport            = new Viewport();
            viewport.ShadowType = ShadowType.None;

            main_box                   = new VBox();
            main_box.Spacing           = 6;
            main_box.BorderWidth       = 5;
            main_box.ReallocateRedraws = true;

            // Clamp the width, preventing horizontal scrolling
            SizeAllocated += delegate(object o, SizeAllocatedArgs args) {
                // TODO '- 10' worked for Nereid, but not for Cubano; properly calculate the right width we should request
                main_box.WidthRequest = args.Allocation.Width - 30;
            };

            viewport.Add(main_box);

            StyleSet += delegate {
                viewport.ModifyBg(StateType.Normal, Style.Base(StateType.Normal));
                viewport.ModifyFg(StateType.Normal, Style.Text(StateType.Normal));
            };

            AddWithFrame(viewport);
            ShowAll();
        }
Ejemplo n.º 2
0
        public bool Initialize()
        {
            tmpPath = Path.Combine(Path.GetTempPath(), "monodoc");
            try {
                string mozHome = System.Environment.GetEnvironmentVariable("MOZILLA_HOME");
                if (mozHome != null)
                {
                    WebControl.CompPath = mozHome;
                }
                html_panel = new WebControl(tmpPath, "MonodocGecko");
            }
            catch (Exception ex) {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
                return(false);
            }

            html_panel.Show();     //due to Gecko bug
            html_panel.OpenUri += OnOpenUri;
            html_panel.LinkMsg += OnLinkMsg;
            panel = new Viewport();
            panel.Add(html_panel);
            cache_imgs = new Hashtable();
            return(true);
        }
Ejemplo n.º 3
0
        private void build_attack_dialog()
        {
            if (this.attack_dialog != null)
            {
                this.attack_dialog.Hide();
                this.attack_dialog.Dispose();
            }
            this.attack_dialog                 = new Dialog();
            this.attack_dialog.Title           = "Attack";
            this.attack_dialog.KeepAbove       = true;
            this.attack_dialog.Modal           = false;
            this.attack_dialog.SkipPagerHint   = true;
            this.attack_dialog.SkipTaskbarHint = true;
            this.attack_dialog.WindowPosition  = WindowPosition.Center;
            ScrolledWindow sw = new ScrolledWindow();
            Viewport       vp = new Viewport();

            this.atkdlg_vbox = new VBox();
            Label header = new Label();

            header.UseMarkup = true;
            header.LabelProp = "<b>Battle Details</b>";
            this.atkdlg_vbox.PackStart(header, false, true, 3);
            vp.Add(this.atkdlg_vbox);
            sw.Add(vp);
            this.attack_dialog.SetDefaultSize(400, 200);
            this.attack_dialog.VBox.PackStart(sw, true, true, 3);
            //this.attack_dialog.AddButton ("Close", ResponseType.Close);
        }
Ejemplo n.º 4
0
        private Widget RenderSimilarArtist(XmlNode node)
        {
            Button artist_button = new Button();

            artist_button.Relief = ReliefStyle.None;

            HBox     box = new HBox();
            Viewport vp  = new Viewport();

            vp.Add(RenderImage(node.SelectSingleNode("image_small").InnerText));
            box.PackStart(vp, false, false, 0);

            Label label = new Label();

            label.Ellipsize = Pango.EllipsizeMode.End;
            label.Xalign    = 0;

            label.Markup = String.Format("{0}\n<small><span foreground=\"grey\">{1}% {2}</span></small>",
                                         GLib.Markup.EscapeText(node.SelectSingleNode("name").InnerText).Trim(),
                                         node.SelectSingleNode("match").InnerText,
                                         Catalog.GetString("similarity"));
            box.PackEnd(label, true, true, 3);

            artist_button.Add(box);

            artist_button.Clicked += delegate(object o, EventArgs args) {
                Gnome.Url.Show(node.SelectSingleNode("url").InnerText);
            };

            return(artist_button);
        }
Ejemplo n.º 5
0
        protected override void OnPreInit(EventArgs e)
        {
            base.OnPreInit(e);
            _viewPort          = new Viewport();
            _grid              = new GridPanelEx();
            _grid.ItemType     = typeof(UserManagerModel);
            _grid.ReadData    += _grid_ReadData;
            _grid.Delete      += _grid_Delete;
            _grid.EnableAdd    = EnableAddUser;
            _grid.EnableEdit   = EnableEditUser;
            _grid.EnableRemove = EnableRemoveUser;
            _grid.Region       = Region.Center;
            _grid.ID           = "gridUsers";
            _grid.EditorConfig = new GridPanelEditorConfig();
            var _addWindowConfig = new WindowConfig();

            _addWindowConfig.Height      = 400;
            _addWindowConfig.Width       = 800;
            _addWindowConfig.Url         = AddUrl;
            _addWindowConfig.Title       = "添加用户";
            _grid.EditorConfig.AddWindow = _addWindowConfig;
            var _editWindowConfig = new WindowConfig();

            _editWindowConfig.Height = 400;
            _editWindowConfig.Width  = 800;
            _editWindowConfig.Url    = EditUrl;
            _editWindowConfig.Title  = "编辑用户";
            _editWindowConfig.ExtraParams.Add(new Parameter("id", "record.data.Id", ParameterMode.Raw));
            _grid.EditorConfig.EditWindow = _editWindowConfig;
            _viewPort.Add(_grid);
            _viewPort.Layout = "border";
            Controls.Add(_viewPort);
        }
Ejemplo n.º 6
0
        protected GroupsEditPanel(bool multiSelect = false)
        {
            gPanel = new GroupsPanel <T> (multiSelect);
            Viewport vPort = new Viewport {
                ShadowType = ShadowType.EtchedIn
            };

            vPort.Add(gPanel);
            PackStart(vPort, true, true, 0);
            PackStart(buttonsBox, false, true, 4);

            buttonsBox.Spacing = 2;
            btnNew             = CreateButton(Translator.GetString("New", "Group"), "Icons.New24.png");
            btnEdit            = CreateButton(Translator.GetString("Edit"), "Icons.Edit24.png");
            btnDelete          = CreateButton(Translator.GetString("Delete"), "Icons.Delete24.png");

            btnNew.Clicked    += btnNew_Clicked;
            btnEdit.Clicked   += btnEdit_Clicked;
            btnDelete.Clicked += btnDelete_Clicked;

            buttonsBox.PackStart(btnNew, false, false, 0);
            buttonsBox.PackStart(btnEdit, false, false, 0);
            buttonsBox.PackStart(btnDelete, false, false, 0);

            vPort.ShowAll();
            buttonsBox.ShowAll();

            ReloadGroups();
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructs the minor mode and sets up the internal
 /// sprites.
 /// </summary>
 public NewStageMinorMode()
     : base()
 {
     // Create the block with a placeholder
     block = AssetLoader.Instance.CreateSprite("Star");
     Viewport.Add(block);
 }
Ejemplo n.º 8
0
        void IPlugin.Init(object context)
        {
            ISolidReflector reflector = context as ISolidReflector;

            mainWindow = reflector.GetMainWindow();
            IAssemblyBrowser browser = reflector.GetPlugins().GetService <IAssemblyBrowser>();

            browser.SelectionChanged += OnSelectionChanged;

            ScrolledWindow scrollWindow = new ScrolledWindow();
            Viewport       viewport     = new Viewport();

            scrollWindow.Add(viewport);
            viewport.Add(nb);
            scrollWindow.ShowAll();

            nb.AppendPage(textView, new Gtk.Label("CG Text"));
            nb.AppendPage(drawingArea, new Gtk.Label("CG Visualizer"));
            nb.ShowAll();

            cgVisualizingDock                = mainWindow.DockFrame.AddItem("CGVisualizer");
            cgVisualizingDock.DrawFrame      = true;
            cgVisualizingDock.Label          = "Call Graph Visualizer";
            cgVisualizingDock.Content        = scrollWindow;
            cgVisualizingDock.DefaultVisible = true;
            cgVisualizingDock.Visible        = true;
        }
Ejemplo n.º 9
0
        private Widget CreateDataSection()
        {
            Table tblMain = new Table(1, 1, false)
            {
                RowSpacing = 2
            };

            tblMain.Attach(new Label {
                Markup = new PangoStyle {
                    Bold = true, Text = Translator.GetString("Displayed columns")
                }
            },
                           0, 1, 0, 1,
                           AttachOptions.Expand | AttachOptions.Fill,
                           AttachOptions.Fill, 0, 2);

            tblColumns = new Table(1, 1, false)
            {
                RowSpacing = 2
            };

            Alignment algColumns = new Alignment(0, 0, 1, 1)
            {
                LeftPadding = 4, RightPadding = 4, TopPadding = 4, BottomPadding = 4
            };

            algColumns.Add(tblColumns);

            Viewport viewport = new Viewport {
                ShadowType = ShadowType.None
            };

            viewport.Add(algColumns);

            ScrolledWindow scw = new ScrolledWindow {
                VscrollbarPolicy = PolicyType.Automatic, HscrollbarPolicy = PolicyType.Never
            };

            scw.Add(viewport);

            tblMain.Attach(scw, 0, 1, 1, 2,
                           AttachOptions.Expand | AttachOptions.Fill,
                           AttachOptions.Expand | AttachOptions.Fill, 0, 2);

            Alignment alg = new Alignment(0, 0, 1, 1)
            {
                LeftPadding = 4, RightPadding = 4, TopPadding = 4, BottomPadding = 4
            };

            alg.Add(tblMain);

            EventBox evbMain = new EventBox {
                alg
            };

            evbMain.ShowAll();

            return(evbMain);
        }
Ejemplo n.º 10
0
        public void AddTabView(string tabName, object control)
        {
            if (labelDictionary.ContainsKey(tabName))
            {
                return;
            }

            Viewport newViewport = new Viewport()
            {
                ShadowType = ShadowType.None,
            };

            Label newLabel = new Label
            {
                Xalign = 0.0f,
                Xpad   = 3,
                Text   = tabName
            };

            viewportDictionary.Add(tabName, newViewport);
            labelDictionary.Add(tabName, newLabel);

            if (!nbook.Children.Contains(newViewport))
            {
                nbook.AppendPage(newViewport, newLabel);
            }

            foreach (Widget child in newViewport.Children)
            {
                newViewport.Remove(child);
                child.Cleanup();
            }
            if (typeof(ViewBase).IsInstanceOfType(control))
            {
                EventBox frame = new EventBox();
#if NETFRAMEWORK
                frame.ModifyBg(StateType.Normal, mainWidget.Style.Base(StateType.Normal));
#endif
                HBox hbox   = new HBox();
                uint border = 0;
                if (tabName == "Properties")
                {
                    border = 5;
                }
                else if (tabName != "Display" & tabName != "Data")
                {
                    border = 10;
                }

                hbox.BorderWidth = border;

                ViewBase view = (ViewBase)control;
                hbox.Add(view.MainWidget);
                frame.Add(hbox);
                newViewport.Add(frame);

                newViewport.ShowAll();
            }
        }
Ejemplo n.º 11
0
        void IPlugin.Init(object context)
        {
            ISolidReflector reflector = context as ISolidReflector;

            mainWindow = reflector.GetMainWindow();
            IAssemblyBrowser browser = reflector.GetPlugins().GetService <IAssemblyBrowser>();

            browser.SelectionChanged += OnSelectionChanged;

            ScrolledWindow cfgDrawingAreaWindow   = new ScrolledWindow();
            Viewport       cfgDrawingAreaViewport = new Viewport();

            cfgDrawingAreaWindow.Add(cfgDrawingAreaViewport);
            cfgDrawingAreaViewport.Add(drawingArea);

            ScrolledWindow cfgTextAreaWindow   = new ScrolledWindow();
            Viewport       cfgTextAreaViewport = new Viewport();

            cfgTextAreaWindow.Add(cfgTextAreaViewport);
            cfgTextAreaViewport.Add(cfgTextView);

            Gtk.Notebook nb = new Gtk.Notebook();
            nb.AppendPage(cfgTextAreaWindow, new Gtk.Label("CFG Text"));
            nb.AppendPage(cfgDrawingAreaWindow, new Gtk.Label("CFG Visualizer"));
            nb.ShowAll();

            cfgVisualizingDock                = mainWindow.DockFrame.AddItem("CFG Visualizer");
            cfgVisualizingDock.Expand         = true;
            cfgVisualizingDock.DrawFrame      = true;
            cfgVisualizingDock.Label          = "CFG Visualizer";
            cfgVisualizingDock.Content        = nb;
            cfgVisualizingDock.DefaultVisible = true;
            cfgVisualizingDock.Visible        = true;

            ScrolledWindow simulationTextViewWindow = new ScrolledWindow();
            VBox           simulationVBox           = new VBox(false, 0);

            simulationTextView = new TextView();
            simulationTextViewWindow.Add(simulationTextView);
            Button simulateButton = new Button("Simulate");

            simulateButton.Clicked += HandleClicked;

            simulationVBox.PackStart(simulateButton, false, false, 0);
            simulationVBox.PackStart(new Label("New CFG: "), false, false, 0);
            simulationVBox.PackStart(simulationTextViewWindow, true, true, 0);
            simulationVBox.PackStart(new Label("Method output: "), false, false, 0);
            simulationVBox.PackEnd(outputTextView, true, true, 0);

            simulationVBox.ShowAll();

            simulationDock                = mainWindow.DockFrame.AddItem("Simulation Visualizer");
            simulationDock.Expand         = true;
            simulationDock.DrawFrame      = true;
            simulationDock.Label          = "Simulation Visualizer";
            simulationDock.Content        = simulationVBox;
            simulationDock.DefaultVisible = true;
            simulationDock.Visible        = true;
        }
Ejemplo n.º 12
0
        private void BuildListView()
        {
            _items = new List(typeof(CellBase));

            CanFocus         = true;
            ShadowType       = ShadowType.None;
            BorderWidth      = 0;
            HscrollbarPolicy = PolicyType.Never;
            VscrollbarPolicy = PolicyType.Automatic;

            _root          = new VBox();
            _refreshHeader = new Table(1, 1, true);
            _refreshHeader.HeightRequest = RefreshHeight;

            // Refresh Loading
            _refreshLabel      = new Gtk.Label();
            _refreshLabel.Text = "Loading";

            // Refresh Button
            _refreshButton = new ImageButton();
            _refreshButton.LabelWidget.SetTextFromSpan(
                new Span()
            {
                Text = "Refresh"
            });
            _refreshButton.ImageWidget.Stock = Stock.Refresh;
            _refreshButton.SetImagePosition(PositionType.Left);
            _refreshButton.Clicked += (sender, args) =>
            {
                OnRefresh?.Invoke(this, new EventArgs());
            };

            _refreshHeader.Attach(_refreshButton, 0, 1, 0, 1);

            _root.PackStart(_refreshHeader, false, false, 0);

            // Header
            _headerContainer = new EventBox();
            _root.PackStart(_headerContainer, false, false, 0);

            // List
            _list       = new VBox();
            _separators = new List <ListViewSeparator>();
            _root.PackStart(_list, true, true, 0);

            // Footer
            _footerContainer = new EventBox();
            _root.PackStart(_footerContainer, false, false, 0);

            _viewPort             = new Viewport();
            _viewPort.ShadowType  = ShadowType.None;
            _viewPort.BorderWidth = 0;
            _viewPort.Add(_root);

            Add(_viewPort);

            ShowAll();
        }
Ejemplo n.º 13
0
        public SongKickSourceContents()
        {
            //HscrollbarPolicy = PolicyType.Never;
            //VscrollbarPolicy = PolicyType.Automatic;

            viewport            = new Viewport();
            viewport.ShadowType = ShadowType.None;

            main_box = new HBox()
            {
                Spacing = 6, BorderWidth = 5, ReallocateRedraws = true
            };

            search_by_artist_contents_box   = new SearchEventsBox(new EventsByArtistSearch());
            search_by_location_contents_box = new SearchEventsBox(new EventsByLocationSearch());
            search_location_contents_box    = new SearchLocationBox(new LocationSearch());
            search_artists_contents_box     = new SearchArtistsBox(new ArtistSearch());

            recommendations_contents_box = new RecommendedArtistsBox();
            recommendations_contents_box.RowActivated += OnRecommendedArtistRowActivate;

            search_location_contents_box.View.RowActivated += SearchLocationRowActivate;
            search_artists_contents_box.View.RowActivated  += SearchArtistRowActivate;

            menu_box = BuildTiles();

            main_box.PackStart(menu_box, false, false, 0);
            contents_box = new HBox();
            main_box.PackStart(contents_box, true, true, 0);

            // set default contents box
            SetView(this.presonal_recommendation_view);

            // Clamp the width, preventing horizontal scrolling

            /*
             * SizeAllocated += delegate (object o, SizeAllocatedArgs args) {
             *  // TODO '- 10' worked for Nereid, but not for Cubano; properly calculate the right width we should request
             *  main_box.WidthRequest = args.Allocation.Width - 30;
             * };
             */

            viewport.Add(main_box);
            #pragma warning disable 612
            StyleSet += delegate {
                viewport.ModifyBg(StateType.Normal, Style.Base(StateType.Normal));
                viewport.ModifyFg(StateType.Normal, Style.Text(StateType.Normal));
            };
            #pragma warning restore 612
            recommendations_contents_box.LoadAndPresentRecommendations();

            AddWithFrame(viewport);
            ShowAll();
        }
Ejemplo n.º 14
0
        public FolderView(ViewBase owner) : base(owner)
        {
            scroller = new ScrolledWindow();
            scroller.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            table = new Table(1, 1, false);
            Viewport vport = new Viewport();

            vport.Add(table);
            vport.ShadowType = ShadowType.None;
            scroller.Add(vport);
            _mainWidget = scroller;
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Creates a new <see cref="WindowsBrowser"/> object, binding a <see cref="WebBrowser"/> to
        /// the input <see cref="Container"/>.
        /// </summary>
        /// <param name="parentContainer">The parent container which will hold the browser.</param>
        public WindowsBrowser(Container parentContainer)
        {
            parentContainer.Add(this.viewport);

            viewport.SizeAllocated += OnViewportSizeAllocated;
            viewport.Add(socket);

            socket.Realize();

            IntPtr browserHandle = browser.Handle;
            IntPtr socketHandle  = (IntPtr)socket.Id;

            SetParent(browserHandle, socketHandle);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Add tab to notebook object
        /// </summary>
        private void AddLabelTab(ref Gtk.Label lblObj, string title)
        {
            // Create and add tab for Thanks info
            ScrolledWindow sw = new ScrolledWindow();
            Viewport       vp = new Viewport();

            sw.AddWithViewport(vp);
            lblObj = new Label();
            lblObj.SetPadding(4, 4);
            lblObj.SetAlignment((float)0, (float)0);
            vp.ModifyBg(StateType.Normal, new Gdk.Color(255, 255, 255));
            vp.Add(lblObj);
            tabInfo.AppendPage(sw, new Gtk.Label(title));
        }
Ejemplo n.º 17
0
        public PosDeveloperTestDialog(Window pSourceWindow, DialogFlags pDialogFlags)
            : base(pSourceWindow, pDialogFlags)
        {
            //Init Local Vars
            String windowTitle           = Resx.window_title_dialog_template;
            String fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_default.png");

            _windowSize = new Size(595, 740);

            //Init VBox
            _vbox = new VBox(false, 2)
            {
                WidthRequest = _windowSize.Width - 44
            };

            //Call InitUI
            InitUI1();
            //InitUI_FilePicker();
            //InitUI_LittleAdds();
            //InitUI2();
            //InitUI3();

            Viewport viewport = new Viewport()
            {
                ShadowType = ShadowType.None
            };

            viewport.ResizeMode = ResizeMode.Parent;
            viewport.Add(_vbox);

            _scrolledWindow            = new ScrolledWindow();
            _scrolledWindow.ShadowType = ShadowType.EtchedIn;
            _scrolledWindow.SetPolicy(PolicyType.Never, PolicyType.Automatic);
            _scrolledWindow.ResizeMode = ResizeMode.Parent;
            _scrolledWindow.Add(viewport);

            //ActionArea Buttons
            TouchButtonIconWithText buttonOk     = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Ok);
            TouchButtonIconWithText buttonCancel = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Cancel);

            //ActionArea
            ActionAreaButtons actionAreaButtons = new ActionAreaButtons();

            actionAreaButtons.Add(new ActionAreaButton(buttonOk, ResponseType.Ok));
            actionAreaButtons.Add(new ActionAreaButton(buttonCancel, ResponseType.Cancel));

            //Init Object
            this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, _windowSize, _scrolledWindow, actionAreaButtons);
        }
Ejemplo n.º 18
0
        public void AddTabView(string tabName, object control)
        {
            Viewport tab    = null;
            Label    tablab = null;

            switch (tabName)
            {
            case "Summary":
                tab    = summaryView;
                tablab = summaryLabel;
                break;

            case "Messages":
                tab    = messagesView;
                tablab = messagesLabel;
                break;

            case "Properties":
                tab    = propertiesView;
                tablab = propertiesLabel;
                break;

            case "Version":
                tab    = versionsView;
                tablab = versionsLabel;
                break;

            default:
                throw new Exception(String.Format("Invalid tab name [{0}] used in CLEMView", tabName));
            }

            // check if tab has been added
            if (nbook.GetTabLabelText(tab) == null)
            {
                nbook.AppendPage(tab, tablab);
            }

            foreach (Widget child in tab.Children)
            {
                tab.Remove(child);
                child.Destroy();
            }
            if (typeof(ViewBase).IsInstanceOfType(control))
            {
                ViewBase view = (ViewBase)control;
                tab.Add(view.MainWidget);
                tab.ShowAll();
            }
        }
Ejemplo n.º 19
0
        public static ScrolledWindow CreateViewport()
        {
            ScrolledWindow scroller = new ScrolledWindow();
            Viewport       viewer   = new Viewport();

            Table widgets = new Table(1, 2, false);

            widgets.Attach(new Entry("This is example Entry 1"), 0, 1, 0, 1);
            widgets.Attach(new Entry("This is example Entry 2"), 1, 2, 0, 1);

            // Place the widgets in a Viewport, and the Viewport in a ScrolledWindow
            viewer.Add(widgets);
            scroller.Add(viewer);
            return(scroller);
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Add a user control to the right hand panel. If Control is null then right hand panel will be cleared.
        /// </summary>
        /// <param name="control">The control to add.</param>
        public void AddRightHandView(object control)
        {
            foreach (Widget child in rightHandView.Children)
            {
                rightHandView.Remove(child);
                child.Destroy();
            }
            ViewBase view = control as ViewBase;

            if (view != null)
            {
                rightHandView.Add(view.MainWidget);
                rightHandView.ShowAll();
            }
        }
Ejemplo n.º 21
0
        public void AddLowerView(object control)
        {
            foreach (Widget child in bottomView.Children)
            {
                bottomView.Remove(child);
                child.Cleanup();
            }
            ViewBase view = control as ViewBase;

            if (view != null)
            {
                bottomView.Add(view.MainWidget);
                bottomView.ShowAll();
            }
        }
Ejemplo n.º 22
0
        public void GuiInit()
        {
            // Load XML file
            Glade.XML gxml = new Glade.XML("gui.glade", "mainWindow", null);
            gxml.Autoconnect(this);

            // Load icons
            toolbuttonRun.IconWidget = Pixmaps.DebugStart.GetImage();
            toolbuttonRun.IconWidget.Show();
            toolbuttonStop.IconWidget = Pixmaps.DebugStopProcess.GetImage();
            toolbuttonStop.IconWidget.Show();
            toolbuttonContinue.IconWidget = Pixmaps.DebugContinue.GetImage();
            toolbuttonContinue.IconWidget.Show();
            toolbuttonStepIn.IconWidget = Pixmaps.DebugStepInto.GetImage();
            toolbuttonStepIn.IconWidget.Show();
            toolbuttonStepOver.IconWidget = Pixmaps.DebugStepOver.GetImage();
            toolbuttonStepOver.IconWidget.Show();
            toolbuttonStepOut.IconWidget = Pixmaps.DebugStepOut.GetImage();
            toolbuttonStepOut.IconWidget.Show();
            toolbuttonBreakpoint.IconWidget = Pixmaps.Breakpoint.GetImage();
            toolbuttonBreakpoint.IconWidget.Show();

            // Source code view
            sourceView = new SourceView(this);
            ScrolledWindow scrolledWindow = new ScrolledWindow();

            scrolledWindow.Add(sourceView);
            viewportSourceView.Add(scrolledWindow);
            scrolledWindow.Show();
            sourceView.Show();

            // Load pads
            mdbConsolePad = new MdbConsolePad(debuggerService);
            viewportConsole.Add(mdbConsolePad);
            callstackPad = new CallstackPad(debuggerService);
            viewportCallstack.Add(callstackPad);
            threadPad = new ThreadPad(debuggerService);
            viewportThreads.Add(threadPad);
            localsPad = new LocalsPad(debuggerService);
            viewportLocalVariables.Add(localsPad);
            breakpointsPad = new BreakpointsPad(debuggerService);
            viewportBreakpoints.Add(breakpointsPad);

            mdbConsolePad.GrabFocus();

            // Regularly update the GUI
            GLib.Timeout.Add(50, ReceiveGUIUpdates);
        }
Ejemplo n.º 23
0
        public FolderView(ViewBase owner) : base(owner)
        {
            scroller = new ScrolledWindow();
            scroller.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            table.RowHomogeneous    = true;
            table.ColumnHomogeneous = true;

            Viewport vport = new Viewport();

            vport.Add(table);
            vport.ShadowType = ShadowType.None;
            scroller.Add(vport);
            mainWidget            = scroller;
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Ejemplo n.º 24
0
	   public static ScrolledWindow CreateViewport()
	   {
		   ScrolledWindow scroller = new ScrolledWindow();
		   Viewport viewer = new Viewport();
		   
		   Table widgets = new Table(1, 2, false);
		   
		   widgets.Attach(new Button("This is example Entry 1"), 0, 1, 0, 1);
		   widgets.Attach(new Button("This is example Entry 2"), 1, 2, 0, 1);
 
		   // Place the widgets in a Viewport, and the 
		   // Viewport in a ScrolledWindow
		   viewer.Add(widgets);
		   scroller.Add(viewer);
		   return scroller;
	   }
Ejemplo n.º 25
0
        public EntryBoxValidationDatePickerMultiDates(Window pSourceWindow, string pLabelText, string pWindowTitle, List <DateTime> pInitialDatesList)
        {
            string initialDate = FrameworkUtils.CurrentDateTimeAtomic().ToString(SettingsApp.DateFormat);

            //Parameters
            _sourceWindow = pSourceWindow;

            //Init Dates List
            _datesList = pInitialDatesList;
            //Init Dates VBox
            _vbox = new VBox(false, 0);

            //Init DateEntry
            _entryBoxAddDate = new EntryBoxValidationDatePickerDialog(pSourceWindow, pLabelText, pWindowTitle, SettingsApp.RegexDate, false);
            _entryBoxAddDate.EntryValidation.Text = initialDate;
            _entryBoxAddDate.EntryValidation.Validate();
            _entryBoxAddDate.ClosePopup += _entryBoxAddDate_ClosePopup;

            VBox vboxOuter = new VBox(false, 0);

            ScrolledWindow scrolledWindow = new ScrolledWindow();

            scrolledWindow.SetPolicy(PolicyType.Never, PolicyType.Always);
            scrolledWindow.ResizeMode = ResizeMode.Parent;
            Viewport viewport = new Viewport()
            {
                ShadowType = ShadowType.None
            };

            viewport.Add(_vbox);
            scrolledWindow.Add(viewport);

            //Initial Values
            if (_datesList.Count > 0)
            {
                for (int i = 0; i < _datesList.Count; i++)
                {
                    //Assign current fileName to _entryBoxAddFile, the last added is the Visible One
                    _entryBoxAddDate.EntryValidation.Text = _datesList[i].ToString(SettingsApp.DateFormat);
                    AddDateTimeEntry(_datesList[i], false);
                }
            }

            vboxOuter.PackStart(_entryBoxAddDate, false, false, 0);
            vboxOuter.PackStart(scrolledWindow, true, true, 0);
            Add(vboxOuter);
        }
Ejemplo n.º 26
0
        public void ShowTools()
        {
            // Remove any open editor, if present.
            if (current_editor != null)
            {
                active_editor.Hide();
                widgets.Remove(active_editor);
                active_editor = null;
                current_editor.Restore();
                current_editor = null;
            }

            // No need to build the widget twice.
            if (buttons != null)
            {
                buttons.Show();
                return;
            }

            if (widgets == null)
            {
                widgets = new VBox(false, 0)
                {
                    NoShowAll = true
                };
                widgets.Show();
                var widgets_port = new Viewport();
                widgets_port.Add(widgets);
                Add(widgets_port);
                widgets_port.ShowAll();
            }

            // Build the widget (first time we call this method).
            buttons = new VButtonBox {
                BorderWidth = 5,
                Spacing     = 5,
                LayoutStyle = ButtonBoxStyle.Start
            };

            foreach (var editor in editors)
            {
                PackButton(editor);
            }

            buttons.Show();
            widgets.Add(buttons);
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Add a user control (aka GUI) to the right hand panel. If Control is null then right hand panel will be cleared.
        /// </summary>
        /// <param name="control">The control to add.</param>
        public void AddRightHandView(object control)
        {
            //remove existing Right Hand View
            foreach (Widget child in rightHandView.Children)
            {
                rightHandView.Remove(child);
                child.Cleanup();
            }
            //create new Right Hand View
            ViewBase view = control as ViewBase;

            if (view != null)
            {
                rightHandView.Add(view.MainWidget);
                rightHandView.ShowAll();
            }
        }
Ejemplo n.º 28
0
        public void AddTabView(string tabName, object control)
        {
            if (labelDictionary.ContainsKey(tabName))
            {
                return;
            }

            Viewport newViewport = new Viewport()
            {
                ShadowType = ShadowType.None,
            };

            Label newLabel = new Label
            {
                Xalign = 0.0f,
                Xpad   = 3,
                Text   = tabName
            };

            viewportDictionary.Add(tabName, newViewport);
            labelDictionary.Add(tabName, newLabel);

            if (!nbook.Children.Contains(newViewport))
            {
                nbook.AppendPage(newViewport, newLabel);
            }

            foreach (Widget child in newViewport.Children)
            {
                newViewport.Remove(child);
                child.Dispose();
            }
            if (typeof(ViewBase).IsInstanceOfType(control))
            {
                EventBox frame = new EventBox();

                HBox hbox = new HBox();

                ViewBase view = (ViewBase)control;
                hbox.Add(view.MainWidget);
                frame.Add(hbox);
                newViewport.Add(frame);

                newViewport.ShowAll();
            }
        }
        public EntryBoxValidationFilePickerMultiImages(Window pSourceWindow, String pLabelText, FileFilter pFileFilter, List <string> pInitialFileList)
        {
            //Parameters
            _sourceWindow = pSourceWindow;

            //Init Dates List
            _fileList = pInitialFileList;
            //Init Dates VBox
            _vbox = new VBox(false, 0);

            //Init AddFile
            _entryBoxAddFile = new EntryBoxValidationFilePickerDialog(pSourceWindow, pLabelText, SettingsApp.RegexAlfaNumericFilePath, false, pFileFilter);
            _entryBoxAddFile.EntryValidation.Validate();
            _entryBoxAddFile.ClosePopup += _entryBoxAddFile_ClosePopup;

            VBox vboxOuter = new VBox(false, 0);

            ScrolledWindow scrolledWindow = new ScrolledWindow();

            scrolledWindow.SetPolicy(PolicyType.Never, PolicyType.Always);
            scrolledWindow.ResizeMode = ResizeMode.Parent;
            Viewport viewport = new Viewport()
            {
                ShadowType = ShadowType.None
            };

            viewport.Add(_vbox);
            scrolledWindow.Add(viewport);

            //Initial Values
            if (_fileList.Count > 0)
            {
                for (int i = 0; i < _fileList.Count; i++)
                {
                    //Assign current fileName to _entryBoxAddFile, the last added is the Visible One
                    _entryBoxAddFile.EntryValidation.Text = _fileList[i];
                    AddFileEntry(_fileList[i], false);
                }
            }

            vboxOuter.PackStart(_entryBoxAddFile, false, false, 0);
            vboxOuter.PackStart(scrolledWindow, true, true, 0);
            Add(vboxOuter);
        }
        public RadioSourceContents()
        {
            HscrollbarPolicy = PolicyType.Never;
            VscrollbarPolicy = PolicyType.Automatic;

            viewport            = new Viewport();
            viewport.ShadowType = ShadowType.None;

            main_box                   = new VBox();
            main_box.Spacing           = 6;
            main_box.BorderWidth       = 5;
            main_box.ReallocateRedraws = true;

            // Clamp the width, preventing horizontal scrolling
            SizeAllocated += delegate(object o, SizeAllocatedArgs args) {
                main_box.WidthRequest = args.Allocation.Width - 10;
            };

            viewport.Add(main_box);

            StyleSet += delegate {
                viewport.ModifyBg(StateType.Normal, Style.Base(StateType.Normal));
                viewport.ModifyFg(StateType.Normal, Style.Text(StateType.Normal));
            };

            logo_pix = new Gdk.Pixbuf(System.Reflection.Assembly.GetExecutingAssembly()
                                      .GetManifestResourceStream("logo_color_large.gif"));
            logo = new Image(logo_pix);

            // auto-scale logo
            SizeAllocated += delegate(object o, SizeAllocatedArgs args) {
                int width = args.Allocation.Width - 50;
                logo.Pixbuf = logo_pix.ScaleSimple(width, (int)((float)width / 6.3f), Gdk.InterpType.Bilinear);
            };

            main_box.PackStart(logo, false, false, 0);

            genres = new TitledList("Genres");
            main_box.PackStart(genres, false, false, 0);

            AddWithFrame(viewport);
            ShowAll();
        }
Ejemplo n.º 31
0
        private void BuildTableView()
        {
            CanFocus         = true;
            ShadowType       = ShadowType.None;
            HscrollbarPolicy = PolicyType.Never;
            VscrollbarPolicy = PolicyType.Automatic;
            BorderWidth      = 0;

            _root = new VBox(false, 0);

            Viewport viewPort = new Viewport();

            viewPort.ShadowType = ShadowType.None;
            viewPort.Add(_root);

            Add(viewPort);

            _cells = new List <Container>();
        }
Ejemplo n.º 32
0
	private DiffWidget(Hunk[] hunks, Options options) : base(false, 0) {
		if (hunks == null || hunks.Length == 0 || options == null)
			throw new ArgumentException();
		
		if (options.LeftName != null && options.RightName != null) {
			HBox filetitles = new HBox(true, 2);
			PackStart(filetitles, false, false, 2);
			Label leftlabel = new Label(options.LeftName);
			Label rightlabel = new Label(options.RightName);
			filetitles.PackStart(leftlabel);
			filetitles.PackStart(rightlabel);
		}
		
		HBox centerpanel = new HBox(false, 0);
		PackStart(centerpanel);

		ScrolledWindow scroller = new ScrolledWindow();
		
		centerpanel.PackStart(new OverviewRenderer(scroller, hunks, options.SideBySide), false, false, 0);
		
		Viewport textviewport = new Viewport();
		
		centerpanel.PackStart(scroller);
		scroller.Add(textviewport);
		
		int nRows = 0;
		foreach (Hunk hunk in hunks) {
			if (options.SideBySide) {
				nRows += hunk.MaxLines();
			} else {
				if (hunk.Same) {
					nRows += hunk.Original().Count;
				} else {
					for (int i = 0; i < hunk.ChangedLists; i++)
						nRows += hunk.Changes(i).Count;
				}
			}
		}
		
		uint nCols = 1 + (uint)hunks[0].ChangedLists;
		if (options.SideBySide) nCols += 2;
		if (options.LineNumbers) nCols++;
		
		Table difftable = new Table((uint)nRows, (uint)nCols, false);
		textviewport.Add(difftable);	
		
		uint row = 0;
		
		Pango.FontDescription font = null;
		if (options.Font != null)
			font = Pango.FontDescription.FromString(options.Font);
		
		foreach (Hunk hunk in hunks) {
			char leftmode = hunk.Same ? ' ' : (hunk.ChangedLists == 1 && hunk.Changes(0).Count == 0) ? '-' : 'C';
			uint inc = 0;
			
			if (options.SideBySide) {
				ComposeLines(hunk.Original(), leftmode, -1, difftable, row, false, 0, options.LineWrap, font, options.LineNumbers);
				inc = (uint)hunk.Original().Count;
			} else { 
				if (leftmode == 'C') leftmode = '-';
				int altlines = -1;
				if (hunk.ChangedLists == 1 && hunk.Same)
					altlines = hunk.Changes(0).Start;
				ComposeLines(hunk.Original(), leftmode, altlines, difftable, row, true, 0, options.LineWrap, font, options.LineNumbers);
				row += (uint)hunk.Original().Count;
			}

			for (int i = 0; i < hunk.ChangedLists; i++) {
				char rightmode = hunk.Same ? ' ' : hunk.Original().Count == 0 ? '+' : 'C';
				
				if (options.SideBySide) {
					int colsper = 1 + (options.LineNumbers ? 1 : 0);			
					ComposeLines(hunk.Changes(i), rightmode, -1, difftable, row, false, (uint)((i+1)*colsper), options.LineWrap, font, options.LineNumbers);
					if (hunk.Changes(i).Count > inc)
						inc = (uint)hunk.Changes(i).Count;
				} else {
					if (rightmode == 'C') rightmode = '+';
	
					if (!hunk.Same) 
						ComposeLines(hunk.Changes(i), rightmode, -1, difftable, row, true, 0, options.LineWrap, font, options.LineNumbers);
					
					if (!hunk.Same) row += (uint)hunk.Changes(i).Count;
				}
			}
			
			if (options.SideBySide)
				row += inc;
		}
	}
Ejemplo n.º 33
0
    /**
     * Creates the "link" panel, which shows links between free blocks
     * */
    private void addLinkPanel()
    {
        //master mid panel container
        midPanel = new VBox ();

        //will store links between free blocks
        linkPanel = new VBox ();
        linkPanel.SetSizeRequest(Constants.Constants.LINK_PANEL_WIDTH, Constants.Constants.LINK_PANEL_HEIGHT);

        Label linkHeader = new Label (Constants.Constants.LinkHeader);
        linkHeader.Style = subHeaderLabelStyle.Copy ();

        linkPanel.PackStart (linkHeader, false, false, 10);

        //get the address link and insert values in form list[i] -> list[i + 1]
        List<int> addresses = FileParser.FileParser.AddressList;

        String link = "";
        for (int i = 0; i < addresses.Count; i++)
        {
            //make the link string
            link += "0x";
            link += addresses [i].ToString ("X");
            link += " -> ";

            if (i < addresses.Count - 1)
                link += ("0x" + addresses [i + 1].ToString ("X"));
            else
                link += "NULL";

            //insert it into thepanel
            Label linkInfoLabel = new Label (link);
            linkInfoLabel.Style = linkInfoStyle.Copy ();
            linkPanel.PackStart (linkInfoLabel, false, false, 5);

            //reset link
            link = "";
        }

        Viewport linkViewPort = new Viewport ();
        linkViewPort.SetSizeRequest(Constants.Constants.LINK_PANEL_WIDTH, Constants.Constants.LINK_PANEL_HEIGHT);
        linkViewPort.Add (linkPanel);

        //add the window for the graph frame
        linkWindow = new ScrolledWindow ();
        linkViewPort.SetSizeRequest(Constants.Constants.LINK_PANEL_WIDTH, Constants.Constants.LINK_PANEL_HEIGHT);
        linkWindow.Add (linkViewPort);

        //give border to legend container
        Frame f = new Frame ();
        f.Add (linkWindow);

        midPanel.PackStart (f, false, false, 10);
    }
Ejemplo n.º 34
0
    /**
     * Method will be responsible for creating all main visual information used in this tool.
     * Achieved with numerous helper methods.
     * **/
    private void addMainPanel()
    {
        //holds graph + mem row size info
        graphContainer = new VBox ();

        EventBox rowSizeLabelContainer = new EventBox ();

        Label rowSizeLabel = new Label ("Row size: " + FileParser.FileParser.MemRowSize);
        rowSizeLabel.Style = subHeaderLabelStyle.Copy ();

        rowSizeLabel.SetSizeRequest(Constants.Constants.GRAPH_SIDE, 50);
        rowSizeLabelContainer.Add (rowSizeLabel);
        graphContainer.PackStart (rowSizeLabelContainer, false, false, 10);
        populateGraph ();

        //create grid layout that will hold block information and visual representation of memory
        HBox graphHBox = new HBox ();
        graphHBox.PackStart (graph, true, true, 40);

        graphContainer.PackStart (graphHBox, false, false, 50);

        //give border to legend container
        graphFrame = new Frame ();
        graphFrame.SetSizeRequest (Constants.Constants.GRAPH_CONTAINER_SIDE, Constants.Constants.LINK_PANEL_HEIGHT + 100);

        Viewport graphViewPort = new Viewport ();

        graphViewPort.SetSizeRequest (Constants.Constants.GRAPH_CONTAINER_SIDE, Constants.Constants.LINK_PANEL_HEIGHT);
        graphViewPort.Add (graphContainer);

        //add the window for the graph frame
        graphWindow = new ScrolledWindow ();
        graphWindow.SetSizeRequest (Constants.Constants.GRAPH_SIDE, Constants.Constants.LINK_PANEL_HEIGHT);
        graphWindow.Add (graphViewPort);

        graphFrame.Add (graphWindow);
    }
Ejemplo n.º 35
0
    //========NPLOT===========
    void OnIvFtpBrowserItemActivated_NPlot(object o, ItemActivatedArgs args)
    {
        //TODO: Implement OnIvFtpBrowserItemActivated

        /* Get and parse file.
         * Populate appropriate classes.
         * --> LogFileEntries.
         * --> Graph Class
         * Plot graph and alarms.
         */

        NPlot.Gtk.PlotSurface2D graph = null;

        string selected_file = get_BrowserItem_Value (ivFtpBrowser);
        StreamReader file_reader = c_current_ftp_session.CFTP_GetFile (selected_file);

        Viewport _port = new Viewport (new Adjustment(1000, 500, 1000, 5, 0, 500),
            new Adjustment (500, 500, 500, 0, 0, 500));
        _port.WidthRequest = 2000;
        _port.ResizeMode = ResizeMode.Parent;

        c_current_logfile = new CLogFile
            (
                file_reader,
                c_current_ftp_session.CFTP_LogFileDate,
                c_current_device.DeviceFileDescription
            );

        c_current_graph = new CGraph (c_current_logfile.LogFileEntries);
        //c_current_graph.YAxisCodeIndex = c_current_logfile.CLogFile_Get_Y_Axis_Code_Index (c_current_device);
        c_current_graph.Title = selected_file;
        c_current_graph.YAxisCode = "CURTEMP";
        c_current_graph.YAxisLabel = "Current Temperature";
        c_current_graph.XAxisLabel = "Time Stamp";
        c_current_graph.CGRAPH_X_AxisData = c_current_logfile.LogFileTime;
        c_current_graph.CGRAPH_Y_AxisData = c_current_logfile.LogFileTemps;

        /**
         * Plot Graph
         */

        swGraph.Remove ((Widget)swGraph.Child);

        graph = new PlotSurface2D();
        graph.WidthRequest = 2000;
        graph.Allocation  = (new Gdk.Rectangle (0, 0, 2000, 500));

        c_current_graph.plot_nplot (out graph);

        swGraph.ReallocateRedraws = true;

        //swGraph.AddWithViewport (graph);
        _port.Add (graph);
        swGraph.ResizeMode = ResizeMode.Queue;
        swGraph.Add (_port);
        graph.QueueResize ();
        swGraph.QueueDraw ();
        swGraph.ShowAll ();

        /**
         * Fill Alarms Table
         */

        FillAlarmsTable (c_current_logfile.LogFileAlarms);

        file_reader.Close ();
        file_reader.Dispose ();

        nbFrames.CurrentPage = (int)nb_Notebook_Pages.GRAPH;
    }