Example #1
0
            public ICSShell(ICSClient client)
                : base()
            {
                this.client = client;
                max_chars = 16 * 1024;
                textView = new TextView ();
                textView.ModifyFont (Pango.FontDescription.
                             FromString
                             ("Monospace 9"));
                client.LineReceivedEvent += OnLineReceived;

                commandEntry = new Entry ();
                sendButton =
                    new Button (Catalog.
                            GetString ("Send"));

                ScrolledWindow win = new ScrolledWindow ();
                  win.HscrollbarPolicy =
                    win.VscrollbarPolicy =
                    PolicyType.Automatic;
                  win.Add (textView);

                  PackStart (win, true, true, 4);
                HBox box = new HBox ();
                  box.PackStart (commandEntry, true, true, 4);
                  box.PackStart (sendButton, false, false, 4);
                  PackStart (box, false, true, 4);

                  textView.Editable = false;

                  commandEntry.Activated += OnCommand;
                  sendButton.Clicked += OnCommand;
                  ShowAll ();
            }
            public RelayTournamentsView(ICSClient c)
            {
                client = c;
                tournamentIter = TreeIter.Zero;
                store = new TreeStore (typeof (int),
                               typeof (string),
                               typeof (string));
                  create_tree ();
                  refreshButton = new Button (Stock.Refresh);
                  refreshButton.Clicked += OnClicked;
                  infoLabel = new Label ();
                  infoLabel.UseMarkup = true;
                  infoLabel.Xalign = 0;
                  infoLabel.Xpad = 4;
                //infoLabel.Yalign = 0;
                //infoLabel.Ypad = 4;
                HBox box = new HBox ();
                  box.PackStart (infoLabel, true, true, 4);
                  box.PackStart (refreshButton, false, false,
                         4);
                  PackStart (box, false, true, 4);

                ScrolledWindow scroll = new ScrolledWindow ();
                  scroll.HscrollbarPolicy =
                    scroll.VscrollbarPolicy =
                    PolicyType.Automatic;
                  scroll.Add (tree);
                  PackStart (scroll, true, true, 4);
                  client.AuthEvent += OnAuth;
                  ShowAll ();
            }
Example #3
0
            public ICSShell(ICSClient client)
                : base()
            {
                this.client = client;
                textView = new ShellTextView (client);

                commandEntry = new Entry ();
                sendButton =
                    new Button (Catalog.
                            GetString ("Send"));

                ScrolledWindow win = new ScrolledWindow ();
                  win.HscrollbarPolicy =
                    win.VscrollbarPolicy =
                    PolicyType.Automatic;
                  win.Add (textView);

                  PackStart (win, true, true, 4);
                HBox box = new HBox ();
                  box.PackStart (commandEntry, true, true, 4);
                  box.PackStart (sendButton, false, false, 4);
                  PackStart (box, false, true, 4);

                  textView.Editable = false;

                  commandEntry.Activated += OnCommand;
                  sendButton.Clicked += OnCommand;
                  ShowAll ();
            }
Example #4
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;
	   }
            public GamesListWidget()
                : base()
            {
                HBox hbox = new HBox ();
                hbox.PackStart (new
                        Label (Catalog.
                               GetString
                               ("Filter")), false,
                        false, 4);

                view = CreateIconView ();
                win = new ScrolledWindow ();
                win.HscrollbarPolicy = PolicyType.Automatic;
                win.VscrollbarPolicy = PolicyType.Automatic;
                win.Add (view);
                PackStart (win, true, true, 4);

                ShowAll ();
            }
            public GamesListWidget()
                : base()
            {
                HBox hbox = new HBox ();
                  hbox.PackStart (new
                          Label (Catalog.
                             GetString
                             ("Filter")), false,
                          false, 4);
                  searchEntry = new Entry ();
                  hbox.PackStart (searchEntry, true, true, 4);
                  tree = new TreeView ();
                  PackStart (hbox, false, true, 0);

                ScrolledWindow win = new ScrolledWindow ();
                  win.HscrollbarPolicy = PolicyType.Automatic;
                  win.VscrollbarPolicy = PolicyType.Automatic;
                  win.Add (tree);
                  PackStart (win, true, true, 4);

                  SetupTree ();
                  ShowAll ();
                  searchEntry.Activated += OnSearch;
            }
Example #7
0
        public SearchResultWidget()
        {
            var vbox    = new VBox();
            var toolbar = new Toolbar()
            {
                Orientation  = Orientation.Vertical,
                IconSize     = IconSize.Menu,
                ToolbarStyle = ToolbarStyle.Icons,
            };

            this.PackStart(vbox, true, true, 0);
            this.PackStart(toolbar, false, false, 0);
            labelStatus = new Label()
            {
                Xalign  = 0,
                Justify = Justification.Left,
            };
            var hpaned = new HPaned();

            vbox.PackStart(hpaned, true, true, 0);
            vbox.PackStart(labelStatus, false, false, 0);
            var resultsScroll = new CompactScrolledWindow();

            hpaned.Pack1(resultsScroll, true, true);
            scrolledwindowLogView = new CompactScrolledWindow();
            hpaned.Pack2(scrolledwindowLogView, true, true);
            textviewLog = new TextView()
            {
                Editable = false,
            };
            scrolledwindowLogView.Add(textviewLog);

            store = new ListStore(typeof(SearchResult),
                                  typeof(bool) // didRead
                                  );

            treeviewSearchResults = new PadTreeView()
            {
                Model            = store,
                HeadersClickable = true,
                RulesHint        = true,
            };

            treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
            resultsScroll.Add(treeviewSearchResults);

            var projectColumn = new TreeViewColumn {
                Resizable    = true,
                SortColumnId = 1,
                Title        = GettextCatalog.GetString("Project"),
                Sizing       = TreeViewColumnSizing.Fixed,
                FixedWidth   = 100
            };

            var projectPixbufRenderer = new CellRendererImage();

            projectColumn.PackStart(projectPixbufRenderer, false);
            projectColumn.SetCellDataFunc(projectPixbufRenderer, ResultProjectIconDataFunc);

            var renderer = treeviewSearchResults.TextRenderer;

            renderer.Ellipsize = Pango.EllipsizeMode.End;
            projectColumn.PackStart(renderer, true);
            projectColumn.SetCellDataFunc(renderer, ResultProjectDataFunc);
            treeviewSearchResults.AppendColumn(projectColumn);

            var fileNameColumn = new TreeViewColumn {
                Resizable    = true,
                SortColumnId = 2,
                Title        = GettextCatalog.GetString("File"),
                Sizing       = TreeViewColumnSizing.Fixed,
                FixedWidth   = 200
            };

            var fileNamePixbufRenderer = new CellRendererImage();

            fileNameColumn.PackStart(fileNamePixbufRenderer, false);
            fileNameColumn.SetCellDataFunc(fileNamePixbufRenderer, FileIconDataFunc);

            fileNameColumn.PackStart(renderer, true);
            fileNameColumn.SetCellDataFunc(renderer, FileNameDataFunc);
            treeviewSearchResults.AppendColumn(fileNameColumn);


            TreeViewColumn textColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Text"),
                                                                           renderer, ResultTextDataFunc);

            textColumn.Resizable  = true;
            textColumn.Sizing     = TreeViewColumnSizing.Fixed;
            textColumn.FixedWidth = 300;

            pathColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Path"),
                                                            renderer, ResultPathDataFunc);
            pathColumn.SortColumnId = 3;
            pathColumn.Resizable    = true;
            pathColumn.Sizing       = TreeViewColumnSizing.Fixed;
            pathColumn.FixedWidth   = 500;

            store.DefaultSortFunc = DefaultSortFunc;
            store.SetSortFunc(1, CompareProjectFileNames);
            store.SetSortFunc(2, CompareFileNames);
            store.SetSortFunc(3, CompareFilePaths);

            treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;

            buttonStop = new ToolButton(new ImageView(Gui.Stock.Stop, Gtk.IconSize.Menu), null)
            {
                Sensitive = false
            };
            buttonStop.Clicked    += ButtonStopClicked;
            buttonStop.TooltipText = GettextCatalog.GetString("Stop");
            toolbar.Insert(buttonStop, -1);

            var buttonClear = new ToolButton(new ImageView(Gui.Stock.Clear, Gtk.IconSize.Menu), null);

            buttonClear.Clicked    += ButtonClearClicked;
            buttonClear.TooltipText = GettextCatalog.GetString("Clear results");
            toolbar.Insert(buttonClear, -1);

            var buttonOutput = new ToggleToolButton();

            buttonOutput.IconWidget  = new ImageView(Gui.Stock.OutputIcon, Gtk.IconSize.Menu);
            buttonOutput.Clicked    += ButtonOutputClicked;
            buttonOutput.TooltipText = GettextCatalog.GetString("Show output");
            toolbar.Insert(buttonOutput, -1);

            buttonPin             = new ToggleToolButton();
            buttonPin.IconWidget  = new ImageView(Gui.Stock.PinUp, Gtk.IconSize.Menu);
            buttonPin.Clicked    += ButtonPinClicked;
            buttonPin.TooltipText = GettextCatalog.GetString("Pin results pad");
            toolbar.Insert(buttonPin, -1);

            // store.SetSortColumnId (3, SortType.Ascending);
            ShowAll();

            scrolledwindowLogView.Hide();
            treeviewSearchResults.FixedHeightMode = true;

            UpdateStyles();
            IdeApp.Preferences.ColorScheme.Changed += UpdateStyles;
        }
        public InstrumenationChartView(InstrumentationViewerDialog parent)
        {
            Build();

            this.parent = parent;

            // The list for the List Mode

            listViewStore  = new ListStore(typeof(ListViewValueInfo), typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
            listView       = new TreeView();
            listView.Model = listViewStore;

            CellRendererText crx = new CellRendererText();

            listView.AppendColumn("Timestamp", crx, "text", 3);

            TreeViewColumn col = new TreeViewColumn();

            col.Title = "Counter";
            CellRendererPixbuf crp = new CellRendererPixbuf();

            col.PackStart(crp, false);
            col.AddAttribute(crp, "pixbuf", 1);
            col.PackStart(crx, true);
            col.AddAttribute(crx, "text", 2);
            listView.AppendColumn(col);

            listView.AppendColumn("Count", crx, "text", 4);
            listView.AppendColumn("Total Count", crx, "text", 5);
            listView.AppendColumn("Time", crx, "text", 6);

            listView.RowActivated += HandleListViewRowActivated;

            listViewScrolled = new ScrolledWindow();
            listViewScrolled.Add(listView);
            listViewScrolled.ShadowType       = ShadowType.In;
            listViewScrolled.HscrollbarPolicy = PolicyType.Automatic;
            listViewScrolled.VscrollbarPolicy = PolicyType.Automatic;
            listViewScrolled.ShowAll();
            boxCharts.PackStart(listViewScrolled, true, true, 0);

            // The series list

            seriesStore      = new ListStore(typeof(bool), typeof(Gdk.Pixbuf), typeof(string), typeof(ChartSerieInfo), typeof(String), typeof(String), typeof(String));
            listSeries.Model = seriesStore;

            col       = new TreeViewColumn();
            col.Title = "Counter";
            CellRendererToggle crt = new CellRendererToggle();

            col.PackStart(crt, false);
            col.AddAttribute(crt, "active", 0);

            crp = new CellRendererPixbuf();
            col.PackStart(crp, false);
            col.AddAttribute(crp, "pixbuf", 1);

            crx = new CellRendererText();
            col.PackStart(crx, true);
            col.AddAttribute(crx, "text", 2);
            listSeries.AppendColumn(col);

            listSeries.AppendColumn("Last", crx, "text", 4);
            listSeries.AppendColumn("Sel", crx, "text", 5);
            listSeries.AppendColumn("Diff", crx, "text", 6);

            crt.Toggled += SerieToggled;

            countChart = new BasicChart();
            countAxisY = new IntegerAxis(true);
            countAxisX = new DateTimeAxis(true);
            countChart.AddAxis(countAxisX, AxisPosition.Bottom);
            countChart.AddAxis(countAxisY, AxisPosition.Right);
            countChart.OriginY = 0;
            countChart.StartY  = 0;
//			countChart.EndY = 100;
            countChart.AllowSelection = true;
            countChart.SetAutoScale(AxisDimension.Y, false, true);
            countChart.SelectionStart.LabelAxis = countAxisX;
            countChart.SelectionEnd.LabelAxis   = countAxisX;
            countChart.SelectionChanged        += CountChartSelectionChanged;

            timeChart = new BasicChart();
            timeAxisY = new IntegerAxis(true);
            timeAxisX = new DateTimeAxis(true);
            timeChart.AddAxis(timeAxisX, AxisPosition.Bottom);
            timeChart.AddAxis(timeAxisY, AxisPosition.Right);
            timeChart.OriginY        = 0;
            timeChart.StartY         = 0;
            timeChart.EndY           = 100;
            timeChart.AllowSelection = true;
//			timeChart.SetAutoScale (AxisDimension.Y, true, true);
            timeChart.SelectionStart.LabelAxis = timeAxisX;
            timeChart.SelectionEnd.LabelAxis   = timeAxisX;

            frameCharts.PackStart(countChart, true, true, 0);
            frameCharts.PackStart(timeChart, true, true, 0);
            frameCharts.ShowAll();

            if (App.FromFile)
            {
                if (visibleTime > App.Service.EndTime - App.Service.StartTime)
                {
                    visibleTime = App.Service.EndTime - App.Service.StartTime;
                }
                startTime = App.Service.StartTime;
                endTime   = startTime + visibleTime;
            }
            else
            {
                endTime   = DateTime.Now;
                startTime = endTime - visibleTime;
            }

            DateTime st = App.Service.StartTime;

            if (st > startTime)
            {
                st = startTime;
            }

            chartScroller.Adjustment.Lower = st.Ticks;

            UpdateCharts();
            chartScroller.Value = chartScroller.Adjustment.Upper;

            if (!App.FromFile)
            {
                StartAutoscroll();
            }

            toggleTimeView.Active = true;
        }
Example #9
0
        public WebBrowserShell(string name, WebView view) : base(2, 3, false)
        {
            this.name = name;
            this.view = view;

            RowSpacing = 5;

            view.LoadStatusChanged += (o, e) => {
                if (view.LoadStatus == OssiferLoadStatus.FirstVisuallyNonEmptyLayout)
                {
                    UpdateTitle(view.Title);

                    switch (search_clear_on_navigate_state)
                    {
                    case 1:
                        search_clear_on_navigate_state = 2;
                        break;

                    case 2:
                        search_clear_on_navigate_state = 0;
                        search_entry.Query             = String.Empty;
                        break;
                    }
                }
            };

            view.Ready += (o, e) => navigation_control.WebView = view;

            navigation_control.GoHomeEvent += (o, e) => view.GoHome();

            Attach(navigation_control, 0, 1, 0, 1,
                   AttachOptions.Shrink,
                   AttachOptions.Shrink,
                   0, 0);

            title.Xalign    = 0.0f;
            title.Xpad      = 6;
            title.Ellipsize = Pango.EllipsizeMode.End;

            Attach(title, 1, 2, 0, 1,
                   AttachOptions.Expand | AttachOptions.Fill,
                   AttachOptions.Shrink,
                   0, 0);

            search_entry.SetSizeRequest(260, -1);
            search_entry.ShowSearchIcon = true;
            search_entry.Show();
            search_entry.Activated += (o, e) => {
                view.GoSearch(search_entry.Query);
                view.HasFocus = true;
                search_clear_on_navigate_state = 1;
            };
            Attach(search_entry, 2, 3, 0, 1,
                   AttachOptions.Fill,
                   AttachOptions.Shrink,
                   0, 0);

            view_scroll.Add(view);
            view_scroll.ShadowType = ShadowType.In;

            Attach(view_scroll, 0, 3, 1, 2,
                   AttachOptions.Expand | AttachOptions.Fill,
                   AttachOptions.Expand | AttachOptions.Fill,
                   0, 0);

            UpdateTitle(String.Format(Catalog.GetString("Loading {0}..."), name));

            ShowAll();
        }
Example #10
0
        private void InitUI()
        {
            //Get Values from Config
            Guid systemCountry;
            Guid systemCurrency;
            bool debug = false;
            bool useDatabaseDataDemo = Convert.ToBoolean(GlobalFramework.Settings["useDatabaseDataDemo"]);

            if (GlobalFramework.Settings["xpoOidConfigurationCountrySystemCountry"] != string.Empty)
            {
                systemCountry = new Guid(GlobalFramework.Settings["xpoOidConfigurationCountrySystemCountry"]);
            }
            else
            {
                systemCountry = SettingsApp.XpoOidConfigurationCountryPortugal;
            }

            if (GlobalFramework.Settings["xpoOidConfigurationCurrencySystemCurrency"] != string.Empty)
            {
                systemCurrency = new Guid(GlobalFramework.Settings["xpoOidConfigurationCurrencySystemCurrency"]);
            }
            else
            {
                systemCurrency = SettingsApp.XpoOidConfigurationCurrencyEuro;
            }

            //Init Inital Values
            CFG_ConfigurationCountry  intialValueConfigurationCountry  = (CFG_ConfigurationCountry)FrameworkUtils.GetXPGuidObject(typeof(CFG_ConfigurationCountry), systemCountry);
            CFG_ConfigurationCurrency intialValueConfigurationCurrency = (CFG_ConfigurationCurrency)FrameworkUtils.GetXPGuidObject(typeof(CFG_ConfigurationCurrency), systemCurrency);

            try
            {
                //Init dictionary for Parameters + Widgets
                _dictionaryObjectBag = new Dictionary <CFG_ConfigurationPreferenceParameter, EntryBoxValidation>();

                //Pack VBOX
                VBox vbox = new VBox(true, 2)
                {
                    WidthRequest = 300
                };

                //Country
                CriteriaOperator criteriaOperatorSystemCountry = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1) AND (RegExFiscalNumber IS NOT NULL)");
                _entryBoxSelectSystemCountry = new XPOEntryBoxSelectRecordValidation <CFG_ConfigurationCountry, TreeViewConfigurationCountry>(this, Resx.global_country, "Designation", "Oid", intialValueConfigurationCountry, criteriaOperatorSystemCountry, SettingsApp.RegexGuid, true);
                _entryBoxSelectSystemCountry.EntryValidation.IsEditable = false;
                _entryBoxSelectSystemCountry.EntryValidation.Validate(_entryBoxSelectSystemCountry.Value.Oid.ToString());
                //Disabled, Now Country and Currency are disabled
                _entryBoxSelectSystemCountry.ButtonSelectValue.Sensitive = true;
                _entryBoxSelectSystemCountry.EntryValidation.Sensitive   = true;
                _entryBoxSelectSystemCountry.ClosePopup += delegate
                {
                    ////Require to Update RegEx
                    _entryBoxZipCode.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExZipCode;
                    _entryBoxZipCode.EntryValidation.Validate();
                    //Require to Update RegEx and Criteria to filter Country Clients Only
                    _entryBoxFiscalNumber.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExFiscalNumber;
                    _entryBoxFiscalNumber.EntryValidation.Validate();
                    if (_entryBoxFiscalNumber.EntryValidation.Validated)
                    {
                        bool isValidFiscalNumber = FiscalNumber.IsValidFiscalNumber(_entryBoxFiscalNumber.EntryValidation.Text, _entryBoxSelectSystemCountry.Value.Code2);
                        _entryBoxFiscalNumber.EntryValidation.Validated = isValidFiscalNumber;
                    }
                    //Call Main Validate
                    Validate();
                };

                //Currency
                CriteriaOperator criteriaOperatorSystemCurrency = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1)");
                _entryBoxSelectSystemCurrency = new XPOEntryBoxSelectRecordValidation <CFG_ConfigurationCurrency, TreeViewConfigurationCurrency>(this, Resx.global_currency, "Designation", "Oid", intialValueConfigurationCurrency, criteriaOperatorSystemCurrency, SettingsApp.RegexGuid, true);
                _entryBoxSelectSystemCurrency.EntryValidation.IsEditable = false;
                _entryBoxSelectSystemCurrency.EntryValidation.Validate(_entryBoxSelectSystemCurrency.Value.Oid.ToString());

                //Disabled, Now Country and Currency are disabled
                //_entryBoxSelectSystemCurrency.ButtonSelectValue.Sensitive = false;
                //_entryBoxSelectSystemCurrency.EntryValidation.Sensitive = false;
                _entryBoxSelectSystemCurrency.ClosePopup += delegate
                {
                    //Call Main Validate
                    Validate();
                };

                //Add to Vbox
                vbox.PackStart(_entryBoxSelectSystemCountry, true, true, 0);
                vbox.PackStart(_entryBoxSelectSystemCurrency, true, true, 0);

                //Start Render Dynamic Inputs
                CriteriaOperator criteriaOperator = CriteriaOperator.Parse("(Disabled = 0 OR Disabled is NULL) AND (FormType = 1 AND FormPageNo = 1)");
                SortProperty[]   sortProperty     = new SortProperty[2];
                sortProperty[0] = new SortProperty("Ord", SortingDirection.Ascending);
                XPCollection xpCollection = new XPCollection(GlobalFramework.SessionXpo, typeof(CFG_ConfigurationPreferenceParameter), criteriaOperator, sortProperty);
                if (xpCollection.Count > 0)
                {
                    string label    = string.Empty;
                    string regEx    = string.Empty;
                    object regExObj = null;
                    bool   required = false;

                    foreach (CFG_ConfigurationPreferenceParameter item in xpCollection)
                    {
                        label = (item.ResourceString != null && Resx.ResourceManager.GetString(item.ResourceString) != null)
                            ? Resx.ResourceManager.GetString(item.ResourceString)
                            : string.Empty;
                        regExObj = FrameworkUtils.GetFieldValueFromType(typeof(SettingsApp), item.RegEx);
                        regEx    = (regExObj != null) ? regExObj.ToString() : string.Empty;
                        required = Convert.ToBoolean(item.Required);

                        //Override Db Regex
                        if (item.Token == "COMPANY_POSTALCODE")
                        {
                            regEx = _entryBoxSelectSystemCountry.Value.RegExZipCode;
                        }
                        if (item.Token == "COMPANY_FISCALNUMBER")
                        {
                            regEx = _entryBoxSelectSystemCountry.Value.RegExFiscalNumber;
                        }

                        //Debug
                        //_log.Debug(string.Format("Label: [{0}], RegEx: [{1}], Required: [{2}]", label, regEx, required));

                        EntryBoxValidation entryBoxValidation = new EntryBoxValidation(
                            this,
                            label,
                            KeyboardMode.AlfaNumeric,
                            regEx,
                            required
                            )
                        {
                            Name = item.Token
                        };

                        //Only Assign Value if Debugger Attached : Now the value for normal user is cleaned in Init Database, we keep this code here, may be usefull
                        if (Debugger.IsAttached == true || useDatabaseDataDemo)
                        {
                            entryBoxValidation.EntryValidation.Text = item.Value;
                        }
                        if (Debugger.IsAttached == true)
                        {
                            if (debug)
                            {
                                _log.Debug(String.Format("[{0}:{1}]:item.Value: [{2}], entryBoxValidation.EntryValidation.Text: [{3}]", Debugger.IsAttached == true, useDatabaseDataDemo, item.Value, entryBoxValidation.EntryValidation.Text));
                            }
                        }

                        //Assign shared Event
                        entryBoxValidation.EntryValidation.Changed += EntryValidation_Changed;

                        //If is ZipCode Assign it to _entryBoxZipCode Reference
                        if (item.Token == "COMPANY_POSTALCODE")
                        {
                            _entryBoxZipCode = entryBoxValidation;
                            _entryBoxZipCode.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExZipCode;
                        }
                        //If is FiscalNumber Assign it to entryBoxSelectCustomerFiscalNumber Reference
                        else if (item.Token == "COMPANY_FISCALNUMBER")
                        {
                            _entryBoxFiscalNumber = entryBoxValidation;
                            _entryBoxFiscalNumber.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExFiscalNumber;
                        }

                        if (item.Token == "COMPANY_TAX_ENTITY")
                        {
                            entryBoxValidation.EntryValidation.Text = "Global";
                        }

                        //Call Validate
                        entryBoxValidation.EntryValidation.Validate();
                        //Pack and Add to ObjectBag
                        vbox.PackStart(entryBoxValidation, true, true, 0);
                        _dictionaryObjectBag.Add(item, entryBoxValidation);
                    }
                }

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

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

                viewport.ResizeMode        = ResizeMode.Parent;
                _scrolledWindow.ResizeMode = ResizeMode.Parent;
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Example #11
0
        void CreateControl()
        {
            control = new HPaned();

            store = new Gtk.TreeStore(typeof(Xwt.Drawing.Image),               // image - type
                                      typeof(bool),                            // read?
                                      typeof(TaskListEntry),                   // read? -- use Pango weight
                                      typeof(string));
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__Type", "store__Read", "store__Task", "store__Description");

            TypeDescriptor.AddAttributes(store, modelAttr);

            TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc(FilterTasks);

            filter             = new TreeModelFilter(store, null);
            filter.VisibleFunc = filterFunct;

            sort = new TreeModelSort(filter);
            sort.SetSortFunc(VisibleColumns.Type, SeverityIterSort);
            sort.SetSortFunc(VisibleColumns.Project, ProjectIterSort);
            sort.SetSortFunc(VisibleColumns.File, FileIterSort);

            view = new PadTreeView(sort);
            view.ShowExpanders = true;
            view.RulesHint     = true;
            view.DoPopupMenu   = (evnt) => IdeApp.CommandService.ShowContextMenu(view, evnt, CreateMenu());
            AddColumns();
            LoadColumnsVisibility();
            view.Columns[VisibleColumns.Type].SortColumnId    = VisibleColumns.Type;
            view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project;
            view.Columns[VisibleColumns.File].SortColumnId    = VisibleColumns.File;

            sw            = new MonoDevelop.Components.CompactScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(view);
            TaskService.Errors.TasksRemoved += ShowResults;
            TaskService.Errors.TasksAdded   += TaskAdded;
            TaskService.Errors.TasksChanged += TaskChanged;
            TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged;

            IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
            IdeApp.Workspace.LastWorkspaceItemClosed  += OnCombineClosed;

            view.RowActivated += new RowActivatedHandler(OnRowActivated);

            iconWarning = ImageService.GetIcon(Ide.Gui.Stock.Warning, Gtk.IconSize.Menu);
            iconError   = ImageService.GetIcon(Ide.Gui.Stock.Error, Gtk.IconSize.Menu);
            iconInfo    = ImageService.GetIcon(Ide.Gui.Stock.Information, Gtk.IconSize.Menu);
            iconEmpty   = ImageService.GetIcon(Ide.Gui.Stock.Empty, Gtk.IconSize.Menu);

            control.Add1(sw);

            outputView = new LogView {
                Name = "buildOutput"
            };
            control.Add2(outputView);

            control.ShowAll();

            control.SizeAllocated += HandleControlSizeAllocated;

            bool outputVisible = OutputViewVisible;

            if (outputVisible)
            {
                outputView.Visible = true;
                logBtn.Active      = true;
            }
            else
            {
                outputView.Hide();
            }

            sw.SizeAllocated += HandleSwSizeAllocated;

            // Load existing tasks
            foreach (TaskListEntry t in TaskService.Errors)
            {
                AddTask(t);
            }

            control.FocusChain = new Gtk.Widget [] { sw };
        }
Example #12
0
        private void InitializeComponent()
        {
            this.plotView = new OxyPlot.GtkSharp.PlotView();
            this.plotView.SetSizeRequest(300, 300);

            this.treeView         = new TreeView();
            this.treeView.Visible = true;

            var    treeModel = new TreeStore(typeof(string), typeof(string));
            var    iter      = new TreeIter();
            string last      = null;

            foreach (var ex in this.Examples)
            {
                if (last == null || last != ex.Category)
                {
                    iter = treeModel.AppendValues(ex.Category);
                    last = ex.Category;
                }

                treeModel.AppendValues(iter, ex.Title);
            }

            this.treeView.Model = treeModel;
            var exampleNameColumn = new TreeViewColumn {
                Title = "Example"
            };
            var exampleNameCell = new CellRendererText();

            exampleNameColumn.PackStart(exampleNameCell, true);
            this.treeView.AppendColumn(exampleNameColumn);
            exampleNameColumn.AddAttribute(exampleNameCell, "text", 0);

            this.treeView.Selection.Changed += (s, e) =>
            {
                TreeIter  selectedNode;
                TreeModel selectedModel;
                if (treeView.Selection.GetSelected(out selectedModel, out selectedNode))
                {
                    string val1 = (string)selectedModel.GetValue(selectedNode, 0);
                    string val2 = (string)selectedModel.GetValue(selectedNode, 1);

                    var info = this.Examples.FirstOrDefault(ex => ex.Title == val1)
                               ?? this.Examples.FirstOrDefault(ex => ex.Category == val1);
                    if (info != null)
                    {
                        this.SelectedExample = info;
                    }
                }
            };

            var scrollwin = new ScrolledWindow();

            scrollwin.Add(this.treeView);
            scrollwin.SetSizeRequest(250, 300);

            var txtSearch = new Entry();

            treeView.SearchEntry = txtSearch;
            var treeVbox = new VBox(false, 0);

            treeVbox.BorderWidth = 6;
            treeVbox.PackStart(txtSearch, false, true, 0);
            treeVbox.PackStart(scrollwin, true, true, 0);

            this.paned = new HPaned();
            this.paned.Pack1(treeVbox, false, false);
            this.paned.Pack2(this.plotView, true, false);
            this.paned.Position = 300;

            this.Add(this.paned);

            //this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            //this.AutoScaleMode = Gtk.AutoScaleMode.Font;
            //this.ClientSize = new System.Drawing.Size(943, 554);
            this.Title        = "OxyPlot.GtkSharp Example Browser";
            this.DeleteEvent += (s, a) =>
            {
                Application.Quit();
                a.RetVal = true;
            };
        }
Example #13
0
        public bool Execute(Tag t)
        {
            this.CreateDialog("edit_icon_dialog");

            this.Dialog.Title = String.Format(Catalog.GetString("Edit Icon for Tag {0}"), t.Name);

            PreviewPixbuf = t.Icon;

            query = new FSpot.PhotoQuery(db.Photos);

            if (db.Tags.Hidden != null)
            {
                query.Terms = FSpot.OrTerm.FromTags(new Tag [] { t, db.Tags.Hidden });
            }
            else
            {
                query.Terms = new FSpot.Literal(t);
            }

            image_view = new FSpot.PhotoImageView(query);
            image_view.SelectionXyRatio  = 1.0;
            image_view.SelectionChanged += HandleSelectionChanged;
            image_view.PhotoChanged     += HandlePhotoChanged;

            external_photo_chooser = new Gtk.FileChooserButton(Catalog.GetString("Select Photo from file"),
                                                               Gtk.FileChooserAction.Open);

            external_photo_chooser.Filter = new FileFilter();
            external_photo_chooser.Filter.AddPixbufFormats();
            external_photo_chooser.LocalOnly = false;
            external_photo_chooser_hbox.PackStart(external_photo_chooser);

            Dialog.ShowAll();
            external_photo_chooser.SelectionChanged += HandleExternalFileSelectionChanged;

            photo_scrolled_window.Add(image_view);

            if (query.Count > 0)
            {
                photo_spin_button.Wrap                     = true;
                photo_spin_button.Adjustment.Lower         = 1.0;
                photo_spin_button.Adjustment.Upper         = (double)query.Count;
                photo_spin_button.Adjustment.StepIncrement = 1.0;
                photo_spin_button.ValueChanged            += HandleSpinButtonChanged;

                image_view.Item.Index = 0;
            }
            else
            {
                from_photo_label.Markup = String.Format(Catalog.GetString(
                                                            "\n<b>From Photo</b>\n" +
                                                            " You can use one of your library photos as an icon for this tag.\n" +
                                                            " However, first you must have at least one photo associated\n" +
                                                            " with this tag. Please tag a photo as '{0}' and return here\n" +
                                                            " to use it as an icon."), t.Name);
                photo_scrolled_window.Visible = false;
                photo_label.Visible           = false;
                photo_spin_button.Visible     = false;
            }

            icon_store = new ListStore(typeof(string), typeof(Gdk.Pixbuf));

            icon_view = new Gtk.IconView(icon_store);
            icon_view.PixbufColumn      = 1;
            icon_view.SelectionMode     = SelectionMode.Single;
            icon_view.SelectionChanged += HandleIconSelectionChanged;

            icon_scrolled_window.Add(icon_view);

            icon_view.Show();

            image_view.Show();

            FSpot.Delay fill_delay = new FSpot.Delay(FillIconView);
            fill_delay.Start();

            ResponseType response = (ResponseType)this.Dialog.Run();
            bool         success  = false;

            if (response == ResponseType.Ok)
            {
                try {
                    if (IconName != null)
                    {
                        t.ThemeIconName = IconName;
                    }
                    else
                    {
                        t.ThemeIconName = null;
                        t.Icon          = PreviewPixbuf_WithoutProfile;
                    }
                    //db.Tags.Commit (t);
                    success = true;
                } catch (Exception ex) {
                    // FIXME error dialog.
                    Console.WriteLine("error {0}", ex);
                }
            }
            else if (response == (ResponseType)(1))
            {
                t.Icon  = null;
                success = true;
            }

            this.Dialog.Destroy();
            return(success);
        }
Example #14
0
        public static void Main(string[] args)
        {
            //start window
            timeSpan = TimeSpan.FromSeconds(0);
            Application.Init();
            window = new Window("Editor Window");
            window.SetPosition(WindowPosition.Center);
            window.HeightRequest = 600;
            window.WidthRequest  = 900;

            //new TreeView
            view = new TreeView();
            view.WidthRequest = 900;

            TreeViewColumn column = new TreeViewColumn();

            column.Title = "Please, hire me!!";

            //init labels and buttons
            searchTimeLabel = new Label("Search time: ");
            searchFileLast  = new Label("Last file: ".PadRight(60));
            searchFileLast.SetAlignment(0, 0.65f);

            searchDirCurrent = new Label("Searching dir: ".PadRight(60));
            searchDirCurrent.SetAlignment(0.1f, 0.65f);

            start           = new Button("Start");
            start.Clicked  += new EventHandler(Start);
            pause           = new Button("Pause");
            pause.Sensitive = false;
            pause.Clicked  += new EventHandler(Pause);
            stop            = new Button("Stop");
            stop.Sensitive  = false;
            stop.Clicked   += new EventHandler(Stop);
            dir             = new Entry("enter the directory");
            reg             = new Entry("enter the regex");
            ScrolledWindow scroller = new ScrolledWindow();

            scroller.BorderWidth = 5;
            scroller.ShadowType  = ShadowType.In;

            CellRendererText cell = new CellRendererText();

            column.PackStart(cell, true);

            view.AppendColumn(column);

            column.AddAttribute(cell, "text", 0);

            store = new TreeStore(typeof(string));
            TreeIter treeIter = store.AppendValues("SearchResult");

            view.Model         = store;
            view.ShowExpanders = true;

            //set labels and buttons
            hb.PackStart(start, false, false, 5);
            hb.PackStart(pause, false, false, 5);
            hb.PackStart(stop, false, false, 5);
            hb.Add(dir);
            hb.Add(reg);
            searchTimeLabel.SetAlignment(0.2f, 0.65f);
            hb.Add(searchTimeLabel);

            hbinfo.Add(searchDirCurrent);
            hbinfo.Add(searchFileLast);

            vb.PackStart(hb, false, false, 5);
            vb.PackStart(hbinfo, false, false, 5);

            scroller.Add(view);
            vb.Add(scroller);
            GLib.Timeout.Add(1, updateTimeLabel);
            GLib.Timeout.Add(1, updateLastFileLabel);
            GLib.Timeout.Add(1, updateCurrentDir);

            window.Add(vb);

            window.Destroyed += new EventHandler(onClosed);

            window.ShowAll();

            //show all items in window
            Application.Run();
        }
        public GtkErrorDialog(Window parent, string title, string message, AlertButton[] buttons)
        {
            if (string.IsNullOrEmpty(title))
            {
                throw new ArgumentException();
            }
            if (buttons == null)
            {
                throw new ArgumentException();
            }

            Title          = BrandingService.ApplicationName;
            TransientFor   = parent;
            Modal          = true;
            WindowPosition = Gtk.WindowPosition.CenterOnParent;
            DefaultWidth   = 624;
            DefaultHeight  = 142;

            this.VBox.BorderWidth = 2;

            var hbox = new HBox()
            {
                Spacing     = 6,
                BorderWidth = 12,
            };

            var errorImage = new Image(Gtk.Stock.DialogError, IconSize.Dialog)
            {
                Yalign = 0F,
            };

            hbox.PackStart(errorImage, false, false, 0);
            this.VBox.Add(hbox);

            var vbox = new VBox()
            {
                Spacing = 6,
            };

            hbox.PackEnd(vbox, true, true, 0);

            var titleLabel = new Label()
            {
                Markup = "<b>" + GLib.Markup.EscapeText(title) + "</b>",
                Xalign = 0F,
            };

            vbox.PackStart(titleLabel, false, false, 0);

            if (!string.IsNullOrWhiteSpace(message))
            {
                message = message.Trim();
                var descriptionLabel = new Label(message)
                {
                    Xalign     = 0F,
                    Selectable = true,
                };
                descriptionLabel.LineWrap     = true;
                descriptionLabel.WidthRequest = 500;
                descriptionLabel.ModifyBg(StateType.Normal, new Gdk.Color(255, 0, 0));
                vbox.PackStart(descriptionLabel, false, false, 0);
            }

            expander = new Expander(GettextCatalog.GetString("Details"))
            {
                CanFocus = true,
                Visible  = false,
            };
            vbox.PackEnd(expander, true, true, 0);

            var sw = new ScrolledWindow()
            {
                HeightRequest = 180,
                ShadowType    = ShadowType.Out,
            };

            expander.Add(sw);

            detailsTextView = new TextView()
            {
                CanFocus = true,
            };
            detailsTextView.KeyPressEvent += TextViewKeyPressed;
            sw.Add(detailsTextView);

            var aa = this.ActionArea;

            aa.Spacing     = 10;
            aa.LayoutStyle = ButtonBoxStyle.End;
            aa.BorderWidth = 5;
            aa.Homogeneous = true;

            expander.Activated += delegate {
                this.AllowGrow = expander.Expanded;
                GLib.Timeout.Add(100, delegate {
                    Resize(DefaultWidth, 1);
                    return(false);
                });
            };

            tagNoWrap          = new TextTag("nowrap");
            tagNoWrap.WrapMode = WrapMode.None;
            detailsTextView.Buffer.TagTable.Add(tagNoWrap);

            tagWrap          = new TextTag("wrap");
            tagWrap.WrapMode = WrapMode.Word;
            detailsTextView.Buffer.TagTable.Add(tagWrap);

            this.Buttons = buttons;
            for (int i = 0; i < Buttons.Length; i++)
            {
                Gtk.Button button;
                button = new Gtk.Button(Buttons[i].Label);
                button.ShowAll();
                AddActionWidget(button, i);
            }

            Child.ShowAll();
            Hide();
        }
Example #16
0
        public MainWindow()
            : base("CAS.NET")
        {
            DeleteEvent += (o, a) => Gtk.Application.Quit();



            textviews = new TextViewList(user, Eval, this);
            DefBox    = new DefinitionBox(Eval);

            // Initiating menu elements
            server        = new ServerMenuItem();
            login         = new LoginMenuItem(user, menu);
            logout        = new LogoutMenuItem(user, menu);
            stdGetAsmList = new StudentGetAssignmentListMenuItem(user, textviews);
            teaAddAsm     = new TeacherAddAssignmentMenuItem(user, textviews);
            teaGetAsmList = new TeacherGetAssignmentListMenuItem(user, textviews);

            taskGenSubMenu      = new TaskGenMenuItem(textviews);
            taskGenMenuAlgItem  = new TaskGenAritMenuItem(textviews);
            taskGenMenuUnitItem = new TaskGenUnitMenuItem(textviews);

            geometMenuItem = new GeometMenuItem(textviews);

            // Adding elements to menu
            server.Submenu = menu;
            menu.Append(login);
            menu.Append(logout);
            menu.Append(stdGetAsmList);
            menu.Append(teaAddAsm);
            menu.Append(teaGetAsmList);

            taskGenSubMenu.Submenu = taskgenMenu;
            taskgenMenu.Append(taskGenMenuAlgItem);
            taskgenMenu.Append(taskGenMenuUnitItem);

            geometMenuItem.Submenu = geometMenu;

            menubar.Append(server);
            menubar.Append(taskGenSubMenu);
            menubar.Append(geometMenuItem);

            open = new OpenToolButton(textviews, ref user);
            save = new SaveToolButton(textviews);
            neo  = new NewToolButton(textviews);

            SeparatorToolItem separator1 = new SeparatorToolItem();

            bold      = new BoldToolButton(ref textviews);
            italic    = new ItalicToolButton(ref textviews);
            underline = new UnderlineToolButton(ref textviews);

            SeparatorToolItem separator2 = new SeparatorToolItem();

            movabletextview      = new MovableTextViewToolButton(ref textviews);
            movablecalcview      = new MovableCalcViewToolButton(ref textviews);
            movablecalcmultiline = new MovableCasCalcMultilineToolButton(ref textviews);
            movabledrawcanvas    = new MovableDrawCanvasToolButton(ref textviews);
            movablecasresult     = new MovableResultToolButton(ref textviews);

            toolbar.Add(open);
            toolbar.Add(save);
            toolbar.Add(neo);
            toolbar.Add(separator1);
            toolbar.Add(bold);
            toolbar.Add(italic);
            toolbar.Add(underline);
            toolbar.Add(separator2);
            toolbar.Add(movabletextview);
            toolbar.Add(movablecalcview);
            toolbar.Add(movablecalcmultiline);
            //toolbar.Add(movabledrawcanvas);
            toolbar.Add(movablecasresult);

            VBox vbox = new VBox();

            ScrolledWindow scrolleddefbox = new ScrolledWindow();

            scrolleddefbox.Add(DefBox);
            scrolleddefbox.HeightRequest = 100;

            vbox.PackStart(menubar, false, false, 2);
            vbox.PackStart(toolbar, false, false, 2);
            scrolledWindow.Add(textviews);
            vbox.Add(scrolledWindow);
            //vbox.PackEnd(scrolleddefbox, false, false, 2);

            Window defWin = new Window("Definitions");

            defWin.WidthRequest  = 300;
            defWin.HeightRequest = 450;
            defWin.Add(scrolleddefbox);
            defWin.ShowAll();

            Add(vbox);
            SetSizeRequest(600, 600);
            ShowAll();

            // Rehiding elements not ment to be shown at start, as the
            // user is currently not logged in.
            foreach (Widget w in menu)
            {
                if (w.GetType() == typeof(StudentGetAssignmentListMenuItem) ||
                    w.GetType() == typeof(TeacherAddAssignmentMenuItem) ||
                    w.GetType() == typeof(TeacherGetAssignmentListMenuItem) ||
                    w.GetType() == typeof(LogoutMenuItem))
                {
                    w.Hide();
                }
                else if (w.GetType() == typeof(LoginMenuItem))
                {
                    w.Show();
                }
            }

            GLib.Timeout.Add(2000, new GLib.TimeoutHandler(DefBoxUpdate));
        }
Example #17
0
        protected virtual void Build()
        {
            global::Stetic.Gui.Initialize(this);
            // Widget MonoGame.Tools.Pipeline.MainWindow
            this.UIManager = new global::Gtk.UIManager();
            global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup("Default");
            this.FileAction            = new global::Gtk.Action("FileAction", global::Mono.Unix.Catalog.GetString("File"), null, null);
            this.FileAction.ShortLabel = global::Mono.Unix.Catalog.GetString("File");
            w1.Add(this.FileAction, null);
            this.NewAction            = new global::Gtk.Action("NewAction", global::Mono.Unix.Catalog.GetString("New..."), null, "gtk-new");
            this.NewAction.ShortLabel = global::Mono.Unix.Catalog.GetString("New...");
            w1.Add(this.NewAction, "<Control>n");
            this.OpenAction            = new global::Gtk.Action("OpenAction", global::Mono.Unix.Catalog.GetString("Open..."), null, "gtk-open");
            this.OpenAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Open...");
            w1.Add(this.OpenAction, "<Control>o");
            this.OpenRecentAction            = new global::Gtk.Action("OpenRecentAction", global::Mono.Unix.Catalog.GetString("Open Recent"), null, null);
            this.OpenRecentAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Open Recent");
            w1.Add(this.OpenRecentAction, null);
            this.CloseAction            = new global::Gtk.Action("CloseAction", global::Mono.Unix.Catalog.GetString("Close"), null, "gtk-close");
            this.CloseAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Close");
            w1.Add(this.CloseAction, null);
            this.ImportAction            = new global::Gtk.Action("ImportAction", global::Mono.Unix.Catalog.GetString("Import..."), null, null);
            this.ImportAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Import...");
            w1.Add(this.ImportAction, null);
            this.SaveAction            = new global::Gtk.Action("SaveAction", global::Mono.Unix.Catalog.GetString("Save"), null, "gtk-save");
            this.SaveAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Save");
            w1.Add(this.SaveAction, "<Control>s");
            this.SaveAsAction            = new global::Gtk.Action("SaveAsAction", global::Mono.Unix.Catalog.GetString("Save As..."), null, "gtk-save-as");
            this.SaveAsAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Save As...");
            w1.Add(this.SaveAsAction, null);
            this.ExitAction             = new global::Gtk.Action("ExitAction", global::Mono.Unix.Catalog.GetString("Exit"), null, "gtk-quit");
            this.ExitAction.HideIfEmpty = false;
            this.ExitAction.ShortLabel  = global::Mono.Unix.Catalog.GetString("Exit");
            w1.Add(this.ExitAction, null);
            this.EditAction            = new global::Gtk.Action("EditAction", global::Mono.Unix.Catalog.GetString("Edit"), null, null);
            this.EditAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Edit");
            w1.Add(this.EditAction, null);
            this.UndoAction            = new global::Gtk.Action("UndoAction", global::Mono.Unix.Catalog.GetString("Undo"), null, "gtk-undo");
            this.UndoAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Undo");
            w1.Add(this.UndoAction, "<Control>z");
            this.RedoAction            = new global::Gtk.Action("RedoAction", global::Mono.Unix.Catalog.GetString("Redo"), null, "gtk-redo");
            this.RedoAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Redo");
            w1.Add(this.RedoAction, "<Control>y");
            RenameAction            = new Action("RenameAction", global::Mono.Unix.Catalog.GetString("Rename"), null, null);
            RenameAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Rename");
            w1.Add(RenameAction, null);
            this.DeleteAction            = new global::Gtk.Action("DeleteAction", global::Mono.Unix.Catalog.GetString("Delete"), null, "gtk-delete");
            this.DeleteAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Delete");
            w1.Add(this.DeleteAction, null);
            this.BuildAction            = new global::Gtk.Action("BuildAction", global::Mono.Unix.Catalog.GetString("Build"), null, null);
            this.BuildAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Build");
            w1.Add(this.BuildAction, null);
            this.BuildAction1            = new global::Gtk.Action("BuildAction1", global::Mono.Unix.Catalog.GetString("Build"), null, "gtk-execute");
            this.BuildAction1.ShortLabel = global::Mono.Unix.Catalog.GetString("Build");
            w1.Add(this.BuildAction1, "<Mod2>F6");
            this.RebuildAction            = new global::Gtk.Action("RebuildAction", global::Mono.Unix.Catalog.GetString("Rebuild"), null, "gtk-execute");
            this.RebuildAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Rebuild");
            w1.Add(this.RebuildAction, null);
            this.CleanAction            = new global::Gtk.Action("CleanAction", global::Mono.Unix.Catalog.GetString("Clean"), null, null);
            this.CleanAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Clean");
            w1.Add(this.CleanAction, null);
            this.DebugModeAction            = new global::Gtk.ToggleAction("DebugModeAction", global::Mono.Unix.Catalog.GetString("Debug Mode"), null, null);
            this.DebugModeAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Debug Mode");
            w1.Add(this.DebugModeAction, null);
            this.FilterOutputAction            = new global::Gtk.ToggleAction("FilterOutputAction", global::Mono.Unix.Catalog.GetString("Filter Output"), null, null);
            this.FilterOutputAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Filter Output");
            this.FilterOutputAction.Active     = true;
            w1.Add(this.FilterOutputAction, null);
            this.HelpAction            = new global::Gtk.Action("HelpAction", global::Mono.Unix.Catalog.GetString("Help"), null, null);
            this.HelpAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Help");
            w1.Add(this.HelpAction, null);
            this.ViewHelpAction            = new global::Gtk.Action("ViewHelpAction", global::Mono.Unix.Catalog.GetString("View Help"), null, "gtk-help");
            this.ViewHelpAction.ShortLabel = global::Mono.Unix.Catalog.GetString("View Help");
            w1.Add(this.ViewHelpAction, "<Mod2>F1");
            this.AboutAction            = new global::Gtk.Action("AboutAction", global::Mono.Unix.Catalog.GetString("About"), null, "gtk-about");
            this.AboutAction.ShortLabel = global::Mono.Unix.Catalog.GetString("About");
            w1.Add(this.AboutAction, null);
            this.CancelBuildAction            = new global::Gtk.Action("CancelBuildAction", global::Mono.Unix.Catalog.GetString("Cancel Build"), null, "gtk-stop");
            this.CancelBuildAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Cancel Build");
            w1.Add(this.CancelBuildAction, null);
            this.AddAction            = new global::Gtk.Action("AddAction", global::Mono.Unix.Catalog.GetString("Add"), null, null);
            this.AddAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Add");
            w1.Add(this.AddAction, null);
            this.NewItemAction            = new global::Gtk.Action("NewItemAction", global::Mono.Unix.Catalog.GetString("New Item..."), null, "gtk-file");
            this.NewItemAction.ShortLabel = global::Mono.Unix.Catalog.GetString("New Item...");
            w1.Add(this.NewItemAction, null);
            this.NewFolderAction            = new global::Gtk.Action("NewFolderAction", global::Mono.Unix.Catalog.GetString("New Folder..."), null, "gtk-directory");
            this.NewFolderAction.ShortLabel = global::Mono.Unix.Catalog.GetString("New Folder...");
            w1.Add(this.NewFolderAction, null);
            this.ExistingItemAction            = new global::Gtk.Action("ExistingItemAction", global::Mono.Unix.Catalog.GetString("Existing Item..."), null, null);
            this.ExistingItemAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Add Existing Item...");
            w1.Add(this.ExistingItemAction, null);
            this.ExistingFolderAction            = new global::Gtk.Action("ExistingFolderAction", global::Mono.Unix.Catalog.GetString("Existing Folder..."), null, null);
            this.ExistingFolderAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Add Existing Folder...");
            w1.Add(this.ExistingFolderAction, null);
            this.UIManager.InsertActionGroup(w1, 0);
            this.AddAccelGroup(this.UIManager.AccelGroup);
            this.Name           = "MonoGame.Tools.Pipeline.MainWindow";
            this.Icon           = global::Gdk.Pixbuf.LoadFromResource("MonoGame.Tools.Pipeline.App.ico");
            this.WindowPosition = ((global::Gtk.WindowPosition)(4));
            // Container child MonoGame.Tools.Pipeline.MainWindow.Gtk.Container+ContainerChild
            this.vbox2      = new global::Gtk.VBox();
            this.vbox2.Name = "vbox2";
            // Container child vbox2.Gtk.Box+BoxChild
            this.UIManager.AddUiFromString("<ui><menubar name='menubar1'><menu name='FileAction' action='FileAction'><menuitem name='NewAction' action='NewAction'/><menuitem name='OpenAction' action='OpenAction'/><menuitem name='OpenRecentAction' action='OpenRecentAction'/><menuitem name='CloseAction' action='CloseAction'/><separator/><menuitem name='ImportAction' action='ImportAction'/><separator/><menuitem name='SaveAction' action='SaveAction'/><menuitem name='SaveAsAction' action='SaveAsAction'/><separator/><menuitem name='ExitAction' action='ExitAction'/></menu><menu name='EditAction' action='EditAction'><menuitem name='UndoAction' action='UndoAction'/><menuitem name='RedoAction' action='RedoAction'/><separator/><menu name='AddAction' action='AddAction'><menuitem name='NewItemAction' action='NewItemAction'/><menuitem name='NewFolderAction' action='NewFolderAction'/><separator/><menuitem name='ExistingItemAction' action='ExistingItemAction'/><menuitem name='ExistingFolderAction' action='ExistingFolderAction'/></menu><separator/><menuitem name='RenameAction' action='RenameAction'/><menuitem name='DeleteAction' action='DeleteAction'/></menu><menu name='BuildAction' action='BuildAction'><menuitem name='BuildAction1' action='BuildAction1'/><menuitem name='RebuildAction' action='RebuildAction'/><menuitem name='CleanAction' action='CleanAction'/><menuitem name='CancelBuildAction' action='CancelBuildAction'/><separator name='sep1'/><menuitem name='DebugModeAction' action='DebugModeAction'/><menuitem name='FilterOutputAction' action='FilterOutputAction'/></menu><menu name='HelpAction' action='HelpAction'><menuitem name='ViewHelpAction' action='ViewHelpAction'/><separator/><menuitem name='AboutAction' action='AboutAction'/></menu></menubar></ui>");
            this.menubar1      = ((global::Gtk.MenuBar)(this.UIManager.GetWidget("/menubar1")));
            this.menubar1.Name = "menubar1";
            this.vbox2.Add(this.menubar1);

            toolBar1 = new Toolbar();

            toolNew             = new ToolButton(new Image(null, "Toolbar.New.png"), "New");
            toolNew.TooltipText = toolNew.Label;
            toolBar1.Add(toolNew);

            toolOpen             = new ToolButton(new Image(null, "Toolbar.Open.png"), "Open");
            toolOpen.TooltipText = toolOpen.Label;
            toolBar1.Add(toolOpen);

            toolSave             = new ToolButton(new Image(null, "Toolbar.Save.png"), "Save");
            toolSave.TooltipText = toolSave.Label;
            toolBar1.Add(toolSave);

            toolBar1.Add(new SeparatorToolItem());

            toolNewItem             = new ToolButton(new Image(null, "Toolbar.NewItem.png"), "Add New Item");
            toolNewItem.TooltipText = toolNewItem.Label;
            toolBar1.Add(toolNewItem);

            toolAddItem             = new ToolButton(new Image(null, "Toolbar.ExistingItem.png"), "Add Existing Item");
            toolAddItem.TooltipText = toolAddItem.Label;
            toolBar1.Add(toolAddItem);

            toolNewFolder             = new ToolButton(new Image(null, "Toolbar.NewFolder.png"), "Add New Folder");
            toolNewFolder.TooltipText = toolNewFolder.Label;
            toolBar1.Add(toolNewFolder);

            toolAddFolder             = new ToolButton(new Image(null, "Toolbar.ExistingFolder.png"), "Add Existing Folder");
            toolAddFolder.TooltipText = toolAddFolder.Label;
            toolBar1.Add(toolAddFolder);

            toolBar1.Add(new SeparatorToolItem());

            toolBuild             = new ToolButton(new Image(null, "Toolbar.Build.png"), "Build");
            toolBuild.TooltipText = toolBuild.Label;
            toolBar1.Add(toolBuild);

            toolRebuild             = new ToolButton(new Image(null, "Toolbar.Rebuild.png"), "Rebuild");
            toolRebuild.TooltipText = toolRebuild.Label;
            toolBar1.Add(toolRebuild);

            toolClean             = new ToolButton(new Image(null, "Toolbar.Clean.png"), "Clean");
            toolClean.TooltipText = toolClean.Label;
            toolBar1.Add(toolClean);

            toolBar1.Add(new SeparatorToolItem());

            toolFilterOutput            = new ToggleToolButton();
            toolFilterOutput.Label      = toolFilterOutput.TooltipText = "Filter Output";
            toolFilterOutput.IconWidget = new Image(null, "Toolbar.FilterOutput.png");
            toolBar1.Add(toolFilterOutput);

            if (!Global.UseHeaderBar)
            {
                this.vbox2.PackStart(toolBar1, false, true, 0);
            }

            global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.menubar1]));
            w2.Position = 0;
            w2.Expand   = false;
            w2.Fill     = false;
            // Container child vbox2.Gtk.Box+BoxChild
            this.hpaned1          = new global::Gtk.HPaned();
            this.hpaned1.CanFocus = true;
            this.hpaned1.Name     = "hpaned1";
            this.hpaned1.Position = 179;
            // Container child hpaned1.Gtk.Paned+PanedChild
            this.vpaned2          = new global::Gtk.VPaned();
            this.vpaned2.CanFocus = true;
            this.vpaned2.Name     = "vpaned2";
            this.vpaned2.Position = 247;
            // Container child vpaned2.Gtk.Paned+PanedChild
            this.projectview1        = new global::MonoGame.Tools.Pipeline.ProjectView();
            this.projectview1.Events = ((global::Gdk.EventMask)(256));
            this.projectview1.Name   = "projectview1";
            this.vpaned2.Add(this.projectview1);
            global::Gtk.Paned.PanedChild w3 = ((global::Gtk.Paned.PanedChild)(this.vpaned2 [this.projectview1]));
            w3.Resize = false;
            // Container child vpaned2.Gtk.Paned+PanedChild
            this.propertiesview1        = new global::MonoGame.Tools.Pipeline.PropertiesView();
            this.propertiesview1.Events = ((global::Gdk.EventMask)(256));
            this.propertiesview1.Name   = "propertiesview1";
            this.vpaned2.Add(this.propertiesview1);
            global::Gtk.Paned.PanedChild w4 = ((global::Gtk.Paned.PanedChild)(this.vpaned2 [this.propertiesview1]));
            w4.Resize = false;
            this.hpaned1.Add(this.vpaned2);
            global::Gtk.Paned.PanedChild w5 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.vpaned2]));
            w5.Resize = false;
            // Container child hpaned1.Gtk.Paned+PanedChild
            buildOutput1 = new BuildOutput();
            this.hpaned1.Add(this.buildOutput1);
            this.vbox2.Add(this.hpaned1);
            global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hpaned1]));
            w8.Position = 2;
            this.Add(this.vbox2);

            treeview1 = new TreeView();

            #if GTK3
            if (Global.UseHeaderBar)
            {
                Builder builder = new Builder(null, "MonoGame.Tools.Pipeline.Gtk.MainWindow.HeaderBar.glade", null);
                hbar = new HeaderBar(builder.GetObject("headerbar").Handle);
                builder.Autoconnect(this);

                hbar.AttachToWindow(this);
                hbar.ShowCloseButton = true;
                hbar.Show();

                foreach (var o in menubar1.Children)
                {
                    menubar1.Remove(o);
                    menu2.Insert(o, 4);
                }

                new_button.Clicked     += OnNewActionActivated;
                save_button.Clicked    += OnSaveActionActivated;
                build_button.Clicked   += OnBuildAction1Activated;
                rebuild_button.Clicked += OnRebuildActionActivated;
                cancel_button.Clicked  += OnCancelBuildActionActivated;

                filteroutput_button.ButtonReleaseEvent += ToggleFilterOutput;
                filteroutput_button.Sensitive           = true;

                vbox2.Remove(menubar1);

                open_menubutton = new MenuButton(open_button.Handle);
                var popover = new Popover(open_menubutton);

                var vbox = new VBox();
                vbox.WidthRequest  = 350;
                vbox.HeightRequest = 300;

                Gtk3Wrapper.gtk_tree_view_set_activate_on_single_click(treeview1.Handle, true);
                treeview1.HeadersVisible  = false;
                treeview1.EnableGridLines = TreeViewGridLines.Horizontal;
                treeview1.HoverSelection  = true;
                treeview1.RowActivated   += delegate(object o, RowActivatedArgs args) {
                    popover.Hide();

                    TreeIter iter;
                    if (!recentListStore.GetIter(out iter, args.Path))
                    {
                        return;
                    }

                    OpenProject(recentListStore.GetValue(iter, 1).ToString());
                };

                ScrolledWindow scroll1 = new ScrolledWindow();
                scroll1.WidthRequest  = 350;
                scroll1.HeightRequest = 300;
                scroll1.Add(treeview1);

                vbox.PackStart(scroll1, true, true, 0);

                var openButton = new Button("Open Other...");
                openButton.Clicked += delegate(object sender, System.EventArgs e) {
                    popover.Hide();
                    OnOpenActionActivated(sender, e);
                };
                vbox.PackStart(openButton, false, true, 0);

                vbox.ShowAll();

                popover.Add(vbox);
                open_menubutton.Popup = popover;
            }
            #endif

            this.Title = basetitle;

            if ((this.Child != null))
            {
                this.Child.ShowAll();
            }
            this.DefaultWidth  = 751;
            this.DefaultHeight = 557;

            #if GTK3
            Gdk.Geometry geom = new Gdk.Geometry();
            geom.MinWidth  = 400;
            geom.MinHeight = 300;
            this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize);
            #endif

            this.Show();
            this.DeleteEvent                         += new global::Gtk.DeleteEventHandler(this.OnDeleteEvent);
            this.NewAction.Activated                 += new global::System.EventHandler(this.OnNewActionActivated);
            this.toolNew.Clicked                     += OnNewActionActivated;
            this.OpenAction.Activated                += new global::System.EventHandler(this.OnOpenActionActivated);
            this.toolOpen.Clicked                    += OnOpenActionActivated;
            this.CloseAction.Activated               += new global::System.EventHandler(this.OnCloseActionActivated);
            this.ImportAction.Activated              += new global::System.EventHandler(this.OnImportActionActivated);
            this.SaveAction.Activated                += new global::System.EventHandler(this.OnSaveActionActivated);
            this.toolSave.Clicked                    += OnSaveActionActivated;
            this.SaveAsAction.Activated              += new global::System.EventHandler(this.OnSaveAsActionActivated);
            this.ExitAction.Activated                += new global::System.EventHandler(this.OnExitActionActivated);
            this.UndoAction.Activated                += new global::System.EventHandler(this.OnUndoActionActivated);
            this.RedoAction.Activated                += new global::System.EventHandler(this.OnRedoActionActivated);
            RenameAction.Activated                   += this.OnRenameActionActivated;
            this.DeleteAction.Activated              += new global::System.EventHandler(this.OnDeleteActionActivated);
            this.BuildAction1.Activated              += new global::System.EventHandler(this.OnBuildAction1Activated);
            toolBuild.Clicked                        += OnBuildAction1Activated;
            this.RebuildAction.Activated             += new global::System.EventHandler(this.OnRebuildActionActivated);
            toolRebuild.Clicked                      += OnRebuildActionActivated;
            this.CleanAction.Activated               += new global::System.EventHandler(this.OnCleanActionActivated);
            toolClean.Clicked                        += OnCleanActionActivated;
            this.ViewHelpAction.Activated            += new global::System.EventHandler(this.OnViewHelpActionActivated);
            this.AboutAction.Activated               += new global::System.EventHandler(this.OnAboutActionActivated);
            this.NewItemAction.Activated             += new global::System.EventHandler(this.OnNewItemActionActivated);
            this.toolNewItem.Clicked                 += OnNewItemActionActivated;
            this.NewFolderAction.Activated           += new global::System.EventHandler(this.OnNewFolderActionActivated);
            this.toolNewFolder.Clicked               += OnNewFolderActionActivated;
            this.ExistingItemAction.Activated        += new global::System.EventHandler(this.OnAddItemActionActivated);
            this.toolAddItem.Clicked                 += OnAddItemActionActivated;
            this.ExistingFolderAction.Activated      += new global::System.EventHandler(this.OnAddFolderActionActivated);
            this.toolAddFolder.Clicked               += OnAddFolderActionActivated;
            this.DebugModeAction.Activated           += new global::System.EventHandler(this.OnDebugModeActionActivated);
            this.FilterOutputAction.Activated        += OnFilterOutputActionActivated;
            this.toolFilterOutput.ButtonReleaseEvent += ToggleFilterOutput;
            this.CancelBuildAction.Activated         += new global::System.EventHandler(this.OnCancelBuildActionActivated);
            this.SizeAllocated                       += MainWindow_SizeAllocated;
        }
Example #18
0
        /// <summary>
        /// Create the UI
        /// </summary>
        private void CreateEdit()
        {
            CmisTreeStore cmisStore = new CmisTreeStore();

            Gtk.TreeView treeView = new Gtk.TreeView(cmisStore.CmisStore);

            RootFolder root = new RootFolder()
            {
                Name    = this.Name,
                Id      = credentials.RepoId,
                Address = credentials.Address.ToString()
            };

            IgnoredFolderLoader.AddIgnoredFolderToRootNode(root, Ignores);
            LocalFolderLoader.AddLocalFolderToRootNode(root, localPath);

            AsyncNodeLoader asyncLoader = new AsyncNodeLoader(root, credentials, PredefinedNodeLoader.LoadSubFolderDelegate, PredefinedNodeLoader.CheckSubFolderDelegate);

            asyncLoader.UpdateNodeEvent += delegate {
                cmisStore.UpdateCmisTree(root);
            };
            cmisStore.UpdateCmisTree(root);
            asyncLoader.Load(root);

            Header = CmisSync.Properties_Resources.EditTitle;

            VBox layout_vertical = new VBox(false, 12);

            Controller.CloseWindowEvent += delegate
            {
                asyncLoader.Cancel();
            };

            Button cancel_button = new Button(CmisSync.Properties_Resources.Cancel);

            cancel_button.Clicked += delegate {
                Close();
            };

            Button finish_button = new Button(CmisSync.Properties_Resources.SaveChanges);

            finish_button.Clicked += delegate {
                Ignores = NodeModelUtils.GetIgnoredFolder(root);
                Controller.SaveFolder();
                Close();
            };

            Gtk.TreeIter iter;
            treeView.HeadersVisible = false;
            treeView.Selection.Mode = SelectionMode.Single;

            TreeViewColumn column = new TreeViewColumn();

            column.Title = "Name";
            CellRendererToggle renderToggle = new CellRendererToggle();

            column.PackStart(renderToggle, false);
            renderToggle.Activatable = true;
            column.AddAttribute(renderToggle, "active", (int)CmisTreeStore.Column.ColumnSelected);
            column.AddAttribute(renderToggle, "inconsistent", (int)CmisTreeStore.Column.ColumnSelectedThreeState);
            column.AddAttribute(renderToggle, "radio", (int)CmisTreeStore.Column.ColumnRoot);
            renderToggle.Toggled += delegate(object render, ToggledArgs args) {
                TreeIter iterToggled;
                if (!cmisStore.CmisStore.GetIterFromString(out iterToggled, args.Path))
                {
                    Console.WriteLine("Toggled GetIter Error " + args.Path);
                    return;
                }

                Node node = cmisStore.CmisStore.GetValue(iterToggled, (int)CmisTreeStore.Column.ColumnNode) as Node;
                if (node == null)
                {
                    Console.WriteLine("Toggled GetValue Error " + args.Path);
                    return;
                }

                if (node.Parent == null)
                {
                    node.Selected = true;
                }
                else
                {
                    if (node.Selected == false)
                    {
                        node.Selected = true;
                    }
                    else
                    {
                        node.Selected = false;
                    }
                }
                cmisStore.UpdateCmisTree(root);
            };
            CellRendererText renderText = new CellRendererText();

            column.PackStart(renderText, false);
            column.SetAttributes(renderText, "text", (int)CmisTreeStore.Column.ColumnName);
            column.Expand = true;
            treeView.AppendColumn(column);

            treeView.AppendColumn("Status", new StatusCellRenderer(), "text", (int)CmisTreeStore.Column.ColumnStatus);

            treeView.RowExpanded += delegate(object o, RowExpandedArgs args) {
                Node node = cmisStore.CmisStore.GetValue(args.Iter, (int)CmisTreeStore.Column.ColumnNode) as Node;
                asyncLoader.Load(node);
            };

            ScrolledWindow sw = new ScrolledWindow()
            {
                ShadowType = Gtk.ShadowType.In
            };

            sw.Add(treeView);

            layout_vertical.PackStart(new Label(""), false, false, 0);
            layout_vertical.PackStart(sw, true, true, 0);
            Add(layout_vertical);
            AddButton(cancel_button);
            AddButton(finish_button);

            finish_button.GrabDefault();

            this.ShowAll();
        }
Example #19
0
        void Build()
        {
            BorderWidth   = 0;
            DefaultWidth  = 901;
            DefaultHeight = 632;

            Name  = "wizard_dialog";
            Title = GettextCatalog.GetString("New Project");

            projectConfigurationWidget      = new GtkProjectConfigurationWidget();
            projectConfigurationWidget.Name = "projectConfigurationWidget";

            // Top banner of dialog.
            var topLabelEventBox = new EventBox();

            topLabelEventBox.Accessible.SetShouldIgnore(true);
            topLabelEventBox.Name          = "topLabelEventBox";
            topLabelEventBox.HeightRequest = 52;
            topLabelEventBox.ModifyBg(StateType.Normal, bannerBackgroundColor);
            topLabelEventBox.ModifyFg(StateType.Normal, whiteColor);
            topLabelEventBox.BorderWidth = 0;

            var topBannerBottomEdgeLineEventBox = new EventBox();

            topBannerBottomEdgeLineEventBox.Accessible.SetShouldIgnore(true);
            topBannerBottomEdgeLineEventBox.Name          = "topBannerBottomEdgeLineEventBox";
            topBannerBottomEdgeLineEventBox.HeightRequest = 1;
            topBannerBottomEdgeLineEventBox.ModifyBg(StateType.Normal, bannerLineColor);
            topBannerBottomEdgeLineEventBox.BorderWidth = 0;

            topBannerLabel                 = new Label();
            topBannerLabel.Name            = "topBannerLabel";
            topBannerLabel.Accessible.Name = "topBannerLabel";
            Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy();              // UNDONE: VV: Use FontService?
            font.Size   = (int)(font.Size * 2.0);
            font.Weight = Pango.Weight.Bold;
            topBannerLabel.ModifyFont(font);
            topBannerLabel.ModifyFg(StateType.Normal, whiteColor);
            var topLabelHBox = new HBox();

            topLabelHBox.Accessible.SetShouldIgnore(true);
            topLabelHBox.Name = "topLabelHBox";
            topLabelHBox.PackStart(topBannerLabel, false, false, 20);
            topLabelEventBox.Add(topLabelHBox);

            VBox.PackStart(topLabelEventBox, false, false, 0);
            VBox.PackStart(topBannerBottomEdgeLineEventBox, false, false, 0);

            // Main templates section.
            centreVBox = new VBox();
            centreVBox.Accessible.SetShouldIgnore(true);
            centreVBox.Name = "centreVBox";
            VBox.PackStart(centreVBox, true, true, 0);
            templatesHBox = new HBox();
            templatesHBox.Accessible.SetShouldIgnore(true);
            templatesHBox.Name = "templatesHBox";
            centreVBox.PackEnd(templatesHBox, true, true, 0);

            // Template categories.
            var templateCategoriesBgBox = new EventBox();

            templateCategoriesBgBox.Accessible.SetShouldIgnore(true);
            templateCategoriesBgBox.Name        = "templateCategoriesVBox";
            templateCategoriesBgBox.BorderWidth = 0;
            templateCategoriesBgBox.ModifyBg(StateType.Normal, categoriesBackgroundColor);
            templateCategoriesBgBox.WidthRequest = 220;
            var templateCategoriesScrolledWindow = new ScrolledWindow();

            templateCategoriesScrolledWindow.Name             = "templateCategoriesScrolledWindow";
            templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Template categories tree view.
            templateCategoriesTreeView                 = new TreeView();
            templateCategoriesTreeView.Name            = "templateCategoriesTreeView";
            templateCategoriesTreeView.Accessible.Name = "templateCategoriesTreeView";
            templateCategoriesTreeView.Accessible.SetTitle(GettextCatalog.GetString("Project Categories"));
            templateCategoriesTreeView.Accessible.Description = GettextCatalog.GetString("Select the project category to see all possible project templates");
            templateCategoriesTreeView.BorderWidth            = 0;
            templateCategoriesTreeView.HeadersVisible         = false;
            templateCategoriesTreeView.Model         = templateCategoriesTreeStore;
            templateCategoriesTreeView.SearchColumn  = -1;            // disable the interactive search
            templateCategoriesTreeView.ShowExpanders = false;

            templateCategoriesTreeView.AppendColumn(CreateTemplateCategoriesTreeViewColumn());
            templateCategoriesScrolledWindow.Add(templateCategoriesTreeView);
            templateCategoriesBgBox.Add(templateCategoriesScrolledWindow);
            templatesHBox.PackStart(templateCategoriesBgBox, false, false, 0);

            // Templates.
            var templatesBgBox = new EventBox();

            templatesBgBox.Accessible.SetShouldIgnore(true);
            templatesBgBox.ModifyBg(StateType.Normal, templateListBackgroundColor);
            templatesBgBox.Name         = "templatesVBox";
            templatesBgBox.WidthRequest = 400;
            templatesHBox.PackStart(templatesBgBox, false, false, 0);
            var templatesScrolledWindow = new ScrolledWindow();

            templatesScrolledWindow.Name             = "templatesScrolledWindow";
            templatesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Templates tree view.
            templatesTreeView                 = new TreeView();
            templatesTreeView.Name            = "templatesTreeView";
            templatesTreeView.Accessible.Name = "templatesTreeView";
            templatesTreeView.Accessible.SetTitle(GettextCatalog.GetString("Project Templates"));
            templatesTreeView.Accessible.Description = GettextCatalog.GetString("Select the project template");
            templatesTreeView.HeadersVisible         = false;
            templatesTreeView.Model         = templatesTreeStore;
            templatesTreeView.SearchColumn  = -1;            // disable the interactive search
            templatesTreeView.ShowExpanders = false;
            templatesTreeView.AppendColumn(CreateTemplateListTreeViewColumn());
            templatesScrolledWindow.Add(templatesTreeView);
            templatesBgBox.Add(templatesScrolledWindow);

            // Accessibilityy
            templateCategoriesTreeView.Accessible.AddLinkedUIElement(templatesTreeView.Accessible);

            // Template
            var templateEventBox = new EventBox();

            templateEventBox.Accessible.SetShouldIgnore(true);
            templateEventBox.Name = "templateEventBox";
            templateEventBox.ModifyBg(StateType.Normal, templateBackgroundColor);
            templatesHBox.PackStart(templateEventBox, true, true, 0);
            templateVBox = new VBox();
            templateVBox.Accessible.SetShouldIgnore(true);
            templateVBox.Visible     = false;
            templateVBox.BorderWidth = 20;
            templateVBox.Spacing     = 10;
            templateEventBox.Add(templateVBox);

            // Template large image.
            templateImage = new ImageView();
            templateImage.Accessible.SetShouldIgnore(true);
            templateImage.Name          = "templateImage";
            templateImage.HeightRequest = 140;
            templateImage.WidthRequest  = 240;
            templateVBox.PackStart(templateImage, false, false, 10);

            // Template description.
            templateNameLabel                        = new Label();
            templateNameLabel.Name                   = "templateNameLabel";
            templateNameLabel.Accessible.Name        = "templateNameLabel";
            templateNameLabel.Accessible.Description = GettextCatalog.GetString("The name of the selected template");
            templateNameLabel.WidthRequest           = 240;
            templateNameLabel.Wrap                   = true;
            templateNameLabel.Xalign                 = 0;
            templateNameLabel.Markup                 = MarkupTemplateName("TemplateName");
            templateVBox.PackStart(templateNameLabel, false, false, 0);
            templateDescriptionLabel                 = new Label();
            templateDescriptionLabel.Name            = "templateDescriptionLabel";
            templateDescriptionLabel.Accessible.Name = "templateDescriptionLabel";
            templateDescriptionLabel.Accessible.SetLabel(GettextCatalog.GetString("The description of the selected template"));
            templateDescriptionLabel.WidthRequest = 240;
            templateDescriptionLabel.Wrap         = true;
            templateDescriptionLabel.Xalign       = 0;
            templateVBox.PackStart(templateDescriptionLabel, false, false, 0);

            var tempLabel = new Label();

            tempLabel.Accessible.SetShouldIgnore(true);
            templateVBox.PackStart(tempLabel, true, true, 0);

            templatesTreeView.Accessible.AddLinkedUIElement(templateNameLabel.Accessible);
            templatesTreeView.Accessible.AddLinkedUIElement(templateDescriptionLabel.Accessible);

            // Template - button separator.
            var templateSectionSeparatorEventBox = new EventBox();

            templateSectionSeparatorEventBox.Accessible.SetShouldIgnore(true);
            templateSectionSeparatorEventBox.Name          = "templateSectionSeparatorEventBox";
            templateSectionSeparatorEventBox.HeightRequest = 1;
            templateSectionSeparatorEventBox.ModifyBg(StateType.Normal, templateSectionSeparatorColor);
            VBox.PackStart(templateSectionSeparatorEventBox, false, false, 0);

            // Buttons at bottom of dialog.
            var bottomHBox = new HBox();

            bottomHBox.Accessible.SetShouldIgnore(true);
            bottomHBox.Name = "bottomHBox";
            VBox.PackStart(bottomHBox, false, false, 0);

            // Cancel button - bottom left.
            var cancelButtonBox = new HButtonBox();

            cancelButtonBox.Accessible.SetShouldIgnore(true);
            cancelButtonBox.Name        = "cancelButtonBox";
            cancelButtonBox.BorderWidth = 16;
            cancelButton                        = new Button();
            cancelButton.Name                   = "cancelButton";
            cancelButton.Accessible.Name        = "cancelButton";
            cancelButton.Accessible.Description = GettextCatalog.GetString("Cancel the dialog");
            cancelButton.Label                  = GettextCatalog.GetString("Cancel");
            cancelButton.UseStock               = true;
            cancelButtonBox.PackStart(cancelButton, false, false, 0);
            bottomHBox.PackStart(cancelButtonBox, false, false, 0);

            // Previous button - bottom right.
            var previousNextButtonBox = new HButtonBox();

            previousNextButtonBox.Accessible.SetShouldIgnore(true);
            previousNextButtonBox.Name        = "previousNextButtonBox";
            previousNextButtonBox.BorderWidth = 16;
            previousNextButtonBox.Spacing     = 9;
            bottomHBox.PackStart(previousNextButtonBox);
            previousNextButtonBox.Layout = ButtonBoxStyle.End;

            previousButton                        = new Button();
            previousButton.Name                   = "previousButton";
            previousButton.Accessible.Name        = "previousButton";
            previousButton.Accessible.Description = GettextCatalog.GetString("Return to the previous page");
            previousButton.Label                  = GettextCatalog.GetString("Previous");
            previousButton.Sensitive              = false;
            previousNextButtonBox.PackEnd(previousButton);

            // Next button - bottom right.
            nextButton                        = new Button();
            nextButton.Name                   = "nextButton";
            nextButton.Accessible.Name        = "nextButton";
            nextButton.Accessible.Description = GettextCatalog.GetString("Move to the next page");
            nextButton.Label                  = GettextCatalog.GetString("Next");
            previousNextButtonBox.PackEnd(nextButton);

            // Remove default button action area.
            VBox.Remove(ActionArea);

            if (Child != null)
            {
                Child.ShowAll();
            }

            templatesTreeView.HasFocus = true;
            Resizable = false;
        }
Example #20
0
        ///<summary>
        ///	InitWindow
        /// Sets up the widgets and events in the chat window
        ///</summary>
        void InitWindow()
        {
            hasBeenShown    = false;
            everShown       = false;
            shiftKeyPressed = false;
            notifyUser      = false;

            // Update the window title
            Title = string.Format("Chat with {0}", peerPerson.DisplayName);
            Icon  = Utilities.GetIcon("banter-22", 22);

            this.DefaultSize = new Gdk.Size(400, 700);

            hpaned          = new HPaned();
            hpaned.CanFocus = true;
            hpaned.Position = 300;
            hpaned.Show();

            this.Add(hpaned);

            leftPaneVBox           = new VBox();
            leftPaneVBox.NoShowAll = true;
            leftPaneVBox.Visible   = false;
            hpaned.Add1(leftPaneVBox);

            rightPaneVBox             = new VBox();
            rightPaneVBox.BorderWidth = 8;
            rightPaneVBox.Show();
            hpaned.Add2(rightPaneVBox);

            personControlVBox = new VBox(false, 4);
            personControlVBox.Show();
            rightPaneVBox.PackStart(personControlVBox, false, false, 0);

            PersonCard card = new PersonCard(peerPerson);

            card.Size = PersonCardSize.Medium;
            // Not sure why but we need to call ShowAll on the PersonCard for it to display
            card.ShowAll();
            card.ShowTextChatButton = false;
            personControlVBox.PackStart(card, true, true, 0);

            HBox hbox = new HBox(false, 0);

            hbox.Show();
            personControlVBox.PackStart(hbox, false, false, 0);

            //showPersonDetailsButton = new Button ();
            //showPersonDetailsButton.CanFocus = true;
            //showPersonDetailsButton.Label = Catalog.GetString ("Show Contact _Details");
            //showPersonDetailsButton.UseUnderline = true;
            //showPersonDetailsButton.Image = new Image (Stock.GoBack, IconSize.Menu);
            //showPersonDetailsButton.Show ();
            //hbox.PackStart (showPersonDetailsButton);

            videoVBox = new VBox(false, 0);
            if (this.chatType == ChatType.Video)
            {
                ShowVideoControl(true);
            }
            else
            {
                videoVBox.Visible = false;
            }

            rightPaneVBox.PackStart(videoVBox, false, true, 0);

            audioVBox = new VBox(false, 0);

            if (this.chatType == ChatType.Audio)
            {
                ShowAudioControl(true);
            }
            else
            {
                audioVBox.Visible = false;
            }

            rightPaneVBox.PackStart(audioVBox, false, false, 0);

            messagesVPaned          = new VPaned();
            messagesVPaned.CanFocus = true;
            // This is lame, fix the way this is all calculated
            if (videoView != null)
            {
                messagesVPaned.Position = 100;
            }
            else
            {
                messagesVPaned.Position = 700;
            }
            messagesVPaned.Show();
            rightPaneVBox.PackStart(messagesVPaned, true, true, 0);

            Gtk.ScrolledWindow sw = new ScrolledWindow();
            sw.VscrollbarPolicy = PolicyType.Automatic;
            sw.HscrollbarPolicy = PolicyType.Never;
            //scrolledWindow.ShadowType = ShadowType.None;
            sw.BorderWidth = 0;
            sw.CanFocus    = true;
            sw.Show();

            messagesView = new MessagesView();
            messagesView.Show();
            sw.Add(messagesView);
            messagesVPaned.Pack1(sw, true, true);

            typingVBox = new VBox(false, 0);
            typingVBox.Show();
            messagesVPaned.Pack2(typingVBox, false, false);

            typingToolbar              = new Toolbar();
            typingToolbar.ShowArrow    = false;
            typingToolbar.ToolbarStyle = ToolbarStyle.Icons;
            typingToolbar.IconSize     = IconSize.SmallToolbar;
            typingToolbar.Show();
            typingVBox.PackStart(typingToolbar, false, false, 0);

            typingScrolledWindow = new ScrolledWindow();
            typingScrolledWindow.VscrollbarPolicy = PolicyType.Automatic;
            typingScrolledWindow.HscrollbarPolicy = PolicyType.Automatic;
            typingScrolledWindow.ShadowType       = ShadowType.EtchedIn;
            typingScrolledWindow.CanFocus         = true;
            typingScrolledWindow.Show();
            typingVBox.PackStart(typingScrolledWindow, true, true, 0);

            typingTextView                  = new TextView();
            typingTextView.CanFocus         = true;
            typingTextView.WrapMode         = WrapMode.Word;
            typingTextView.LeftMargin       = 4;
            typingTextView.RightMargin      = 4;
            typingTextView.KeyPressEvent   += OnTypingTextViewKeyPressEvent;
            typingTextView.KeyReleaseEvent += OnTypingTextViewKeyReleaseEvent;
            typingTextView.Show();
            typingScrolledWindow.Add(typingTextView);
            spell_check        = new SpellCheck(typingTextView, "en-us");
            Shown             += OnWindowShown;
            DeleteEvent       += WindowDeleted;
            this.FocusInEvent += FocusInEventHandler;
        }
Example #21
0
        public BubbleChartView(ViewBase owner = null) : base(owner)
        {
            vpaned1               = new VPaned();
            mainWidget            = vpaned1;
            mainWidget.Destroyed += OnDestroyed;

            graphView = new DirectedGraphView(this);
            vpaned1.Pack1(graphView.MainWidget, true, true);

            VBox vbox1 = new VBox(false, 0);

            ctxBox = new VBox(false, 0);

            // Arc selection: rules & actions
            VBox arcSelBox = new VBox();

            Label l1 = new Label("Rules");

            l1.Xalign = 0;
            arcSelBox.PackStart(l1, true, true, 0);
            RuleList = new EditorView(owner);
            RuleList.TextHasChangedByUser += OnRuleChanged;
            //RuleList.ScriptMode = false;

            ScrolledWindow rules = new ScrolledWindow();

            rules.ShadowType = ShadowType.EtchedIn;
            rules.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            rules.Add((RuleList as ViewBase).MainWidget);

            (RuleList as ViewBase).MainWidget.ShowAll();
            arcSelBox.PackStart(rules, true, true, 0);
            rules.Show();

            Label l2 = new Label("Actions");

            l2.Xalign = 0;
            arcSelBox.PackStart(l2, true, true, 0);
            ActionList = new EditorView(owner);
            ActionList.TextHasChangedByUser += OnActionChanged;
            //ActionList.ScriptMode = false;

            ScrolledWindow actions = new ScrolledWindow();

            actions.ShadowType = ShadowType.EtchedIn;
            actions.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            actions.Add((ActionList as ViewBase).MainWidget);

            (ActionList as ViewBase).MainWidget.ShowAll();
            arcSelBox.PackStart(actions, true, true, 0); actions.Show();
            arcSelWdgt = arcSelBox as Widget;
            arcSelWdgt.Hide();
            ctxBox.PackStart(arcSelWdgt, true, true, 0);

            // Node selection:

            Grid t1 = new Grid();

            Label l3 = new Label("Name");

            l3.Xalign = 0;
            t1.Attach(l3, 0, 0, 1, 1);

            Label l4 = new Label("Description");

            l4.Xalign = 0;
            t1.Attach(l4, 0, 1, 1, 1);

            Label l5 = new Label("Colour");

            l5.Xalign = 0;
            t1.Attach(l5, 0, 2, 1, 1);

            nameEntry          = new Entry();
            nameEntry.Changed += OnNameChanged;
            nameEntry.Xalign   = 0;

            // Setting the WidthRequest to 350 will effectively
            // set the minimum size, beyond which it cannot be further
            // shrunk by dragging the HPaned's splitter.
            nameEntry.WidthRequest = 350;
            t1.Attach(nameEntry, 1, 0, 1, 1);

            descEntry              = new Entry();
            descEntry.Xalign       = 0;
            descEntry.Changed     += OnDescriptionChanged;
            descEntry.WidthRequest = 350;
            t1.Attach(descEntry, 1, 1, 1, 1);
            colourChooser              = new ColorButton();
            colourChooser.Xalign       = 0;
            colourChooser.ColorSet    += OnColourChanged;
            colourChooser.WidthRequest = 350;
            t1.Attach(colourChooser, 1, 2, 1, 1);
            nodeSelWdgt = t1;
            ctxBox.PackStart(t1, true, true, 0);

            // Info
            Label l6 = new Label();

            l6.LineWrap = true;
            l6.Text     = "<left-click>: select a node or arc.\n" +
                          "<right-click>: shows a context-sensitive menu.\n\n" +
                          "Once a node/arc is selected, it can be dragged to a new position.\n\n" +
                          "Nodes are created by right-clicking on a blank area.\n\n" +
                          "Transition arcs are created by firstly selecting a source node,\n" +
                          "then right-clicking over a target node.";
            infoWdgt = l6 as Widget;
            infoWdgt.ShowAll();
            l6.Xalign = 0;
            l6.Yalign = 0;
            l6.Wrap   = false;
            Alignment infoWdgtWrapper = new Alignment(0, 0, 1, 0);

            infoWdgtWrapper.Add(infoWdgt);
            //ctxBox.PackStart(infoWdgt, true, true, 0);
            //vbox1.PackStart(ctxBox, false, false, 0);

            PropertiesView = new PropertyView(this);
            ((ScrolledWindow)((ViewBase)PropertiesView).MainWidget).HscrollbarPolicy = PolicyType.Never;
            // settingsBox = new Table(2, 2, false);
            // settingsBox.Attach(new Label("Initial State"), 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            // combobox1 = new ComboBox();
            // combobox1.PackStart(comboRender, false);
            // combobox1.AddAttribute(comboRender, "text", 0);
            // combobox1.Model = comboModel;
            // settingsBox.Attach(combobox1, 1, 2, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            // chkVerbose = new CheckButton();
            // chkVerbose.Toggled += OnToggleVerboseMode;
            // settingsBox.Attach(new Label("Verbose Mode"), 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            // settingsBox.Attach(chkVerbose, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            hpaned1 = new HPaned();
            hpaned2 = new HPaned();
            Frame frame1 = new Frame("Rotation Settings");

            frame1.Add(((ViewBase)PropertiesView).MainWidget);
            frame1.ShadowType = ShadowType.In;
            Frame frame2 = new Frame();

            frame2.Add(hpaned2);
            frame2.ShadowType = ShadowType.In;
            ctxFrame          = new Frame();
            ctxFrame.Add(ctxBox);
            ctxFrame.ShadowType = ShadowType.In;
            Frame frame4 = new Frame("Instructions");

            frame4.Add(infoWdgtWrapper);
            frame4.ShadowType = ShadowType.In;
            hpaned1.Pack1(frame1, false, false);
            hpaned1.Pack2(frame2, true, false);
            hpaned2.Pack1(ctxFrame, true, false);
            hpaned2.Pack2(frame4, true, false);
            hpaned1.ShowAll();
            Alignment halign = new Alignment(0, 0, 1, 1);

            halign.Add(hpaned1);

            vpaned1.Pack2(halign, false, false);
            vpaned1.Show();

            graphView.OnGraphObjectSelected += OnGraphObjectSelected;
            graphView.OnGraphObjectMoved    += OnGraphObjectMoved;
            //combobox1.Changed += OnComboBox1SelectedValueChanged;

            contextMenuHelper              = new ContextMenuHelper(graphView.MainWidget);
            contextMenuHelper.ContextMenu += OnPopup;

            ContextMenu.SelectionDone += OnContextMenuDeactivated;
            ContextMenu.Mapped        += OnContextMenuRendered;

            // Ensure the menu is populated
            Select(null);
        }
Example #22
0
        protected override void Initialize(IPadWindow window)
        {
            Id = "MonoDevelop.Debugger.BreakpointPad";
            // Toolbar and menu definitions

            gotoCmd = new ActionCommand(LocalCommands.GoToFile, GettextCatalog.GetString("Go to Breakpoint"));
            var propertiesCmd = new ActionCommand(LocalCommands.Properties, GettextCatalog.GetString("Edit Breakpoint…"), Stock.Properties);

            // The toolbar registers the Properties command with the CommandManager for us,
            // but gotoCmd isn't used in the toolbar so we need to register it ourselves for the menu to work
            IdeApp.CommandService.RegisterCommand(gotoCmd);

            menuSet = new CommandEntrySet();
            menuSet.Add(propertiesCmd);
            menuSet.Add(gotoCmd);
            menuSet.AddSeparator();
            menuSet.AddItem(DebugCommands.EnableDisableBreakpoint);
            menuSet.AddItem(DebugCommands.DisableAllBreakpoints);
            menuSet.AddSeparator();
            menuSet.AddItem(EditCommands.DeleteKey);
            menuSet.AddItem(DebugCommands.ClearAllBreakpoints);

            var toolbarSet = new CommandEntrySet();

            toolbarSet.AddItem(DebugCommands.EnableDisableBreakpoint);
            toolbarSet.AddItem(DebugCommands.ClearAllBreakpoints);
            toolbarSet.AddItem(DebugCommands.DisableAllBreakpoints);
            toolbarSet.AddItem(EditCommands.Delete);
            toolbarSet.AddSeparator();
            toolbarSet.Add(propertiesCmd);
            toolbarSet.AddSeparator();
            toolbarSet.Add(new CommandEntry(DebugCommands.NewFunctionBreakpoint)
            {
                DisplayType = CommandEntryDisplayType.IconAndText
            });
            toolbarSet.Add(new CommandEntry(DebugCommands.NewCatchpoint)
            {
                DisplayType = CommandEntryDisplayType.IconAndText
            });

            // The breakpoint list

            store = new TreeStore(typeof(string), typeof(bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));
            var modelAttr = new SemanticModelAttribute("store__Icon", "store__Selected", "store_FileName",
                                                       "store_Breakpoint", "store_Condition", "store_TraceExp", "store_HitCount", "store_LastTrace");

            TypeDescriptor.AddAttributes(store, modelAttr);

            tree                = new PadTreeView();
            tree.Model          = store;
            tree.RulesHint      = true;
            tree.HeadersVisible = true;
            tree.DoPopupMenu    = ShowPopup;
            tree.KeyPressEvent += OnKeyPressEvent;
            tree.Selection.Mode = SelectionMode.Multiple;

            treeState = new TreeViewState(tree, (int)Columns.Breakpoint);

            var col = new TreeViewColumn();
            var crp = new CellRendererImage();

            col.PackStart(crp, false);
            col.AddAttribute(crp, "stock_id", (int)Columns.Icon);
            tree.AppendColumn(col);

            var toggleRender = new Gtk.CellRendererToggle();

            toggleRender.Toggled += new ToggledHandler(ItemToggled);
            col = new TreeViewColumn();
            col.PackStart(toggleRender, false);
            col.AddAttribute(toggleRender, "active", (int)Columns.Selected);
            tree.AppendColumn(col);

            var FrameCol = new TreeViewColumn();
            var crt      = tree.TextRenderer;

            FrameCol.Title = GettextCatalog.GetString("Name");
            FrameCol.PackStart(crt, true);
            FrameCol.AddAttribute(crt, "text", (int)Columns.FileName);
            FrameCol.Resizable = true;
            FrameCol.Alignment = 0.0f;
            tree.AppendColumn(FrameCol);

            col           = tree.AppendColumn(GettextCatalog.GetString("Condition"), crt, "text", (int)Columns.Condition);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Trace Expression"), crt, "text", (int)Columns.TraceExp);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Hit Count"), crt, "text", (int)Columns.HitCount);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Last Trace"), crt, "text", (int)Columns.LastTrace);
            col.Resizable = true;

            sw            = new Gtk.ScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(tree);

            control = sw;

            control.ShowAll();

            breakpoints = DebuggingService.Breakpoints;

            UpdateDisplay();

            breakpoints.BreakpointAdded   += OnBreakpointAdded;
            breakpoints.BreakpointRemoved += OnBreakpointRemoved;
            breakpoints.Changed           += OnBreakpointChanged;
            breakpoints.BreakpointUpdated += OnBreakpointUpdated;

            DebuggingService.PausedEvent  += OnDebuggerStatusCheck;
            DebuggingService.ResumedEvent += OnDebuggerStatusCheck;
            DebuggingService.StoppedEvent += OnDebuggerStatusCheck;

            tree.RowActivated += OnRowActivated;

            var toolbar = window.GetToolbar(DockPositionType.Top);

            toolbar.Add(toolbarSet, sw);
            toolbar.ShowAll();
        }
Example #23
0
        public SendEmail(IBrowsableCollection selection) : base("mail_dialog")
        {
            this.selection = selection;

            for (int i = 0; i < selection.Count; i++)
            {
                Photo p = selection[i] as Photo;
                if (Gnome.Vfs.MimeType.GetMimeTypeForUri(p.DefaultVersionUri.ToString()) != "image/jpeg")
                {
                    force_original = true;
                }
            }

            if (force_original)
            {
                original_size.Active   = true;
                tiny_size.Sensitive    = false;
                small_size.Sensitive   = false;
                medium_size.Sensitive  = false;
                large_size.Sensitive   = false;
                x_large_size.Sensitive = false;
            }
            else
            {
                switch (Preferences.Get <int> (Preferences.EXPORT_EMAIL_SIZE))
                {
                case 0:  original_size.Active = true; break;

                case 1:  tiny_size.Active = true; break;

                case 2:  small_size.Active = true; break;

                case 3:  medium_size.Active = true; break;

                case 4:  large_size.Active = true; break;

                case 5:  x_large_size.Active = true; break;

                default: break;
                }
            }

            rotate_check.Active    = Preferences.Get <bool> (Preferences.EXPORT_EMAIL_ROTATE);
            rotate_check.Sensitive = original_size.Active && tiny_size.Sensitive;

            tray_scrolled.Add(new TrayView(selection));

            Dialog.Modal = false;

            // Calculate total original filesize
            for (int i = 0; i < selection.Count; i++)
            {
                Photo photo = selection[i] as Photo;
                try {
                    Orig_Photo_Size += (new Gnome.Vfs.FileInfo(photo.DefaultVersionUri.ToString())).Size;
                } catch {
                }
            }

            for (int k = 0; k < avg_scale_ref.Length; k++)
            {
                avg_scale[k] = avg_scale_ref[k];
            }


            // Calculate approximate size shrinking, use first photo, and shrink to medium size as base.
            Photo scalephoto = selection [0] as Photo;

            if (scalephoto != null && !force_original)
            {
                // Get first photos file size
                long orig_size = (new Gnome.Vfs.FileInfo(scalephoto.DefaultVersionUri.ToString())).Size;

                FilterSet filters = new FilterSet();
                filters.Add(new ResizeFilter((uint)(sizes [3])));
                long new_size;
                using (FilterRequest request = new FilterRequest(scalephoto.DefaultVersionUri)) {
                    filters.Convert(request);
                    new_size = (new Gnome.Vfs.FileInfo(request.Current.ToString())).Size;
                }

                if (orig_size > 0)
                {
                    // Get the factor (scale) between original and resized medium size.
                    scale_percentage = 1 - ((float)(orig_size - new_size) / orig_size);

                    // What is the relation between the estimated medium scale factor, and reality?
                    double scale_scale = scale_percentage / avg_scale_ref[3];

                    //System.Console.WriteLine ("scale_percentage {0}, ref {1}, relative {2}",
                    //	scale_percentage, avg_scale_ref[3], scale_scale  );

                    // Re-Calculate the proper relation per size
                    for (int k = 0; k < avg_scale_ref.Length; k++)
                    {
                        avg_scale[k] = avg_scale_ref[k] * scale_scale;
                        //	System.Console.WriteLine ("avg_scale[{0}]={1} (was {2})",
                        //		k, avg_scale[k], avg_scale_ref[k]  );
                    }
                }
            }

            NumberOfPictures.Text  = selection.Count.ToString();
            TotalOriginalSize.Text = SizeUtil.ToHumanReadable(Orig_Photo_Size);

            UpdateEstimatedSize();

            Dialog.ShowAll();

            //LoadHistory ();

            Dialog.Response += HandleResponse;
        }
Example #24
0
        public ObjectValuePad(bool allowWatchExpressions = false)
        {
            if (UseNewTreeView)
            {
                controller = new ObjectValueTreeViewController(allowWatchExpressions);
                controller.AllowEditing = true;

                if (Platform.IsMac)
                {
                    LoggingService.LogInfo("Using MacObjectValueTreeView for {0}", allowWatchExpressions ? "Watch Pad" : "Locals Pad");
                    var treeView = controller.GetMacControl(ObjectValueTreeViewFlags.ObjectValuePadFlags);
                    treeView.UIElementName = allowWatchExpressions ? "WatchPad" : "LocalsPad";
                    _treeview = treeView;

                    fontChanger = new PadFontChanger(treeView, treeView.SetCustomFont, treeView.QueueResize);

                    var scrolled = new AppKit.NSScrollView {
                        DocumentView          = treeView,
                        AutohidesScrollers    = false,
                        HasVerticalScroller   = true,
                        HasHorizontalScroller = true,
                    };

                    // disable implicit animations
                    scrolled.WantsLayer    = true;
                    scrolled.Layer.Actions = new NSDictionary(
                        "actions", NSNull.Null,
                        "contents", NSNull.Null,
                        "hidden", NSNull.Null,
                        "onLayout", NSNull.Null,
                        "onOrderIn", NSNull.Null,
                        "onOrderOut", NSNull.Null,
                        "position", NSNull.Null,
                        "sublayers", NSNull.Null,
                        "transform", NSNull.Null,
                        "bounds", NSNull.Null);

                    var host = new GtkNSViewHost(scrolled);
                    host.ShowAll();

                    control = host;
                }
                else
                {
                    LoggingService.LogInfo("Using GtkObjectValueTreeView for {0}", allowWatchExpressions ? "Watch Pad" : "Locals Pad");
                    var treeView = controller.GetGtkControl(ObjectValueTreeViewFlags.ObjectValuePadFlags);
                    treeView.Show();

                    fontChanger = new PadFontChanger(treeView, treeView.SetCustomFont, treeView.QueueResize);

                    var scrolled = new ScrolledWindow {
                        HscrollbarPolicy = PolicyType.Automatic,
                        VscrollbarPolicy = PolicyType.Automatic
                    };
                    scrolled.Add(treeView);
                    scrolled.Show();

                    control = scrolled;
                }
            }
            else
            {
                LoggingService.LogInfo("Using old ObjectValueTreeView for {0}", allowWatchExpressions ? "Watch Pad" : "Locals Pad");
                tree              = new ObjectValueTreeView();
                tree.AllowAdding  = allowWatchExpressions;
                tree.AllowEditing = true;
                tree.Show();

                fontChanger = new PadFontChanger(tree, tree.SetCustomFont, tree.QueueResize);

                var scrolled = new ScrolledWindow {
                    HscrollbarPolicy = PolicyType.Automatic,
                    VscrollbarPolicy = PolicyType.Automatic
                };
                scrolled.Add(tree);
                scrolled.Show();

                control = scrolled;
            }

            DebuggingService.CurrentFrameChanged      += OnFrameChanged;
            DebuggingService.PausedEvent              += OnDebuggerPaused;
            DebuggingService.ResumedEvent             += OnDebuggerResumed;
            DebuggingService.StoppedEvent             += OnDebuggerStopped;
            DebuggingService.EvaluationOptionsChanged += OnEvaluationOptionsChanged;
            DebuggingService.VariableChanged          += OnVariableChanged;

            needsUpdateValues = false;
            needsUpdateFrame  = true;

            //If pad is created/opened while debugging...
            IsInitialResume = !DebuggingService.IsDebugging;
        }
Example #25
0
        public SearchResultWidget()
        {
            var vbox    = new VBox();
            var toolbar = new Toolbar()
            {
                Orientation  = Orientation.Vertical,
                IconSize     = IconSize.Menu,
                ToolbarStyle = ToolbarStyle.Icons,
            };

            this.PackStart(vbox, true, true, 0);
            this.PackStart(toolbar, false, false, 0);
            labelStatus = new Label()
            {
                Xalign  = 0,
                Justify = Justification.Left,
            };
            var hpaned = new HPaned();

            vbox.PackStart(hpaned, true, true, 0);
            vbox.PackStart(labelStatus, false, false, 0);
            var resultsScroll = new CompactScrolledWindow();

            hpaned.Pack1(resultsScroll, true, true);
            scrolledwindowLogView = new CompactScrolledWindow();
            hpaned.Pack2(scrolledwindowLogView, true, true);
            textviewLog = new TextView()
            {
                Editable = false,
            };
            scrolledwindowLogView.Add(textviewLog);

            store = new ListStore(typeof(SearchResult),
                                  typeof(bool) // didRead
                                  );

            treeviewSearchResults = new PadTreeView()
            {
                Model            = store,
                HeadersClickable = true,
                RulesHint        = true,
            };
            treeviewSearchResults.Selection.Mode = Gtk.SelectionMode.Multiple;
            resultsScroll.Add(treeviewSearchResults);

            this.ShowAll();

            var fileNameColumn = new TreeViewColumn {
                Resizable    = false,
                SortColumnId = 0,
                Title        = GettextCatalog.GetString("File")
            };

            fileNameColumn.FixedWidth = 200;

            var fileNamePixbufRenderer = new CellRendererPixbuf();

            fileNameColumn.PackStart(fileNamePixbufRenderer, false);
            fileNameColumn.SetCellDataFunc(fileNamePixbufRenderer, FileIconDataFunc);

            fileNameColumn.PackStart(treeviewSearchResults.TextRenderer, true);
            fileNameColumn.SetCellDataFunc(treeviewSearchResults.TextRenderer, FileNameDataFunc);
            treeviewSearchResults.AppendColumn(fileNameColumn);

//			TreeViewColumn lineColumn = treeviewSearchResults.AppendColumn (GettextCatalog.GetString ("Line"), new CellRendererText (), ResultLineDataFunc);
//			lineColumn.SortColumnId = 1;
//			lineColumn.FixedWidth = 50;
//

            TreeViewColumn textColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Text"),
                                                                           treeviewSearchResults.TextRenderer, ResultTextDataFunc);

            textColumn.SortColumnId = 2;
            textColumn.Resizable    = false;
            textColumn.FixedWidth   = 300;


            TreeViewColumn pathColumn = treeviewSearchResults.AppendColumn(GettextCatalog.GetString("Path"),
                                                                           treeviewSearchResults.TextRenderer, ResultPathDataFunc);

            pathColumn.SortColumnId = 3;
            pathColumn.Resizable    = false;
            pathColumn.FixedWidth   = 500;


            store.SetSortFunc(0, CompareFileNames);
//			store.SetSortFunc (1, CompareLineNumbers);
            store.SetSortFunc(3, CompareFilePaths);

            treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;

            buttonStop = new ToolButton(Stock.Stop)
            {
                Sensitive = false
            };

            buttonStop.Clicked += ButtonStopClicked;

            buttonStop.TooltipText = GettextCatalog.GetString("Stop");
            toolbar.Insert(buttonStop, -1);

            var buttonClear = new ToolButton(Gtk.Stock.Clear);

            buttonClear.Clicked    += ButtonClearClicked;
            buttonClear.TooltipText = GettextCatalog.GetString("Clear results");
            toolbar.Insert(buttonClear, -1);

            var buttonOutput = new ToggleToolButton(Gui.Stock.OutputIcon);

            buttonOutput.Clicked    += ButtonOutputClicked;
            buttonOutput.TooltipText = GettextCatalog.GetString("Show output");
            toolbar.Insert(buttonOutput, -1);

            buttonPin             = new ToggleToolButton(Gui.Stock.PinUp);
            buttonPin.Clicked    += ButtonPinClicked;
            buttonPin.TooltipText = GettextCatalog.GetString("Pin results pad");
            toolbar.Insert(buttonPin, -1);

            store.SetSortColumnId(3, SortType.Ascending);
            ShowAll();

            scrolledwindowLogView.Hide();
        }
Example #26
0
        void Build()
        {
            BorderWidth   = 0;
            WidthRequest  = 901;
            HeightRequest = 632;

            Name           = "wizard_dialog";
            Title          = GettextCatalog.GetString("New Project");
            WindowPosition = WindowPosition.CenterOnParent;
            TransientFor   = IdeApp.Workbench.RootWindow;

            projectConfigurationWidget      = new GtkProjectConfigurationWidget();
            projectConfigurationWidget.Name = "projectConfigurationWidget";

            // Top banner of dialog.
            var topLabelEventBox = new EventBox();

            topLabelEventBox.Name          = "topLabelEventBox";
            topLabelEventBox.HeightRequest = 52;
            topLabelEventBox.ModifyBg(StateType.Normal, bannerBackgroundColor);
            topLabelEventBox.ModifyFg(StateType.Normal, whiteColor);
            topLabelEventBox.BorderWidth = 0;

            var topBannerTopEdgeLineEventBox = new EventBox();

            topBannerTopEdgeLineEventBox.Name          = "topBannerTopEdgeLineEventBox";
            topBannerTopEdgeLineEventBox.HeightRequest = 1;
            topBannerTopEdgeLineEventBox.ModifyBg(StateType.Normal, bannerLineColor);
            topBannerTopEdgeLineEventBox.BorderWidth = 0;

            var topBannerBottomEdgeLineEventBox = new EventBox();

            topBannerBottomEdgeLineEventBox.Name          = "topBannerBottomEdgeLineEventBox";
            topBannerBottomEdgeLineEventBox.HeightRequest = 1;
            topBannerBottomEdgeLineEventBox.ModifyBg(StateType.Normal, bannerLineColor);
            topBannerBottomEdgeLineEventBox.BorderWidth = 0;

            topBannerLabel      = new Label();
            topBannerLabel.Name = "topBannerLabel";
            Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy();              // UNDONE: VV: Use FontService?
            font.Size = (int)(font.Size * 1.8);
            topBannerLabel.ModifyFont(font);
            topBannerLabel.ModifyFg(StateType.Normal, whiteColor);
            var topLabelHBox = new HBox();

            topLabelHBox.Name = "topLabelHBox";
            topLabelHBox.PackStart(topBannerLabel, false, false, 20);
            topLabelEventBox.Add(topLabelHBox);

            VBox.PackStart(topBannerTopEdgeLineEventBox, false, false, 0);
            VBox.PackStart(topLabelEventBox, false, false, 0);
            VBox.PackStart(topBannerBottomEdgeLineEventBox, false, false, 0);

            // Main templates section.
            centreVBox      = new VBox();
            centreVBox.Name = "centreVBox";
            VBox.PackStart(centreVBox, true, true, 0);
            templatesHBox      = new HBox();
            templatesHBox.Name = "templatesHBox";
            centreVBox.PackEnd(templatesHBox, true, true, 0);

            // Template categories.
            var templateCategoriesBgBox = new EventBox();

            templateCategoriesBgBox.Name        = "templateCategoriesVBox";
            templateCategoriesBgBox.BorderWidth = 0;
            templateCategoriesBgBox.ModifyBg(StateType.Normal, categoriesBackgroundColor);
            templateCategoriesBgBox.WidthRequest = 220;
            var templateCategoriesScrolledWindow = new ScrolledWindow();

            templateCategoriesScrolledWindow.Name             = "templateCategoriesScrolledWindow";
            templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Template categories tree view.
            templateCategoriesTreeView                = new TreeView();
            templateCategoriesTreeView.Name           = "templateCategoriesTreeView";
            templateCategoriesTreeView.BorderWidth    = 0;
            templateCategoriesTreeView.HeadersVisible = false;
            templateCategoriesTreeView.Model          = templateCategoriesListStore;
            templateCategoriesTreeView.SearchColumn   = -1;           // disable the interactive search
            templateCategoriesTreeView.AppendColumn(CreateTemplateCategoriesTreeViewColumn());
            templateCategoriesScrolledWindow.Add(templateCategoriesTreeView);
            templateCategoriesBgBox.Add(templateCategoriesScrolledWindow);
            templatesHBox.PackStart(templateCategoriesBgBox, false, false, 0);

            // Templates.
            var templatesBgBox = new EventBox();

            templatesBgBox.ModifyBg(StateType.Normal, templateListBackgroundColor);
            templatesBgBox.Name         = "templatesVBox";
            templatesBgBox.WidthRequest = 400;
            templatesHBox.PackStart(templatesBgBox, false, false, 0);
            var templatesScrolledWindow = new ScrolledWindow();

            templatesScrolledWindow.Name             = "templatesScrolledWindow";
            templatesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

            // Templates tree view.
            templatesTreeView                = new TreeView();
            templatesTreeView.Name           = "templatesTreeView";
            templatesTreeView.HeadersVisible = false;
            templatesTreeView.Model          = templatesListStore;
            templatesTreeView.SearchColumn   = -1;           // disable the interactive search
            templatesTreeView.AppendColumn(CreateTemplateListTreeViewColumn());
            templatesScrolledWindow.Add(templatesTreeView);
            templatesBgBox.Add(templatesScrolledWindow);

            // Template
            var templateEventBox = new EventBox();

            templateEventBox.Name = "templateEventBox";
            templateEventBox.ModifyBg(StateType.Normal, templateBackgroundColor);
            templatesHBox.PackStart(templateEventBox, true, true, 0);
            templateVBox             = new VBox();
            templateVBox.Visible     = false;
            templateVBox.BorderWidth = 20;
            templateVBox.Spacing     = 10;
            templateEventBox.Add(templateVBox);

            // Template large image.
            templateImage               = new ImageView();
            templateImage.Name          = "templateImage";
            templateImage.HeightRequest = 140;
            templateImage.WidthRequest  = 240;
            templateVBox.PackStart(templateImage, false, false, 10);

            // Template description.
            templateNameLabel              = new Label();
            templateNameLabel.Name         = "templateNameLabel";
            templateNameLabel.WidthRequest = 240;
            templateNameLabel.Wrap         = true;
            templateNameLabel.Xalign       = 0;
            templateNameLabel.Markup       = MarkupTemplateName("TemplateName");
            templateVBox.PackStart(templateNameLabel, false, false, 0);
            templateDescriptionLabel              = new Label();
            templateDescriptionLabel.Name         = "templateDescriptionLabel";
            templateDescriptionLabel.WidthRequest = 240;
            templateDescriptionLabel.Wrap         = true;
            templateDescriptionLabel.Xalign       = 0;
            templateVBox.PackStart(templateDescriptionLabel, false, false, 0);
            templateVBox.PackStart(new Label(), true, true, 0);

            // Template - button separator.
            var templateSectionSeparatorEventBox = new EventBox();

            templateSectionSeparatorEventBox.Name          = "templateSectionSeparatorEventBox";
            templateSectionSeparatorEventBox.HeightRequest = 1;
            templateSectionSeparatorEventBox.ModifyBg(StateType.Normal, templateSectionSeparatorColor);
            VBox.PackStart(templateSectionSeparatorEventBox, false, false, 0);

            // Buttons at bottom of dialog.
            var bottomHBox = new HBox();

            bottomHBox.Name = "bottomHBox";
            VBox.PackStart(bottomHBox, false, false, 0);

            // Cancel button - bottom left.
            var cancelButtonBox = new HButtonBox();

            cancelButtonBox.Name        = "cancelButtonBox";
            cancelButtonBox.BorderWidth = 16;
            cancelButton          = new Button();
            cancelButton.Name     = "cancelButton";
            cancelButton.Label    = "gtk-cancel";
            cancelButton.UseStock = true;
            cancelButtonBox.PackStart(cancelButton, false, false, 0);
            bottomHBox.PackStart(cancelButtonBox, false, false, 0);

            // Previous button - bottom right.
            var previousNextButtonBox = new HButtonBox();

            previousNextButtonBox.Name        = "previousNextButtonBox";
            previousNextButtonBox.BorderWidth = 16;
            previousNextButtonBox.Spacing     = 9;
            bottomHBox.PackStart(previousNextButtonBox);
            previousNextButtonBox.Layout = ButtonBoxStyle.End;

            previousButton           = new Button();
            previousButton.Name      = "previousButton";
            previousButton.Label     = GettextCatalog.GetString("Previous");
            previousButton.Sensitive = false;
            previousNextButtonBox.PackEnd(previousButton);

            // Next button - bottom right.
            nextButton       = new Button();
            nextButton.Name  = "nextButton";
            nextButton.Label = GettextCatalog.GetString("Next");
            previousNextButtonBox.PackEnd(nextButton);

            // Remove default button action area.
            VBox.Remove(ActionArea);

            if (Child != null)
            {
                Child.ShowAll();
            }

            Show();

            templatesTreeView.HasFocus = true;
            Resizable = false;
        }
Example #27
0
        public AvatarWindow() : base($"Ryujinx {Program.Version} - Manage Accounts - Avatar")
        {
            Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.Resources.Logo_Ryujinx.png");

            CanFocus  = false;
            Resizable = false;
            Modal     = true;
            TypeHint  = Gdk.WindowTypeHint.Dialog;

            SetDefaultSize(740, 400);
            SetPosition(WindowPosition.Center);

            VBox vbox = new VBox(false, 0);

            Add(vbox);

            ScrolledWindow scrolledWindow = new ScrolledWindow
            {
                ShadowType = ShadowType.EtchedIn
            };

            scrolledWindow.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            HBox hbox = new HBox(false, 0);

            Button chooseButton = new Button()
            {
                Label           = "Choose",
                CanFocus        = true,
                ReceivesDefault = true
            };

            chooseButton.Clicked += ChooseButton_Pressed;

            _setBackgroungColorButton = new Button()
            {
                Label    = "Set Background Color",
                CanFocus = true
            };
            _setBackgroungColorButton.Clicked += SetBackgroungColorButton_Pressed;

            _backgroundColor.Red   = 1;
            _backgroundColor.Green = 1;
            _backgroundColor.Blue  = 1;
            _backgroundColor.Alpha = 1;

            Button closeButton = new Button()
            {
                Label    = "Close",
                CanFocus = true
            };

            closeButton.Clicked += CloseButton_Pressed;

            vbox.PackStart(scrolledWindow, true, true, 0);
            hbox.PackStart(chooseButton, true, true, 0);
            hbox.PackStart(_setBackgroungColorButton, true, true, 0);
            hbox.PackStart(closeButton, true, true, 0);
            vbox.PackStart(hbox, false, false, 0);

            _listStore = new ListStore(typeof(string), typeof(Gdk.Pixbuf));
            _listStore.SetSortColumnId(0, SortType.Ascending);

            _iconView              = new IconView(_listStore);
            _iconView.ItemWidth    = 64;
            _iconView.ItemPadding  = 10;
            _iconView.PixbufColumn = 1;

            _iconView.SelectionChanged += IconView_SelectionChanged;

            scrolledWindow.Add(_iconView);

            _iconView.GrabFocus();

            ProcessAvatars();

            ShowAll();
        }
Example #28
0
        /// <summary>Initialise widget.</summary>
        private void InitialiseWidget()
        {
            scroller = new ScrolledWindow();
            if (textEditor.Parent is Container container)
            {
                container.Remove(textEditor);
                container.Add(scroller);
            }
            scroller.Add(textEditor);
            mainWidget = scroller;
            CodeSegmentPreviewWindow.CodeSegmentPreviewInformString = "";
            TextEditorOptions options = new TextEditorOptions();

            options.EnableSyntaxHighlighting = true;
            options.ColorScheme                = Configuration.Settings.EditorStyleName;
            options.Zoom                       = Configuration.Settings.EditorZoom;
            options.HighlightCaretLine         = true;
            options.EnableSyntaxHighlighting   = true;
            options.HighlightMatchingBracket   = true;
            options.FontName                   = Utility.Configuration.Settings.EditorFontName;
            textEditor.Options                 = options;
            textEditor.Options.Changed        += EditorOptionsChanged;
            textEditor.Options.ColorScheme     = Configuration.Settings.EditorStyleName;
            textEditor.Options.Zoom            = Configuration.Settings.EditorZoom;
            textEditor.TextArea.DoPopupMenu    = DoPopup;
            textEditor.Document.LineChanged   += OnTextHasChanged;
            textEditor.TextArea.FocusInEvent  += OnTextBoxEnter;
            textEditor.TextArea.FocusOutEvent += OnTextBoxLeave;
            textEditor.TextArea.KeyPressEvent += OnKeyPress;
            textEditor.Text                    = "";
            scroller.Hadjustment.Changed      += Hadjustment_Changed;
            scroller.Vadjustment.Changed      += Vadjustment_Changed;
            mainWidget.Destroyed              += _mainWidget_Destroyed;

            AddContextActionWithAccel("Cut", OnCut, "Ctrl+X");
            AddContextActionWithAccel("Copy", OnCopy, "Ctrl+C");
            AddContextActionWithAccel("Paste", OnPaste, "Ctrl+V");
            AddContextActionWithAccel("Delete", OnDelete, "Delete");
            AddContextSeparator();
            AddContextActionWithAccel("Undo", OnUndo, "Ctrl+Z");
            AddContextActionWithAccel("Redo", OnRedo, "Ctrl+Y");
            AddContextActionWithAccel("Find", OnFind, "Ctrl+F");
            AddContextActionWithAccel("Replace", OnReplace, "Ctrl+H");
            AddContextActionWithAccel("Change Font", OnChangeFont, null);
            styleSeparator = AddContextSeparator();
            styleMenu      = AddMenuItem("Use style", null);
            Menu styles = new Menu();

            // find all the editor styles and add sub menu items to the popup
            string[] styleNames = Mono.TextEditor.Highlighting.SyntaxModeService.Styles;
            Array.Sort(styleNames, StringComparer.InvariantCulture);
            foreach (string name in styleNames)
            {
                CheckMenuItem subItem = new CheckMenuItem(name);
                if (string.Compare(name, options.ColorScheme, true) == 0)
                {
                    subItem.Toggle();
                }
                subItem.Activated += OnChangeEditorStyle;
                subItem.Visible    = true;
                styles.Append(subItem);
            }
            styleMenu.Submenu = styles;

            IntelliSenseChars = ".";
        }
        public DemoStockBrowser() : base("Stock Icons and Items")
        {
            SetDefaultSize(-1, 500);
            BorderWidth = 8;

            HBox hbox = new HBox(false, 8);

            Add(hbox);

            ScrolledWindow sw = new ScrolledWindow();

            sw.SetPolicy(PolicyType.Never, PolicyType.Automatic);
            hbox.PackStart(sw, false, false, 0);

            ListStore model = CreateModel();

            TreeView treeview = new TreeView(model);

            sw.Add(treeview);

            TreeViewColumn column = new TreeViewColumn();

            column.Title = "Name";
            CellRenderer renderer = new CellRendererPixbuf();

            column.PackStart(renderer, false);
            column.SetAttributes(renderer, "stock_id", Column.Id);
            renderer = new CellRendererText();
            column.PackStart(renderer, true);
            column.SetAttributes(renderer, "text", Column.Name);

            treeview.AppendColumn(column);
            treeview.AppendColumn("Label", new CellRendererText(), "text", Column.Label);
            treeview.AppendColumn("Accel", new CellRendererText(), "text", Column.Accel);
            treeview.AppendColumn("ID", new CellRendererText(), "text", Column.Id);

            Alignment align = new Alignment(0.5f, 0.0f, 0.0f, 0.0f);

            hbox.PackEnd(align, false, false, 0);

            Frame frame = new Frame("Selected Item");

            align.Add(frame);

            VBox vbox = new VBox(false, 8);

            vbox.BorderWidth = 8;
            frame.Add(vbox);

            typeLabel = new Label();
            vbox.PackStart(typeLabel, false, false, 0);
            iconImage = new Gtk.Image();
            vbox.PackStart(iconImage, false, false, 0);
            accelLabel = new Label();
            vbox.PackStart(accelLabel, false, false, 0);
            nameLabel = new Label();
            vbox.PackStart(nameLabel, false, false, 0);
            idLabel = new Label();
            vbox.PackStart(idLabel, false, false, 0);

            treeview.Selection.Mode     = Gtk.SelectionMode.Single;
            treeview.Selection.Changed += new EventHandler(SelectionChanged);

            ShowAll();
        }
Example #30
0
        public override void Initialize(NodeBuilder[] builders, TreePadOption[] options, string menuPath)
        {
            base.Initialize(builders, options, menuPath);

            testChangedHandler            = (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnDetailsTestChanged));
            testService.TestSuiteChanged += (EventHandler)DispatchService.GuiDispatch(new EventHandler(OnTestSuiteChanged));
            paned = new VPaned();

            VBox            vbox       = new VBox();
            DockItemToolbar topToolbar = Window.GetToolbar(PositionType.Top);

            buttonRunAll             = new Button(new Gtk.Image(Gtk.Stock.GoUp, IconSize.Menu));
            buttonRunAll.Clicked    += new EventHandler(OnRunAllClicked);
            buttonRunAll.Sensitive   = true;
            buttonRunAll.TooltipText = GettextCatalog.GetString("Run all tests");
            topToolbar.Add(buttonRunAll);

            buttonRun             = new Button(new Gtk.Image(Gtk.Stock.Execute, IconSize.Menu));
            buttonRun.Clicked    += new EventHandler(OnRunClicked);
            buttonRun.Sensitive   = true;
            buttonRun.TooltipText = GettextCatalog.GetString("Run test");
            topToolbar.Add(buttonRun);

            buttonStop             = new Button(new Gtk.Image(Gtk.Stock.Stop, IconSize.Menu));
            buttonStop.Clicked    += new EventHandler(OnStopClicked);
            buttonStop.Sensitive   = false;
            buttonStop.TooltipText = GettextCatalog.GetString("Cancel running test");
            topToolbar.Add(buttonStop);
            topToolbar.ShowAll();

            vbox.PackEnd(base.Control, true, true, 0);
            vbox.FocusChain = new Gtk.Widget [] { base.Control };

            paned.Pack1(vbox, true, true);

            detailsPad = new VBox();

            EventBox eb     = new EventBox();
            HBox     header = new HBox();

            eb.Add(header);

            detailLabel         = new HeaderLabel();
            detailLabel.Padding = 6;

            Button hb = new Button(new Gtk.Image("gtk-close", IconSize.SmallToolbar));

            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnCloseDetails);
            header.PackEnd(hb, false, false, 0);

            hb          = new Button(new Gtk.Image("gtk-go-back", IconSize.SmallToolbar));
            hb.Relief   = ReliefStyle.None;
            hb.Clicked += new EventHandler(OnGoBackTest);
            header.PackEnd(hb, false, false, 0);

            header.Add(detailLabel);
            Gdk.Color hcol = eb.Style.Background(StateType.Normal);
            hcol.Red   = (ushort)(((double)hcol.Red) * 0.9);
            hcol.Green = (ushort)(((double)hcol.Green) * 0.9);
            hcol.Blue  = (ushort)(((double)hcol.Blue) * 0.9);
            //	eb.ModifyBg (StateType.Normal, hcol);

            detailsPad.PackStart(eb, false, false, 0);

            VPaned panedDetails = new VPaned();

            panedDetails.BorderWidth = 3;
            VBox boxPaned1 = new VBox();

            chart = new TestChart();
            chart.ButtonPressEvent += OnChartButtonPress;
            chart.SelectionChanged += new EventHandler(OnChartDateChanged);
            chart.HeightRequest     = 50;

            Toolbar toolbar = new Toolbar();

            toolbar.IconSize     = IconSize.SmallToolbar;
            toolbar.ToolbarStyle = ToolbarStyle.Icons;
            toolbar.ShowArrow    = false;
            ToolButton but = new ToolButton("gtk-zoom-in");

            but.Clicked += new EventHandler(OnZoomIn);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-zoom-out");
            but.Clicked += new EventHandler(OnZoomOut);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-back");
            but.Clicked += new EventHandler(OnChartBack);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-go-forward");
            but.Clicked += new EventHandler(OnChartForward);
            toolbar.Insert(but, -1);

            but          = new ToolButton("gtk-goto-last");
            but.Clicked += new EventHandler(OnChartLast);
            toolbar.Insert(but, -1);

            boxPaned1.PackStart(toolbar, false, false, 0);
            boxPaned1.PackStart(chart, true, true, 0);

            panedDetails.Pack1(boxPaned1, false, false);

            // Detailed test information --------

            infoBook = new ButtonNotebook();
            infoBook.PageLoadRequired += new EventHandler(OnPageLoadRequired);

            // Info - Group summary

            Frame          tf = new Frame();
            ScrolledWindow sw = new ScrolledWindow();

            detailsTree = new TreeView();

            detailsTree.HeadersVisible = true;
            detailsTree.RulesHint      = true;
            detailsStore = new ListStore(typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));

            CellRendererText trtest = new CellRendererText();
            CellRendererText tr;

            TreeViewColumn col3 = new TreeViewColumn();

            col3.Expand = false;
//			col3.Alignment = 0.5f;
            col3.Widget = new Gtk.Image(CircleImage.Success);
            col3.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col3.PackStart(tr, false);
            col3.AddAttribute(tr, "markup", 2);
            detailsTree.AppendColumn(col3);

            TreeViewColumn col4 = new TreeViewColumn();

            col4.Expand = false;
//			col4.Alignment = 0.5f;
            col4.Widget = new Gtk.Image(CircleImage.Failure);
            col4.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col4.PackStart(tr, false);
            col4.AddAttribute(tr, "markup", 3);
            detailsTree.AppendColumn(col4);

            TreeViewColumn col5 = new TreeViewColumn();

            col5.Expand = false;
//			col5.Alignment = 0.5f;
            col5.Widget = new Gtk.Image(CircleImage.NotRun);
            col5.Widget.Show();
            tr = new CellRendererText();
//			tr.Xalign = 0.5f;
            col5.PackStart(tr, false);
            col5.AddAttribute(tr, "markup", 4);
            detailsTree.AppendColumn(col5);

            TreeViewColumn col1 = new TreeViewColumn();

//			col1.Resizable = true;
//			col1.Expand = true;
            col1.Title = "Test";
            col1.PackStart(trtest, true);
            col1.AddAttribute(trtest, "markup", 1);
            detailsTree.AppendColumn(col1);

            detailsTree.Model = detailsStore;

            sw.Add(detailsTree);
            tf.Add(sw);
            tf.ShowAll();

            TestSummaryPage = infoBook.AddPage(GettextCatalog.GetString("Summary"), tf);

            // Info - Regressions list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            regressionTree = new TreeView();
            regressionTree.HeadersVisible = false;
            regressionTree.RulesHint      = true;
            regressionStore = new ListStore(typeof(object), typeof(string), typeof(Pixbuf));

            CellRendererText trtest2 = new CellRendererText();
            var pr = new CellRendererPixbuf();

            TreeViewColumn col = new TreeViewColumn();

            col.PackStart(pr, false);
            col.AddAttribute(pr, "pixbuf", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            regressionTree.AppendColumn(col);
            regressionTree.Model = regressionStore;
            sw.Add(regressionTree);
            tf.ShowAll();

            TestRegressionsPage = infoBook.AddPage(GettextCatalog.GetString("Regressions"), tf);

            // Info - Failed tests list

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            failedTree = new TreeView();
            failedTree.HeadersVisible = false;
            failedTree.RulesHint      = true;
            failedStore = new ListStore(typeof(object), typeof(string), typeof(Pixbuf));

            trtest2 = new CellRendererText();
            pr      = new CellRendererPixbuf();

            col = new TreeViewColumn();
            col.PackStart(pr, false);
            col.AddAttribute(pr, "pixbuf", 2);
            col.PackStart(trtest2, false);
            col.AddAttribute(trtest2, "markup", 1);
            failedTree.AppendColumn(col);
            failedTree.Model = failedStore;
            sw.Add(failedTree);
            tf.ShowAll();

            TestFailuresPage = infoBook.AddPage(GettextCatalog.GetString("Failed tests"), tf);

            // Info - results

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            resultView          = new TextView();
            resultView.Editable = false;
            sw.Add(resultView);
            tf.ShowAll();
            TestResultPage = infoBook.AddPage(GettextCatalog.GetString("Result"), tf);

            // Info - Output

            tf = new Frame();
            sw = new ScrolledWindow();
            tf.Add(sw);
            outputView          = new TextView();
            outputView.Editable = false;
            sw.Add(outputView);
            tf.ShowAll();
            TestOutputPage = infoBook.AddPage(GettextCatalog.GetString("Output"), tf);

            panedDetails.Pack2(infoBook, true, true);
            detailsPad.PackStart(panedDetails, true, true, 0);
            paned.Pack2(detailsPad, true, true);

            paned.ShowAll();

            infoBook.HidePage(TestResultPage);
            infoBook.HidePage(TestOutputPage);
            infoBook.HidePage(TestSummaryPage);
            infoBook.HidePage(TestRegressionsPage);
            infoBook.HidePage(TestFailuresPage);

            detailsPad.Sensitive = false;
            detailsPad.Hide();

            detailsTree.RowActivated    += new Gtk.RowActivatedHandler(OnTestActivated);
            regressionTree.RowActivated += new Gtk.RowActivatedHandler(OnRegressionTestActivated);
            failedTree.RowActivated     += new Gtk.RowActivatedHandler(OnFailedTestActivated);

            foreach (UnitTest t in testService.RootTests)
            {
                TreeView.AddChild(t);
            }
        }
            private Frame GetCollectionDetailsFrame()
            {
                collectionEntry = new Entry ();
                ScrolledWindow scroll = new ScrolledWindow ();
                scroll.HscrollbarPolicy = PolicyType.Never;
                scroll.VscrollbarPolicy =
                    PolicyType.Automatic;

                description = new TextView ();
                description.WrapMode = WrapMode.Word;
                scroll.Add (description);

                addCollectionToggle =
                    new CheckButton (Catalog.
                             GetString
                             ("Create a collection"));
                addCollectionToggle.Toggled += OnToggled;
                addCollectionToggle.Active = false;
                addCollectionToggle.Toggle ();

                Frame frame = new Frame ();
                Table table = new Table (4, 2, false);
                Label label;
                uint row = 0;

                table.RowSpacing = table.ColumnSpacing = 4;

                table.Attach (addCollectionToggle, 0, 2, row,
                          row + 1);

                row++;
                label = new Label ();
                label.Markup =
                    Catalog.GetString ("<b>Title</b>");
                label.Xalign = 0;
                table.Attach (label, 0, 1, row, row + 1);
                table.Attach (collectionEntry, 1, 2, row,
                          row + 1);
                row++;
                label = new Label ();
                label.Xalign = 0;
                label.Markup =
                    Catalog.
                    GetString
                    ("<i><small>Create a collection with this title</small></i>");
                table.Attach (label, 0, 2, row, row + 1);

                label = new Label ();
                label.Markup =
                    Catalog.
                    GetString ("<b>Description</b>");
                label.Xalign = 0;
                row++;
                table.Attach (label, 0, 2, row, row + 1);

                row++;
                table.Attach (scroll, 0, 2, row, row + 1);
                frame.Add (table);
                return frame;
            }
Example #32
0
        public void Initialize(IPadWindow window)
        {
            // Toolbar and menu definitions

            ActionCommand gotoCmd       = new ActionCommand(LocalCommands.GoToFile, GettextCatalog.GetString("Go to File"));
            ActionCommand propertiesCmd = new ActionCommand(LocalCommands.Properties, GettextCatalog.GetString("Properties"), Gtk.Stock.Properties);

            menuSet = new CommandEntrySet();
            menuSet.Add(gotoCmd);
            menuSet.AddSeparator();
            menuSet.AddItem(DebugCommands.EnableDisableBreakpoint);
            menuSet.AddItem(DebugCommands.ClearAllBreakpoints);
            menuSet.AddItem(DebugCommands.DisableAllBreakpoints);
            menuSet.AddItem(EditCommands.Delete);
            menuSet.AddSeparator();
            menuSet.Add(propertiesCmd);

            CommandEntrySet toolbarSet = new CommandEntrySet();

            toolbarSet.AddItem(DebugCommands.EnableDisableBreakpoint);
            toolbarSet.AddItem(DebugCommands.ClearAllBreakpoints);
            toolbarSet.AddItem(DebugCommands.DisableAllBreakpoints);
            toolbarSet.AddItem(EditCommands.Delete);
            toolbarSet.AddSeparator();
            toolbarSet.Add(propertiesCmd);

            // The breakpoint list

            store = new TreeStore(typeof(string), typeof(bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string));

            tree                = new PadTreeView();
            tree.Model          = store;
            tree.RulesHint      = true;
            tree.HeadersVisible = true;
            tree.DoPopupMenu    = ShowPopup;

            treeState = new TreeViewState(tree, (int)Columns.Breakpoint);

            TreeViewColumn col = new TreeViewColumn();
            CellRenderer   crp = new CellRendererIcon();

            col.PackStart(crp, false);
            col.AddAttribute(crp, "stock_id", (int)Columns.Icon);
            tree.AppendColumn(col);

            Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle();
            toggleRender.Toggled += new ToggledHandler(ItemToggled);
            col = new TreeViewColumn();
            col.PackStart(toggleRender, false);
            col.AddAttribute(toggleRender, "active", (int)Columns.Selected);
            tree.AppendColumn(col);

            TreeViewColumn FrameCol = new TreeViewColumn();
            CellRenderer   crt      = tree.TextRenderer;

            FrameCol.Title = GettextCatalog.GetString("File");
            FrameCol.PackStart(crt, true);
            FrameCol.AddAttribute(crt, "text", (int)Columns.FileName);
            FrameCol.Resizable = true;
            FrameCol.Alignment = 0.0f;
            tree.AppendColumn(FrameCol);

            col           = tree.AppendColumn(GettextCatalog.GetString("Condition"), crt, "text", (int)Columns.Condition);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Trace Expression"), crt, "text", (int)Columns.TraceExp);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Hit Count"), crt, "text", (int)Columns.HitCount);
            col.Resizable = true;

            col           = tree.AppendColumn(GettextCatalog.GetString("Last Trace"), crt, "text", (int)Columns.LastTrace);
            col.Resizable = true;

            sw            = new Gtk.ScrolledWindow();
            sw.ShadowType = ShadowType.None;
            sw.Add(tree);

            control = sw;

            control.ShowAll();

            bps = DebuggingService.Breakpoints;

            UpdateDisplay();

            breakpointUpdatedHandler = DispatchService.GuiDispatch(new EventHandler <BreakpointEventArgs> (OnBreakpointUpdated));

            DebuggingService.Breakpoints.BreakpointAdded   += OnBpAdded;
            DebuggingService.Breakpoints.BreakpointRemoved += OnBpRemoved;
            DebuggingService.Breakpoints.Changed           += OnBpChanged;
            DebuggingService.Breakpoints.BreakpointUpdated += breakpointUpdatedHandler;

            DebuggingService.PausedEvent  += OnDebuggerStatusCheck;
            DebuggingService.ResumedEvent += OnDebuggerStatusCheck;
            DebuggingService.StoppedEvent += OnDebuggerStatusCheck;

            tree.RowActivated += OnRowActivated;

            DockItemToolbar toolbar = window.GetToolbar(PositionType.Top);

            toolbar.Add(toolbarSet, sw);
            toolbar.ShowAll();
        }
            public ICSGameObserverWidget(ICSClient
						      client)
                : base()
            {
                split = new HPaned ();
                this.client = client;
                currentGames = new Hashtable ();
                gamesBook = new Notebook ();
                gamesBook.ShowTabs = false;

                gamesList = new TreeView ();
                gamesStore =
                    new ListStore (typeof (string),
                               typeof (string));
                gamesList.Model = gamesStore;
                gamesList.AppendColumn ("Games",
                            new
                            CellRendererText (),
                            "markup", 0);
                ScrolledWindow scroll = new ScrolledWindow ();
                scroll.HscrollbarPolicy =
                    scroll.VscrollbarPolicy =
                    PolicyType.Automatic;
                scroll.Add (gamesList);

                gamesList.CursorChanged +=
                    OnGamesListCursorChanged;
                split.Add1 (scroll);
                split.Add2 (gamesBook);

                split.ShowAll ();
                PackStart (split, true, true, 2);
                client.GameMessageEvent += OnGameMessage;
            }
Example #34
0
        /// <summary>
        /// Default constructor. Initialises intellisense popup, but doesn't display anything.
        /// </summary>
        public IntellisenseView(ViewBase owner) : base(owner)
        {
            completionForm = new Window(WindowType.Toplevel)
            {
                HeightRequest   = 300,
                WidthRequest    = 750,
                Decorated       = false,
                SkipPagerHint   = true,
                SkipTaskbarHint = true,
            };

            Frame completionFrame = new Frame();

            completionForm.Add(completionFrame);

            ScrolledWindow completionScroller = new ScrolledWindow();

            completionFrame.Add(completionScroller);

            completionModel = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(bool));
            completionView  = new Gtk.TreeView(completionModel);
            completionScroller.Add(completionView);

            TreeViewColumn column = new TreeViewColumn()
            {
                Title     = "Item",
                Resizable = true,
            };
            CellRendererPixbuf iconRender = new CellRendererPixbuf();

            column.PackStart(iconRender, false);
            CellRendererText textRender = new CellRendererText()
            {
                Editable   = false,
                WidthChars = 25,
                Ellipsize  = Pango.EllipsizeMode.End
            };

            column.PackStart(textRender, true);
            column.SetAttributes(iconRender, "pixbuf", 0);
            column.SetAttributes(textRender, "text", 1);
            completionView.AppendColumn(column);

            textRender = new CellRendererText()
            {
                Editable   = false,
                WidthChars = 10,
                Ellipsize  = Pango.EllipsizeMode.End
            };
            column = new TreeViewColumn("Units", textRender, "text", 2)
            {
                Resizable = true
            };
            completionView.AppendColumn(column);

            textRender = new CellRendererText()
            {
                Editable   = false,
                WidthChars = 15,
                Ellipsize  = Pango.EllipsizeMode.End
            };
            column = new TreeViewColumn("Type", textRender, "text", 3)
            {
                Resizable = true
            };
            completionView.AppendColumn(column);

            textRender = new CellRendererText()
            {
                Editable = false,
            };
            column = new TreeViewColumn("Descr", textRender, "text", 4)
            {
                Resizable = true
            };
            completionView.AppendColumn(column);

            completionView.HasTooltip        = true;
            completionView.TooltipColumn     = 5;
            completionForm.FocusOutEvent    += OnLeaveCompletion;
            completionView.ButtonPressEvent += OnButtonPress;
            completionView.KeyPressEvent    += OnContextListKeyDown;
            completionView.KeyReleaseEvent  += OnKeyRelease;
        }
            public ObservableGamesWidget(GameObservationManager
						      observer)
            {
                obManager = observer;
                iters = new TreeIter[3, 4];
                gamesView = new TreeView ();
                infoLabel = new Label ();
                infoLabel.Xalign = 0;
                infoLabel.Xpad = 4;
                observer.ObservableGameEvent +=
                    OnObservableGameEvent;

                store = new TreeStore (typeof (string),	// used for filtering
                               typeof (int),	// gameid
                               typeof (string),	// markup
                               typeof (string),	//
                               typeof (string));

                  gamesView.HeadersVisible = true;
                  gamesView.HeadersClickable = true;

                  gamesView.AppendColumn (Catalog.
                              GetString ("Games"),
                              new
                              CellRendererText (),
                              "markup", 2);
                  gamesView.AppendColumn (Catalog.
                              GetString ("Time"),
                              new
                              CellRendererText (),
                              "markup", 3);
                  gamesView.AppendColumn (Catalog.
                              GetString
                              ("Category"),
                              new
                              CellRendererText (),
                              "markup", 4);

                ScrolledWindow win = new ScrolledWindow ();
                  win.HscrollbarPolicy =
                    win.VscrollbarPolicy =
                    PolicyType.Automatic;
                  win.Add (gamesView);

                  UpdateInfoLabel ();

                  filterEntry = new Entry ();
                  filterEntry.Changed += OnFilter;

                  filter = new TreeModelFilter (store, null);
                  filter.VisibleFunc = FilterFunc;
                  gamesView.Model = filter;

                  AddParentIters ();

                  infoLabel.UseMarkup = true;
                Button refreshButton =
                    new Button (Stock.Refresh);
                  refreshButton.Clicked +=
                    delegate (object o, EventArgs args)
                {
                    Clear ();
                    obManager.GetGames ();
                };
                Alignment align = new Alignment (0, 1, 0, 0);
                align.Add (refreshButton);

                HBox hbox = new HBox ();
                hbox.PackStart (infoLabel, true, true, 4);
                hbox.PackStart (align, false, false, 4);

                PackStart (hbox, false, true, 4);

                Label tipLabel = new Label ();
                tipLabel.Xalign = 0;
                tipLabel.Xpad = 4;
                tipLabel.Markup =
                    String.
                    Format ("<small><i>{0}</i></small>",
                        Catalog.
                        GetString
                        ("Press the refresh button to get an updated list of games.\nDouble click on a game to observe it."));
                PackStart (tipLabel, false, true, 4);
                PackStart (filterEntry, false, true, 4);
                PackStart (win, true, true, 4);

                gamesView.RowActivated += OnRowActivated;
                SetSizeRequest (600, 400);
                ShowAll ();
            }
Example #36
0
			private Test ()
			{
				const string path = "/tmp/TagSelectionTest.db";

				try {
					File.Delete (path);
				} catch {}

				Db db = new Db (path, true);

				Category people_category = db.Tags.CreateCategory (null, "People");
				db.Tags.CreateTag (people_category, "Anna");
				db.Tags.CreateTag (people_category, "Ettore");
				db.Tags.CreateTag (people_category, "Miggy");
				db.Tags.CreateTag (people_category, "Nat");

				Category places_category = db.Tags.CreateCategory (null, "Places");
				db.Tags.CreateTag (places_category, "Milan");
				db.Tags.CreateTag (places_category, "Boston");

				Category exotic_category = db.Tags.CreateCategory (places_category, "Exotic");
				db.Tags.CreateTag (exotic_category, "Bengalore");
				db.Tags.CreateTag (exotic_category, "Manila");
				db.Tags.CreateTag (exotic_category, "Tokyo");

				selection_widget = new TagSelectionWidget (db.Tags);
				selection_widget.SelectionChanged += new SelectionChangedHandler (OnSelectionChanged);

				Window window = new Window (WindowType.Toplevel);
				window.SetDefaultSize (400, 200);
				ScrolledWindow scrolled = new ScrolledWindow (null, null);
				scrolled.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
				scrolled.Add (selection_widget);
				window.Add (scrolled);

				window.ShowAll ();
			}
Example #37
0
        public BuyDialog(int featureLicenceId, string featureTitle, Gtk.Window parent) : base()
        {
            this.featureTitle     = featureTitle;
            this.featureLicenceId = featureLicenceId;
            this.HasSeparator     = false;
            if (parent != null)
            {
                this.TransientFor = parent;
            }
            this.WidthRequest  = 570;
            this.HeightRequest = 450;

            this.ModifyBg(Gtk.StateType.Normal, Style.White);

            string userLicenceId = "-100";

            if (MainClass.User != null)
            {
                userLicenceId = MainClass.User.LicenseId;
            }

            int iTyp = 0;

            if (!Int32.TryParse(userLicenceId, out iTyp))
            {
                iTyp = -100;
            }

            featureLicence = MainClass.LicencesSystem.GetLicence(this.featureLicenceId.ToString());

            handCursor    = new Gdk.Cursor(Gdk.CursorType.Hand2);
            regularCursor = new Gdk.Cursor(Gdk.CursorType.Xterm);

            viewHeader          = new TextView();
            viewHeader.CanFocus = false;
            TextBuffer buffer = viewHeader.Buffer;

            viewFooter = new TextView();
            TextBuffer buffer2 = viewFooter.Buffer;

            viewFooter.KeyPressEvent     += new KeyPressEventHandler(KeyPress);
            viewFooter.WidgetEventAfter  += new WidgetEventAfterHandler(EventAfter);
            viewFooter.MotionNotifyEvent += new MotionNotifyEventHandler(MotionNotify);
            viewFooter.HeightRequest      = 15;
            viewFooter.CanFocus           = false;

            viewTable          = new TextView();
            viewTable.CanFocus = false;
            TextBuffer buffer3 = viewTable.Buffer;

            ScrolledWindow sw = new ScrolledWindow();

            sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            sw.HeightRequest = 115;
            sw.Add(viewHeader);

            ScrolledWindow sw2 = new ScrolledWindow();

            sw2.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            sw2.HeightRequest = 15;
            sw2.Add(viewFooter);

            ScrolledWindow sw3 = new ScrolledWindow();

            sw3.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            sw3.Add(viewTable);

            CreateTags(buffer);
            CreateTags(buffer2);
            CreateTags(buffer3);
            InsertTextHeader(buffer);
            InsertTextFooter(buffer2);
            InsertTextTable(buffer3);

            Table tbl = new Table(4, 1, false);

            if (MainClass.Platform.IsMac)
            {
                tbl.BorderWidth = 20;
            }
            else
            {
                tbl.BorderWidth = 6;
            }

            BannerButton btnBuy = new BannerButton();

            btnBuy.ModifyBase(StateType.Normal, new Gdk.Color(109, 158, 24));
            btnBuy.ModifyBg(StateType.Normal, new Color(109, 158, 24));
            btnBuy.HeightRequest = 38;
            btnBuy.WidthRequest  = 170;
            string buyPath = System.IO.Path.Combine(MainClass.Paths.ResDir, "btnBuy.png");

            btnBuy.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) {
                string url = "http://moscrif.com/download?t={0}";
                if (MainClass.User != null && (!String.IsNullOrEmpty(MainClass.User.Token)))
                {
                    url = string.Format(url, MainClass.User.Token);
                }

                System.Diagnostics.Process.Start(url);
                this.Respond(Gtk.ResponseType.Ok);
            };

            btnBuy.ImageIcon = new Pixbuf(buyPath);

            BannerButton btnCancel = new BannerButton();

            btnCancel.HeightRequest = 38;
            btnCancel.WidthRequest  = 170;
            string cancelPath = System.IO.Path.Combine(MainClass.Paths.ResDir, "btnCancel.png");

            btnCancel.ImageIcon         = new Pixbuf(cancelPath);
            btnCancel.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) {
                this.Respond(Gtk.ResponseType.Cancel);
            };

            Table tblButton = new Table(1, 4, false);

            tblButton.ColumnSpacing = 12;
            tblButton.BorderWidth   = 6;
            tblButton.Attach(new Label(""), 0, 1, 0, 1, AttachOptions.Expand, AttachOptions.Expand, 0, 0);
            tblButton.Attach(btnCancel, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tblButton.Attach(btnBuy, 2, 3, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tblButton.Attach(new Label(""), 3, 4, 0, 1, AttachOptions.Expand, AttachOptions.Expand, 0, 0);

            tbl.Attach(sw, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            tbl.Attach(sw3, 0, 1, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 0, 0);
            tbl.Attach(tblButton, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            tbl.Attach(sw2, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            tbl.ShowAll();
            this.VBox.Add(tbl);
            this.ShowAll();
        }
Example #38
0
        public void ShowPage(PageType type, string [] warnings)
        {
            if (type == PageType.Setup)
            {
                Header      = "Welcome to SparkleShare!";
                Description = "First off, what’s your name and email?\n(visible only to team members)";

                Table table = new Table(2, 3, true)
                {
                    RowSpacing    = 6,
                    ColumnSpacing = 6
                };

                Label name_label = new Label("<b>" + "Full Name:" + "</b>")
                {
                    UseMarkup = true,
                    Xalign    = 1
                };

                Entry name_entry = new Entry()
                {
                    Xalign           = 0,
                    ActivatesDefault = true
                };

                try {
                    UnixUserInfo user_info = UnixUserInfo.GetRealUser();

                    if (user_info != null && user_info.RealName != null)
                    {
                        // Some systems append a series of "," for some reason
                        name_entry.Text = user_info.RealName.TrimEnd(",".ToCharArray());
                    }
                } catch (ArgumentException) {
                    // No username, not a big deal
                }

                Entry email_entry = new Entry()
                {
                    Xalign           = 0,
                    ActivatesDefault = true
                };

                Label email_label = new Label("<b>" + "Email:" + "</b>")
                {
                    UseMarkup = true,
                    Xalign    = 1
                };

                table.Attach(name_label, 0, 1, 0, 1);
                table.Attach(name_entry, 1, 2, 0, 1);
                table.Attach(email_label, 0, 1, 1, 2);
                table.Attach(email_entry, 1, 2, 1, 2);

                VBox wrapper = new VBox(false, 9);
                wrapper.PackStart(table, true, false, 0);

                Button cancel_button   = new Button("Cancel");
                Button continue_button = new Button("Continue")
                {
                    Sensitive = false
                };


                Controller.UpdateSetupContinueButtonEvent += delegate(bool button_enabled) {
                    Application.Invoke(delegate { continue_button.Sensitive = button_enabled; });
                };

                name_entry.Changed    += delegate { Controller.CheckSetupPage(name_entry.Text, email_entry.Text); };
                email_entry.Changed   += delegate { Controller.CheckSetupPage(name_entry.Text, email_entry.Text); };
                cancel_button.Clicked += delegate { Controller.SetupPageCancelled(); };

                continue_button.Clicked += delegate {
                    Controller.SetupPageCompleted(name_entry.Text, email_entry.Text);
                };


                AddButton(cancel_button);
                AddButton(continue_button);
                Add(wrapper);

                Controller.CheckSetupPage(name_entry.Text, email_entry.Text);

                if (name_entry.Text.Equals(""))
                {
                    name_entry.GrabFocus();
                }
                else
                {
                    email_entry.GrabFocus();
                }
            }

            if (type == PageType.Add)
            {
                Header = "Where’s your project hosted?";

                VBox layout_vertical = new VBox(false, 16);
                HBox layout_fields   = new HBox(true, 32);
                VBox layout_address  = new VBox(true, 0);
                VBox layout_path     = new VBox(true, 0);

                ListStore store = new ListStore(typeof(string), typeof(Gdk.Pixbuf), typeof(string), typeof(SparklePlugin));

                SparkleTreeView tree_view = new SparkleTreeView(store)
                {
                    HeadersVisible = false
                };
                ScrolledWindow scrolled_window = new ScrolledWindow()
                {
                    ShadowType = ShadowType.In
                };
                scrolled_window.SetPolicy(PolicyType.Never, PolicyType.Automatic);

                // Padding column
                tree_view.AppendColumn("Padding", new Gtk.CellRendererText(), "text", 0);
                tree_view.Columns [0].Cells [0].Xpad = 4;

                // Icon column
                tree_view.AppendColumn("Icon", new Gtk.CellRendererPixbuf(), "pixbuf", 1);
                tree_view.Columns [1].Cells [0].Xpad = 4;

                // Service column
                TreeViewColumn service_column = new TreeViewColumn()
                {
                    Title = "Service"
                };
                CellRendererText service_cell = new CellRendererText()
                {
                    Ypad = 8
                };
                service_column.PackStart(service_cell, true);
                service_column.SetCellDataFunc(service_cell, new TreeCellDataFunc(RenderServiceColumn));

                foreach (SparklePlugin plugin in Controller.Plugins)
                {
                    store.AppendValues("", new Gdk.Pixbuf(plugin.ImagePath),
                                       "<span size=\"small\"><b>" + plugin.Name + "</b>\n" +
                                       "<span fgcolor=\"" + SecondaryTextColor + "\">" + plugin.Description + "</span>" +
                                       "</span>", plugin);
                }

                tree_view.AppendColumn(service_column);
                scrolled_window.Add(tree_view);

                Entry address_entry = new Entry()
                {
                    Text             = Controller.PreviousAddress,
                    Sensitive        = (Controller.SelectedPlugin.Address == null),
                    ActivatesDefault = true
                };

                Entry path_entry = new Entry()
                {
                    Text             = Controller.PreviousPath,
                    Sensitive        = (Controller.SelectedPlugin.Path == null),
                    ActivatesDefault = true
                };

                Label address_example = new Label()
                {
                    Xalign    = 0,
                    UseMarkup = true,
                    Markup    = "<span size=\"small\" fgcolor=\"" +
                                SecondaryTextColor + "\">" + Controller.SelectedPlugin.AddressExample + "</span>"
                };

                Label path_example = new Label()
                {
                    Xalign    = 0,
                    UseMarkup = true,
                    Markup    = "<span size=\"small\" fgcolor=\"" +
                                SecondaryTextColor + "\">" + Controller.SelectedPlugin.PathExample + "</span>"
                };


                TreeSelection default_selection = tree_view.Selection;
                TreePath      default_path      = new TreePath("" + Controller.SelectedPluginIndex);
                default_selection.SelectPath(default_path);

                tree_view.Model.Foreach(new TreeModelForeachFunc(
                                            delegate(ITreeModel model, TreePath path, TreeIter iter) {
                    string address;

                    try {
                        address = (model.GetValue(iter, 2) as SparklePlugin).Address;
                    } catch (NullReferenceException) {
                        address = "";
                    }

                    if (!string.IsNullOrEmpty(address) &&
                        address.Equals(Controller.PreviousAddress))
                    {
                        tree_view.SetCursor(path, service_column, false);
                        SparklePlugin plugin = (SparklePlugin)model.GetValue(iter, 2);

                        if (plugin.Address != null)
                        {
                            address_entry.Sensitive = false;
                        }

                        if (plugin.Path != null)
                        {
                            path_entry.Sensitive = false;
                        }

                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                                            ));

                layout_address.PackStart(new Label()
                {
                    Markup = "<b>" + "Address" + "</b>",
                    Xalign = 0
                }, true, true, 0);

                layout_address.PackStart(address_entry, false, false, 0);
                layout_address.PackStart(address_example, false, false, 0);

                path_entry.Changed += delegate {
                    Controller.CheckAddPage(address_entry.Text, path_entry.Text, tree_view.SelectedRow);
                };

                layout_path.PackStart(new Label()
                {
                    Markup = "<b>" + "Remote Path" + "</b>",
                    Xalign = 0
                }, true, true, 0);

                layout_path.PackStart(path_entry, false, false, 0);
                layout_path.PackStart(path_example, false, false, 0);

                layout_fields.PackStart(layout_address, true, true, 0);
                layout_fields.PackStart(layout_path, true, true, 0);

                layout_vertical.PackStart(new Label(""), false, false, 0);
                layout_vertical.PackStart(scrolled_window, true, true, 0);
                layout_vertical.PackStart(layout_fields, false, false, 0);

                tree_view.ScrollToCell(new TreePath("" + Controller.SelectedPluginIndex), null, true, 0, 0);

                Add(layout_vertical);


                if (string.IsNullOrEmpty(path_entry.Text))
                {
                    address_entry.GrabFocus();
                    address_entry.Position = -1;
                }
                else
                {
                    path_entry.GrabFocus();
                    path_entry.Position = -1;
                }

                Button cancel_button = new Button("Cancel");
                Button add_button    = new Button("Add")
                {
                    Sensitive = false
                };


                Controller.ChangeAddressFieldEvent += delegate(string text,
                                                               string example_text, FieldState state) {
                    Application.Invoke(delegate {
                        address_entry.Text      = text;
                        address_entry.Sensitive = (state == FieldState.Enabled);
                        address_example.Markup  = "<span size=\"small\" fgcolor=\"" +
                                                  SecondaryTextColor + "\">" + example_text + "</span>";
                    });
                };

                Controller.ChangePathFieldEvent += delegate(string text,
                                                            string example_text, FieldState state) {
                    Application.Invoke(delegate {
                        path_entry.Text      = text;
                        path_entry.Sensitive = (state == FieldState.Enabled);
                        path_example.Markup  = "<span size=\"small\" fgcolor=\""
                                               + SecondaryTextColor + "\">" + example_text + "</span>";
                    });
                };

                Controller.UpdateAddProjectButtonEvent += delegate(bool button_enabled) {
                    Application.Invoke(delegate { add_button.Sensitive = button_enabled; });
                };


                tree_view.CursorChanged += delegate(object sender, EventArgs e) {
                    Controller.SelectedPluginChanged(tree_view.SelectedRow);
                };

                address_entry.Changed += delegate {
                    Controller.CheckAddPage(address_entry.Text, path_entry.Text, tree_view.SelectedRow);
                };

                cancel_button.Clicked += delegate { Controller.PageCancelled(); };
                add_button.Clicked    += delegate { Controller.AddPageCompleted(address_entry.Text, path_entry.Text); };


                CheckButton check_button = new CheckButton("Fetch prior revisions")
                {
                    Active = true
                };
                check_button.Toggled += delegate { Controller.HistoryItemChanged(check_button.Active); };

                AddOption(check_button);
                AddButton(cancel_button);
                AddButton(add_button);

                Controller.HistoryItemChanged(check_button.Active);
                Controller.CheckAddPage(address_entry.Text, path_entry.Text, 1);
            }

            if (type == PageType.Invite)
            {
                Header      = "You’ve received an invite!";
                Description = "Do you want to add this project to SparkleShare?";

                Table table = new Table(2, 3, true)
                {
                    RowSpacing    = 6,
                    ColumnSpacing = 6
                };

                Label address_label = new Label("Address:")
                {
                    Xalign = 1
                };
                Label path_label = new Label("Remote Path:")
                {
                    Xalign = 1
                };

                Label address_value = new Label("<b>" + Controller.PendingInvite.Address + "</b>")
                {
                    UseMarkup = true,
                    Xalign    = 0
                };

                Label path_value = new Label("<b>" + Controller.PendingInvite.RemotePath + "</b>")
                {
                    UseMarkup = true,
                    Xalign    = 0
                };

                table.Attach(address_label, 0, 1, 0, 1);
                table.Attach(address_value, 1, 2, 0, 1);
                table.Attach(path_label, 0, 1, 1, 2);
                table.Attach(path_value, 1, 2, 1, 2);

                VBox wrapper = new VBox(false, 9);
                wrapper.PackStart(table, true, false, 0);

                Button cancel_button = new Button("Cancel");
                Button add_button    = new Button("Add");


                cancel_button.Clicked += delegate { Controller.PageCancelled(); };
                add_button.Clicked    += delegate { Controller.InvitePageCompleted(); };


                AddButton(cancel_button);
                AddButton(add_button);
                Add(wrapper);
            }

            if (type == PageType.Syncing)
            {
                Header      = String.Format("Adding project ‘{0}’…", Controller.SyncingFolder);
                Description = "This may take a while for large projects.\nIsn’t it coffee-o’clock?";

                ProgressBar progress_bar = new ProgressBar();
                progress_bar.Fraction = Controller.ProgressBarPercentage / 100;

                Button cancel_button = new Button()
                {
                    Label = "Cancel"
                };
                Button finish_button = new Button("Finish")
                {
                    Sensitive = false
                };

                Label progress_label = new Label("Preparing to fetch files…")
                {
                    Justify = Justification.Right,
                    Xalign  = 1
                };


                Controller.UpdateProgressBarEvent += delegate(double percentage, string speed) {
                    Application.Invoke(delegate {
                        progress_bar.Fraction = percentage / 100;
                        progress_label.Text   = speed;
                    });
                };

                cancel_button.Clicked += delegate { Controller.SyncingCancelled(); };


                VBox bar_wrapper = new VBox(false, 0);
                bar_wrapper.PackStart(progress_bar, false, false, 21);
                bar_wrapper.PackStart(progress_label, false, true, 0);

                Add(bar_wrapper);
                AddButton(cancel_button);
                AddButton(finish_button);
            }

            if (type == PageType.Error)
            {
                Header = "Oops! Something went wrong" + "…";

                VBox  points           = new VBox(false, 0);
                Image list_point_one   = new Image(SparkleUIHelpers.GetIcon("list-point", 16));
                Image list_point_two   = new Image(SparkleUIHelpers.GetIcon("list-point", 16));
                Image list_point_three = new Image(SparkleUIHelpers.GetIcon("list-point", 16));

                Label label_one = new Label()
                {
                    Markup = "<b>" + Controller.PreviousUrl + "</b> is the address we’ve compiled. " +
                             "Does this look alright?",
                    Wrap   = true,
                    Xalign = 0
                };

                Label label_two = new Label()
                {
                    Text   = "Is this computer’s Client ID known by the host?",
                    Wrap   = true,
                    Xalign = 0
                };

                points.PackStart(new Label("Please check the following:")
                {
                    Xalign = 0
                }, false, false, 6);

                HBox point_one = new HBox(false, 0);
                point_one.PackStart(list_point_one, false, false, 0);
                point_one.PackStart(label_one, true, true, 12);
                points.PackStart(point_one, false, false, 12);

                HBox point_two = new HBox(false, 0);
                point_two.PackStart(list_point_two, false, false, 0);
                point_two.PackStart(label_two, true, true, 12);
                points.PackStart(point_two, false, false, 12);

                if (warnings.Length > 0)
                {
                    string warnings_markup = "";

                    foreach (string warning in warnings)
                    {
                        warnings_markup += "\n<b>" + warning + "</b>";
                    }

                    Label label_three = new Label()
                    {
                        Markup = "Here’s the raw error message:" + warnings_markup,
                        Wrap   = true,
                        Xalign = 0
                    };

                    HBox point_three = new HBox(false, 0);
                    point_three.PackStart(list_point_three, false, false, 0);
                    point_three.PackStart(label_three, true, true, 12);
                    points.PackStart(point_three, false, false, 12);
                }

                points.PackStart(new Label(""), true, true, 0);

                Button cancel_button    = new Button("Cancel");
                Button try_again_button = new Button("Try Again…")
                {
                    Sensitive = true
                };


                cancel_button.Clicked    += delegate { Controller.PageCancelled(); };
                try_again_button.Clicked += delegate { Controller.ErrorPageCompleted(); };


                AddButton(cancel_button);
                AddButton(try_again_button);
                Add(points);
            }

            if (type == PageType.CryptoSetup || type == PageType.CryptoPassword)
            {
                if (type == PageType.CryptoSetup)
                {
                    Header      = "Set up file encryption";
                    Description = "Please a provide a strong password that you don’t use elsewhere.";
                }
                else
                {
                    Header      = "This project contains encrypted files";
                    Description = "Please enter the password to see their contents.";
                }

                Label password_label = new Label("<b>" + "Password" + "</b>")
                {
                    UseMarkup = true,
                    Xalign    = 1
                };

                Entry password_entry = new Entry()
                {
                    Xalign           = 0,
                    Visibility       = false,
                    ActivatesDefault = true
                };

                CheckButton show_password_check_button = new CheckButton("Show password")
                {
                    Active = false,
                    Xalign = 0,
                };

                Table table = new Table(2, 3, true)
                {
                    RowSpacing    = 6,
                    ColumnSpacing = 6
                };

                table.Attach(password_label, 0, 1, 0, 1);
                table.Attach(password_entry, 1, 2, 0, 1);

                table.Attach(show_password_check_button, 1, 2, 1, 2);

                VBox wrapper = new VBox(false, 9);
                wrapper.PackStart(table, true, false, 0);

                Image warning_image = new Image(
                    SparkleUIHelpers.GetIcon("dialog-information", 24));

                Label warning_label = new Label()
                {
                    Xalign = 0,
                    Wrap   = true,
                    Text   = "This password can’t be changed later, and your files can’t be recovered if it’s forgotten."
                };

                HBox warning_layout = new HBox(false, 0);
                warning_layout.PackStart(warning_image, false, false, 15);
                warning_layout.PackStart(warning_label, true, true, 0);

                VBox warning_wrapper = new VBox(false, 0);
                warning_wrapper.PackStart(warning_layout, false, false, 15);

                if (type == PageType.CryptoSetup)
                {
                    wrapper.PackStart(warning_wrapper, false, false, 0);
                }

                Button cancel_button   = new Button("Cancel");
                Button continue_button = new Button("Continue")
                {
                    Sensitive = false
                };


                Controller.UpdateCryptoSetupContinueButtonEvent += delegate(bool button_enabled) {
                    Application.Invoke(delegate { continue_button.Sensitive = button_enabled; });
                };

                Controller.UpdateCryptoPasswordContinueButtonEvent += delegate(bool button_enabled) {
                    Application.Invoke(delegate { continue_button.Sensitive = button_enabled; });
                };

                show_password_check_button.Toggled += delegate {
                    password_entry.Visibility = !password_entry.Visibility;
                };

                password_entry.Changed += delegate {
                    if (type == PageType.CryptoSetup)
                    {
                        Controller.CheckCryptoSetupPage(password_entry.Text);
                    }
                    else
                    {
                        Controller.CheckCryptoPasswordPage(password_entry.Text);
                    }
                };

                cancel_button.Clicked += delegate { Controller.CryptoPageCancelled(); };

                continue_button.Clicked += delegate {
                    if (type == PageType.CryptoSetup)
                    {
                        Controller.CryptoSetupPageCompleted(password_entry.Text);
                    }
                    else
                    {
                        Controller.CryptoPasswordPageCompleted(password_entry.Text);
                    }
                };


                Add(wrapper);

                AddButton(cancel_button);
                AddButton(continue_button);

                password_entry.GrabFocus();
            }

            if (type == PageType.Finished)
            {
                Header      = "Your shared project is ready!";
                Description = "You can find the files in your SparkleShare folder.";

                UrgencyHint = true;

                Button show_files_button = new Button("Show Files…");
                Button finish_button     = new Button("Finish");


                show_files_button.Clicked += delegate { Controller.ShowFilesClicked(); };
                finish_button.Clicked     += delegate { Controller.FinishPageCompleted(); };


                if (warnings.Length > 0)
                {
                    Image warning_image = new Image(SparkleUIHelpers.GetIcon("dialog-information", 24));

                    Label warning_label = new Label(warnings [0])
                    {
                        Xalign = 0,
                        Wrap   = true
                    };

                    HBox warning_layout = new HBox(false, 0);
                    warning_layout.PackStart(warning_image, false, false, 15);
                    warning_layout.PackStart(warning_label, true, true, 0);

                    VBox warning_wrapper = new VBox(false, 0);
                    warning_wrapper.PackStart(warning_layout, false, false, 0);

                    Add(warning_wrapper);
                }
                else
                {
                    Add(null);
                }

                AddButton(show_files_button);
                AddButton(finish_button);
            }

            if (type == PageType.Tutorial)
            {
                switch (Controller.TutorialPageNumber)
                {
                case 1: {
                    Header      = "What’s happening next?";
                    Description = "SparkleShare creates a special folder on your computer " +
                                  "that will keep track of your projects.";

                    Button skip_tutorial_button = new Button("Skip Tutorial");
                    Button continue_button      = new Button("Continue");

                    skip_tutorial_button.Clicked += delegate { Controller.TutorialSkipped(); };
                    continue_button.Clicked      += delegate { Controller.TutorialPageCompleted(); };

                    AddButton(skip_tutorial_button);
                    AddButton(continue_button);

                    break;
                }

                case 2: {
                    Header      = "Sharing files with others";
                    Description = "All files added to your project folders are synced automatically with " +
                                  "the host and your team members.";

                    Button continue_button = new Button("Continue");
                    continue_button.Clicked += delegate { Controller.TutorialPageCompleted(); };
                    AddButton(continue_button);

                    break;
                }

                case 3: {
                    Header      = "The status icon helps you";
                    Description = "It shows the syncing progress, provides easy access to " +
                                  "your projects, and lets you view recent changes.";

                    Button continue_button = new Button("Continue");
                    continue_button.Clicked += delegate { Controller.TutorialPageCompleted(); };
                    AddButton(continue_button);

                    break;
                }

                case 4: {
                    Header      = "Here’s your unique Client ID";
                    Description = "You’ll need it whenever you want to link this computer to a host. " +
                                  "You can also find it in the status icon menu.";

                    Button finish_button   = new Button("Finish");
                    VBox   layout_vertical = new VBox(false, 0)
                    {
                        BorderWidth = 48
                    };
                    HBox layout_horizontal = new HBox(false, 6);

                    Entry link_code_entry = new Entry()
                    {
                        Text      = Program.Controller.CurrentUser.PublicKey,
                        Sensitive = false
                    };

                    Button copy_button = new Button(" Copy ");

                    CheckButton check_button = new CheckButton("Add SparkleShare to startup items");
                    check_button.Active = true;


                    copy_button.Clicked   += delegate { Controller.CopyToClipboardClicked(); };
                    check_button.Toggled  += delegate { Controller.StartupItemChanged(check_button.Active); };
                    finish_button.Clicked += delegate { Controller.TutorialPageCompleted(); };


                    layout_horizontal.PackStart(link_code_entry, true, true, 0);
                    layout_horizontal.PackStart(copy_button, false, false, 0);

                    layout_vertical.PackStart(new Label(""), true, true, 0);
                    layout_vertical.PackStart(layout_horizontal, false, false, 0);
                    layout_vertical.PackStart(new Label(""), true, true, 18);

                    Add(layout_vertical);

                    AddOption(check_button);
                    AddButton(finish_button);

                    break;
                }
                }

                if (Controller.TutorialPageNumber < 4)
                {
                    Image slide = SparkleUIHelpers.GetImage("tutorial-slide-" + Controller.TutorialPageNumber + ".png");
                    Add(slide);
                }
            }
        }
            public ObservingGamePage(ICSGameObserverWidget
						  widget,
						  MoveDetails details)
                : base()
            {
                this.win = widget;
                gameId = details.gameNumber;

                InitGameWidget (details);

                movesWidget = new ChessMovesWidget ();
                movesWidget.CursorChanged += OnCursorChanged;

                gameWidget.WhiteAtBottom =
                    !details.blackAtBottom;
                board.side = details.blackAtBottom;
                gameWidget.whiteClock.Configure (details.
                                 initial_time
                                 * 60,
                                 (uint)
                                 details.
                                 increment);
                gameWidget.blackClock.Configure (details.
                                 initial_time
                                 * 60,
                                 (uint)
                                 details.
                                 increment);

                white = details.white;
                black = details.black;
                gameWidget.White = white;
                gameWidget.Black = black;

                gameWidget.Show ();
                board.Show ();
                movesWidget.Show ();

                HBox box = new HBox ();
                Button closeButton;
                if (Config.WindowsBuild)
                    closeButton =
                        new Button (Stock.Close);
                else
                  {
                      closeButton = new Button ("");
                      closeButton.Image =
                          new Image (Stock.Close,
                                 IconSize.Menu);
                  }
                resultLabel = new Label ();
                resultLabel.Xalign = 0;
                box.PackStart (resultLabel, true, true, 2);
                box.PackStart (closeButton, false, false, 2);

                PackStart (box, false, true, 2);

                box = new HBox ();
                ScrolledWindow scroll = new ScrolledWindow ();
                scroll.HscrollbarPolicy = PolicyType.Never;
                scroll.VscrollbarPolicy =
                    PolicyType.Automatic;
                scroll.Add (movesWidget);

                VBox movesBox = new VBox ();
                movesBox.PackStart (scroll, true, true, 2);
                AddGameNavigationButtons (movesBox);

                box.PackStart (gameWidget, true, true, 2);
                box.PackStart (movesBox, false, true, 2);
                PackStart (box, true, true, 2);

                closeButton.Clicked += OnCloseButtonClicked;

                Update (details);
                ShowAll ();
            }
            public ChessGameView()
                : base()
            {
                handCursor =
                    new Gdk.Cursor (Gdk.CursorType.Hand2);
                regularCursor =
                    new Gdk.Cursor (Gdk.CursorType.Xterm);

                marks = new Hashtable ();
                tag_links = new Hashtable ();
                taglinks = new ArrayList ();
                curMoveIdx = -1;

                view = new TextView ();
                view.WrapMode = WrapMode.Word;
                view.Editable = false;
                view.WidgetEventAfter += EventAfter;
                view.MotionNotifyEvent += MotionNotify;
                view.VisibilityNotifyEvent +=
                    VisibilityNotify;

                ScrolledWindow win = new ScrolledWindow ();
                  win.SetPolicy (PolicyType.Never,
                         PolicyType.Automatic);
                  win.Add (view);

                  PackStart (win, true, true, 0);
                  view.WidthRequest = 150;

                  CreateTags ();
                  ShowAll ();
            }
Example #41
0
        public OptionsDialog(MonoDevelop.Components.Window parentWindow, object dataObject, string extensionPath, bool removeEmptySections)
        {
            buttonCancel = new Gtk.Button(Gtk.Stock.Cancel);
            AddActionWidget(this.buttonCancel, ResponseType.Cancel);

            buttonSave = new Gtk.Button(Gtk.Stock.Save);
            this.ActionArea.PackStart(buttonSave);
            buttonSave.Clicked += OnButtonSaveClicked;

            mainHBox = new HBox();
            tree     = new TreeView();
            var sw = new ScrolledWindow();

            sw.Add(tree);
            sw.HscrollbarPolicy = PolicyType.Never;
            sw.VscrollbarPolicy = PolicyType.Automatic;
            sw.ShadowType       = ShadowType.None;

            var fboxTree = new HeaderBox();

            fboxTree.SetMargins(0, 1, 0, 1);
            fboxTree.SetPadding(0, 0, 0, 0);
            fboxTree.BackgroundColor = new Gdk.Color(255, 255, 255);
            fboxTree.Add(sw);
            mainHBox.PackStart(fboxTree, false, false, 0);

            Realized += delegate {
                fboxTree.BackgroundColor = tree.Style.Base(Gtk.StateType.Normal);
            };

            var vbox = new VBox();

            mainHBox.PackStart(vbox, true, true, 0);
            var headerBox = new HBox(false, 6);

            image = new Xwt.ImageView();
            //	headerBox.PackStart (image, false, false, 0);

            labelTitle        = new Label();
            labelTitle.Xalign = 0;
            textHeader        = new Alignment(0, 0, 1, 1);
            textHeader.Add(labelTitle);
            textHeader.BorderWidth = 12;
            headerBox.PackStart(textHeader, true, true, 0);

            imageHeader = new OptionsDialogHeader();
            imageHeader.Hide();
            headerBox.PackStart(imageHeader.ToGtkWidget());

            var fboxHeader = new HeaderBox();

            fboxHeader.SetMargins(0, 1, 0, 0);
            fboxHeader.Add(headerBox);
//			fbox.GradientBackround = true;
//			fbox.BackgroundColor = new Gdk.Color (255, 255, 255);
            Realized += delegate {
                var c = Style.Background(Gtk.StateType.Normal).ToXwtColor();
                c.Light += 0.09;
                fboxHeader.BackgroundColor = c.ToGdkColor();
            };
            vbox.PackStart(fboxHeader, false, false, 0);

            pageFrame = new HBox();
            var fbox = new HeaderBox();

            fbox.SetMargins(0, 1, 0, 0);
            fbox.ShowTopShadow = true;
            fbox.Add(pageFrame);
            vbox.PackStart(fbox, true, true, 0);

            this.VBox.PackStart(mainHBox, true, true, 0);

            this.removeEmptySections = removeEmptySections;
            extensionContext         = AddinManager.CreateExtensionContext();

            this.mainDataObject = dataObject;
            this.extensionPath  = extensionPath;

            if (parentWindow != null)
            {
                TransientFor = parentWindow;
            }

            ImageService.EnsureStockIconIsLoaded(emptyCategoryIcon);

            store               = new TreeStore(typeof(OptionsDialogSection));
            tree.Model          = store;
            tree.HeadersVisible = false;

            // Column 0 is used to add some padding at the left of the expander
            TreeViewColumn col0 = new TreeViewColumn();

            col0.MinWidth = 6;
            tree.AppendColumn(col0);

            TreeViewColumn col = new TreeViewColumn();
            var            crp = new CellRendererImage();

            col.PackStart(crp, false);
            col.SetCellDataFunc(crp, PixbufCellDataFunc);
            var crt = new CellRendererText();

            col.PackStart(crt, true);
            col.SetCellDataFunc(crt, TextCellDataFunc);
            tree.AppendColumn(col);

            tree.ExpanderColumn = col;

            tree.Selection.Changed += OnSelectionChanged;

            Child.ShowAll();

            InitializeContext(extensionContext);

            FillTree();
            ExpandCategories();
            this.DefaultResponse = Gtk.ResponseType.Ok;

            DefaultWidth  = 960;
            DefaultHeight = 680;
        }
            public OpeningBrowserUI(OpeningsDb db)
                : base()
            {
                menubar = new AppMenuBar ();
                title = Catalog.GetString ("Opening Browser");
                accel = new AccelGroup ();
                menubar.quitMenuItem.
                    AddAccelerator ("activate", accel,
                            new AccelKey (Gdk.Key.
                                      q,
                                      Gdk.
                                      ModifierType.
                                      ControlMask,
                                      AccelFlags.
                                      Visible));
                toolbutton = new ToolButton (Stock.Info);
                toolbutton.Label =
                    Catalog.GetString ("Openings");
                toolbutton.ShowAll ();

                this.db = db;
                store = new TreeStore (typeof (string),
                               typeof (int),
                               typeof (string));
                this.db.PopulateTree (store);
                view = new TreeView ();
                view.Model = store;
                view.AppendColumn (Catalog.
                           GetString ("Moves"),
                           new CellRendererText (),
                           "text", 0);
                view.AppendColumn (Catalog.
                           GetString ("Variations"),
                           new CellRendererText (),
                           "text", 1);
                view.AppendColumn (Catalog.
                           GetString ("Name"),
                           new CellRendererText (),
                           "markup", 2);

                ScrolledWindow win = new ScrolledWindow ();
                win.SetPolicy (PolicyType.Automatic,
                           PolicyType.Automatic);
                win.Add (view);

                boardWidget = new GameViewerBoard ();
                HPaned split = new HPaned ();
                VBox box = new VBox ();
                box.PackStart (boardWidget, true, true, 2);
                split.Pack1 (box, false, true);	// resize, shrink
                split.Pack2 (win, true, true);
                split.ShowAll ();
                //split.Position = 400;
                int width, height;
                CsBoardApp.Instance.Window.GetSize (out width,
                                    out
                                    height);
                split.Position =
                    (int) Math.Round (width * 0.5f);
                split.PositionSet = true;
                PackStart (split, true, true, 2);

                view.CursorChanged += OnCursorChanged;
                ShowAll ();
            }
Example #43
0
        /// <summary>
        /// Set up the UI inside the Window
        /// </summary>
        private void InitializeWidgets()
        {
            this.Spacing     = 10;
            this.BorderWidth = 10;

            // Create the main TreeView and add it to a scrolled
            // window, then add it to the main vbox widget
            UserTreeView = new iFolderTreeView();
            ScrolledWindow sw = new ScrolledWindow();

            sw.ShadowType = Gtk.ShadowType.EtchedIn;
            sw.Add(UserTreeView);
            this.PackStart(sw, true, true, 0);


            // Set up the iFolder TreeView
            UserTreeStore      = new ListStore(typeof(iFolderUser));
            UserTreeView.Model = UserTreeStore;

            CellRendererPixbuf mcrp       = new CellRendererPixbuf();
            TreeViewColumn     UserColumn = new TreeViewColumn();

            UserColumn.PackStart(mcrp, false);
            UserColumn.Spacing = 2;
            UserColumn.SetCellDataFunc(mcrp,
                                       new TreeCellDataFunc(UserCellPixbufDataFunc));

            CellRendererText mcrt = new CellRendererText();

            UserColumn.PackStart(mcrt, false);
            UserColumn.SetCellDataFunc(mcrt,
                                       new TreeCellDataFunc(UserCellTextDataFunc));
            UserColumn.Title = Util.GS("User");
            UserTreeView.AppendColumn(UserColumn);
            UserColumn.Resizable = true;

            CellRendererText statecr = new CellRendererText();

            statecr.Xpad = 5;
            TreeViewColumn stateColumn =
                UserTreeView.AppendColumn(Util.GS("Role"),
                                          statecr,
                                          new TreeCellDataFunc(StateCellTextDataFunc));

            stateColumn.Resizable = true;
            stateColumn.MinWidth  = 150;

            CellRendererText accesscr = new CellRendererText();

            accesscr.Xpad = 5;
            TreeViewColumn accessColumn =
                UserTreeView.AppendColumn(Util.GS("Rights"),
                                          accesscr,
                                          new TreeCellDataFunc(AccessCellTextDataFunc));

            accessColumn.Resizable = true;

            UserTreeView.Selection.Mode     = SelectionMode.Multiple;
            UserTreeView.Selection.Changed +=
                new EventHandler(OnUserSelectionChanged);

            UserTreeView.ButtonPressEvent += new ButtonPressEventHandler(
                OnUserTreeViewButtonPressed);

            UserTreeView.RowActivated += new RowActivatedHandler(
                OnUserTreeViewRowActivated);



            OwnerUserPixbuf =
                new Gdk.Pixbuf(Util.ImagesPath("ifolder-user-owner16.png"));
            CurrentUserPixbuf =
                new Gdk.Pixbuf(Util.ImagesPath("ifolder-user-current16.png"));
            // Use an empty pixbuf to represent a normal user
            NormalUserPixbuf =
                new Gdk.Pixbuf(OwnerUserPixbuf.Colorspace, true,
                               OwnerUserPixbuf.BitsPerSample,
                               OwnerUserPixbuf.Width,
                               OwnerUserPixbuf.Height);
            NormalUserPixbuf.Fill(0x00000000);                  // transparent

            // Set up buttons for add/remove/accept/decline
            HBox buttonBox = new HBox();

            buttonBox.Spacing = 10;
            this.PackStart(buttonBox, false, false, 0);

            HBox leftBox = new HBox();

            leftBox.Spacing = 10;
            buttonBox.PackStart(leftBox, false, false, 0);
            HBox midBox = new HBox();

            midBox.Spacing = 10;
            buttonBox.PackStart(midBox, true, true, 0);
            HBox rightBox = new HBox();

            rightBox.Spacing = 10;
            buttonBox.PackStart(rightBox, false, false, 0);

            AddButton = new Button(Gtk.Stock.Add);
            rightBox.PackStart(AddButton);
            AddButton.Clicked += new EventHandler(OnAddUser);
            RemoveButton       = new Button(Gtk.Stock.Remove);
            rightBox.PackStart(RemoveButton);
            RemoveButton.Clicked += new EventHandler(OnRemoveUser);
            AccessButton          = new Button(Util.GS("R_ights..."));
            leftBox.PackStart(AccessButton);
            AccessButton.Clicked += new EventHandler(OnAccessClicked);
        }