Exemple #1
0
        public GlToggleButton(GdkGL.Config config)
        {
            // VBox.
            VBox vbox = new VBox (false, 0);
            vbox.BorderWidth = 10;

            // Drawing area for drawing OpenGL scene.
            DrawingArea drawing_area = new DrawingArea ();
            drawing_area.SetSizeRequest (200, 200);

            // Set OpenGL-capability to the widget.
            m_gl = new GlWidget (drawing_area, config);
            drawing_area.Realized += new EventHandler (Realize);
            drawing_area.ConfigureEvent += new ConfigureEventHandler (Configure);
            drawing_area.ExposeEvent += new ExposeEventHandler (Expose);
            drawing_area.Unrealized += new EventHandler (Unrealize);
            drawing_area.VisibilityNotifyEvent += new VisibilityNotifyEventHandler (VisibilityNotify);

            vbox.PackStart (drawing_area, true, true, 0);
            drawing_area.Show ();

            // Label.
            Label label = new Label ("Toggle Animation");
            vbox.PackStart (label, false, false, 10);
            label.Show ();

            Toggled += new EventHandler (ToggleAnimation);

            // Add VBox.
            vbox.Show ();
            Add (vbox);
        }
 private Widget CreateWidgets()
 {
     VBox vbox = new VBox(false, 0);
        Label l = new Label("<span size=\"large\">Base Colors</span>");
        vbox.PackStart(l, false, false, 0);
        l.UseMarkup = true;
        l.Xalign = 0;
        vbox.PackStart(CreateColorBox("Normal", this.Style.Base(StateType.Normal)));
        vbox.PackStart(CreateColorBox("Active", this.Style.Base(StateType.Active)));
        vbox.PackStart(CreateColorBox("Prelight", this.Style.Base(StateType.Prelight)));
        vbox.PackStart(CreateColorBox("Selected", this.Style.Base(StateType.Selected)));
        vbox.PackStart(CreateColorBox("Insensitive", this.Style.Base(StateType.Insensitive)));
        l = new Label("<span size=\"large\">Background Colors</span>");
        vbox.PackStart(l, false, false, 0);
        l.UseMarkup = true;
        l.Xalign = 0;
        vbox.PackStart(CreateColorBox("Normal", this.Style.Background(StateType.Normal)));
        vbox.PackStart(CreateColorBox("Active", this.Style.Background(StateType.Active)));
        vbox.PackStart(CreateColorBox("Prelight", this.Style.Background(StateType.Prelight)));
        vbox.PackStart(CreateColorBox("Selected", this.Style.Background(StateType.Selected)));
        vbox.PackStart(CreateColorBox("Insensitive", this.Style.Background(StateType.Insensitive)));
        l = new Label("<span size=\"large\">Foreground Colors</span>");
        vbox.PackStart(l, false, false, 0);
        l.UseMarkup = true;
        l.Xalign = 0;
        vbox.PackStart(CreateColorBox("Normal", this.Style.Foreground(StateType.Normal)));
        vbox.PackStart(CreateColorBox("Active", this.Style.Foreground(StateType.Active)));
        vbox.PackStart(CreateColorBox("Prelight", this.Style.Foreground(StateType.Prelight)));
        vbox.PackStart(CreateColorBox("Selected", this.Style.Foreground(StateType.Selected)));
        vbox.PackStart(CreateColorBox("Insensitive", this.Style.Foreground(StateType.Insensitive)));
        vbox.ShowAll();
        return vbox;
 }
        public AboutMonoDevelopTabPage ()
        {
            Label label = new Label();
            label.Markup = String.Format (
                "<b>{0}</b>\n    {1}", 
                GettextCatalog.GetString ("Version"), 
                BuildVariables.PackageVersion == BuildVariables.PackageVersionLabel ? BuildVariables.PackageVersionLabel : String.Format ("{0} ({1})", 
                BuildVariables.PackageVersionLabel, 
                BuildVariables.PackageVersion));
            HBox hBoxVersion = new HBox ();
            hBoxVersion.PackStart (label, false, false, 5);
            this.PackStart (hBoxVersion, false, true, 0);

            label = null;
            label = new Label ();
            label.Markup = GettextCatalog.GetString ("<b>License</b>\n    {0}", GettextCatalog.GetString ("Released under the GNU Lesser General Public License."));
            HBox hBoxLicense = new HBox ();
            hBoxLicense.PackStart (label, false, false, 5);
            this.PackStart (hBoxLicense, false, true, 5);

            label = null;
            label = new Label ();
            label.Markup = GettextCatalog.GetString ("<b>Copyright</b>\n    (c) 2000-2003 by icsharpcode.net\n    (c) 2004-{0} by MonoDevelop contributors", 2009);
            HBox hBoxCopyright = new HBox ();
            hBoxCopyright.PackStart (label, false, false, 5);
            this.PackStart (hBoxCopyright, false, true, 5);

            this.ShowAll ();
        }
		public static Widget GetButton (Action action, bool label)
		{
			Widget w = action.CreateIcon (IconSize.Button);
			if (label) {
				HBox box = new HBox ();
				box.PackStart (w, false, false, 0);
				Label l = new Label ();
				l.Markup = "<small>" + action.Label + "</small>";
				box.PackStart (l);
				w = box;
			}
			Button button;
			if (action is ToggleAction) {
				ToggleButton toggle = new ToggleButton ();
				toggle.Active = ((ToggleAction)action).Active;
				button = toggle;
			} else {
				button = new Button ();
			}
			button.Relief = ReliefStyle.None;
			button.Add (w);
			w.ShowAll ();

			action.ConnectProxy (button);
			tips.SetTip (button, action.Tooltip, String.Empty);
			return button;
		}
Exemple #5
0
        public AttributeEntry(FileTemplate.Attribute attribute)
        {
            this.attribute = attribute;

            Label lblApp = new Label(attribute.Name.Replace("_","__")+": ");
            lblApp.Xalign = 1;
            lblApp.Yalign = 0.5F;
            lblApp.WidthRequest = 115;
            Entry entr = new Entry();
            entr.Name = "entr";
            if (attribute.Value != null)
                entr.Text = attribute.Value.ToString();

            entr.Changed+= delegate(object sender, EventArgs e) {

                if (!String.IsNullOrEmpty(attribute.ValidateExpr)){
                    Regex regex = new Regex(attribute.ValidateExpr, RegexOptions.Compiled);
                    if (regex.IsMatch(entr.Text)){
                        this.attribute.Value = (object)entr.Text;
                    } else {
                        if (attribute.Value != null)
                        entr.Text = attribute.Value.ToString();
                    }

                } else
                    this.attribute.Value = (object)entr.Text;
            };

            this.PackStart(lblApp,false,false,2);
            this.PackEnd(entr,true,true,2);
        }
        public MainWindow_Widget()
            : base("You know I'm no good")
        {
            SetDefaultSize(800, 600);

            BorderWidth = 8;
            SetPosition(WindowPosition.Center);

            // Title
            Title = "Widget Test";

            // Label
            DeleteEvent += delegate
            {
                    Application.Quit();
            };

            Fixed fix = new Fixed();

            ComboBox combo = new ComboBox(distros);
            combo.Changed += OnChanged;

            lyrics = new Label(text);

            fix.Put(combo, 50, 30);
            fix.Put(lyrics, 50, 150);

            Add(fix);

            ShowAll();
        }
Exemple #7
0
        public ListPage(Notebook notebook, ModulesTreeInfo module)
        {
            this.notebook = notebook;
            this.module = module;

            headerbox = new HBox();
            headerlabel = new Label(module.Text);
            headerbox.PackStart(headerlabel);
            //Image img = new Image("gtk-close", IconSize.Menu);
            close_img = ImageManager.GetImage("Images.close-button.png");
            //close_img = new Image("gtk-close", IconSize.Menu);
            btnCloseTab = new Button(close_img);
            btnCloseTab.BorderWidth = 0;
            btnCloseTab.Relief = ReliefStyle.None;
            //btnCloseTab.WidthRequest = 19;
            //btnCloseTab.HeightRequest = 19;
            btnCloseTab.Clicked += delegate { this.Dispose(); };
            headerbox.PackStart(btnCloseTab);
            headerbox.ShowAll();

            tableview = new DataTableView(module);
            this.Add(tableview);
            this.ShowAll();

            notebook.AppendPage(this, headerbox);
            notebook.SetTabReorderable(this, true);
        }
        public BebidasCalientesView(Label labelTotalMainWindow,Button botonNP)
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build ();

            labelBebidasCalientes.Markup = "<span size='xx-large' weight='bold'>Bebidas Calientes</span>";
            botonNuevoPedidoMainWindow = botonNP;
            totalMainWindow = labelTotalMainWindow;

            dbConnection = ApplicationContext.Instance.DbConnection;

            //hacer la consulta bd
            IDbCommand dbCommand = dbConnection.CreateCommand ();
            dbCommand.CommandText =
                "select * from bebidascalientes ";

            IDataReader dataReader = dbCommand.ExecuteReader ();

            //Aquí creamos un objeto de la clase RellenarTreeView y le pasamos a la clase el treeView y el dataReader
            RellenarTreeView rellenar =new RellenarTreeView();
            rellenar.llenarTreeView(treeView, dataReader);

            //recogemos el listStore que usamos en la clase RellenarTreeView, para ser usada en los los métodos en esa clase
            listStore = rellenar.get_ListStore();

            dataReader.Close ();
        }
        public AboutPintaTabPage()
        {
            Label label = new Label ();
            label.Markup = String.Format (
                "<b>{0}</b>\n    {1}",
                Catalog.GetString ("Version"),
                "1.2");

            HBox hBoxVersion = new HBox ();
            hBoxVersion.PackStart (label, false, false, 5);
            this.PackStart (hBoxVersion, false, true, 0);

            label = null;
            label = new Label ();
            label.Markup = string.Format ("<b>{0}</b>\n    {1}", Catalog.GetString ("License"), Catalog.GetString ("Released under the MIT X11 License."));
            HBox hBoxLicense = new HBox ();
            hBoxLicense.PackStart (label, false, false, 5);
            this.PackStart (hBoxLicense, false, true, 5);

            label = null;
            label = new Label ();
            label.Markup = string.Format ("<b>{0}</b>\n    (c) 2010-2011 {1}", Catalog.GetString ("Copyright"), Catalog.GetString ("by Pinta contributors"));
            HBox hBoxCopyright = new HBox ();
            hBoxCopyright.PackStart (label, false, false, 5);
            this.PackStart (hBoxCopyright, false, true, 5);

            this.ShowAll ();
        }
        public NodeKeyInfo(NodeKey key)
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build ();

            int childNodes = key.ChildNodes != null ? key.ChildNodes.Count : 0;
            int values = key.ChildValues != null ? key.ChildValues.Count : 0;
            byte[] classnameData = key.ClassnameData != null ? key.ClassnameData : new byte[] {};
            string name = key.Name != null ? key.Name : string.Empty;
            DateTime timestamp = key.Timestamp != null ? key.Timestamp : DateTime.MinValue;

            Label nameLabel = new Label("Name: " + name);
            Label timestampLabel = new Label("Timestamp: " + timestamp.ToLongDateString());
            Label childNodesLabel = new Label("Child nodes: " + childNodes);
            Label valueCountLabel = new Label("Values: " + values);
            //Label data = new Label(BitConverter.ToString(classnameData).Replace('-', ' '));

            VBox box = new VBox();
            box.PackStart(nameLabel, false, false, 30);
            box.PackStart(timestampLabel, false, false, 30);
            box.PackStart(childNodesLabel, false, false, 30);
            box.PackStart(valueCountLabel, false, false, 30);
            //data.Wrap = true;
            //box.PackStart(data, false, false, 0);

            this.Add(box);

            this.ShowAll();
        }
Exemple #11
0
		public FormOrder() : base(4,2, false)
		{
			labelid = new Label("Id :");
			labelid.SetAlignment(0, (float)0.5);
			labelcust = new Label("Customer :");
			labelcust.SetAlignment(0, (float)0.5);
			labelpay = new Label("Payment :");
			labelpay.SetAlignment(0, (float)0.5);
			labeltax = new Label("Tax :");
			labeltax.SetAlignment(0, (float)0.5);
			
			entryid = new Entry();
			entryid.Sensitive = false;
			
			combocust = new ComboBoxCustomers();
			combopay = new ComboBoxPayments();
			combopay.NoneRow = true;
			combotax = new ComboBoxTaxes();
			combotax.NoneRow = true;
			
			this.ColumnSpacing = 6;
			Attach(labelid, 0, 1, 0, 1);
			Attach(labelcust, 0, 1, 1, 2);
			Attach(labelpay, 0, 1, 2, 3);
			Attach(labeltax, 0, 1, 3, 4);

			Attach(entryid, 1, 2, 0, 1);
			Attach(combocust, 1, 2, 1, 2);
			Attach(combopay, 1, 2, 2, 3);
			Attach(combotax, 1, 2, 3, 4);
			
			this.ShowAll();
		}
        public ParameterInformationWindow()
        {
            desc = new Gtk.Label ("");
            desc.Xalign = 0;
            desc.Wrap = true;
            count = new Gtk.Label ("");

            mainBox = new HBox (false, 2);
            mainBox.BorderWidth = 3;

            HBox arrowHBox = new HBox ();

            goPrev = new Gtk.Arrow (Gtk.ArrowType.Up, ShadowType.None);
            arrowHBox.PackStart (goPrev, false, false, 0);
            arrowHBox.PackStart (count, false, false, 0);
            goNext = new Gtk.Arrow (Gtk.ArrowType.Down, ShadowType.None);
            arrowHBox.PackStart (goNext, false, false, 0);

            VBox vBox = new VBox ();
            vBox.PackStart (arrowHBox, false, false, 0);

            mainBox.PackStart (vBox, false, false, 0);
            mainBox.PackStart (desc, true, true, 0);
            mainBox.ShowAll ();
            this.Add (mainBox);

            EnableTransparencyControl = true;
        }
Exemple #13
0
		//this is a popup so it behaves like other splashes on Windows, i.e. doesn't show up as a second window in the taskbar.
		public SplashScreenForm () : base (Gtk.WindowType.Popup)
		{
			AppPaintable = true;
			this.Decorated = false;
			this.WindowPosition = WindowPosition.Center;
			this.TypeHint = Gdk.WindowTypeHint.Splashscreen;
			try {
				using (var stream = BrandingService.GetStream ("SplashScreen.png", true))
					bitmap = new Gdk.Pixbuf (stream);
			} catch (Exception e) {
				LoggingService.LogError ("Can't load splash screen pixbuf 'SplashScreen.png'.", e);
			}
			progress = new ProgressBar();
			progress.Fraction = 0.00;
			progress.HeightRequest = 6;

			vbox = new VBox();
			vbox.BorderWidth = 12;
			label = new Gtk.Label ();
			label.UseMarkup = true;
			label.Xalign = 0;
			vbox.PackEnd (progress, false, true, 0);
			vbox.PackEnd (label, false, true, 3);
			this.Add (vbox);
			if (bitmap != null)
				this.Resize (bitmap.Width, bitmap.Height);
		}
		public NodeEditorWidget (DotNetProject project, AddinRegistry reg, ExtensionNodeType ntype, AddinDescription parentAddinDescription, string parentPath, ExtensionNodeDescription node)
		{
			this.node = node;
			this.project = project;
			tips = new Tooltips ();
			Spacing = 0;
			
			// Header
			
			Label label = new Label ();
			label.Wrap = true;
			label.WidthRequest = 480;
			string txt = "<b>" + node.NodeName + "</b>";
			if (ntype.Description.Length > 0)
				txt += "\n" + GLib.Markup.EscapeText (ntype.Description);
			label.Markup = txt;
			label.Xalign = 0f;
			PackStart (label, false, false, 6);
			PackStart (new HSeparator (), false, false, 0);
			
			// Attributes
			
			grid = new PropertyGrid ();
			grid.CurrentObject = new NodeWrapper (project, reg, ntype, parentAddinDescription, parentPath, node);
			
			PackStart (grid, true, true, 0);
			
			ShowAll ();
			
			grid.ShowHelp = true;
			grid.ShowToolbar = false;
			
		}
		public ParameterInformationWindow ()
		{
			heading = new Gtk.Label ("");
			heading.Xalign = 0;
			heading.Wrap = false;
			
			desc = new DescriptionLabel ();
			count = new Gtk.Label ("");

			var mainBox = new HBox (false, 2);
			
			HBox arrowHBox = new HBox ();

			goPrev = new Gtk.Arrow (Gtk.ArrowType.Up, ShadowType.None);
			arrowHBox.PackStart (goPrev, false, false, 0);
			arrowHBox.PackStart (count, false, false, 0);
			goNext = new Gtk.Arrow (Gtk.ArrowType.Down, ShadowType.None);
			arrowHBox.PackStart (goNext, false, false, 0);

			VBox vBox = new VBox ();
			vBox.PackStart (arrowHBox, false, false, 0);
			
			mainBox.PackStart (vBox, false, false, 0);
			mainBox.PackStart (heading, true, true, 0);
			
			var vBox2 = new VBox ();
			vBox2.BorderWidth = 3;
			vBox2.PackStart (mainBox, false, false, 0);
			vBox2.PackStart (desc, true, true, 4);
			Add (vBox2);
			EnableTransparencyControl = true;
			ShowAll ();
		}
		void SetLabel (string text)
		{
			Clear ();
			var label = new Gtk.Label (text);
			PackStart (label, true, true, 0);
			ShowAll ();
		}
		public void AddMessage (string msg, IconId icon)
		{
			if (lastImage != null) {
				HSeparator sep = new HSeparator ();
				sep.Show ();
				msgBox.PackStart (sep, false, false, 0);
				lastImage.IconSize = Gtk.IconSize.Menu;
			}
			
			HBox box = new HBox ();
			box.Spacing = 12;
			Alignment imgBox = new Alignment (0, 0, 0, 0);
			var img = new ImageView (icon, lastImage != null ? Gtk.IconSize.Menu : IconSize.Dialog);
			imgBox.Add (img);
			lastImage = img;
			box.PackStart (imgBox, false, false, 0);
			Label lab = new Label (msg);
			lab.UseUnderline = false;
			lab.Xalign = 0;
			lab.Yalign = 0;
			lab.Wrap = true;
			lab.WidthRequest = 500;
			box.PackStart (lab, true, true, 0);
			msgBox.PackStart (box, false, false, 0);
			box.ShowAll ();
		}
Exemple #18
0
 public SqlitePreferences()
     : base()
 {
     var lbl = new Label ("Local file requires no configuration.");
     PackStart (lbl, true, true, 0);
     ShowAll ();
 }
        public TitledList(string title_str)
            : base()
        {
            genre_map = new Dictionary<string, Genre> ();
            title = new Label ();
            title.Xalign = 0;
            title.Ellipsize = Pango.EllipsizeMode.End;
            title.Markup = String.Format ("<b>{0}</b>", GLib.Markup.EscapeText (title_str));

            PackStart (title, false, false, 0);
            title.Show ();

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

            tile_view = new TileView (2);
            PackStart (tile_view, true, true, 0);
            tile_view.Show ();

            StyleSet += delegate {
                tile_view.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
                tile_view.ModifyFg (StateType.Normal, Style.Base (StateType.Normal));
            };
        }
Exemple #20
0
 public void addNewTab(String name, IElement element)
 {
     Label tablabel = new Label(name);
     this.AppendPage((Widget)element,tablabel);
     this.ShowAll();
     TabCount++;
 }
Exemple #21
0
		public DialogError(string message, Exception e, Window parent) : base("Error", parent, DialogFlags.Modal, Stock.Ok, ResponseType.Ok)
		{
			HBox hbox = new HBox();
			Image icon = new Image(Stock.DialogError,IconSize.Dialog);
			Label label = new Label(message);
			Expander exp = new Expander("Details");
			ScrolledWindow sw = new ScrolledWindow();
			TextView tview = new TextView();
			
			hbox.BorderWidth = 6;
			hbox.Spacing = 6;
			label.SetAlignment(0f, 0.5f);
			exp.BorderWidth = 6;
			tview.Buffer.Text = e.Message;
			tview.Buffer.Text += "\n";
			tview.Buffer.Text += e.StackTrace;
			
			sw.Add(tview);
			exp.Add(sw);
			hbox.PackStart(icon, false, false, 0);
			hbox.PackStart(label, true, true, 0);
			this.VBox.PackStart(hbox, false, false, 0);
			this.VBox.PackStart(exp, true, true, 0);
			this.ShowAll();
			
		}
		public void Fill (SolutionFolder parentCombine, SolutionItem entry, ISolutionItemFeature[] features)
		{
			selectedFeatures.Clear ();
			selectedEditors.Clear ();
			
			this.entry = entry;
			this.parentCombine = parentCombine;
			
			foreach (Gtk.Widget w in box.Children) {
				box.Remove (w);
				w.Destroy ();
			}
			// Show enabled features at the beginning
			foreach (ISolutionItemFeature feature in features)
				if (feature.GetSupportLevel (parentCombine, entry) == FeatureSupportLevel.Enabled) {
					Gtk.Widget editor = AddFeature (feature);
					selectedFeatures.Add (feature);
					selectedEditors.Add (editor);
				}
			foreach (ISolutionItemFeature feature in features)
				if (feature.GetSupportLevel (parentCombine, entry) != FeatureSupportLevel.Enabled)
					AddFeature (feature);
			
			if (box.Children.Length == 0) {
				// No features
				Label lab = new Label ();
				lab.Xalign = 0;
				lab.Text = GettextCatalog.GetString ("There are no additional features available for this project.");
				box.PackStart (lab, false, false, 0);
				lab.Show ();
			}
			scrolled.AddWithViewport (box);
		}
        public BDialog(string aName, Gtk.Window aParent, string aText)
            : base(aName, aParent, Gtk.DialogFlags.NoSeparator)
        {
            // setup dialog
              this.Modal = true;
              this.BorderWidth = 6;
              this.HasSeparator = false;
              this.Resizable = false;
              this.VBox.Spacing=12;

              // graphic items
              hbox = new Gtk.HBox();
              		Gtk.VBox labelBox = new VBox();
              		label = new Gtk.Label();
              		image = new Gtk.Image();

            hbox.Spacing=12;
            hbox.BorderWidth=6;
            this.VBox.Add(hbox);

            // set-up image
            image.Yalign=0.0F;
              hbox.Add(image);

            // set-up label
            label.Yalign=0.0F;
            label.Xalign=0.0F;
            label.UseMarkup=true;
            label.Wrap=true;
            label.Markup=aText;

            // add to dialog
            labelBox.Add(label);
            hbox.Add(labelBox);
        }
Exemple #24
0
 public void set_snippet(string snippet)
 {
     snippet_wrapper = new Gtk.EventBox();
     Gtk.Label tmp = new Gtk.Label();
     tmp.Markup = snippet;
     snippet_wrapper.Add(tmp);
 }
Exemple #25
0
 public DummyPreferences()
     : base()
 {
     var lbl = new Label ("Debugging System (this message is a test)");
     PackStart (lbl, true, true, 0);
     ShowAll ();
 }
Exemple #26
0
        // create the TopBar widget
        public TopBar()
        {
            // create the widgets
            Button add_button = new Button (Stock.Add);
            Button remove_button = new Button (Stock.Remove);
            Label search_label = new Label ("Search:");

            Image clear_image = new Image (Stock.Clear, IconSize.Menu);
            clear_box.Add (clear_image);

            // hook up the widget events
            add_button.Clicked += add_clicked;
            remove_button.Clicked += remove_clicked;
            search.Changed += search_changed;
            clear_box.ButtonReleaseEvent += clear_released;
            clear_box.Realized += clear_realized;

            // homogeneous button box
            HBox button_box = new HBox (true, 0);
            button_box.PackStart (add_button, false, true, 0);
            button_box.PackStart (remove_button, false, true, 0);

            // pack widgets
            this.PackStart (button_box, false, true, 0);
            this.PackStart (search_label, false, false, 5);
            this.PackStart (search, true, true, 0);
            this.PackStart (clear_box, false, false, 0);
        }
Exemple #27
0
        public ProgressDialog(string title, CancelButtonType cancel_button_type, int total_count, Gtk.Window parent_window)
        {
            Title = title;
            this.total_count = total_count;

            if (parent_window != null)
                this.TransientFor = parent_window;

            HasSeparator = false;
            BorderWidth = 6;
            SetDefaultSize (300, -1);

            message_label = new Label (String.Empty);
            VBox.PackStart (message_label, true, true, 12);

            progress_bar = new ProgressBar ();
            VBox.PackStart (progress_bar, true, true, 6);

            switch (cancel_button_type) {
            case CancelButtonType.Cancel:
                button = (Gtk.Button)AddButton (Gtk.Stock.Cancel, (int) ResponseType.Cancel);
                break;
            case CancelButtonType.Stop:
                button = (Gtk.Button)AddButton (Gtk.Stock.Stop, (int) ResponseType.Cancel);
                break;
            }

            Response += new ResponseHandler (HandleResponse);
        }
Exemple #28
0
		public IndexInfo ()
		{
			HeaderIcon = Beagle.Util.WidgetFu.LoadThemeIcon ("dialog-information", 48);
			Header = Catalog.GetString ("Index Information");

			Gtk.Label description = new Gtk.Label ();
			description.Markup = Catalog.GetString ("Number of items currently indexed:");
			description.LineWrap = true;
			description.Justify = Justification.Left;
			description.SetAlignment (0.0f, 0.5f);

			Append (description, Gtk.AttachOptions.Fill, 0);

			label = new Gtk.Label ();
			label.LineWrap = true;
			label.SetAlignment (0.0f, 0.5f);
			label.Justify = Justification.Fill;
			
			Append (label, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0);

			note = new Gtk.Label ();
			note.Markup = Catalog.GetString ("<i>NOTE: The search service is still indexing new data.</i>");
			note.LineWrap = true;
			note.Justify = Justification.Fill;
			note.SetAlignment (0.0f, 0.5f);
			note.NoShowAll = true;
			
			Append (note, Gtk.AttachOptions.Fill, 0);
		}
Exemple #29
0
        void BuildLayout ()
        {
            primary_vbox = new VBox ();
            
            var label = new Label ("Super duper test UI!");
            label.Show ();
            primary_vbox.Add (label);
            
            var button_box = new HButtonBox ();
            button_box.Show ();
            primary_vbox.Add (button_box);
            
            var folder_button = new FileChooserButton ("Select import folder", FileChooserAction.SelectFolder);
            folder_button.FileSet += delegate {
                folder = folder_button.Uri;
                Log.Information ("Selected " + folder);
            };
            folder_button.Show ();
            button_box.Add (folder_button);
            
            var import_button = new Button { Label = "Start Import" };
            import_button.Activated += StartImport;
            import_button.Clicked += StartImport;
            import_button.Show ();
            button_box.Add (import_button);

            primary_vbox.Show ();
            Add (primary_vbox);
        }
Exemple #30
0
        public void creaVentanaArticulo()
        {
            titulo="Añadir articulo";
            ventana(titulo);
            Label cat=new Label("Introduce el nombre del nuevo articulo: ");
            text= new Entry();
            ComboBox cb=new ComboBox();
            Label cat2=new Label("Selecciona la categoria: ");
            combot= new ComboBoxHelper(App.Instance.DbConnection,cb,"nombre","id",0,"categoria");
            tabla.Attach(cat,0,1,0,1);
            tabla.Attach(text,1,2,0,1);
            tabla.Attach(cat2,0,1,1,2);
            tabla.Attach(cb,1,2,1,2);
            Label pre=new Label("Introduce el precio del nuevo articulo: ");
            precio=new Entry();
            tabla.Attach(pre,0,1,2,3);
            tabla.Attach(precio,1,2,2,3);
            Button button=new Button("Añadir");
                    button.Clicked +=delegate{
                    añadirArticulo(App.Instance.DbConnection);
                    if(!enBlanco){
                        window.Destroy();
                        refresh();
                }
            };

            tabla.Attach(button,1,2,3,4);
            window.Add(vbox);
            window.ShowAll();
        }
        void Init()
        {
            main   = new VBox(false, 6);
            widget = main;

            buttonCommit = new Gtk.Button()
            {
                Image = new Gtk.Image("vc-commit", Gtk.IconSize.Menu),
                Label = GettextCatalog.GetString("Commit...")
            };
            buttonCommit.Image.Show();
            buttonRevert = new Gtk.Button()
            {
                Image = new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu),
                Label = GettextCatalog.GetString("Revert")
            };
            buttonRevert.Image.Show();
            showRemoteStatus = new Gtk.Button()
            {
                Image = new Gtk.Image("vc-remote-status", Gtk.IconSize.Menu),
                Label = GettextCatalog.GetString("Show Remote Status")
            };
            showRemoteStatus.Image.Show();

            status = new Label("");
            main.PackStart(status, false, false, 0);

            scroller                = new ScrolledWindow();
            scroller.ShadowType     = Gtk.ShadowType.None;
            filelist                = new FileTreeView();
            filelist.Selection.Mode = Gtk.SelectionMode.Multiple;

            scroller.Add(filelist);
            scroller.HscrollbarPolicy   = PolicyType.Automatic;
            scroller.VscrollbarPolicy   = PolicyType.Automatic;
            filelist.RowActivated      += OnRowActivated;
            filelist.DiffLineActivated += OnDiffLineActivated;

            CellRendererToggle cellToggle = new CellRendererToggle();

            cellToggle.Toggled += new ToggledHandler(OnCommitToggledHandler);
            var crc = new CellRendererIcon();

            crc.StockId       = "vc-comment";
            colCommit         = new TreeViewColumn();
            colCommit.Spacing = 2;
            colCommit.Widget  = new Gtk.Image("vc-commit", Gtk.IconSize.Menu);
            colCommit.Widget.Show();
            colCommit.PackStart(cellToggle, false);
            colCommit.PackStart(crc, false);
            colCommit.AddAttribute(cellToggle, "active", ColCommit);
            colCommit.AddAttribute(cellToggle, "visible", ColShowToggle);
            colCommit.AddAttribute(crc, "visible", ColShowComment);

            CellRendererText crt     = new CellRendererText();
            var            crp       = new CellRendererPixbuf();
            TreeViewColumn colStatus = new TreeViewColumn();

            colStatus.Title = GettextCatalog.GetString("Status");
            colStatus.PackStart(crp, false);
            colStatus.PackStart(crt, true);
            colStatus.AddAttribute(crp, "pixbuf", ColIcon);
            colStatus.AddAttribute(crp, "visible", ColShowStatus);
            colStatus.AddAttribute(crt, "text", ColStatus);
            colStatus.AddAttribute(crt, "foreground", ColStatusColor);

            TreeViewColumn colFile = new TreeViewColumn();

            colFile.Title   = GettextCatalog.GetString("File");
            colFile.Spacing = 2;
            crp             = new CellRendererPixbuf();
            diffRenderer    = new CellRendererDiff();
            colFile.PackStart(crp, false);
            colFile.PackStart(diffRenderer, true);
            colFile.AddAttribute(crp, "pixbuf", ColIconFile);
            colFile.AddAttribute(crp, "visible", ColShowStatus);
            colFile.SetCellDataFunc(diffRenderer, new TreeCellDataFunc(SetDiffCellData));

            crt             = new CellRendererText();
            crp             = new CellRendererPixbuf();
            colRemote       = new TreeViewColumn();
            colRemote.Title = GettextCatalog.GetString("Remote Status");
            colRemote.PackStart(crp, false);
            colRemote.PackStart(crt, true);
            colRemote.AddAttribute(crp, "pixbuf", ColRemoteIcon);
            colRemote.AddAttribute(crt, "text", ColRemoteStatus);
            colRemote.AddAttribute(crt, "foreground", ColStatusColor);

            filelist.AppendColumn(colStatus);
            filelist.AppendColumn(colRemote);
            filelist.AppendColumn(colCommit);
            filelist.AppendColumn(colFile);

            colRemote.Visible = false;

            filestore               = new TreeStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string[]), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(Gdk.Pixbuf), typeof(bool), typeof(Gdk.Pixbuf), typeof(string), typeof(bool), typeof(bool));
            filelist.Model          = filestore;
            filelist.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow);

            commitBox = new VBox();

            HeaderBox commitMessageLabelBox = new HeaderBox();

            commitMessageLabelBox.SetPadding(6, 6, 6, 6);
            commitMessageLabelBox.SetMargins(1, 1, 0, 0);

            HBox labBox = new HBox();

            labelCommit        = new Gtk.Label(GettextCatalog.GetString("Commit message:"));
            labelCommit.Xalign = 0;
            labBox.PackStart(new Gtk.Image("vc-comment", Gtk.IconSize.Menu), false, false, 0);
            labBox.PackStart(labelCommit, true, true, 3);

            commitMessageLabelBox.Add(labBox);
            commitMessageLabelBox.ShowAll();
            //commitBox.PackStart (commitMessageLabelBox, false, false, 0);

            Gtk.ScrolledWindow frame = new Gtk.ScrolledWindow();
            frame.HeightRequest        = 75;
            frame.ShadowType           = ShadowType.None;
            commitText                 = new TextView();
            commitText.WrapMode        = WrapMode.WordChar;
            commitText.Buffer.Changed += OnCommitTextChanged;
            frame.Add(commitText);
            commitBox.PackStart(frame, true, true, 0);

            var paned = new VPanedThin();

            paned.HandleWidget = commitMessageLabelBox;
            paned.Pack1(scroller, true, true);
            paned.Pack2(commitBox, false, false);
            main.PackStart(paned, true, true, 0);

            main.ShowAll();
            status.Visible = false;

            filelist.Selection.Changed += new EventHandler(OnCursorChanged);
            VersionControlService.FileStatusChanged += OnFileStatusChanged;

            filelist.HeadersClickable = true;
            filestore.SetSortFunc(0, CompareNodes);
            colStatus.SortColumnId = 0;
            filestore.SetSortFunc(1, CompareNodes);
            colRemote.SortColumnId = 1;
            filestore.SetSortFunc(2, CompareNodes);
            colCommit.SortColumnId = 2;
            filestore.SetSortFunc(3, CompareNodes);
            colFile.SortColumnId = 3;

            filestore.SetSortColumnId(3, Gtk.SortType.Ascending);

            filelist.DoPopupMenu = DoPopupMenu;

            StartUpdate();
        }
Exemple #32
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);

            buttonOk = new Gtk.Button(Gtk.Stock.Ok);
            this.ActionArea.PackStart(buttonOk);
            buttonOk.Clicked += OnButtonOkClicked;

            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);

            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();
            };
            StyleSet += delegate {
                if (IsRealized)
                {
                    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();
            RestoreLastPanel();
            this.DefaultResponse = Gtk.ResponseType.Ok;

            buttonOk.CanDefault = true;
            buttonOk.GrabDefault();

            DefaultWidth  = 960;
            DefaultHeight = 680;
        }
Exemple #33
0
        void CreatePageWidget(SectionPage page)
        {
            List <PanelInstance> boxPanels = new List <PanelInstance> ();
            List <PanelInstance> tabPanels = new List <PanelInstance> ();

            foreach (PanelInstance pi in page.Panels)
            {
                if (pi.Widget == null)
                {
                    pi.Widget = pi.Panel.CreatePanelWidget();
                    if (pi.Widget == null)
                    {
                        continue;
                    }

                    //HACK: work around bug 469427 - broken themes match on widget names
                    if (pi.Widget.Name.IndexOf("Panel") > 0)
                    {
                        pi.Widget.Name = pi.Widget.Name.Replace("Panel", "_");
                    }
                }
                else if (pi.Widget.Parent != null)
                {
                    ((Gtk.Container)pi.Widget.Parent).Remove(pi.Widget);
                }

                if (pi.Node.Grouping == PanelGrouping.Tab)
                {
                    tabPanels.Add(pi);
                }
                else
                {
                    boxPanels.Add(pi);
                }
            }

            // Try to fit panels with grouping=box or auto in the main page.
            // If they don't fit. Move auto panels to its own tab page.

            int  mainPageSize;
            bool fits;

            do
            {
                PanelInstance lastAuto = null;
                mainPageSize = 0;
                foreach (PanelInstance pi in boxPanels)
                {
                    if (pi.Node.Grouping == PanelGrouping.Auto)
                    {
                        lastAuto = pi;
                    }
                    // HACK: This we are parenting/unparenting the widget here as a workaround
                    // for a layout issue. To properly calculate the size of the widget, the widget
                    // needs to have the style that it will have when added to the window.
                    pi.Widget.Parent = this;
                    mainPageSize    += pi.Widget.SizeRequest().Height + 6;
                    pi.Widget.Unparent();
                }
                fits = mainPageSize <= pageFrame.Allocation.Height;
                if (!fits)
                {
                    if (lastAuto != null && boxPanels.Count > 1)
                    {
                        boxPanels.Remove(lastAuto);
                        tabPanels.Insert(0, lastAuto);
                    }
                    else
                    {
                        fits = true;
                    }
                }
            } while (!fits);

            Gtk.VBox box = new VBox(false, 12);
            box.Show();
            for (int n = 0; n < boxPanels.Count; n++)
            {
                if (n != 0)
                {
                    HSeparator sep = new HSeparator();
                    sep.Show();
                    box.PackStart(sep, false, false, 0);
                }
                PanelInstance pi = boxPanels [n];
                box.PackStart(pi.Widget, pi.Node.Fill, pi.Node.Fill, 0);
                pi.Widget.Show();
            }

            box.BorderWidth = 12;

            if (tabPanels.Count > 0)
            {
                /*				SquaredNotebook nb = new SquaredNotebook ();
                 * nb.Show ();
                 * nb.AddTab (box, GettextCatalog.GetString ("General"));
                 * foreach (PanelInstance pi in tabPanels) {
                 *      Gtk.Alignment a = new Alignment (0, 0, 1, 1);
                 *      a.BorderWidth = 9;
                 *      a.Show ();
                 *      a.Add (pi.Widget);
                 *      nb.AddTab (a, GettextCatalog.GetString (pi.Node.Label));
                 *      pi.Widget.Show ();
                 * }*/
                Gtk.Notebook nb = new Notebook();
                nb.Show();
                if (box.Children.Length > 0)
                {
                    Gtk.Label blab = new Gtk.Label(GettextCatalog.GetString("General"));
                    blab.Show();
                    box.BorderWidth = 9;
                    nb.InsertPage(box, blab, -1);
                }
                foreach (PanelInstance pi in tabPanels)
                {
                    Gtk.Label lab = new Gtk.Label(GettextCatalog.GetString(pi.Node.Label));
                    lab.Show();
                    Gtk.Alignment a = new Alignment(0, 0, 1, 1);
                    a.BorderWidth = 9;
                    a.Show();
                    a.Add(pi.Widget);
                    nb.InsertPage(a, lab, -1);
                    pi.Widget.Show();
                }
                page.Widget    = nb;
                nb.BorderWidth = 12;
            }
            else
            {
                page.Widget = box;
            }
        }
Exemple #34
0
        public DemoImages() : base("Images")
        {
            BorderWidth = 8;

            vbox             = new VBox(false, 8);
            vbox.BorderWidth = 8;
            Add(vbox);

            Gtk.Label label = new Gtk.Label("<u>Image loaded from a file</u>");
            label.UseMarkup = true;
            vbox.PackStart(label, false, false, 0);

            Gtk.Frame frame = new Gtk.Frame();
            frame.ShadowType = ShadowType.In;

            // The alignment keeps the frame from growing when users resize
            // the window
            Alignment alignment = new Alignment(0.5f, 0.5f, 0f, 0f);

            alignment.Add(frame);
            vbox.PackStart(alignment, false, false, 0);

            Gtk.Image image = Gtk.Image.LoadFromResource("gtk-logo-rgb.gif");
            frame.Add(image);

            // Animation
            label           = new Gtk.Label("<u>Animation loaded from a file</u>");
            label.UseMarkup = true;
            vbox.PackStart(label, false, false, 0);

            frame            = new Gtk.Frame();
            frame.ShadowType = ShadowType.In;

            alignment = new Alignment(0.5f, 0.5f, 0f, 0f);
            alignment.Add(frame);
            vbox.PackStart(alignment, false, false, 0);

            image = Gtk.Image.LoadFromResource("floppybuddy.gif");
            frame.Add(image);

            // Progressive
            label           = new Gtk.Label("<u>Progressive image loading</u>");
            label.UseMarkup = true;
            vbox.PackStart(label, false, false, 0);

            frame            = new Gtk.Frame();
            frame.ShadowType = ShadowType.In;

            alignment = new Alignment(0.5f, 0.5f, 0f, 0f);
            alignment.Add(frame);
            vbox.PackStart(alignment, false, false, 0);

            // Create an empty image for now; the progressive loader
            // will create the pixbuf and fill it in.

            progressiveImage = new Gtk.Image();
            frame.Add(progressiveImage);

            StartProgressiveLoading();

            // Sensitivity control
            Gtk.ToggleButton button = new Gtk.ToggleButton("_Insensitive");
            vbox.PackStart(button, false, false, 0);
            button.Toggled += new EventHandler(ToggleSensitivity);

            ShowAll();
        }
Exemple #35
0
        public void SetRoom(int room)
        {
            indexSpinButton.Value = room;

            vrContainer.Remove(vrEditor);
            vrEditor = null;
            v1       = null;
            v2       = null;
            v3       = null;
            v4       = null;

            Data data = Chest.GetChestData(room);

            if (data == null)
            {
                VBox vbox = new VBox();

                Button addButton = new Button("Add");
                addButton.Clicked += (a, b) => {
                    Chest.AddChestData(RoomIndex);
                    SetRoom(RoomIndex);
                };
                addButton.Label    = "gtk-add";
                addButton.UseStock = true;

                var l = new Gtk.Label("No chest data\nexists for this room.");
                vbox.Add(l);
                var btnAlign = new Alignment(0.5f, 0.5f, 0.0f, 0.2f);
                btnAlign.TopPadding = 3;
                btnAlign.Add(addButton);
                vbox.Add(btnAlign);

                vrEditor = vbox;
            }
            else
            {
                v1 = new ValueReference("YX", 0, DataValueType.Byte);
                v1.SetData(data);
                data = data.NextData;
                v2   = new ValueReference("Room", 0, DataValueType.Byte, false);
                v2.SetData(data);
                data = data.NextData;
                v3   = new ValueReference("ID1", 0, DataValueType.Byte);
                v3.SetData(data);
                data = data.NextData;
                v4   = new ValueReference("ID2", 0, DataValueType.Byte);
                v4.SetData(data);
                data = data.NextData;

                ValueReferenceGroup vrGroup = new ValueReferenceGroup(new ValueReference[] { v1, v2, v3, v4 });

                var vr = new ValueReferenceEditor(
                    Project,
                    vrGroup,
                    "Data");
                vr.SetMaxBound(0, 0xfe); // Max bound for YX

                vr.AddDataModifiedHandler(() => {
                    if (ChestChangedEvent != null)
                    {
                        ChestChangedEvent();
                    }
                });

                VBox vbox = new VBox();
                vbox.Add(vr);

                Button delButton = new Button("Remove");
                delButton.Clicked += (a, b) => {
                    Chest.DeleteChestData(RoomIndex);
                    SetRoom(RoomIndex);
                };
                delButton.Label    = "gtk-delete";
                delButton.UseStock = true;

                Alignment btnAlign = new Alignment(0.5f, 0.5f, 0.0f, 0.2f);
                btnAlign.TopPadding = 3;
                btnAlign.Add(delButton);
                vbox.Add(btnAlign);

                vrEditor = vbox;
            }

            if (ChestChangedEvent != null)
            {
                ChestChangedEvent();
            }

            vrContainer.Add(vrEditor);
            vrContainer.ShowAll();
        }
Exemple #36
0
        public override void Clicked()
        {
            Treasure.Project = Project;
            Chest.Project    = Project;

            Gtk.Window win = new Window(WindowType.Toplevel);
            Alignment  warningsContainer = new Alignment(0.1f, 0.1f, 0f, 0f);

            VBox vbox = new VBox();

            var chestGui = new ChestEditorGui(manager);

            chestGui.SetRoom(manager.GetActiveRoom().Index);
            chestGui.Destroyed += (sender2, e2) => win.Destroy();

            Frame chestFrame = new Frame();

            chestFrame.Label = "Chest Data";
            chestFrame.Add(chestGui);

            var   treasureGui   = new TreasureEditorGui(manager);
            Frame treasureFrame = new Frame();

            treasureFrame.Label = "Treasure Data";
            treasureFrame.Add(treasureGui);

            System.Action UpdateWarnings = () => {
                VBox warningBox = new VBox();
                warningBox.Spacing = 4;

                System.Action <string> AddWarning = (s) => {
                    Image img = new Image(Stock.DialogWarning, IconSize.Button);
                    HBox  hb  = new HBox();
                    hb.Spacing = 10;
                    hb.Add(img);
                    Gtk.Label l = new Gtk.Label(s);
                    l.LineWrap = true;
                    hb.Add(l);
                    Alignment a = new  Alignment(0, 0, 0, 0);
                    a.Add(hb);
                    warningBox.Add(a);
                };

                foreach (var c in warningsContainer.Children)
                {
                    warningsContainer.Remove(c);
                }

                int index = chestGui.GetTreasureIndex();
                if (index < 0)
                {
                    return;
                }

                if (!Treasure.IndexExists(index))
                {
                    AddWarning("Treasure " + Wla.ToWord(index) + " does not exist.");
                }
                else
                {
                    if (index != treasureGui.Index)
                    {
                        AddWarning("Your treasure index is different\nfrom the chest you're editing.");
                    }

                    int spawnMode = (Treasure.GetTreasureByte(index, 0) >> 4) & 7;

                    if (spawnMode != 3)
                    {
                        AddWarning("Treasure " + Wla.ToWord(index) + " doesn't have spawn\nmode $3 (needed for chests).");
                    }

                    int  yx = Chest.GetChestByte(chestGui.RoomIndex, 0);
                    int  x  = yx & 0xf;
                    int  y  = yx >> 4;
                    Room r  = Project.GetIndexedDataType <Room>(chestGui.RoomIndex);
                    if (x >= r.Width || y >= r.Height || r.GetTile(x, y) != 0xf1)
                    {
                        AddWarning("There is no chest at coordinates (" + x + "," + y + ").");
                    }
                }

                warningsContainer.Add(warningBox);

                win.ShowAll();
            };

            chestGui.SetTreasureEditor(treasureGui);
            chestGui.ChestChangedEvent += () => {
                UpdateWarnings();
            };
            treasureGui.TreasureChangedEvent += () => {
                UpdateWarnings();
            };

            HBox hbox = new Gtk.HBox();

            hbox.Spacing = 6;
            hbox.Add(chestFrame);
            hbox.Add(treasureFrame);

            Button okButton = new Gtk.Button();

            okButton.UseStock = true;
            okButton.Label    = "gtk-ok";
            okButton.Clicked += (a, b) => {
                win.Destroy();
            };

            Alignment buttonAlign = new Alignment(0.5f, 0.5f, 0f, 0f);

            buttonAlign.Add(okButton);

            vbox.Add(hbox);
            vbox.Add(warningsContainer);
            vbox.Add(buttonAlign);

            win.Add(vbox);

            UpdateWarnings();
            win.ShowAll();
        }
        public DockItemContainer(DockFrame frame, DockItem item)
        {
            this.frame = frame;
            this.item  = item;

            ResizeMode = Gtk.ResizeMode.Queue;
            Spacing    = 0;

            title           = new Gtk.Label();
            title.Xalign    = 0;
            title.Xpad      = 3;
            title.UseMarkup = true;

            btnDock              = new Button(new Gtk.Image(pixAutoHide));
            btnDock.Relief       = ReliefStyle.None;
            btnDock.CanFocus     = false;
            btnDock.WidthRequest = btnDock.HeightRequest = 17;
            btnDock.Clicked     += OnClickDock;

            btnClose              = new Button(new Gtk.Image(pixClose));
            btnClose.TooltipText  = Catalog.GetString("Hide");
            btnClose.Relief       = ReliefStyle.None;
            btnClose.CanFocus     = false;
            btnClose.WidthRequest = btnClose.HeightRequest = 17;
            btnClose.Clicked     += delegate {
                item.Visible = false;
            };

            HBox box = new HBox(false, 0);

            box.PackStart(title, true, true, 0);
            box.PackEnd(btnClose, false, false, 0);
            box.PackEnd(btnDock, false, false, 0);

            headerAlign            = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            headerAlign.TopPadding = headerAlign.BottomPadding = headerAlign.RightPadding = headerAlign.LeftPadding = 1;
            headerAlign.Add(box);

            header                     = new EventBox();
            header.Events             |= Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask;
            header.ButtonPressEvent   += HeaderButtonPress;
            header.ButtonReleaseEvent += HeaderButtonRelease;
            header.MotionNotifyEvent  += HeaderMotion;
            header.KeyPressEvent      += HeaderKeyPress;
            header.KeyReleaseEvent    += HeaderKeyRelease;
            header.Add(headerAlign);
            header.ExposeEvent += HeaderExpose;
            header.Realized    += delegate {
                header.GdkWindow.Cursor = handCursor;
            };

            foreach (Widget w in new Widget [] { header, btnDock, btnClose })
            {
                w.EnterNotifyEvent += HeaderEnterNotify;
                w.LeaveNotifyEvent += HeaderLeaveNotify;
            }

            PackStart(header, false, false, 0);
            ShowAll();

            PackStart(item.GetToolbar(PositionType.Top).Container, false, false, 0);

            HBox hbox = new HBox();

            hbox.Show();
            hbox.PackStart(item.GetToolbar(PositionType.Left).Container, false, false, 0);

            contentBox = new HBox();
            contentBox.Show();
            hbox.PackStart(contentBox, true, true, 0);

            hbox.PackStart(item.GetToolbar(PositionType.Right).Container, false, false, 0);

            PackStart(hbox, true, true, 0);

            PackStart(item.GetToolbar(PositionType.Bottom).Container, false, false, 0);

            UpdateBehavior();
        }
Exemple #38
0
        public Widget CreateBuildResultsWidget(Orientation orientation)
        {
            EventBox ebox = new EventBox();

            Gtk.Box box;
            if (orientation == Orientation.Horizontal)
            {
                box = new HBox();
            }
            else
            {
                box = new VBox();
            }
            box.Spacing = 3;

            var errorIcon   = ImageService.GetIcon(StockIcons.Error).WithSize(Xwt.IconSize.Small);
            var warningIcon = ImageService.GetIcon(StockIcons.Warning).WithSize(Xwt.IconSize.Small);

            var errorImage   = new Xwt.ImageView(errorIcon);
            var warningImage = new Xwt.ImageView(warningIcon);

            box.PackStart(errorImage.ToGtkWidget(), false, false, 0);
            Label errors = new Gtk.Label();

            box.PackStart(errors, false, false, 0);

            box.PackStart(warningImage.ToGtkWidget(), false, false, 0);
            Label warnings = new Gtk.Label();

            box.PackStart(warnings, false, false, 0);
            box.NoShowAll = true;
            box.Show();

            TaskEventHandler updateHandler = delegate {
                int ec = 0, wc = 0;

                foreach (TaskListEntry t in TaskService.Errors)
                {
                    if (t.Severity == TaskSeverity.Error)
                    {
                        ec++;
                    }
                    else if (t.Severity == TaskSeverity.Warning)
                    {
                        wc++;
                    }
                }


                using (var font = FontService.SansFont.CopyModified(MonoDevelop.Ide.Gui.Styles.FontScale11)) {
                    errors.Visible = ec > 0;
                    errors.ModifyFont(font);
                    errors.Text        = ec.ToString();
                    errorImage.Visible = ec > 0;

                    warnings.Visible = wc > 0;
                    warnings.ModifyFont(font);
                    warnings.Text        = wc.ToString();
                    warningImage.Visible = wc > 0;
                }

                ebox.Visible = ec > 0 || wc > 0;

                UpdateSeparators();
            };

            updateHandler(null, null);

            TaskService.Errors.TasksAdded   += updateHandler;
            TaskService.Errors.TasksRemoved += updateHandler;

            currentApplicationName = BrandingService.ApplicationName;
            BrandingService.ApplicationNameChanged += ApplicationNameChanged;

            box.Destroyed += delegate {
                TaskService.Errors.TasksAdded          -= updateHandler;
                TaskService.Errors.TasksRemoved        -= updateHandler;
                BrandingService.ApplicationNameChanged -= ApplicationNameChanged;
            };

            ebox.VisibleWindow = false;
            ebox.Add(box);
            ebox.ShowAll();
            ebox.ButtonReleaseEvent += delegate {
                var pad = IdeApp.Workbench.GetPad <MonoDevelop.Ide.Gui.Pads.ErrorListPad> ();
                pad.BringToFront();
            };

            errors.Visible       = false;
            errorImage.Visible   = false;
            warnings.Visible     = false;
            warningImage.Visible = false;

            return(ebox);
        }
Exemple #39
0
        public override Widget CreateWidget()
        {
            var icon  = Gdk.Pixbuf.LoadFromResource("lightning.png");
            var image = new Gtk.Image(icon);

            HBox box = new HBox(false, 6);
            VBox vb  = new VBox();

            vb.PackStart(image, false, false, 0);
            box.PackStart(vb, false, false, 0);
            vb = new VBox(false, 6);
            vb.PackStart(new Gtk.Label()
            {
                Markup = GettextCatalog.GetString("<b>{0}</b> has been thrown", exception.Type),
                Xalign = 0
            });
            messageLabel = new Gtk.Label()
            {
                Xalign    = 0,
                NoShowAll = true
            };
            vb.PackStart(messageLabel);

            var  detailsBtn = new Xwt.LinkLabel(GettextCatalog.GetString("Show Details"));
            HBox hh         = new HBox();

            detailsBtn.NavigateToUrl += (o, e) => dlg.ShowDialog();
            hh.PackStart(detailsBtn.ToGtkWidget(), false, false, 0);
            vb.PackStart(hh, false, false, 0);

            box.PackStart(vb, true, true, 0);

            vb = new VBox();
            var closeButton = new ImageButton()
            {
                InactiveImage = closeSelImage,
                Image         = closeSelOverImage
            };

            closeButton.Clicked += delegate {
                dlg.ShowMiniButton();
            };
            vb.PackStart(closeButton, false, false, 0);
            box.PackStart(vb, false, false, 0);

            exception.Changed += delegate {
                Application.Invoke(delegate {
                    LoadData();
                });
            };
            LoadData();

            PopoverWidget eb = new PopoverWidget();

            eb.ShowArrow       = true;
            eb.EnableAnimation = true;
            eb.PopupPosition   = PopupPosition.Left;
            eb.ContentBox.Add(box);
            eb.ShowAll();
            return(eb);
        }
Exemple #40
0
        /// <summary>
        /// setup fields like: store password:yes/no and the actual password entry,
        /// if it should be stored
        /// </summary>
        /// <param name="insertTo"></param>
        /// <param name="defaultSpacing"></param>
        void SetupGuiEncryptionRelated(Gtk.Box insertTo, int defaultSpacing)
        {
            Gtk.HBox customBox = new Gtk.HBox(false, defaultSpacing);
            insertTo.PackStart(customBox);
            rbt_storePw = new Gtk.RadioButton(Catalog.GetString("_Store password"));
            customBox.PackStart(rbt_storePw);

            customBox = new Gtk.HBox(false, defaultSpacing);
            insertTo.PackStart(customBox);

            //	--- Password Boxes ---
#if WIN32 && DPAPI
            String pw = DPAPIUtil.getPassword();
#else
            String pw = Convert.ToString(Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_PASSWORD));
#endif
            pw = (pw == null) ? "" : pw;
            Gtk.VBox pwbox    = new Gtk.VBox(false, defaultSpacing);
            Gtk.HBox superbox = new Gtk.HBox(false, defaultSpacing);
            superbox.PackStart(new Gtk.Alignment(0, 0, 200, 0));             // spacer
            superbox.PackStart(pwbox);
            customBox.PackStart(superbox);

            stored_pw = new Gtk.Entry();
            // set password style:
            stored_pw.InvisibleChar = '*';
            stored_pw.Visibility    = false;
            stored_pw.Text          = pw;
            pwbox.PackStart(stored_pw);

            stored_pw2 = new Gtk.Entry();
            // set password style:
            stored_pw2.InvisibleChar = '*';
            stored_pw2.Visibility    = false;
            stored_pw2.Text          = pw;
            pwbox.PackStart(stored_pw2);

            match_label        = new Gtk.Label();
            match_label.Markup = Catalog.GetString(AddinPreferences.MATCH_TEXT);
            pwbox.PackStart(match_label);

            customBox = new Gtk.HBox(false, defaultSpacing);
            insertTo.PackStart(customBox);

            // give the first rbt here to link the 2
            rbt_alwaysAsk = new Gtk.RadioButton(rbt_storePw, Catalog.GetString("_Always ask for password"));
            customBox.PackStart(rbt_alwaysAsk);


            // assign event-listener
            rbt_storePw.Toggled += PasswordMethodChanged;

            // init with values from preferences
            object value = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_ASKEVERYTIME);
            if (value == null || value.Equals(false))
            {
                rbt_storePw.Active = true;
            }
            else
            {
                rbt_alwaysAsk.Active = true;
            }

            // assign event-listeners
            stored_pw.Changed  += PasswordChanged;
            stored_pw2.Changed += PasswordChanged;
        }
        /// <summary>
        /// Set up the UI inside the Window
        /// </summary>
        private void InitializeWidgets()
        {
            this.SetDefaultSize(600, 480);
            this.Icon =
                new Gdk.Pixbuf(Util.ImagesPath("ifolder-warning16.png"));
            VBox vbox = new VBox();

            vbox.Spacing     = 10;
            vbox.BorderWidth = 10;
            this.VBox.PackStart(vbox, true, true, 0);

            HBox topbox = new HBox();

            topbox.Spacing = 10;

            Gdk.Pixbuf bigConflict =
                new Gdk.Pixbuf(Util.ImagesPath("ifolder-warning48.png"));
            Image conflictImage = new Image(bigConflict);

            conflictImage.Yalign = 0;
            topbox.PackStart(conflictImage, false, false, 0);

            VBox textbox = new VBox();

            textbox.Spacing = 10;

            Label l = new Label("<span weight=\"bold\" size=\"larger\">" +
                                Util.GS("This iFolder contains conflicts") +
                                "</span>");

            l.LineWrap   = false;
            l.UseMarkup  = true;
            l.Selectable = false;
            l.Xalign     = 0;
            l.Yalign     = 0;
            textbox.PackStart(l, true, true, 0);

            Table ifTable = new Table(2, 2, false);

            ifTable.ColumnSpacing = 10;
            ifTable.Homogeneous   = false;

            Label nameLabel = new Label(Util.GS("Name:"));

            nameLabel.Xalign = 1;
            ifTable.Attach(nameLabel, 0, 1, 0, 1,
                           Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

            Label nameValue = new Label(ifolder.Name);

            nameValue.UseUnderline = false;
            nameValue.Xalign       = 0;
            ifTable.Attach(nameValue, 1, 2, 0, 1);

            Label pathLabel = new Label(Util.GS("Location:"));

            pathLabel.Xalign = 1;
            ifTable.Attach(pathLabel, 0, 1, 1, 2,
                           Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

            Label pathValue = new Label(ifolder.UnManagedPath);

            pathValue.UseUnderline = false;
            pathValue.Xalign       = 0;
            ifTable.Attach(pathValue, 1, 2, 1, 2);

            textbox.PackStart(ifTable, false, true, 0);

            topbox.PackStart(textbox, true, true, 0);

            vbox.PackStart(topbox, false, true, 0);

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

            sw.Add(ConflictTreeView);
            sw.ShadowType = Gtk.ShadowType.EtchedIn;
            vbox.PackStart(sw, true, true, 0);

            //
            // File Conflict Box
            //
            fileConflictBox         = new HBox();
            fileConflictBox.Spacing = 10;

            LocalFrame = new Frame(Util.GS("Local Version"));
            fileConflictBox.PackStart(LocalFrame, true, true, 0);

            Table localTable = new Table(2, 4, false);

            localTable.BorderWidth   = 10;
            localTable.ColumnSpacing = 10;

            LocalNameLabel        = new Label(Util.GS("Name:"));
            LocalNameLabel.Xalign = 0;
            localTable.Attach(LocalNameLabel, 0, 1, 0, 1,
                              Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

            LocalNameValue = new Label("");
            LocalNameValue.UseUnderline = false;
            LocalNameValue.Xalign       = 0;
            localTable.Attach(LocalNameValue, 1, 2, 0, 1);

            LocalDateLabel        = new Label(Util.GS("Date:"));
            LocalDateLabel.Xalign = 0;
            localTable.Attach(LocalDateLabel, 0, 1, 1, 2,
                              Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

            LocalDateValue        = new Label("");
            LocalDateValue.Xalign = 0;
            localTable.Attach(LocalDateValue, 1, 2, 1, 2);

            LocalSizeLabel        = new Label(Util.GS("Size:"));
            LocalSizeLabel.Xalign = 0;
            localTable.Attach(LocalSizeLabel, 0, 1, 2, 3,
                              Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

            LocalSizeValue        = new Label("");
            LocalSizeValue.Xalign = 0;
            localTable.Attach(LocalSizeValue, 1, 2, 2, 3);

            LocalSaveButton = new Button(Stock.Save);
            localTable.Attach(LocalSaveButton, 0, 1, 3, 4,
                              Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, 0, 5);
            LocalSaveButton.Clicked += new EventHandler(SaveLocalHandler);

            LocalFrame.Add(localTable);



            ServerFrame = new Frame(Util.GS("Server Version"));
            fileConflictBox.PackStart(ServerFrame, true, true, 0);

            Table serverTable = new Table(2, 4, false);

            serverTable.BorderWidth   = 10;
            serverTable.ColumnSpacing = 10;

            ServerNameLabel        = new Label(Util.GS("Name:"));
            ServerNameLabel.Xalign = 0;
            serverTable.Attach(ServerNameLabel, 0, 1, 0, 1,
                               Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

            ServerNameValue = new Label("");
            ServerNameValue.UseUnderline = false;
            ServerNameValue.Xalign       = 0;
            serverTable.Attach(ServerNameValue, 1, 2, 0, 1);

            ServerDateLabel        = new Label(Util.GS("Date:"));
            ServerDateLabel.Xalign = 0;
            serverTable.Attach(ServerDateLabel, 0, 1, 1, 2,
                               Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

            ServerDateValue        = new Label("");
            ServerDateValue.Xalign = 0;
            serverTable.Attach(ServerDateValue, 1, 2, 1, 2);

            ServerSizeLabel        = new Label(Util.GS("Size:"));
            ServerSizeLabel.Xalign = 0;
            serverTable.Attach(ServerSizeLabel, 0, 1, 2, 3,
                               Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

            ServerSizeValue        = new Label("");
            ServerSizeValue.Xalign = 0;
            serverTable.Attach(ServerSizeValue, 1, 2, 2, 3);

            ServerSaveButton = new Button(Stock.Save);
            serverTable.Attach(ServerSaveButton, 0, 1, 3, 4,
                               Gtk.AttachOptions.Shrink, Gtk.AttachOptions.Shrink, 0, 5);
            ServerSaveButton.Clicked += new EventHandler(SaveServerHandler);

            ServerFrame.Add(serverTable);

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


            //
            // Name Conflict Box
            //
            nameConflictBox         = new VBox();
            nameConflictBox.Spacing = 10;

            VBox nameConflictInternalBox = new VBox();

            nameConflictInternalBox.Spacing     = 10;
            nameConflictInternalBox.BorderWidth = 10;

            renameFileFrame = new Frame(Util.GS("Rename"));
            nameConflictBox.PackStart(renameFileFrame, true, true, 0);

            nameConflictSummary        = new Label(Util.GS("Enter a new name and click Rename to resolve the conflict."));
            nameConflictSummary.Xalign = 0;
//			nameConflictSummary.ColumnSpacing = 10;

            nameConflictInternalBox.PackStart(nameConflictSummary, false, false, 0);

            HBox nameConflictHBox = new HBox();

            nameConflictHBox.Spacing = 10;

            nameConflictFileNameLabel = new Label(Util.GS("Name:"));
            nameConflictHBox.PackStart(nameConflictFileNameLabel, false, false, 0);

            nameConflictEntry                  = new Entry();
            nameConflictEntry.CanFocus         = true;
            nameConflictEntry.Changed         += new EventHandler(OnNameEntryChanged);
            nameConflictEntry.ActivatesDefault = true;
            nameConflictHBox.PackStart(nameConflictEntry, true, true, 0);

            nameConflictInternalBox.PackStart(nameConflictHBox, false, false, 0);

            HBox saveButtonBox = new HBox();

            nameEntrySaveButton          = new Button(Util.GS("Rename"));
            nameEntrySaveButton.Clicked += new EventHandler(RenameFileHandler);
            saveButtonBox.PackStart(nameEntrySaveButton, false, false, 0);
            nameConflictInternalBox.PackEnd(saveButtonBox, false, false, 0);

            renameFileFrame.Add(nameConflictInternalBox);

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

            nameConflictBox.Visible = false;

            // Set up the iFolder TreeView
            ConflictTreeStore      = new ListStore(typeof(ConflictHolder));
            ConflictTreeView.Model = ConflictTreeStore;

            // File Name Column
            TreeViewColumn fileNameColumn = new TreeViewColumn();

            fileNameColumn.Title = Util.GS("Name");
            CellRendererText fileNameCR = new CellRendererText();

            fileNameCR.Xpad = 5;
            fileNameColumn.PackStart(fileNameCR, false);
            fileNameColumn.SetCellDataFunc(fileNameCR,
                                           new TreeCellDataFunc(FileNameCellTextDataFunc));
            fileNameColumn.Resizable = true;
            fileNameColumn.MinWidth  = 150;
            ConflictTreeView.AppendColumn(fileNameColumn);

            // Path Column
            TreeViewColumn pathColumn = new TreeViewColumn();

            pathColumn.Title = Util.GS("Folder");
            CellRendererText pathCR = new CellRendererText();

            pathCR.Xpad = 5;
            pathColumn.PackStart(pathCR, false);
            pathColumn.SetCellDataFunc(pathCR,
                                       new TreeCellDataFunc(PathCellTextDataFunc));
            pathColumn.Resizable = true;
            pathColumn.MinWidth  = 300;
            pathColumn.Sizing    = TreeViewColumnSizing.Autosize;
            ConflictTreeView.AppendColumn(pathColumn);

            // Conflict Type Column
            TreeViewColumn conflictTypeColumn = new TreeViewColumn();

            conflictTypeColumn.Title = Util.GS("Conflict Type");
            CellRendererText conflictTypeCR = new CellRendererText();

            conflictTypeCR.Xpad = 5;
            conflictTypeColumn.PackStart(conflictTypeCR, false);
            conflictTypeColumn.SetCellDataFunc(conflictTypeCR,
                                               new TreeCellDataFunc(ConflictTypeCellTextDataFunc));
            conflictTypeColumn.Resizable  = false;
            conflictTypeColumn.FixedWidth = 100;
            ConflictTreeView.AppendColumn(conflictTypeColumn);



            // Set up Pixbuf and Text Rendering for "iFolder Conflicts" column
//			CellRendererPixbuf mcrp = new CellRendererPixbuf();
//			TreeViewColumn memberColumn = new TreeViewColumn();
//			memberColumn.PackStart(mcrp, false);
//			memberColumn.SetCellDataFunc(mcrp, new TreeCellDataFunc(
//						ConflictCellPixbufDataFunc));
//			CellRendererText mcrt = new CellRendererText();
//			memberColumn.PackStart(mcrt, false);
//			memberColumn.SetCellDataFunc(mcrt, new TreeCellDataFunc(
//						ConflictCellTextDataFunc));
//			memberColumn.Title = Util.GS("iFolder Conflicts");
//			memberColumn.Resizable = true;
//			ConflictTreeView.AppendColumn(memberColumn);
            ConflictTreeView.Selection.Mode = SelectionMode.Multiple;

            ConflictTreeView.Selection.Changed += new EventHandler(
                OnConflictSelectionChanged);

//			ConflictPixBuf =
//				new Gdk.Pixbuf(Util.ImagesPath("conflict24.png"));

            this.AddButton(Stock.Close, ResponseType.Ok);
            this.AddButton(Stock.Help, ResponseType.Help);

            RefreshConflictList();
        }
Exemple #42
0
 Gtk.Widget CreateDesignerNotAvailableWidget()
 {
     Gtk.Label label = new Gtk.Label(GettextCatalog.GetString("Designer not available"));
     label.Show();
     return(label);
 }
            public WidgetBuilderOptionPanelWidget(Project project) : base(false, 6)
            {
                this.project = project as DotNetProject;

                Gtk.HBox  box = new Gtk.HBox(false, 3);
                Gtk.Label lbl = new Gtk.Label(GettextCatalog.GetString("Target Gtk# version:"));
                box.PackStart(lbl, false, false, 0);
                comboVersions = ComboBox.NewText();
                ReferenceManager refmgr = new ReferenceManager(project as DotNetProject);

                foreach (string v in refmgr.SupportedGtkVersions)
                {
                    comboVersions.AppendText(v);
                }
                comboVersions.Active = refmgr.SupportedGtkVersions.IndexOf(refmgr.GtkPackageVersion);
                refmgr.Dispose();
                box.PackStart(comboVersions, false, false, 0);
                box.ShowAll();
                PackStart(box, false, false, 0);

                HSeparator sep = new HSeparator();

                sep.Show();
                PackStart(sep, false, false, 0);

                if (!GtkDesignInfo.HasDesignedObjects(project))
                {
                    return;
                }

                GtkDesignInfo designInfo = GtkDesignInfo.FromProject(project);

                checkGettext        = new CheckButton(GettextCatalog.GetString("Enable gettext support"));
                checkGettext.Active = designInfo.GenerateGettext;
                checkGettext.Show();
                PackStart(checkGettext, false, false, 0);

                box = new Gtk.HBox(false, 3);
                box.PackStart(new Label(GettextCatalog.GetString("Gettext class:")), false, false, 0);
                entryGettext           = new Gtk.Entry();
                entryGettext.Text      = designInfo.GettextClass;
                entryGettext.Sensitive = checkGettext.Active;
                box.PackStart(entryGettext, false, false, 0);
                box.ShowAll();
                PackStart(box, false, false, 0);

                box = new Gtk.HBox(false, 3);
                box.PackStart(new Label(GettextCatalog.GetString("Resource loader class:")), false, false, 0);
                entryResourceLoader           = new Gtk.Entry();
                entryResourceLoader.Text      = designInfo.ImageResourceLoaderClass;
                entryResourceLoader.Sensitive = checkGettext.Active;
                box.PackStart(entryResourceLoader, false, false, 0);
                box.ShowAll();
                PackStart(box, false, false, 0);

                checkGettext.Clicked += delegate {
                    box.Sensitive = checkGettext.Active;
                    if (checkGettext.Active)
                    {
                        entryGettext.Text = "Mono.Unix.Catalog";
                    }
                };
            }
Exemple #44
0
        public HigMessageDialog(Gtk.Window parent,
                                Gtk.DialogFlags flags,
                                Gtk.MessageType type,
                                Gtk.ButtonsType buttons,
                                string header,
                                string msg)
            : base()
        {
            HasSeparator = false;
            BorderWidth  = 5;
            Resizable    = false;
            Title        = String.Empty;

            VBox.Spacing      = 12;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

            accel_group = new Gtk.AccelGroup();
            AddAccelGroup(accel_group);

            Gtk.HBox hbox = new Gtk.HBox(false, 12);
            hbox.BorderWidth = 5;
            hbox.Show();
            VBox.PackStart(hbox, false, false, 0);

            Gtk.Image image = null;

            switch (type)
            {
            case Gtk.MessageType.Error:
                image = new Gtk.Image(Gtk.Stock.DialogError, Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Question:
                image = new Gtk.Image(Gtk.Stock.DialogQuestion, Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Info:
                image = new Gtk.Image(Gtk.Stock.DialogInfo, Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Warning:
                image = new Gtk.Image(Gtk.Stock.DialogWarning, Gtk.IconSize.Dialog);
                break;
            }

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

            Gtk.VBox label_vbox = new Gtk.VBox(false, 0);
            label_vbox.Show();
            hbox.PackStart(label_vbox, true, true, 0);

            string title = String.Format("<span weight='bold' size='larger'>{0}" +
                                         "</span>{1}",
                                         header, Environment.NewLine);

            Gtk.Label label;

            label           = new Gtk.Label(title);
            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.LineWrap  = true;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();
            label_vbox.PackStart(label, false, false, 0);

            label           = new Gtk.Label(msg);
            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.LineWrap  = true;
            label.SetAlignment(0.0f, 0.5f);
            label.UseUnderline = false;
            label.Show();
            label_vbox.PackStart(label, false, false, 0);

            switch (buttons)
            {
            case Gtk.ButtonsType.None:
                break;

            case Gtk.ButtonsType.Ok:
                AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;

            case Gtk.ButtonsType.Close:
                AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close, true);
                break;

            case Gtk.ButtonsType.Cancel:
                AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
                break;

            case Gtk.ButtonsType.YesNo:
                AddButton(Gtk.Stock.No, Gtk.ResponseType.No, false);
                AddButton(Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);
                break;

            case Gtk.ButtonsType.OkCancel:
                AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
                AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;
            }

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

            if ((int)(flags & Gtk.DialogFlags.Modal) != 0)
            {
                Modal = true;
            }

            if ((int)(flags & Gtk.DialogFlags.DestroyWithParent) != 0)
            {
                DestroyWithParent = true;
            }
        }
Exemple #45
0
        public QueryWidget(PhotoQuery query, Db db) : base(new HBox())
        {
            box             = Child as HBox;
            box.Spacing     = 6;
            box.BorderWidth = 2;

            this.query     = query;
            query.Changed += HandleChanged;

            label = new Gtk.Label(Strings.FindColonSpace);
            label.Show();
            label.Ypad = 9;
            box.PackStart(label, false, false, 0);

            untagged = new Gtk.Label(Strings.UntaggedPhotos)
            {
                Visible = false
            };
            box.PackStart(untagged, false, false, 0);

            comma1_label = new Gtk.Label(", ")
            {
                Visible = false
            };
            box.PackStart(comma1_label, false, false, 0);

            rated = new Gtk.Label(Strings.RatedPhotos)
            {
                Visible = false
            };
            box.PackStart(rated, false, false, 0);

            comma2_label = new Gtk.Label(", ")
            {
                Visible = false
            };
            box.PackStart(comma2_label, false, false, 0);

            rollfilter = new Gtk.Label(Strings.ImportRoll)
            {
                Visible = false
            };
            box.PackStart(rollfilter, false, false, 0);

            folder_query_widget = new FolderQueryWidget(query)
            {
                Visible = false
            };
            box.PackStart(folder_query_widget, false, false, 0);

            Logic = new LogicWidget(query, db.Tags);
            Logic.Show();
            box.PackStart(Logic, true, true, 0);

            warning_box = new Gtk.HBox();
            warning_box.PackStart(new Gtk.Label(string.Empty));

            var warning_image = new Gtk.Image("gtk-info", Gtk.IconSize.Button);

            warning_image.Show();
            warning_box.PackStart(warning_image, false, false, 0);

            clear_button = new Gtk.Button();
            clear_button.Add(new Gtk.Image("gtk-close", Gtk.IconSize.Button));
            clear_button.Clicked    += HandleClearButtonClicked;
            clear_button.Relief      = Gtk.ReliefStyle.None;
            clear_button.TooltipText = Strings.ClearSearch;
            box.PackEnd(clear_button, false, false, 0);

            refresh_button = new Gtk.Button();
            refresh_button.Add(new Gtk.Image("gtk-refresh", Gtk.IconSize.Button));
            refresh_button.Clicked    += HandleRefreshButtonClicked;
            refresh_button.Relief      = Gtk.ReliefStyle.None;
            refresh_button.TooltipText = Strings.RefreshSearch;
            box.PackEnd(refresh_button, false, false, 0);

            var warning = new Gtk.Label(Strings.NoMatchingPhotosFound);

            warning_box.PackStart(warning, false, false, 0);
            warning_box.ShowAll();
            warning_box.Spacing = 6;
            warning_box.Visible = false;

            box.PackEnd(warning_box, false, false, 0);

            warning_box.Visible = false;
        }
        void CreatePageWidget(SectionPage page)
        {
            List <PanelInstance> boxPanels = new List <PanelInstance> ();
            List <PanelInstance> tabPanels = new List <PanelInstance> ();

            foreach (PanelInstance pi in page.Panels)
            {
                if (pi.Widget == null)
                {
                    pi.Widget = pi.Panel.CreatePanelWidget();
                    //HACK: work around bug 469427 - broken themes match on widget names
                    if (pi.Widget.Name.IndexOf("Panel") > 0)
                    {
                        pi.Widget.Name = pi.Widget.Name.Replace("Panel", "_");
                    }
                }
                else if (pi.Widget.Parent != null)
                {
                    ((Gtk.Container)pi.Widget.Parent).Remove(pi.Widget);
                }

                if (pi.Node.Grouping == PanelGrouping.Tab)
                {
                    tabPanels.Add(pi);
                }
                else
                {
                    boxPanels.Add(pi);
                }
            }

            // Try to fit panels with grouping=box or auto in the main page.
            // If they don't fit. Move auto panels to its own tab page.

            int  mainPageSize;
            bool fits;

            do
            {
                PanelInstance lastAuto = null;
                mainPageSize = 0;
                foreach (PanelInstance pi in boxPanels)
                {
                    if (pi.Node.Grouping == PanelGrouping.Auto)
                    {
                        lastAuto = pi;
                    }
                    mainPageSize += pi.Widget.SizeRequest().Height + 6;
                }
                fits = mainPageSize <= pageFrame.Allocation.Height;
                if (!fits)
                {
                    if (lastAuto != null && boxPanels.Count > 1)
                    {
                        boxPanels.Remove(lastAuto);
                        tabPanels.Insert(0, lastAuto);
                    }
                    else
                    {
                        fits = true;
                    }
                }
            }while (!fits);

            Gtk.VBox box = new VBox(false, 12);
            box.Show();
            for (int n = 0; n < boxPanels.Count; n++)
            {
                if (n != 0)
                {
                    HSeparator sep = new HSeparator();
                    sep.Show();
                    box.PackStart(sep, false, false, 0);
                }
                PanelInstance pi = boxPanels [n];
                box.PackStart(pi.Widget, pi.Node.Fill, pi.Node.Fill, 0);
                pi.Widget.Show();
            }

            if (tabPanels.Count > 0)
            {
                Gtk.Notebook nb = new Notebook();
                nb.Show();
                Gtk.Label blab = new Gtk.Label(GettextCatalog.GetString("General"));
                blab.Show();
                box.BorderWidth = 9;
                nb.InsertPage(box, blab, -1);
                foreach (PanelInstance pi in tabPanels)
                {
                    Gtk.Label lab = new Gtk.Label(GettextCatalog.GetString(pi.Node.Label));
                    lab.Show();
                    Gtk.Alignment a = new Alignment(0, 0, 1, 1);
                    a.BorderWidth = 9;
                    a.Show();
                    a.Add(pi.Widget);
                    nb.InsertPage(a, lab, -1);
                    pi.Widget.Show();
                }
                page.Widget = nb;
            }
            else
            {
                page.Widget = box;
            }
        }
Exemple #47
0
 public static void PrintLabelWithTooltip(Gtk.Label l, string s)
 {
     l.Text        = s;
     l.UseMarkup   = true;
     l.TooltipText = Util.RemoveMarkup(s);
 }
        private void BuildInterface()
        {
            Gui.Initialize(this);
            Name = "CategoryTab";


            _nameFixed = new Fixed
            {
                Name      = "nameFixed",
                HasWindow = false
            };

            _nameLabel = new Label
            {
                Name = "nameLabel",
                Text = "Name"
            };

            _nameEntry = new Entry
            {
                Name = "nameEntry"
            };

            _descFixed = new Fixed
            {
                Name      = "descFixed",
                HasWindow = false
            };

            _descLabel = new Label
            {
                Name = "descLabel",
                Text = "Description"
            };

            _descWindow = new ScrolledWindow
            {
                Name             = "descWindow",
                ShadowType       = ShadowType.None,
                HscrollbarPolicy = PolicyType.Never,
                VscrollbarPolicy = PolicyType.Automatic
            };

            _descView = new TextView
            {
                Name          = "descView",
                BorderWidth   = 2,
                WrapMode      = WrapMode.WordChar,
                HscrollPolicy = ScrollablePolicy.Natural
            };

            _buttonsHBox = new HBox
            {
                Name      = "buttonsFixed",
                HasWindow = false
            };

            _addButton = new Button
            {
                Name  = "addButton",
                Label = "Create"
            };

            _cancelButton = new Button
            {
                Name  = "cancelButton",
                Label = "Cancel"
            };


            _descWindow.HScrollbar.Visible = false;
            _descWindow.VScrollbar.Visible = true;


            _addButton.WidthRequest    = 100;
            _cancelButton.WidthRequest = 100;

            Add(_nameFixed);

            var nameFixedChild = (BoxChild)this[_nameFixed];

            nameFixedChild.Expand  = false;
            nameFixedChild.Padding = 5;

            _nameFixed.Add(_nameLabel);
            var nameLabelChild = (Fixed.FixedChild)_nameFixed[_nameLabel];

            nameLabelChild.X = 5;
            nameLabelChild.Y = 5;

            Add(_nameEntry);

            var nameEntryChild = (BoxChild)this[_nameEntry];

            nameEntryChild.Expand = false;

            Add(_descFixed);
            var descFixedChild = (BoxChild)this[_descFixed];

            descFixedChild.Expand  = false;
            descFixedChild.Padding = 5;

            _descFixed.Add(_descLabel);

            var descLabelChild = (Fixed.FixedChild)_descFixed[_descLabel];

            descLabelChild.X = 5;
            descLabelChild.Y = 5;

            Add(_descWindow);

            var descViewChild = (BoxChild)this[_descWindow];

            descViewChild.Expand = false;

            _descWindow.AddWithViewport(_descView);

            Add(_buttonsHBox);

            var buttonsChild = (BoxChild)this[_buttonsHBox];

            buttonsChild.Expand  = false;
            buttonsChild.Padding = 5;

            _buttonsHBox.Add(_addButton);

            var addChild = (BoxChild)_buttonsHBox[_addButton];

            addChild.Expand  = false;
            addChild.Padding = 5;

            _buttonsHBox.Add(_cancelButton);
            var cancelChild = (BoxChild)_buttonsHBox[_cancelButton];

            cancelChild.Expand  = false;
            cancelChild.Padding = 5;

            Margin = 10;

            ShowAll();

            DeleteEvent           += OnDeleteEvent;
            _addButton.Clicked    += AddButton_Clicked;
            _cancelButton.Clicked += CancelButton_Clicked;
        }
Exemple #49
0
        public Widget CreateBuildResultsWidget(Orientation orientation)
        {
            EventBox ebox = new EventBox();

            Gtk.Box box;
            if (orientation == Orientation.Horizontal)
            {
                box = new HBox();
            }
            else
            {
                box = new VBox();
            }
            box.Spacing = 3;

            Gdk.Pixbuf errorIcon     = ImageService.GetPixbuf(StockIcons.Error, IconSize.Menu);
            Gdk.Pixbuf noErrorIcon   = ImageService.MakeGrayscale(errorIcon);            // creates a new pixbuf instance
            Gdk.Pixbuf warningIcon   = ImageService.GetPixbuf(StockIcons.Warning, IconSize.Menu);
            Gdk.Pixbuf noWarningIcon = ImageService.MakeGrayscale(warningIcon);          // creates a new pixbuf instance

            Gtk.Image errorImage   = new Gtk.Image(errorIcon);
            Gtk.Image warningImage = new Gtk.Image(warningIcon);

            box.PackStart(errorImage, false, false, 0);
            Label errors = new Gtk.Label();

            box.PackStart(errors, false, false, 0);

            box.PackStart(warningImage, false, false, 0);
            Label warnings = new Gtk.Label();

            box.PackStart(warnings, false, false, 0);
            box.NoShowAll = true;
            box.Show();

            TaskEventHandler updateHandler = delegate {
                int ec = 0, wc = 0;
                foreach (Task t in TaskService.Errors)
                {
                    if (t.Severity == TaskSeverity.Error)
                    {
                        ec++;
                    }
                    else if (t.Severity == TaskSeverity.Warning)
                    {
                        wc++;
                    }
                }
                errors.Visible     = ec > 0;
                errors.Text        = ec.ToString();
                errorImage.Visible = ec > 0;

                warnings.Visible     = wc > 0;
                warnings.Text        = wc.ToString();
                warningImage.Visible = wc > 0;
                ebox.Visible         = ec > 0 || wc > 0;
                UpdateSeparators();
            };

            updateHandler(null, null);

            TaskService.Errors.TasksAdded   += updateHandler;
            TaskService.Errors.TasksRemoved += updateHandler;

            box.Destroyed += delegate {
                noErrorIcon.Dispose();
                noWarningIcon.Dispose();
                TaskService.Errors.TasksAdded   -= updateHandler;
                TaskService.Errors.TasksRemoved -= updateHandler;
            };

            ebox.VisibleWindow = false;
            ebox.Add(box);
            ebox.ShowAll();
            ebox.ButtonReleaseEvent += delegate {
                var pad = IdeApp.Workbench.GetPad <MonoDevelop.Ide.Gui.Pads.ErrorListPad> ();
                pad.BringToFront();
            };

            errors.Visible       = false;
            errorImage.Visible   = false;
            warnings.Visible     = false;
            warningImage.Visible = false;

            return(ebox);
        }
Exemple #50
0
            public void draw(Gdk.Drawable da, string datasubtype, bool autoscale = false, double tMin = 0, bool manualscaleMin = false, double manualMin = -999999, bool manualscaleMax = false, double manualMax = 99999999)
            {
                try {
                    if (data == null)
                    {
                        return;
                    }

                    if (time.Count < 5)
                    {
                        return;
                    }

                    int width, height;
                    da.GetSize(out width, out height);

                    double maxY, minY;
                    minY = 99999; maxY = -99999;


                    int startIdx = 0;
                    for (int sIdx = 0; sIdx < this.time.Count; sIdx++)
                    {
                        if (this.time[sIdx] <= tMin)
                        {
                            startIdx = sIdx;
                        }
                    }

                    int skip = (int)Math.Max(1, Math.Floor((double)((this.time.Count - startIdx) / 1000)));


                    if (this.probe.measlistAct == null)
                    {
                        this.probe.measlistAct = new bool[this.probe.ChannelMap.Length];
                        for (int i = 0; i < this.probe.ChannelMap.Length; i++)
                        {
                            this.probe.measlistAct[i] = false;
                        }
                        this.probe.measlistAct[0] = true;
                    }



                    for (int i = 0; i < this.probe.ChannelMap.Length; i++)
                    {
                        for (int j = startIdx; j < this.data[i].Count; j++)
                        {
                            if (this.probe.ChannelMap[i].datasubtype.ToLower().Equals(datasubtype.ToLower()))
                            {
                                if (this.probe.measlistAct[i])
                                {
                                    double d = this.data[i][j]; // Only shown data will define the scale
                                    if (maxY < d)
                                    {
                                        maxY = d;
                                    }
                                    if (minY > d)
                                    {
                                        minY = d;
                                    }
                                }
                                else if (!autoscale)   // This will include all the data in defining the scale
                                {
                                    double d = this.data[i][j];
                                    if (maxY < d)
                                    {
                                        maxY = d;
                                    }
                                    if (minY > d)
                                    {
                                        minY = d;
                                    }
                                }
                            }
                        }
                    }

                    if (manualscaleMax)
                    {
                        maxY = manualMax;
                    }
                    if (manualscaleMin)
                    {
                        minY = manualMin;
                    }
                    double rangeY  = maxY - minY;
                    double rangeX  = this.time[this.time.Count - 1] - this.time[startIdx];
                    int    xoffset = 50;
                    int    yoffset = 1;

                    height = height - 31;
                    width  = width - 51;

                    Gdk.GC gc = new Gdk.GC(da);

                    gc.RgbBgColor = new Gdk.Color(0, 0, 0);
                    gc.RgbFgColor = new Gdk.Color(0, 0, 0);
                    Rectangle rarea = new Rectangle();
                    rarea.X      = xoffset - 1;
                    rarea.Y      = yoffset - 1;
                    rarea.Height = height + 2;
                    rarea.Width  = width + 2;
                    da.DrawRectangle(gc, true, rarea);

                    gc.RgbBgColor = new Color(0, 0, 0);
                    gc.RgbFgColor = new Color(255, 255, 255);
                    rarea         = new Rectangle();
                    rarea.X       = xoffset;
                    rarea.Y       = yoffset;
                    rarea.Height  = height;
                    rarea.Width   = width;
                    da.DrawRectangle(gc, true, rarea);


                    gc.SetLineAttributes(2, LineStyle.Solid, CapStyle.Projecting, JoinStyle.Round);

                    // Draw stim events

                    for (int j = 0; j < stimulus.Count; j++)
                    {
                        gc.RgbFgColor = stimcolor[j];
                        Rectangle area = new Rectangle();


                        for (int k = 0; k < stimulus[j].onsets.Count; k++)
                        {
                            if (stimulus[j].amplitude[k] > 0 & stimulus[j].onsets[k] + stimulus[j].duration[k] >= this.time[startIdx])
                            {
                                area.Width = (int)(stimulus[j].duration[k] / rangeX * width);
                                if (area.Width == 0)
                                {
                                    area.Width = 1;
                                }
                                area.Height = height;
                                area.X      = (int)(xoffset + Math.Max((stimulus[j].onsets[k] - this.time[startIdx]), 0) / rangeX * width);
                                area.Y      = yoffset;
                                da.DrawRectangle(gc, true, area);
                            }
                            //da.DrawLine(gc,(int)x+xoffset,yoffset,(int)x+xoffset,(int)height+yoffset);
                        }
                    }



                    gc.SetLineAttributes(1, LineStyle.Solid, CapStyle.Projecting, JoinStyle.Round);
                    for (int i = 0; i < this.probe.ChannelMap.Length; i++)
                    {
                        if (this.probe.measlistAct[i] & this.probe.ChannelMap[i].datasubtype.Equals(datasubtype))
                        {
                            gc.RgbFgColor = this.probe.colormap[i];
                            for (int j = 0; j < this.probe.ChannelMap.Length; j++)
                            {
                                if (this.probe.ChannelMap[i].sourceindex == this.probe.ChannelMap[j].sourceindex &
                                    this.probe.ChannelMap[i].detectorindex == this.probe.ChannelMap[j].detectorindex &
                                    this.probe.ChannelMap[j].datasubtype.Equals(this.probe.ChannelMap[0].datasubtype))
                                {
                                    gc.RgbFgColor = this.probe.colormap[j];
                                    break;
                                }
                            }

                            for (int j = startIdx + skip; j < Math.Min(this.data[i].Count, this.time.Count); j = j + skip)
                            {
                                double y2 = (this.data[i][j] - minY) / rangeY * height;
                                double y1 = (this.data[i][j - skip] - minY) / rangeY * height;

                                double x2 = (this.time[j] - this.time[startIdx]) / rangeX * width;
                                double x1 = (this.time[j - skip] - this.time[startIdx]) / rangeX * width;

                                da.DrawLine(gc, (int)x1 + xoffset, (int)(height - y1 + yoffset), (int)x2 + xoffset, (int)(height - y2 + yoffset));
                            }
                        }
                    }


                    if (stimulus.Count > 0)
                    {
                        // add legend to window
                        int w = 0;
                        int h = 0;

                        int maxw = 0;

                        for (int j = 0; j < stimulus.Count; j++)
                        {
                            Gtk.Label lab = new Gtk.Label();
                            gc.RgbFgColor = stimcolor[j];
                            lab.Text      = stimulus[j].name;
                            da.DrawLayout(gc, xoffset + 10, yoffset + j * 10 + 10, lab.Layout);
                            lab.Layout.GetPixelSize(out w, out h);
                            if (w > maxw)
                            {
                                maxw = w;
                            }
                        }
                        gc.RgbBgColor = new Gdk.Color(0, 0, 0);
                        gc.RgbFgColor = new Gdk.Color(0, 0, 0);
                        rarea         = new Rectangle();
                        rarea.X       = xoffset + 4;
                        rarea.Y       = yoffset + 4;
                        rarea.Height  = stimulus.Count * 10 + 12;
                        rarea.Width   = maxw + 12;
                        da.DrawRectangle(gc, true, rarea);

                        gc.RgbBgColor = new Gdk.Color(0, 0, 0);
                        gc.RgbFgColor = new Gdk.Color(255, 255, 255);
                        rarea         = new Rectangle();
                        rarea.X       = xoffset + 5;
                        rarea.Y       = yoffset + 5;
                        rarea.Height  = stimulus.Count * 10 + 10;
                        rarea.Width   = maxw + 10;
                        da.DrawRectangle(gc, true, rarea);
                        for (int j = 0; j < stimulus.Count; j++)
                        {
                            Gtk.Label lab = new Gtk.Label();
                            gc.RgbFgColor = stimcolor[j];
                            lab.Text      = stimulus[j].name;
                            da.DrawLayout(gc, xoffset + 10, yoffset + j * 10 + 10, lab.Layout);
                        }
                    }

                    gc.RgbFgColor = new Gdk.Color(0, 0, 0);
                    int numxlabels = 10;
                    int numylabels = 5;

                    // Add Xtick marks to the graph
                    double tstart, tend, dt;
                    tstart = this.time[startIdx];
                    tend   = this.time[this.time.Count - 1];
                    dt     = Math.Round((tend - tstart) / (1 + numxlabels));

                    if (dt < 1)
                    {
                        dt = 1;
                    }

                    for (double i = 0; i < rangeX; i += dt)
                    {
                        double    x   = i / rangeX * width;
                        Gtk.Label lab = new Gtk.Label();
                        lab.Text = String.Format("{0}", Math.Round((tstart + i) * 10) / 10);
                        da.DrawLayout(gc, (int)x + xoffset, (int)height + 2, lab.Layout);
                    }

                    double dy;
                    dy = rangeY / (1 + numylabels);

                    if (dy == 0.0)
                    {
                        dy = 1;
                    }

                    for (double i = 0; i < rangeY; i += dy)
                    {
                        double    y   = height - i / rangeY * height;
                        Gtk.Label lab = new Gtk.Label();
                        lab.Text = String.Format("{0}", Math.Round((i + minY) * 10) / 10);
                        da.DrawLayout(gc, 10, (int)y + yoffset, lab.Layout);
                    }
                }
                catch
                {
                }
            }
        internal MonoDevelopStatusBar()
        {
            BorderWidth   = 0;
            Spacing       = 0;
            HasResizeGrip = true;

            Accessible.Role = Atk.Role.Filler;

            HeaderBox hb = new HeaderBox(1, 0, 0, 0);

            hb.Accessible.Role = Atk.Role.Filler;
            hb.StyleSet       += (o, args) => {
                hb.BorderColor     = Styles.DockSeparatorColor.ToGdkColor();
                hb.BackgroundColor = Styles.DockBarBackground.ToGdkColor();
            };
            var mainBox = new HBox();

            mainBox.Accessible.Role = Atk.Role.Filler;
            var alignment = new Alignment(0f, 0f, 0f, 0f);

            alignment.Accessible.Role = Atk.Role.Filler;
            mainBox.PackStart(alignment, true, true, 0);
            hb.Add(mainBox);
            hb.ShowAll();
            PackStart(hb, true, true, 0);

            // Feedback button

            if (FeedbackService.Enabled)
            {
                CustomFrame fr = new CustomFrame(0, 0, 1, 0);
                fr.Accessible.Role = Atk.Role.Filler;
                var  px = Xwt.Drawing.Image.FromResource("feedback-16.png");
                HBox b  = new HBox(false, 3);
                b.Accessible.Role = Atk.Role.Filler;

                var im = new Xwt.ImageView(px).ToGtkWidget();
                im.Accessible.Role = Atk.Role.Filler;
                b.PackStart(im);
                var label = new Gtk.Label(GettextCatalog.GetString("Feedback"));
                label.Accessible.Role = Atk.Role.Filler;
                b.PackStart(label);
                Gtk.Alignment al = new Gtk.Alignment(0f, 0f, 1f, 1f);
                al.Accessible.Role = Atk.Role.Filler;
                al.RightPadding    = 5;
                al.LeftPadding     = 3;
                al.Add(b);
                feedbackButton = new MiniButton(al);
                feedbackButton.Accessible.SetLabel(GettextCatalog.GetString("Feedback"));
                feedbackButton.Accessible.Description = GettextCatalog.GetString("Click to send feedback to the development team");

                //feedbackButton.BackroundColor = new Gdk.Color (200, 200, 255);
                fr.Add(feedbackButton);
                mainBox.PackStart(fr, false, false, 0);
                feedbackButton.Clicked          += HandleFeedbackButtonClicked;
                feedbackButton.ButtonPressEvent += HandleFeedbackButtonButtonPressEvent;
                ;
                feedbackButton.ClickOnRelease          = true;
                FeedbackService.FeedbackPositionGetter = delegate {
                    int x, y;
                    if (feedbackButton.GdkWindow != null)
                    {
                        feedbackButton.GdkWindow.GetOrigin(out x, out y);
                        x += feedbackButton.Allocation.Width;
                        y -= 6;
                    }
                    else
                    {
                        x = y = -1;
                    }
                    return(new Gdk.Point(x, y));
                };
            }

            // Dock area

            CustomFrame dfr = new CustomFrame(0, 0, 1, 0);

            dfr.Accessible.Role = Atk.Role.Filler;
            dfr.StyleSet       += (o, args) => {
                dfr.BorderColor = Styles.DockSeparatorColor.ToGdkColor();
            };
            dfr.ShowAll();
            DefaultWorkbench wb = (DefaultWorkbench)IdeApp.Workbench.RootWindow;
            var dockBar         = wb.DockFrame.ExtractDockBar(PositionType.Bottom);

            dockBar.AlignToEnd = true;
            dockBar.ShowBorder = false;
            dockBar.NoShowAll  = true;
            dfr.Add(dockBar);
            mainBox.PackStart(dfr, false, false, 0);

            // Resize grip

            resizeGrip.Accessible.SetRole(AtkCocoa.Roles.AXGrowArea);
            resizeGrip.WidthRequest  = ResizeGripWidth;
            resizeGrip.HeightRequest = 0;
            resizeGrip.VisibleWindow = false;
            mainBox.PackStart(resizeGrip, false, false, 0);

            resizeGrip.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) {
                if (args.Event.Button == 1)
                {
                    GdkWindow.BeginResizeDrag(Gdk.WindowEdge.SouthEast, (int)args.Event.Button, (int)args.Event.XRoot, (int)args.Event.YRoot, args.Event.Time);
                }
            };

            this.ShowAll();

//			// todo: Move this to the CompletionWindowManager when it's possible.
//			StatusBarContext completionStatus = null;
//			CompletionWindowManager.WindowShown += delegate {
//				CompletionListWindow wnd = CompletionWindowManager.Wnd;
//				if (wnd != null && wnd.List != null && wnd.List.CategoryCount > 1) {
//					if (completionStatus == null)
//						completionStatus = CreateContext ();
//					completionStatus.ShowMessage (string.Format (GettextCatalog.GetString ("To toggle categorized completion mode press {0}."), IdeApp.CommandService.GetCommandInfo (Commands.TextEditorCommands.ShowCompletionWindow).AccelKey));
//				}
//			};
        }
Exemple #52
0
 public static void ColorsTestLabel(Gtk.Viewport v, Gtk.Label l)
 {
     l.ModifyFg(StateType.Active, v.Style.Foreground(StateType.Selected));
     l.ModifyFg(StateType.Prelight, v.Style.Foreground(StateType.Selected));
 }
Exemple #53
0
        private Gtk.Widget CreateContents()
        {
            Gtk.HBox entryLine = new HBox(false, 4);

            Gtk.Label words = new Gtk.Label(Catalog.GetString("Search terms:"));
            entryLine.PackStart(words, false, false, 3);

            history = new Gtk.ListStore(new Type[] { typeof(string) });

            Gtk.EntryCompletion comp = new Gtk.EntryCompletion();
            comp.Model      = history;
            comp.TextColumn = 0;

            entry            = new Gtk.Entry("");
            entry.Activated += new EventHandler(this.DoSearch);
            entry.Completion = comp;
            entryLine.PackStart(entry, true, true, 3);

            words = new Gtk.Label("");
            entryLine.PackStart(words, false, false, 3);

            Gtk.ComboBox combo = FilterComboBox();
            combo.Changed += new EventHandler(this.ChangeType);
            entryLine.PackStart(combo, false, false, 3);

            Gtk.HBox   buttonContents = new HBox(false, 0);
            Gtk.Widget buttonImg      = Beagle.Images.GetWidget("icon-search.png");
            buttonContents.PackStart(buttonImg, false, false, 1);
            Gtk.Label buttonLabel = new Gtk.Label(Catalog.GetString("Find"));
            buttonContents.PackStart(buttonLabel, false, false, 1);

            Gtk.Button button = new Gtk.Button();
            button.Add(buttonContents);
            button.Clicked += new EventHandler(this.DoSearch);
            entryLine.PackStart(button, false, false, 3);

            Gtk.Button clearButton = new Gtk.Button();
            clearButton.Label    = "Clear";
            clearButton.Clicked += new EventHandler(this.ClearSearch);
            entryLine.PackStart(clearButton, false, false, 4);

            canvas = new TileCanvas();
            canvas.Show();

            HBox pager = new HBox();

            page_label = new Label();
            page_label.Show();
            pager.PackStart(page_label, false, false, 3);

            forward_button = StockButton("gtk-go-forward",
                                         Catalog.GetString("Show More Results"));
            forward_button.Show();
            forward_button.Clicked += new EventHandler(PageForwardHandler);
            pager.PackEnd(forward_button, false, false, 3);

            back_button = StockButton("gtk-go-back",
                                      Catalog.GetString("Show Previous Results"));
            back_button.Show();

            back_button.Clicked += new EventHandler(PageBackHandler);
            pager.PackEnd(back_button, false, false, 3);

            pager.Show();

            VBox contents = new VBox(false, 3);

            contents.PackStart(entryLine, false, true, 3);
            contents.PackStart(canvas, true, true, 3);
            contents.PackStart(pager, false, false, 3);

            entryLine.ShowAll();
            canvas.ShowAll();

            return(contents);
        }
        public Widget CreateLabel(Orientation orientation)
        {
            Gtk.Box box;
            if (orientation == Orientation.Horizontal)
            {
                box = new HBox();
            }
            else
            {
                box = new VBox();
            }
            box.Spacing = 3;

            Gdk.Pixbuf errorIcon     = ImageService.GetPixbuf(MonoDevelop.Ide.Gui.Stock.Error, IconSize.Menu);
            Gdk.Pixbuf noErrorIcon   = ImageService.MakeGrayscale(errorIcon);   // creates a new pixbuf instance
            Gdk.Pixbuf warningIcon   = ImageService.GetPixbuf(MonoDevelop.Ide.Gui.Stock.Warning, IconSize.Menu);
            Gdk.Pixbuf noWarningIcon = ImageService.MakeGrayscale(warningIcon); // creates a new pixbuf instance

            Gtk.Image errorImage   = new Gtk.Image(errorIcon);
            Gtk.Image warningImage = new Gtk.Image(warningIcon);

            box.PackStart(errorImage, false, false, 0);
            Label errors = new Gtk.Label();

            box.PackStart(errors, false, false, 0);

            box.PackStart(warningImage, false, false, 0);
            Label warnings = new Gtk.Label();

            box.PackStart(warnings, false, false, 0);

            TaskEventHandler updateHandler = delegate
            {
                int ec = 0, wc = 0;
                foreach (Task t in TaskService.Errors)
                {
                    if (t.Severity == TaskSeverity.Error)
                    {
                        ec++;
                    }
                    else if (t.Severity == TaskSeverity.Warning)
                    {
                        wc++;
                    }
                }
                errors.Text         = ec.ToString();
                errorImage.Pixbuf   = ec > 0 ? errorIcon : noErrorIcon;
                warnings.Text       = wc.ToString();
                warningImage.Pixbuf = wc > 0 ? warningIcon : noWarningIcon;
            };

            updateHandler(null, null);

            TaskService.Errors.TasksAdded   += updateHandler;
            TaskService.Errors.TasksRemoved += updateHandler;

            box.Destroyed += delegate
            {
                noErrorIcon.Dispose();
                noWarningIcon.Dispose();
                TaskService.Errors.TasksAdded   -= updateHandler;
                TaskService.Errors.TasksRemoved -= updateHandler;
            };
            return(box);
        }
Exemple #55
0
        private void Initialize()
        {
            DefaultResponse = Gtk.ResponseType.Ok;
            AddStockButton(Stock.Cancel, ResponseType.Cancel);
            AddStockButton(Stock.Ok, ResponseType.Ok, true);

            int minimum_width, natural_width;

            GetPreferredWidth(out minimum_width, out natural_width);
            SetGeometryHints(this, new Gdk.Geometry()
            {
                MinWidth  = minimum_width,
                MaxWidth  = Gdk.Screen.Default.Width,
                MinHeight = -1,
                MaxHeight = -1
            }, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);

            var table = new Table(2, 2, false)
            {
                RowSpacing    = 12,
                ColumnSpacing = 6
            };

            table.Attach(new Label()
            {
                Text         = Catalog.GetString("Station _Type:"),
                UseUnderline = true,
                Xalign       = 0.0f
            }, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table.Attach(arg_label = new Label()
            {
                Xalign = 0.0f
            }, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table.Attach(type_combo = new ComboBoxText(),
                         1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);

            table.Attach(arg_entry = new Entry(),
                         1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);

            VBox.PackStart(table, true, true, 0);
            VBox.Spacing = 12;
            VBox.ShowAll();

            type_combo.Remove(0);
            int active_type = 0;
            int i           = 0;

            foreach (StationType type in StationType.Types)
            {
                if (!type.SubscribersOnly || lastfm.Account.Subscriber)
                {
                    type_combo.AppendText(type.Label);
                    if (source != null && type == source.Type)
                    {
                        active_type = i;
                    }
                    i++;
                }
            }

            type_combo.Changed += HandleTypeChanged;
            type_combo.Active   = active_type;
            type_combo.GrabFocus();
        }
Exemple #56
0
    private void progressbarEventOrTimeExecution(Gtk.ProgressBar progressbar, bool percentageMode, Gtk.Label label_value, double events)
    {
        if (progressbarLimit == -1)             //unlimited event (until 'finish' is clicked)
        {
            progressbar.Pulse();
            //label_value.Text = events.ToString();
            if (events != -1)
            {
                label_value.Text = Math.Round(events, 3).ToString();
            }
        }
        else
        {
            if (percentageMode)
            {
                double myFraction = events / progressbarLimit * 1.0;

                if (myFraction > 1)
                {
                    myFraction = 1;
                }
                else if (myFraction < 0)
                {
                    myFraction = 0;
                }

                progressbar.Fraction = myFraction;
                //progressbar.Text = Util.TrimDecimals(events.ToString(), 1) + " / " + progressbarLimit.ToString();
                if (events == -1)                //we don't want to display nothing
                //progressbar.Text = "";
                {
                    label_value.Text = "";
                }
                else
                {
                    label_value.Text = Math.Round(events, 3).ToString();
                }
            }
            else
            {
                //activity mode
                progressbar.Pulse();

                //pass -1 in events in activity mode if don't want to use this label
                if (events != -1)
                {
                    //label_value.Text = Util.TrimDecimals(events.ToString(), 1);
                    label_value.Text = Math.Round(events, 3).ToString();
                }
            }
        }
    }
Exemple #57
0
        public StatusView(string filepath, Repository vc)
            : base(Path.GetFileName(filepath) + " Status")
        {
            this.vc       = vc;
            this.filepath = filepath;
            changeSet     = vc.CreateChangeSet(filepath);

            main   = new VBox(false, 6);
            widget = main;

            commandbar = new Toolbar();
            commandbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
            commandbar.IconSize     = Gtk.IconSize.Menu;
            main.PackStart(commandbar, false, false, 0);

            buttonCommit             = new Gtk.ToolButton(new Gtk.Image("vc-commit", Gtk.IconSize.Menu), GettextCatalog.GetString("Commit..."));
            buttonCommit.IsImportant = true;
            buttonCommit.Clicked    += new EventHandler(OnCommitClicked);
            commandbar.Insert(buttonCommit, -1);

            Gtk.ToolButton btnRefresh = new Gtk.ToolButton(new Gtk.Image(Gtk.Stock.Refresh, IconSize.Menu), GettextCatalog.GetString("Refresh"));
            btnRefresh.IsImportant = true;
            btnRefresh.Clicked    += new EventHandler(OnRefresh);
            commandbar.Insert(btnRefresh, -1);

            buttonRevert             = new Gtk.ToolButton(new Gtk.Image("vc-revert-command", Gtk.IconSize.Menu), GettextCatalog.GetString("Revert"));
            buttonRevert.IsImportant = true;
            buttonRevert.Clicked    += new EventHandler(OnRevert);
            commandbar.Insert(buttonRevert, -1);

            showRemoteStatus             = new Gtk.ToolButton(new Gtk.Image("vc-remote-status", Gtk.IconSize.Menu), GettextCatalog.GetString("Show Remote Status"));
            showRemoteStatus.IsImportant = true;
            showRemoteStatus.Clicked    += new EventHandler(OnShowRemoteStatusClicked);
            commandbar.Insert(showRemoteStatus, -1);

            Gtk.ToolButton btnCreatePatch = new Gtk.ToolButton(new Gtk.Image("vc-diff", Gtk.IconSize.Menu), GettextCatalog.GetString("Create Patch"));
            btnCreatePatch.IsImportant = true;
            btnCreatePatch.Clicked    += new EventHandler(OnCreatePatch);
            commandbar.Insert(btnCreatePatch, -1);

            commandbar.Insert(new Gtk.SeparatorToolItem(), -1);

            Gtk.ToolButton btnOpen = new Gtk.ToolButton(new Gtk.Image(Gtk.Stock.Open, IconSize.Menu), GettextCatalog.GetString("Open"));
            btnOpen.IsImportant = true;
            btnOpen.Clicked    += new EventHandler(OnOpen);
            commandbar.Insert(btnOpen, -1);

            commandbar.Insert(new Gtk.SeparatorToolItem(), -1);

            Gtk.ToolButton btnExpand = new Gtk.ToolButton(null, GettextCatalog.GetString("Expand All"));
            btnExpand.IsImportant = true;
            btnExpand.Clicked    += new EventHandler(OnExpandAll);
            commandbar.Insert(btnExpand, -1);

            Gtk.ToolButton btnCollapse = new Gtk.ToolButton(null, GettextCatalog.GetString("Collapse All"));
            btnCollapse.IsImportant = true;
            btnCollapse.Clicked    += new EventHandler(OnCollapseAll);
            commandbar.Insert(btnCollapse, -1);

            commandbar.Insert(new Gtk.SeparatorToolItem(), -1);

            Gtk.ToolButton btnSelectAll = new Gtk.ToolButton(null, GettextCatalog.GetString("Select All"));
            btnSelectAll.IsImportant = true;
            btnSelectAll.Clicked    += new EventHandler(OnSelectAll);
            commandbar.Insert(btnSelectAll, -1);

            Gtk.ToolButton btnSelectNone = new Gtk.ToolButton(null, GettextCatalog.GetString("Select None"));
            btnSelectNone.IsImportant = true;
            btnSelectNone.Clicked    += new EventHandler(OnSelectNone);
            commandbar.Insert(btnSelectNone, -1);

            status = new Label("");
            main.PackStart(status, false, false, 0);

            scroller                = new ScrolledWindow();
            scroller.ShadowType     = Gtk.ShadowType.In;
            filelist                = new FileTreeView();
            filelist.Selection.Mode = Gtk.SelectionMode.Multiple;

            scroller.Add(filelist);
            scroller.HscrollbarPolicy   = PolicyType.Automatic;
            scroller.VscrollbarPolicy   = PolicyType.Automatic;
            filelist.RowActivated      += OnRowActivated;
            filelist.DiffLineActivated += OnDiffLineActivated;

            CellRendererToggle cellToggle = new CellRendererToggle();

            cellToggle.Toggled += new ToggledHandler(OnCommitToggledHandler);
            var crc = new CellRendererIcon();

            crc.StockId       = "vc-comment";
            colCommit         = new TreeViewColumn();
            colCommit.Spacing = 2;
            colCommit.Widget  = new Gtk.Image("vc-commit", Gtk.IconSize.Menu);
            colCommit.Widget.Show();
            colCommit.PackStart(cellToggle, false);
            colCommit.PackStart(crc, false);
            colCommit.AddAttribute(cellToggle, "active", ColCommit);
            colCommit.AddAttribute(cellToggle, "visible", ColShowToggle);
            colCommit.AddAttribute(crc, "visible", ColShowComment);

            CellRendererText crt     = new CellRendererText();
            var            crp       = new CellRendererPixbuf();
            TreeViewColumn colStatus = new TreeViewColumn();

            colStatus.Title = GettextCatalog.GetString("Status");
            colStatus.PackStart(crp, false);
            colStatus.PackStart(crt, true);
            colStatus.AddAttribute(crp, "pixbuf", ColIcon);
            colStatus.AddAttribute(crp, "visible", ColShowStatus);
            colStatus.AddAttribute(crt, "text", ColStatus);
            colStatus.AddAttribute(crt, "foreground", ColStatusColor);

            TreeViewColumn colFile = new TreeViewColumn();

            colFile.Title   = GettextCatalog.GetString("File");
            colFile.Spacing = 2;
            crp             = new CellRendererPixbuf();
            diffRenderer    = new CellRendererDiff();
            colFile.PackStart(crp, false);
            colFile.PackStart(diffRenderer, true);
            colFile.AddAttribute(crp, "pixbuf", ColIconFile);
            colFile.AddAttribute(crp, "visible", ColShowStatus);
            colFile.SetCellDataFunc(diffRenderer, new TreeCellDataFunc(SetDiffCellData));

            crt             = new CellRendererText();
            crp             = new CellRendererPixbuf();
            colRemote       = new TreeViewColumn();
            colRemote.Title = GettextCatalog.GetString("Remote Status");
            colRemote.PackStart(crp, false);
            colRemote.PackStart(crt, true);
            colRemote.AddAttribute(crp, "pixbuf", ColRemoteIcon);
            colRemote.AddAttribute(crt, "text", ColRemoteStatus);
            colRemote.AddAttribute(crt, "foreground", ColStatusColor);

            filelist.AppendColumn(colStatus);
            filelist.AppendColumn(colRemote);
            filelist.AppendColumn(colCommit);
            filelist.AppendColumn(colFile);

            colRemote.Visible = false;

            filestore               = new TreeStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string[]), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(Gdk.Pixbuf), typeof(bool), typeof(Gdk.Pixbuf), typeof(string), typeof(bool), typeof(bool));
            filelist.Model          = filestore;
            filelist.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow);

            commitBox = new VBox();

            HBox labBox = new HBox();

            labelCommit        = new Gtk.Label(GettextCatalog.GetString("Commit message:"));
            labelCommit.Xalign = 0;
            labBox.PackStart(new Gtk.Image("vc-comment", Gtk.IconSize.Menu), false, false, 0);
            labBox.PackStart(labelCommit, true, true, 3);

            commitBox.PackStart(labBox, false, false, 0);

            Gtk.ScrolledWindow frame = new Gtk.ScrolledWindow();
            frame.ShadowType           = ShadowType.In;
            commitText                 = new TextView();
            commitText.WrapMode        = WrapMode.WordChar;
            commitText.Buffer.Changed += OnCommitTextChanged;
            frame.Add(commitText);
            commitBox.PackStart(frame, true, true, 6);

            VPaned paned = new VPaned();

            paned.Pack1(scroller, true, true);
            paned.Pack2(commitBox, false, false);
            main.PackStart(paned, true, true, 0);

            main.ShowAll();
            status.Visible = false;

            filelist.Selection.Changed += new EventHandler(OnCursorChanged);
            VersionControlService.FileStatusChanged += OnFileStatusChanged;

            filelist.HeadersClickable = true;
            filestore.SetSortFunc(0, CompareNodes);
            colStatus.SortColumnId = 0;
            filestore.SetSortFunc(1, CompareNodes);
            colRemote.SortColumnId = 1;
            filestore.SetSortFunc(2, CompareNodes);
            colCommit.SortColumnId = 2;
            filestore.SetSortFunc(3, CompareNodes);
            colFile.SortColumnId = 3;

            filestore.SetSortColumnId(3, Gtk.SortType.Ascending);

            filelist.DoPopupMenu = DoPopupMenu;

            StartUpdate();
        }
        private static Gtk.ResponseType showErrDialog(Exception e, bool canContinue)
        {
            Gtk.Table          pnlError;
            Gtk.Image          pctError;
            Gtk.Label          lblError;
            Gtk.ScrolledWindow scrError;
            Gtk.TextView       txtError;
            Gtk.Button         cmdReport;
            Gtk.Button         cmdIgnore;
            Gtk.Button         cmdExit;

            pnlError               = new Gtk.Table(2, 2, false);
            pnlError.Name          = "pnlError";
            pnlError.RowSpacing    = 6;
            pnlError.ColumnSpacing = 6;

            pctError      = new Gtk.Image();
            pctError.Name = "pctError";
            pctError.Xpad = 8;
            pctError.Ypad = 8;
            if (CurrentOS.IsMac)
            {
                pctError.Pixbuf = Gdk.Pixbuf.LoadFromResource("RestrictionTrackerGTK.Resources.config.os_x.advanced_nettest_error.png");
            }
            else
            {
                pctError.Pixbuf = Gdk.Pixbuf.LoadFromResource("RestrictionTrackerGTK.Resources.config.linux.advanced_nettest_error.png");
            }
            pnlError.Attach(pctError, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            lblError        = new Gtk.Label();
            lblError.Name   = "lblError";
            lblError.Xalign = 0F;
            lblError.Yalign = 0.5F;
            if (e.TargetSite == null)
            {
                lblError.LabelProp = "<span size=\"12000\" weight=\"bold\">" + modFunctions.ProductName + " has Encountered an Error</span>";
            }
            else
            {
                lblError.LabelProp = "<span size=\"12000\" weight=\"bold\">" + modFunctions.ProductName + " has Encountered an Error in " + e.TargetSite.Name + "</span>";
            }
            var signal = GLib.Signal.Lookup(lblError, "size-allocate", typeof(SizeAllocatedArgs));

            signal.AddDelegate(new EventHandler <SizeAllocatedArgs>(SizeAllocateLabel));
            lblError.LineWrap  = true;
            lblError.UseMarkup = true;
            pnlError.Attach(lblError, 1, 2, 0, 1, AttachOptions.Shrink | AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0);

            scrError                  = new Gtk.ScrolledWindow();
            scrError.Name             = "scrError";
            scrError.VscrollbarPolicy = PolicyType.Automatic;
            scrError.HscrollbarPolicy = PolicyType.Never;
            scrError.ShadowType       = ShadowType.In;

            txtError            = new Gtk.TextView();
            txtError.CanFocus   = true;
            txtError.Name       = "txtError";
            txtError.Editable   = false;
            txtError.AcceptsTab = false;
            txtError.WrapMode   = WrapMode.Word;

            scrError.Add(txtError);
            pnlError.Attach(scrError, 1, 2, 1, 2, AttachOptions.Shrink | AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink | AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            txtError.Buffer.Text = "Error: " + e.Message;
            if (!string.IsNullOrEmpty(e.StackTrace))
            {
                if (e.StackTrace.Contains("\n"))
                {
                    txtError.Buffer.Text += "\n" + e.StackTrace.Substring(0, e.StackTrace.IndexOf("\n"));
                }
                else
                {
                    txtError.Buffer.Text += "\n" + e.StackTrace;
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(e.Source))
                {
                    txtError.Buffer.Text += "\n @ " + e.Source;
                    if (e.TargetSite != null)
                    {
                        txtError.Buffer.Text += "." + e.TargetSite.Name;
                    }
                }
                else
                {
                    if (e.TargetSite != null)
                    {
                        txtError.Buffer.Text += "\n @ " + e.TargetSite.Name;
                    }
                }
            }

            cmdReport              = new Gtk.Button();
            cmdReport.CanDefault   = true;
            cmdReport.CanFocus     = true;
            cmdReport.Name         = "cmdReport";
            cmdReport.UseUnderline = false;
            cmdReport.Label        = "Report Error";

            if (canContinue)
            {
                cmdIgnore              = new Gtk.Button();
                cmdIgnore.CanDefault   = true;
                cmdIgnore.CanFocus     = true;
                cmdIgnore.Name         = "cmdIgnore";
                cmdIgnore.UseUnderline = false;
                cmdIgnore.Label        = "Ignore and Continue";
            }
            else
            {
                cmdIgnore = null;
            }

            cmdExit              = new global::Gtk.Button();
            cmdExit.CanFocus     = true;
            cmdExit.Name         = "cmdExit";
            cmdExit.UseUnderline = true;
            cmdExit.Label        = global::Mono.Unix.Catalog.GetString("Exit Application");

            Gtk.Dialog dlgErr = new Gtk.Dialog("Error in " + modFunctions.ProductName, null, DialogFlags.Modal | DialogFlags.DestroyWithParent, cmdReport);

            dlgErr.TypeHint        = Gdk.WindowTypeHint.Dialog;
            dlgErr.WindowPosition  = WindowPosition.CenterAlways;
            dlgErr.SkipPagerHint   = true;
            dlgErr.SkipTaskbarHint = true;
            dlgErr.AllowShrink     = true;
            dlgErr.AllowGrow       = true;

            VBox pnlErrorDialog = dlgErr.VBox;

            pnlErrorDialog.Name        = "pnlErrorDialog";
            pnlErrorDialog.BorderWidth = 2;
            pnlErrorDialog.Add(pnlError);

            Box.BoxChild pnlError_BC = (Box.BoxChild)pnlErrorDialog[pnlError];
            pnlError_BC.Position = 0;

            Gtk.HButtonBox dlgErrorAction = dlgErr.ActionArea;
            dlgErrorAction.Name        = "dlgErrorAction";
            dlgErrorAction.Spacing     = 10;
            dlgErrorAction.BorderWidth = 5;
            dlgErrorAction.LayoutStyle = ButtonBoxStyle.End;

            dlgErr.AddActionWidget(cmdReport, ResponseType.Ok);
            if (canContinue)
            {
                dlgErr.AddActionWidget(cmdIgnore, ResponseType.No);
            }
            dlgErr.AddActionWidget(cmdExit, ResponseType.Reject);

            dlgErr.ShowAll();
            Gdk.Geometry minGeo = new Gdk.Geometry();
            minGeo.MinWidth  = dlgErr.Allocation.Width;
            minGeo.MinHeight = dlgErr.Allocation.Height;
            if (minGeo.MinWidth > 1 & minGeo.MinHeight > 1)
            {
                dlgErr.SetGeometryHints(null, minGeo, Gdk.WindowHints.MinSize);
            }

            Gtk.ResponseType dRet;
            do
            {
                dRet = (Gtk.ResponseType)dlgErr.Run();
            } while (dRet == ResponseType.None);
            dlgErr.Hide();
            dlgErr.Destroy();
            dlgErr = null;
            return(dRet);
        }
Exemple #59
0
        public void initComponents()
        {
            ActionPanelLocation       = new Alignment(0, 1, 0, 0);
            MainWindow                = new Window("Game");
            mainPanel                 = new Layout(null, null);
            defaultFontBold           = Pango.FontDescription.FromString("Microsoft Sans Serif 10");
            defaultFontBold.Weight    = Pango.Weight.Bold;
            defaultFontRegular        = Pango.FontDescription.FromString("Microsoft Sans Serif 10");
            defaultFontRegular.Weight = Pango.Weight.Normal;
            labelLibido               = new Label();
            labelSpeed                = new Label();
            this.labelToughness       = new Label();
            this.labelStrenght        = new Label();
            this.label6               = new Label();
            this.label5               = new Label();
            this.label4               = new Label();
            this.label3               = new Label();
            this.label2               = new Label();
            this.label1               = new Label();
            this.btnOptions           = new Button();

            this.btnNewGame = new Button();

            this.btnLoad = new Button();

            this.btnSave = new Button();

            this.buttonCmd5 = new Button();

            this.buttonCmd4 = new Button();
            this.buttonCmd1 = new Button();

            this.buttonCmd2 = new Button();

            this.buttonCmd3 = new Button();

            this.button8 = new Button();

            this.button9 = new Button();

            this.button7 = new Button();

            this.button6 = new Button();

            this.button5 = new Button();

            this.button10 = new Button();

            this.button4 = new Button();

            this.button3 = new Button();

            this.button2 = new Button();

            this.button1 = new Button();

            this.label11              = new Label();
            this.label10              = new Label();
            this.label9               = new Label();
            this.label8               = new Label();
            this.label7               = new Label();
            this.labelHP              = new Label();
            this.labelLust            = new Label();
            this.progressBarHP        = new ProgressBar();
            this.progressBarLust      = new ProgressBar();
            this.labelLevel           = new Label();
            this.labelDay             = new Label();
            this.labelHour            = new Label();
            this.labelCoins           = new Label();
            this.labelExp             = new Label();
            this.progressBarExp       = new ProgressBar();
            this.MainStoryTextPanel   = new Layout(null, null);
            this.richTextBoxMain      = new TextView();
            this.ActionbuttonHolder   = new Layout(null, null);
            this.button12             = new Button();
            this.button14             = new Button();
            this.button11             = new Button();
            this.button13             = new Button();
            this.button15             = new Button();
            this.panel3               = new Layout(null, null);
            this.richTextBoxSub       = new TextView();
            this.PlayerStatsPanel     = new Layout(null, null);
            this.AdditionalStatsPanel = new Layout(null, null);
            this.MainActionsPanel     = new Table(2, 2, true);

            //
            // labelLibido
            //
            ////this.labelLibido.AutoSize = true;
            this.labelLibido.ModifyFont(defaultFontBold);
            // //this.labelLibido.Location = new System.Drawing.Point(93, 69);
            this.labelLibido.Name = "labelLibido";
            this.labelLibido.SetSizeRequest(16, 16);
            // //this.labelLibido.TabIndex = 9;
            this.labelLibido.Text = "0";
            //
            // labelSpeed
            //
            // //this.labelSpeed.AutoSize = true;
            this.labelSpeed.ModifyFont(defaultFontBold);
            // //this.labelSpeed.Location = new System.Drawing.Point(93, 47);
            this.labelSpeed.Name = "labelSpeed";
            this.labelSpeed.SetSizeRequest(16, 16);
            ////this.labelSpeed.TabIndex = 8;
            this.labelSpeed.Text = "0";
            //
            // labelToughness
            //
            // //this.labelToughness.AutoSize = true;
            this.labelToughness.ModifyFont(defaultFontBold);
            // //this.labelToughness.Location = new System.Drawing.Point(93, 27);
            this.labelToughness.Name = "labelToughness";
            this.labelToughness.SetSizeRequest(16, 16);
            // //this.labelToughness.TabIndex = 7;
            this.labelToughness.Text = "0";
            // this.labelToughness.Click += new System.EventHandler(this.label14_Click);
            //
            // labelStrenght
            //
            ////this.labelStrenght.AutoSize = true;
            this.labelStrenght.ModifyFont(defaultFontBold);
            ////this.labelStrenght.Location = new System.Drawing.Point(93, 7);
            this.labelStrenght.Name = "labelStrenght";
            this.labelStrenght.SetSizeRequest(16, 16);
            ////this.labelStrenght.TabIndex = 6;
            this.labelStrenght.Text = "0";
            //
            // label6
            //
            // //this.label6.AutoSize = true;
            this.label6.ModifyFont(defaultFontBold);
            // //this.label6.Location = new System.Drawing.Point(200, 47);
            this.label6.Name = "label6";
            this.label6.SetSizeRequest(36, 16);
            // //this.label6.TabIndex = 5;
            this.label6.Text = "Lust";
            //
            // label5
            //
            // //this.label5.AutoSize = true;
            this.label5.ModifyFont(defaultFontBold);
            // //this.label5.Location = new System.Drawing.Point(200, 7);
            this.label5.Name = "label5";
            this.label5.SetSizeRequest(29, 16);
            // //this.label5.TabIndex = 4;
            this.label5.Text = "HP";
            //
            // label4
            //
            ////this.label4.AutoSize = true;
            this.label4.ModifyFont(defaultFontBold);
            ////this.label4.Location = new System.Drawing.Point(8, 69);
            this.label4.Name = "label4";
            this.label4.SetSizeRequest(51, 16);
            // //this.label4.TabIndex = 3;
            this.label4.Text = "Libido";
            //
            // label3
            //
            // //this.label3.AutoSize = true;
            this.label3.ModifyFont(defaultFontBold);
            // //this.label3.Location = new System.Drawing.Point(8, 47);
            this.label3.Name = "label3";
            this.label3.SetSizeRequest(54, 16);
            // //this.label3.TabIndex = 2;
            this.label3.Text = "Speed";
            //
            // label2
            //
            ////this.label2.AutoSize = true;
            this.label2.ModifyFont(defaultFontBold);
            // //this.label2.Location = new System.Drawing.Point(8, 27);
            this.label2.Name = "label2";
            this.label2.SetSizeRequest(85, 16);
            //  //this.label2.TabIndex = 1;
            this.label2.Text = "Toughness";
            //
            // label1
            //
            ////this.label1.AutoSize = true;
            this.label1.ModifyFont(defaultFontBold);
            ////this.label1.Location = new System.Drawing.Point(8, 7);
            this.label1.Name = "label1";
            this.label1.SetSizeRequest(65, 16);
            // //this.label1.TabIndex = 0;
            this.label1.Text = "Strenght";
            //
            // btnOptions
            //
            ////this.btnOptions.BackColor = System.Drawing.Color.PeachPuff;
            ////this.btnOptions.FlatAppearance.BorderSize = 2;
            // //this.btnOptions.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnOptions.ModifyFont(defaultFontBold);
            ////this.btnOptions.Location = new System.Drawing.Point(163, 3);
            //this.btnOptions.Name = "btnOptions";
            // this.btnOptions.SetSizeRequest(140, 33);
            ////this.btnOptions.TabIndex = 18;
            this.btnOptions.Label = "Options";
            ////this.btnOptions.UseVisualStyleBackColor = false;
            // this.btnOptions.Click += new System.EventHandler(this.btnOptions_Click);
            //
            // btnNewGame
            //
            //this.btnNewGame.BackColor = System.Drawing.Color.PeachPuff;
            //this.btnNewGame.FlatAppearance.BorderSize = 2;
            //this.btnNewGame.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnNewGame.ModifyFont(defaultFontBold);
            //this.btnNewGame.Location = new System.Drawing.Point(18, 3);
            this.btnNewGame.Name = "btnNewGame";
            this.btnNewGame.SetSizeRequest(140, 33);
            //this.btnNewGame.TabIndex = 17;
            this.btnNewGame.Label = "New Game";
            //this.btnNewGame.UseVisualStyleBackColor = false;
            //
            // btnLoad
            //
            //this.btnLoad.BackColor = System.Drawing.Color.PeachPuff;
            //this.btnLoad.FlatAppearance.BorderSize = 2;
            //this.btnLoad.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnLoad.ModifyFont(defaultFontBold);
            //this.btnLoad.Location = new System.Drawing.Point(164, 42);
            this.btnLoad.Name = "btnLoad";
            this.btnLoad.SetSizeRequest(140, 33);
            //this.btnLoad.TabIndex = 16;
            this.btnLoad.Label = "Load";
            //this.btnLoad.UseVisualStyleBackColor = false;
            //
            // btnSave
            //
            //this.btnSave.BackColor = System.Drawing.Color.PeachPuff;
            //this.btnSave.FlatAppearance.BorderSize = 2;
            //this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnSave.ModifyFont(defaultFontBold);
            //this.btnSave.Location = new System.Drawing.Point(18, 42);
            this.btnSave.Name = "btnSave";
            this.btnSave.SetSizeRequest(140, 33);
            //this.btnSave.TabIndex = 15;
            this.btnSave.Label = "Save";
            //this.btnSave.UseVisualStyleBackColor = false;
            //
            // buttonCmd5
            //
            //this.buttonCmd5.BackColor = System.Drawing.Color.PeachPuff;
            //this.buttonCmd5.FlatAppearance.BorderSize = 2;
            //this.buttonCmd5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonCmd5.ModifyFont(defaultFontBold);
            //this.buttonCmd5.Location = new System.Drawing.Point(718, 126);
            this.buttonCmd5.Name = "buttonCmd5";
            this.buttonCmd5.SetSizeRequest(170, 34);
            //this.buttonCmd5.TabIndex = 10;
            this.buttonCmd5.Label = "buttonCmd5";
            //this.buttonCmd5.UseVisualStyleBackColor = false;
            //
            // buttonCmd4
            //
            //this.buttonCmd4.BackColor = System.Drawing.Color.PeachPuff;
            //this.buttonCmd4.FlatAppearance.BorderSize = 2;
            //this.buttonCmd4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonCmd4.ModifyFont(defaultFontBold);
            //this.buttonCmd4.Location = new System.Drawing.Point(542, 126);
            this.buttonCmd4.Name = "buttonCmd4";
            this.buttonCmd4.SetSizeRequest(170, 34);
            //this.buttonCmd4.TabIndex = 11;
            this.buttonCmd4.Label = "buttonCmd4";
            //this.buttonCmd4.UseVisualStyleBackColor = false;
            //
            // buttonCmd1
            //
            //this.buttonCmd1.BackColor = System.Drawing.Color.PeachPuff;
            //this.buttonCmd1.FlatAppearance.BorderSize = 2;
            //this.buttonCmd1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonCmd1.ModifyFont(defaultFontBold);
            //this.buttonCmd1.Location = new System.Drawing.Point(14, 126);
            this.buttonCmd1.Name = "buttonCmd1";
            this.buttonCmd1.SetSizeRequest(170, 34);
            //this.buttonCmd1.TabIndex = 14;
            this.buttonCmd1.Label = "Perks";
            //this.buttonCmd1.UseVisualStyleBackColor = false;
            //
            // buttonCmd2
            //
            //this.buttonCmd2.BackColor = System.Drawing.Color.PeachPuff;
            //this.buttonCmd2.FlatAppearance.BorderSize = 2;
            //this.buttonCmd2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonCmd2.ModifyFont(defaultFontBold);
            //this.buttonCmd2.Location = new System.Drawing.Point(190, 126);
            this.buttonCmd2.Name = "buttonCmd2";
            this.buttonCmd2.SetSizeRequest(170, 34);
            //this.buttonCmd2.TabIndex = 13;
            this.buttonCmd2.Label = "Inventory";
            //this.buttonCmd2.UseVisualStyleBackColor = false;
            //
            // buttonCmd3
            //
            //this.buttonCmd3.BackColor = System.Drawing.Color.PeachPuff;
            //this.buttonCmd3.FlatAppearance.BorderSize = 2;
            //this.buttonCmd3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.buttonCmd3.ModifyFont(defaultFontBold);
            //this.buttonCmd3.Location = new System.Drawing.Point(366, 126);
            this.buttonCmd3.Name = "buttonCmd3";
            this.buttonCmd3.SetSizeRequest(170, 34);
            //this.buttonCmd3.TabIndex = 12;
            this.buttonCmd3.Label = "buttonCmd3";
            //this.buttonCmd3.UseVisualStyleBackColor = false;
            //
            // button8
            //
            //this.button8.BackColor = System.Drawing.Color.Peru;
            //this.button8.FlatAppearance.BorderSize = 2;
            //this.button8.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button8.ModifyFont(defaultFontBold);
            //this.button8.Location = new System.Drawing.Point(366, 41);
            this.button8.Name = "button8";
            this.button8.SetSizeRequest(170, 34);
            //this.button8.TabIndex = 7;
            this.button8.Label = "button8";
            //this.button8.UseVisualStyleBackColor = false;
            //
            // button9
            //
            //this.button9.BackColor = System.Drawing.Color.Peru;
            //this.button9.FlatAppearance.BorderSize = 2;
            //this.button9.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button9.ModifyFont(defaultFontBold);
            //this.button9.Location = new System.Drawing.Point(542, 41);
            this.button9.Name = "button9";
            this.button9.SetSizeRequest(170, 34);
            //this.button9.TabIndex = 6;
            this.button9.Label = "button9";
            //this.button9.UseVisualStyleBackColor = false;
            //
            // button7
            //
            //this.button7.BackColor = System.Drawing.Color.Peru;
            //this.button7.FlatAppearance.BorderSize = 2;
            //this.button7.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button7.ModifyFont(defaultFontBold);
            //this.button7.Location = new System.Drawing.Point(190, 41);
            this.button7.Name = "button7";
            this.button7.SetSizeRequest(170, 34);
            //this.button7.TabIndex = 8;
            this.button7.Label = "button7";
            //this.button7.UseVisualStyleBackColor = false;
            //
            // button6
            //
            //this.button6.BackColor = System.Drawing.Color.Peru;
            //this.button6.FlatAppearance.BorderSize = 2;
            //this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button6.ModifyFont(defaultFontBold);
            //this.button6.Location = new System.Drawing.Point(14, 41);
            this.button6.Name = "button6";
            this.button6.SetSizeRequest(170, 34);
            //this.button6.TabIndex = 9;
            this.button6.Label = "button6";
            //this.button6.UseVisualStyleBackColor = false;
            //
            // button5
            //
            //this.button5.BackColor = System.Drawing.Color.Peru;
            //this.button5.FlatAppearance.BorderSize = 2;
            //this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button5.ModifyFont(defaultFontBold);
            //this.button5.Location = new System.Drawing.Point(718, 4);
            this.button5.Name = "button5";
            this.button5.SetSizeRequest(170, 34);
            //this.button5.TabIndex = 4;
            this.button5.Label = "button5";
            //this.button5.UseVisualStyleBackColor = false;
            //
            // button10
            //
            //this.button10.BackColor = System.Drawing.Color.Peru;
            //this.button10.FlatAppearance.BorderSize = 2;
            //this.button10.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button10.ModifyFont(defaultFontBold);
            //this.button10.Location = new System.Drawing.Point(718, 41);
            this.button10.Name = "button10";
            this.button10.SetSizeRequest(170, 34);
            //this.button10.TabIndex = 5;
            this.button10.Label = "button10";
            //this.button10.UseVisualStyleBackColor = false;
            //
            // button4
            //
            //this.button4.BackColor = System.Drawing.Color.Peru;
            //this.button4.FlatAppearance.BorderSize = 2;
            //this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button4.ModifyFont(defaultFontBold);
            //this.button4.Location = new System.Drawing.Point(542, 4);
            this.button4.Name = "button4";
            this.button4.SetSizeRequest(170, 34);
            //this.button4.TabIndex = 3;
            this.button4.Label = "button4";
            //this.button4.UseVisualStyleBackColor = false;
            //
            // button3
            //
            //this.button3.BackColor = System.Drawing.Color.Peru;
            //this.button3.FlatAppearance.BorderSize = 2;
            //this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button3.ModifyFont(defaultFontBold);
            //this.button3.Location = new System.Drawing.Point(366, 4);
            this.button3.Name = "button3";
            this.button3.SetSizeRequest(170, 34);
            //this.button3.TabIndex = 2;
            this.button3.Label = "button3";
            //this.button3.UseVisualStyleBackColor = false;
            //
            // button2
            //
            //this.button2.BackColor = System.Drawing.Color.Peru;
            //this.button2.FlatAppearance.BorderSize = 2;
            //this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button2.ModifyFont(defaultFontBold);
            //this.button2.Location = new System.Drawing.Point(190, 4);
            this.button2.Name = "button2";
            this.button2.SetSizeRequest(170, 34);
            //this.button2.TabIndex = 1;
            this.button2.Label = "button2";
            //this.button2.UseVisualStyleBackColor = false;
            //
            // button1
            //
            //this.button1.BackColor = System.Drawing.Color.Peru;
            //this.button1.FlatAppearance.BorderSize = 2;
            //this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button1.ModifyFont(defaultFontBold);
            //this.button1.Location = new System.Drawing.Point(14, 4);
            this.button1.Name = "button1";
            this.button1.SetSizeRequest(170, 34);
            //this.button1.TabIndex = 0;
            this.button1.Label = "button1";
            //this.button1.UseVisualStyleBackColor = false;
            //
            // label11
            //
            //this.label11.AutoSize = true;
            this.label11.ModifyFont(defaultFontBold);
            //this.label11.Location = new System.Drawing.Point(172, 38);
            this.label11.Name = "label11";
            this.label11.SetSizeRequest(47, 16);
            //this.label11.TabIndex = 10;
            this.label11.Text = "Coins";
            //
            // label10
            //
            //this.label10.AutoSize = true;
            this.label10.ModifyFont(defaultFontBold);
            //this.label10.Location = new System.Drawing.Point(241, 12);
            this.label10.Name = "label10";
            this.label10.SetSizeRequest(41, 16);
            //this.label10.TabIndex = 9;
            this.label10.Text = "Hour";
            //
            // label9
            //
            //this.label9.AutoSize = true;
            this.label9.ModifyFont(defaultFontBold);
            //this.label9.Location = new System.Drawing.Point(172, 12);
            this.label9.Name = "label9";
            this.label9.SetSizeRequest(36, 16);
            //this.label9.TabIndex = 8;
            this.label9.Text = "Day";
            //
            // label8
            //
            //this.label8.AutoSize = true;
            this.label8.ModifyFont(defaultFontBold);
            //this.label8.Location = new System.Drawing.Point(8, 38);
            this.label8.Name = "label8";
            this.label8.SetSizeRequest(34, 16);
            //this.label8.TabIndex = 7;
            this.label8.Text = "Exp";
            //
            // label7
            //
            //this.label7.AutoSize = true;
            this.label7.ModifyFont(defaultFontBold);
            //this.label7.Location = new System.Drawing.Point(8, 12);
            this.label7.Name = "label7";
            this.label7.SetSizeRequest(46, 16);
            //this.label7.TabIndex = 6;
            this.label7.Text = "Level";
            //
            // labelHP
            //
            //this.labelHP.AutoSize = true;
            this.labelHP.ModifyFont(defaultFontBold);
            //this.labelHP.Location = new System.Drawing.Point(254, 7);
            this.labelHP.Name = "labelHP";
            this.labelHP.SetSizeRequest(16, 16);
            //this.labelHP.TabIndex = 10;
            this.labelHP.Text = "0";
            //
            // labelLust
            //
            //this.labelLust.AutoSize = true;
            this.labelLust.ModifyFont(defaultFontBold);
            //this.labelLust.Location = new System.Drawing.Point(254, 47);
            this.labelLust.Name = "labelLust";
            this.labelLust.SetSizeRequest(16, 16);
            //this.labelLust.TabIndex = 11;
            this.labelLust.Text = "0";
            //
            // progressBarHP
            //
            //this.progressBarHP.ForeColor = System.Drawing.Color.Purple;
            //this.progressBarHP.Location = new System.Drawing.Point(203, 26);
            this.progressBarHP.Name = "progressBarHP";
            this.progressBarHP.SetSizeRequest(100, 10);
            //this.progressBarHP.TabIndex = 12;
            //
            // progressBarLust
            //
            //this.progressBarLust.ForeColor = System.Drawing.Color.DeepPink;
            //this.progressBarLust.Location = new System.Drawing.Point(203, 69);
            this.progressBarLust.Name = "progressBarLust";
            this.progressBarLust.SetSizeRequest(100, 10);
            //this.progressBarLust.TabIndex = 13;
            //
            // labelLevel
            //
            //this.labelLevel.AutoSize = true;
            this.labelLevel.ModifyFont(defaultFontBold);
            //this.labelLevel.Location = new System.Drawing.Point(58, 12);
            this.labelLevel.Name = "labelLevel";
            this.labelLevel.SetSizeRequest(16, 16);
            //this.labelLevel.TabIndex = 14;
            this.labelLevel.Text = "0";
            //
            // labelDay
            //
            //this.labelDay.AutoSize = true;
            this.labelDay.ModifyFont(defaultFontBold);
            //this.labelDay.Location = new System.Drawing.Point(214, 12);
            this.labelDay.Name = "labelDay";
            this.labelDay.SetSizeRequest(16, 16);
            //this.labelDay.TabIndex = 15;
            this.labelDay.Text = "0";
            //
            // labelHour
            //
            //this.labelHour.AutoSize = true;
            this.labelHour.ModifyFont(defaultFontBold);
            //this.labelHour.Location = new System.Drawing.Point(290, 12);
            this.labelHour.Name = "labelHour";
            this.labelHour.SetSizeRequest(16, 16);
            //this.labelHour.TabIndex = 16;
            this.labelHour.Text = "0";
            //
            // labelCoins
            //
            //this.labelCoins.AutoSize = true;
            this.labelCoins.ModifyFont(defaultFontBold);
            //this.labelCoins.Location = new System.Drawing.Point(241, 38);
            this.labelCoins.Name = "labelCoins";
            this.labelCoins.SetSizeRequest(16, 16);
            //this.labelCoins.TabIndex = 17;
            this.labelCoins.Text = "0";
            //
            // labelExp
            //
            //this.labelExp.AutoSize = true;
            this.labelExp.ModifyFont(defaultFontBold);
            //this.labelExp.Location = new System.Drawing.Point(44, 38);
            this.labelExp.Name = "labelExp";
            this.labelExp.SetSizeRequest(16, 16);
            //this.labelExp.TabIndex = 18;
            this.labelExp.Text = "0";
            //
            // progressBarExp
            //
            //this.progressBarExp.ForeColor = System.Drawing.Color.Lime;
            //this.progressBarExp.Location = new System.Drawing.Point(65, 44);
            this.progressBarExp.Name = "progressBarExp";
            this.progressBarExp.SetSizeRequest(95, 10);
            //this.progressBarExp.TabIndex = 14;
            //
            // MainStoryTextPanel
            //
            //this.MainStoryTextPanel.BackColor = System.Drawing.Color.MediumOrchid;
            //this.MainStoryTextPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.MainStoryTextPanel.Add(this.richTextBoxMain);
            //this.MainStoryTextPanel.Location = new System.Drawing.Point(346, 10);
            this.MainStoryTextPanel.Name = "MainStoryTextPanel";
            this.MainStoryTextPanel.SetSizeRequest(906, 495);
            //this.MainStoryTextPanel.TabIndex = 4;
            //
            // richTextBoxMain
            //
            //this.richTextBoxMain.BackColor = System.Drawing.Color.Thistle;
            this.richTextBoxMain.ModifyFont(FontDescription.FromString("Microsoft Sans Serif 10"));
            //this.richTextBoxMain.Location = new System.Drawing.Point(3, 3);
            this.richTextBoxMain.Name = "richTextBoxMain";
            this.richTextBoxMain.SetSizeRequest(898, 487);
            //this.richTextBoxMain.TabIndex = 0;
            this.richTextBoxMain.Buffer.Text = "";
            //
            // panel2
            //
            //this.panel2.BackColor = System.Drawing.Color.MediumSeaGreen;
            //this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.ActionbuttonHolder.Add(this.button12);
            this.ActionbuttonHolder.Add(this.button14);
            this.ActionbuttonHolder.Add(this.button11);
            this.ActionbuttonHolder.Add(this.button13);
            this.ActionbuttonHolder.Add(this.button15);
            this.ActionbuttonHolder.Add(this.button1);
            this.ActionbuttonHolder.Add(this.button3);
            this.ActionbuttonHolder.Add(this.button7);
            this.ActionbuttonHolder.Add(this.buttonCmd5);
            this.ActionbuttonHolder.Add(this.button9);
            this.ActionbuttonHolder.Add(this.button6);
            this.ActionbuttonHolder.Add(this.buttonCmd4);
            this.ActionbuttonHolder.Add(this.button8);
            this.ActionbuttonHolder.Add(this.button2);
            this.ActionbuttonHolder.Add(this.button5);
            this.ActionbuttonHolder.Add(this.buttonCmd1);
            this.ActionbuttonHolder.Add(this.buttonCmd3);
            this.ActionbuttonHolder.Add(this.button4);
            this.ActionbuttonHolder.Add(this.button10);
            this.ActionbuttonHolder.Add(this.buttonCmd2);
            //this.panel2.Location = new System.Drawing.Point(346, 509);
            this.ActionbuttonHolder.Name = "ActionButtonHolder";
            this.ActionbuttonHolder.SetSizeRequest(906, 167);
            //this.panel2.TabIndex = 5;
            //this.panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.panel2_Paint);
            //
            // button12
            //
            //this.button12.BackColor = System.Drawing.Color.Peru;
            //this.button12.FlatAppearance.BorderSize = 2;
            //this.button12.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button12.ModifyFont(defaultFontBold);
            //this.button12.Location = new System.Drawing.Point(190, 78);
            this.button12.Name = "button12";
            this.button12.SetSizeRequest(170, 34);
            //this.button12.TabIndex = 18;
            this.button12.Label = "button12";
            //this.button12.UseVisualStyleBackColor = false;
            //
            // button14
            //
            //this.button14.BackColor = System.Drawing.Color.Peru;
            //this.button14.FlatAppearance.BorderSize = 2;
            //this.button14.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button14.ModifyFont(defaultFontBold);
            //this.button14.Location = new System.Drawing.Point(542, 78);
            this.button14.Name = "button14";
            this.button14.SetSizeRequest(170, 34);
            //this.button14.TabIndex = 16;
            this.button14.Label = "button14";
            //this.button14.UseVisualStyleBackColor = false;
            //
            // button11
            //
            //this.button11.BackColor = System.Drawing.Color.Peru;
            //this.button11.FlatAppearance.BorderSize = 2;
            //this.button11.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button11.ModifyFont(defaultFontBold);
            //this.button11.Location = new System.Drawing.Point(14, 78);
            this.button11.Name = "button11";
            this.button11.SetSizeRequest(170, 34);
            //this.button11.TabIndex = 19;
            this.button11.Label = "button11";
            //this.button11.UseVisualStyleBackColor = false;
            //
            // button13
            //
            //this.button13.BackColor = System.Drawing.Color.Peru;
            //this.button13.FlatAppearance.BorderSize = 2;
            //this.button13.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button13.ModifyFont(defaultFontBold);
            //this.button13.Location = new System.Drawing.Point(366, 78);
            this.button13.Name = "button13";
            this.button13.SetSizeRequest(170, 34);
            //this.button13.TabIndex = 17;
            //this.button13.Label = "button13";
            this.button13.Label = "button13";
            //this.button13.UseVisualStyleBackColor = false;
            //
            // button15
            //
            // //this.button15.BackColor = System.Drawing.Color.Peru;
            // //this.button15.FlatAppearance.BorderSize = 2;
            ////this.button15.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button15.ModifyFont(defaultFontBold);
            ////this.button15.Location = new System.Drawing.Point(718, 78);
            this.button15.Name = "button15";
            this.button15.SetSizeRequest(170, 34);
            ////this.button15.TabIndex = 15;
            //this.button15.Label = "button15";
            ////this.button15.UseVisualStyleBackColor = false;
            //
            // panel3
            //
            //this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))),
            //    ((int)(((byte)(128)))));
            // //this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel3.Add(this.richTextBoxSub);
            // //this.panel3.Location = new System.Drawing.Point(10, 112);
            this.panel3.Name = "panel3";
            this.panel3.SetSize(330, 408);
            ////this.panel3.TabIndex = 6;
            //
            // richTextBoxSub
            //
            ////this.richTextBoxSub.BackColor = System.Drawing.Color.PeachPuff;
            this.richTextBoxSub.ModifyFont(FontDescription.FromString("Microsoft Sans Serif 10"));

            // //this.richTextBoxSub.Location = new System.Drawing.Point(3, 3);
            this.richTextBoxSub.Name = "richTextBoxSub";
            this.richTextBoxSub.SetSizeRequest(322, 400);
            ////this.richTextBoxSub.TabIndex = 0;
            //this.richTextBoxSub.Text = "";
            // this.richTextBoxSub.TextChanged += new System.EventHandler(this.richTextBoxSub_TextChanged);
            //
            // PlayerStatsPanel
            //
            ////this.PlayerStatsPanel.BackColor = System.Drawing.Color.SteelBlue;
            ////this.PlayerStatsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.PlayerStatsPanel.Add(this.progressBarLust);
            this.PlayerStatsPanel.Add(this.labelLibido);
            this.PlayerStatsPanel.Add(this.labelStrenght);
            this.PlayerStatsPanel.Add(this.progressBarHP);
            this.PlayerStatsPanel.Add(this.label6);
            this.PlayerStatsPanel.Add(this.label1);
            this.PlayerStatsPanel.Add(this.labelToughness);
            this.PlayerStatsPanel.Add(this.labelLust);
            this.PlayerStatsPanel.Add(this.label5);
            this.PlayerStatsPanel.Add(this.label2);
            this.PlayerStatsPanel.Add(this.labelSpeed);
            this.PlayerStatsPanel.Add(this.labelHP);
            this.PlayerStatsPanel.Add(this.label4);
            this.PlayerStatsPanel.Add(this.label3);
            // //this.PlayerStatsPanel.Location = new System.Drawing.Point(10, 10);
            this.PlayerStatsPanel.Name = "PlayerStatsPanel";
            this.PlayerStatsPanel.SetSize(330, 93);
            ////this.PlayerStatsPanel.TabIndex = 7;
            //
            // AdditionalStatsPanel
            //
            // this.AdditionalStatsPanel. = System.Drawing.Color.SteelBlue;
            // //this.AdditionalStatsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.AdditionalStatsPanel.Add(this.progressBarExp);
            this.AdditionalStatsPanel.Add(this.label10);
            this.AdditionalStatsPanel.Add(this.labelDay);
            this.AdditionalStatsPanel.Add(this.label11);
            this.AdditionalStatsPanel.Add(this.labelExp);
            this.AdditionalStatsPanel.Add(this.labelLevel);
            this.AdditionalStatsPanel.Add(this.label7);
            this.AdditionalStatsPanel.Add(this.label9);
            this.AdditionalStatsPanel.Add(this.labelCoins);
            this.AdditionalStatsPanel.Add(this.labelHour);
            this.AdditionalStatsPanel.Add(this.label8);
            ////this.AdditionalStatsPanel.Location = new System.Drawing.Point(10, 524);
            this.AdditionalStatsPanel.Name = "AdditionalStatsPanel";
            this.AdditionalStatsPanel.SetSize(330, 65);
            ////this.AdditionalStatsPanel.TabIndex = 8;
            //
            // MainActionsPanel
            //
            ////this.MainActionsPanel.BackColor = System.Drawing.Color.DarkOrange;
            ////this.MainActionsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.MainActionsPanel.Add(this.btnOptions);
            this.MainActionsPanel.Add(this.btnLoad);
            this.MainActionsPanel.Add(this.btnSave);
            this.MainActionsPanel.Add(this.btnNewGame);
            ////this.MainActionsPanel.Location = new System.Drawing.Point(10, 594);
            this.MainActionsPanel.Name = "MainActionsPanel";
            //this.MainActionsPanel.SetSizeRequest(330, 82);
            this.ActionPanelLocation.Add(MainActionsPanel);
            ////this.MainActionsPanel.TabIndex = 9;
            //
            // TestFormX
            //
            // MainWindow.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            // MainWindow.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            //MainWindow.BackColor = System.Drawing.Color.LightSteelBlue;
            // MainWindow.ClientSize = new System.Drawing.Size(1264, 681);
            MainWindow.Resize(1264, 681);

            mainPanel.Add(this.ActionPanelLocation);
            //mainPanel.Add(this.AdditionalStatsPanel);
            //mainPanel.Add(this.PlayerStatsPanel);
            //mainPanel.Add(this.panel3);
            //mainPanel.Add(this.ActionbuttonHolder);
            //mainPanel.Add(this.MainStoryTextPanel);
            MainWindow.Add(mainPanel);
            MainWindow.Name = "TestFormX";
            MainWindow.ShowAll();
            //MainWindow.Text = "TestFormX";
        }
        private NetworkOverviewPage()
        {
            /* Build the UI */

            CreateUserList();

            /* Create mainbar */

            Widget mapWidget = null;

            try {
                map = new ZoomableNetworkMap();
                map.SelectedNodeChanged += map_SelectedNodeChanged;
                map.NodeDoubleClicked   += map_NodeDoubleClicked;
                mapWidget = map;
            } catch (Exception ex) {
                LoggingService.LogError("Failed to load map !!!", ex);
                mapWidget = new Label("Error loading map.");
            }

            this.Pack1(mapWidget, true, true);

            /* Create sidebar */
            sidebar = new EventBox();
            sidebar.WidthRequest = 190;

            var sidebarBox = new Gtk.VBox();

            sidebar.Add(sidebarBox);

            var headerAlign = new FadingAlignment();

            sidebarBox.PackStart(headerAlign, false, false, 0);

            var headerLabel = new Gtk.Label();

            headerLabel.Markup = "<b>Users</b>";
            headerLabel.Xalign = 0;
            headerLabel.Ypad   = 6;
            headerLabel.Xpad   = 6;
            headerAlign.Add(headerLabel);

            sidebarBox.PackStart(AddScrolledWindow(userList), true, true, 0);

            this.Pack2(sidebar, false, true);

            sidebar.ShowAll();

            foreach (Network network in Runtime.Core.Networks)
            {
                Core_NetworkAdded(network);
            }

            Runtime.Core.TransportManager.TransportError +=
                (TransportErrorEventHandler)DispatchService.GuiDispatch(
                    new TransportErrorEventHandler(Core_TransportError)
                    );

            Runtime.Core.NetworkAdded +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkAdded)
                    );

            Runtime.Core.NetworkRemoved +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkRemoved)
                    );

            Runtime.Core.AvatarManager.AvatarsChanged +=
                (EventHandler)DispatchService.GuiDispatch(
                    new EventHandler(AvatarManager_AvatarsChanged)
                    );

            this.ShowAll();
        }