예제 #1
0
        public PinnedWatchWidget(TextEditor editor, PinnedWatch watch)
        {
            objectValue = watch.Value;
            Editor      = editor;
            Watch       = watch;

            valueTree                = new ObjectValueTreeView();
            valueTree.AllowAdding    = false;
            valueTree.AllowEditing   = true;
            valueTree.AllowPinning   = true;
            valueTree.HeadersVisible = false;
            valueTree.CompactView    = true;
            valueTree.PinnedWatch    = watch;
            if (objectValue != null)
            {
                valueTree.AddValue(objectValue);
            }

            valueTree.ButtonPressEvent   += HandleValueTreeButtonPressEvent;
            valueTree.ButtonReleaseEvent += HandleValueTreeButtonReleaseEvent;
            valueTree.MotionNotifyEvent  += HandleValueTreeMotionNotifyEvent;

            Gtk.Frame fr = new Gtk.Frame();
            fr.ShadowType = Gtk.ShadowType.Out;
            fr.Add(valueTree);
            Add(fr);
            HandleEditorOptionsChanged(null, null);
            ShowAll();
            //unpin.Hide ();
            Editor.EditorOptionsChanged += HandleEditorOptionsChanged;

            DebuggingService.PausedEvent  += HandleDebuggingServicePausedEvent;
            DebuggingService.ResumedEvent += HandleDebuggingServiceResumedEvent;
        }
예제 #2
0
    protected void OnToolboxSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
    {
        Gtk.Frame fActive = (Gtk.Frame)o;
        Gtk.Frame fOther  = (o == fToolsRight)?fToolsLeft:fToolsRight;
        Settings.Instance.ToolboxOnRight = (fActive == fToolsRight);                    //recently touched frame becomes stored in preferences

        if (args.Allocation.Width < 5)
        {
            if (fOther.Visible)                         //ignore, if the other frame is already visible;
            {
                return;
            }
            fActive.Show();
            fOther.Show();
        }
        else
        {
            if (!fOther.Visible)                        //ignore, if the other frame is already hidden;
            {
                return;
            }
            fActive.WidthRequest = 1;
            fActive.Show();
            aTools.Reparent(fActive);
            fOther.Hide();
        }
    }
예제 #3
0
        private void AddTeamNamesWidget()
        {
            Gtk.Frame sframe, tframe;
            EventBox  ebox;

            sframe = new Gtk.Frame("<b>" + Catalog.GetString("Shield") + "</b>");
            (sframe.LabelWidget as Label).UseMarkup = true;
            sframe.ShadowType = ShadowType.None;
            tframe            = new Gtk.Frame("<b>" + Catalog.GetString("Team Name") + "</b>");
            (tframe.LabelWidget as Label).UseMarkup = true;
            tframe.ShadowType = ShadowType.None;

            ebox = new EventBox();
            ebox.ButtonPressEvent += OnImageClicked;

            shieldImage        = new Gtk.Image();
            shieldImage.Pixbuf = IconLoader.LoadIcon(this, "gtk-execute", IconSize.Dialog);
            box = new VBox();

            teamentry          = new Entry();
            teamentry.Changed += delegate(object sender, EventArgs e) {
                Template.TeamName = teamentry.Text;
            };

            sframe.Add(ebox);
            ebox.Add(shieldImage);
            tframe.Add(teamentry);

            box.PackStart(sframe, false, false, 0);
            box.PackStart(tframe, false, false, 0);
            box.ShowAll();
            box.Sensitive = false;
            AddUpperWidget(box);
        }
예제 #4
0
        protected void build()
        {
            this.SetDefaultSize (1000, 600);
            this.Title = "Battle";
            this.DeleteEvent += HandleDeleteEvent;

            this.vbox = new VBox ();

            this.tbar = new Toolbar ();
            this.tbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            this.about = new ToolButton (Stock.About);
            this.about.IsImportant = false;
            this.about.Label = "About";
            this.about.TooltipText = "About this application";
            this.tbar.Add (this.about);

            this.hpaned = new HPaned ();
            this.frame = new Frame ("Battle Map");
            this.map = new MapControl ();
            this.frame.Add (this.map);
            Label a = new Label ("Welcome");
            this.hpaned.Pack1 (a, false, false);
            this.hpaned.Pack2 (this.frame, true, true);

            this.sbar = new Statusbar ();

            this.vbox.PackStart (this.tbar, false, true, 0);
            this.vbox.PackStart (this.hpaned, true, true, 0);
            this.vbox.PackEnd (this.sbar, false, true, 0);

            this.Add (this.vbox);
        }
 protected virtual void Build()
 {
     Gui.Initialize (this);
     // Widget BolPatcher.MenuGameWidget
     BinContainer.Attach (this);
     Name = "BolPatcher.MenuGameWidget";
     // Container child BolPatcher.MenuGameWidget.Gtk.Container+ContainerChild
     _frame1 = new Frame ();
     _frame1.Name = "frame1";
     _frame1.ShadowType = 0;
     // Container child frame1.Gtk.Container+ContainerChild
     _gtkAlignment = new Alignment (0F, 0F, 1F, 1F);
     _gtkAlignment.Name = "GtkAlignment";
     _gtkAlignment.LeftPadding = 12;
     // Container child GtkAlignment.Gtk.Container+ContainerChild
     _button2 = new Button ();
     _button2.CanFocus = true;
     _button2.Name = "button2";
     _button2.UseUnderline = true;
     _button2.Label = Catalog.GetString ("GtkButton");
     _gtkAlignment.Add (_button2);
     _frame1.Add (_gtkAlignment);
     _gtkLabel1 = new Label ();
     _gtkLabel1.Name = "GtkLabel1";
     _gtkLabel1.LabelProp = Catalog.GetString ("<b>GtkFrame</b>");
     _gtkLabel1.UseMarkup = true;
     _frame1.LabelWidget = _gtkLabel1;
     Add (_frame1);
     if ((Child != null)) {
         Child.ShowAll ();
     }
     Hide ();
 }
예제 #6
0
        public void Initialize(EditSession session)
        {
            PropertyDescriptor prop = session.Property;

            if (!prop.PropertyType.IsEnum)
            {
                throw new ApplicationException("Flags editor does not support editing values of type " + prop.PropertyType);
            }

            Spacing  = 3;
            propType = prop.PropertyType;

            property = prop.Description;
            if (property == null || property.Length == 0)
            {
                property = prop.Name;
            }

            // For small enums, the editor is a list of checkboxes inside a frame
            // For large enums (>5), use a selector dialog.

            values = System.Enum.GetValues(prop.PropertyType);

            if (values.Length < 6)
            {
                Gtk.VBox vbox = new Gtk.VBox(true, 3);

                flags = new Hashtable();

                foreach (object value in values)
                {
                    Gtk.CheckButton check = new Gtk.CheckButton(value.ToString());
                    check.TooltipText = value.ToString();
                    ulong uintVal = Convert.ToUInt64(value);
                    flags[check]   = uintVal;
                    flags[uintVal] = check;

                    check.Toggled += FlagToggled;
                    vbox.PackStart(check, false, false, 0);
                }

                Gtk.Frame frame = new Gtk.Frame();
                frame.Add(vbox);
                frame.ShowAll();
                PackStart(frame, true, true, 0);
            }
            else
            {
                flagsLabel            = new Gtk.Entry();
                flagsLabel.IsEditable = false;
                flagsLabel.HasFrame   = false;
                flagsLabel.ShowAll();
                PackStart(flagsLabel, true, true, 0);

                Gtk.Button but = new Gtk.Button("...");
                but.Clicked += OnSelectFlags;
                but.ShowAll();
                PackStart(but, false, false, 0);
            }
        }
예제 #7
0
		public DemoColorSelection () : base ("Color Selection")
		{
			BorderWidth = 8;
			VBox vbox = new VBox (false,8);
			vbox.BorderWidth = 8;
			Add (vbox);

			// Create the color swatch area
			Frame frame = new Frame ();
			frame.ShadowType = ShadowType.In;
			vbox.PackStart (frame, true, true, 0);

			drawingArea = new DrawingArea ();
			// set a minimum size
			drawingArea.SetSizeRequest (200,200);
			// set the color
			color.Red = 0;
			color.Green = 0;
			color.Blue = 1;
			color.Alpha = 1;
			drawingArea.OverrideBackgroundColor (StateFlags.Normal, color);
			frame.Add (drawingArea);

			Alignment alignment = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
			Button button = new Button ("_Change the above color");
			button.Clicked += new EventHandler (ChangeColorCallback);
			alignment.Add (button);
			vbox.PackStart (alignment, false, false, 0);

			ShowAll ();
		}
예제 #8
0
		public DemoColorSelection () : base ("Color Selection")
		{
			BorderWidth = 8;
			VBox vbox = new VBox (false,8);
			vbox.BorderWidth = 8;
			Add (vbox);

			// Create the color swatch area
			Frame frame = new Frame ();
			frame.ShadowType = ShadowType.In;
			vbox.PackStart (frame, true, true, 0);

			drawingArea = new DrawingArea ();
			drawingArea.ExposeEvent += new ExposeEventHandler (ExposeEventCallback);
			// set a minimum size
			drawingArea.SetSizeRequest (200,200);
			// set the color
			color = new Gdk.Color (0, 0, 0xff);
			drawingArea.ModifyBg (StateType.Normal, color);
			frame.Add (drawingArea);

			Alignment alignment = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
			Button button = new Button ("_Change the above color");
			button.Clicked += new EventHandler (ChangeColorCallback);
			alignment.Add (button);
			vbox.PackStart (alignment);

			ShowAll ();
		}
 public DeclarationViewWindow()
     : base(WindowType.Popup)
 {
     Gtk.Frame frame = new Gtk.Frame ();
     frame.Add (label = new Label (""));
     Add (frame);
 }
        public ChessGameWidget(Widget board)
        {
            whiteLabel = new Label ();
            blackLabel = new Label ();

            blackClock = new ChessClock ();
            blackHBox = new HBox ();
            blackHBox.PackStart (blackLabel, true, true, 2);
            blackHBox.PackStart (blackClock, false, false, 2);

            whiteClock = new ChessClock ();
            whiteHBox = new HBox ();
            whiteHBox.PackStart (whiteLabel, true, true, 2);
            whiteHBox.PackStart (whiteClock, false, false, 2);

            topBin = new Frame ();
            bottomBin = new Frame ();

            whiteAtBottom = true;
            topBin.Add (blackHBox);
            bottomBin.Add (whiteHBox);

            PackStart (topBin, false, false, 2);
            PackStart (board, true, true, 2);
            PackStart (bottomBin, false, false, 2);

            topBin.ShowAll ();
            bottomBin.ShowAll ();
        }
예제 #11
0
파일: AudioView.cs 프로젝트: GNOME/banter
        public AudioView()
        {
            //			this.WidthRequest = 500; //250;
            //			this.HeightRequest = 375; //187;

            Frame frame = new Frame();
            frame.BorderWidth = 5;
            frame.Show();

            VBox vbox = new VBox(false, 0);
            frame.Add(vbox);
            vbox.Show();

            Label label = new Label(Catalog.GetString("Audio Chat in progress..."));

            label.Show();
            vbox.PackStart(label, false, true, 5);

            Button button = new Button(Catalog.GetString("End Call"));
            button.Clicked += OnCloseAudioClicked;
            button.Show();
            vbox.PackStart(button, false, true, 5);

            this.Add(frame);
        }
예제 #12
0
        private void BuildInterface ()
        {
            NoShowAll = true;

            Alignment matchesAlignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            matchesAlignment.SetPadding (5, 5, 5, 5);
            matchesAlignment.Add (terms_box);

            matchesFrame = new Frame (null);
            matchesFrame.Add (matchesAlignment);
            matchesFrame.LabelWidget = BuildMatchHeader ();
            matchesFrame.ShowAll ();

            terms_entry_box = new HBox ();
            terms_entry_box.Spacing = 8;
            terms_entry_box.PackStart (new Label (Catalog.GetString ("Condition:")), false, false, 0);
            terms_entry = new Entry ();
            terms_entry_box.PackStart (terms_entry, true, true, 0);

            limit_box.ShowAll ();

            PackStart(matchesFrame, true, true, 0);
            PackStart(terms_entry_box, false, false, 0);
            PackStart(limit_box, false, false, 0);

            //ShowAll ();
        }
        public InsightWindow(SourceEditorView control, Project project, string fileName)
            : base(WindowType.Popup)
        {
            this.control             = control;
            this.fileName = fileName;
            this.project = project;
            /*System.Drawing.Point caretPos  = control.ActiveTextAreaControl.TextArea.Caret.Position;
            System.Drawing.Point visualPos = new System.Drawing.Point(control.ActiveTextAreaControl.TextArea.TextView.GetDrawingXPos(caretPos.Y, caretPos.X) + control.ActiveTextAreaControl.TextArea.TextView.DrawingPosition.X,
                      (int)((1 + caretPos.Y) * control.ActiveTextAreaControl.TextArea.TextView.FontHeight) - control.ActiveTextAreaControl.TextArea.VirtualTop.Y - 1 + control.ActiveTextAreaControl.TextArea.TextView.DrawingPosition.Y);*/

            //control.ActiveTextAreaControl.Caret.PositionChanged += new EventHandler(CaretOffsetChanged);
            //			control.TextAreaPainter.IHaveTheFocusChanged += focusEventHandler;

            AddEvents ((int) (Gdk.EventMask.KeyPressMask));
            this.SkipPagerHint = true;
            this.SkipTaskbarHint = true;
            this.Decorated = false;
            this.BorderWidth = 2;
            this.TypeHint = Gdk.WindowTypeHint.Dialog;

            desc = new Gtk.Label ("");
            current = new Gtk.Label ("");
            max = new Gtk.Label ("");
            HBox mainBox = new HBox (false, 2);
            mainBox.PackStart (new Gtk.Image (Gtk.Stock.GotoTop, Gtk.IconSize.Menu), false, false, 2);
            mainBox.PackStart (current, false, false, 2);
            mainBox.PackStart (new Gtk.Label (" of "), false, false, 2);
            mainBox.PackStart (max, false, false, 2);
            mainBox.PackStart (new Gtk.Image (Gtk.Stock.GotoBottom, Gtk.IconSize.Menu), false, false, 2);
            mainBox.PackStart (desc);
            Gtk.Frame framer = new Gtk.Frame ();
            framer.Add (mainBox);
            this.Add (framer);
        }
예제 #14
0
        public ConfigurationDialog (LCDService plugin)
        {
            this.plugin = plugin;
            Title = AddinManager.CurrentLocalizer.GetString ("LCD configuration");
            BorderWidth = 5;
            HasSeparator = false;
            Resizable = false;

            VBox lcdproc_box = new VBox ();

            HBox host_box = new HBox ();
            host_box.PackStart (new Label (AddinManager.CurrentLocalizer.GetString ("Hostname:")), false, false, 3);
            host_entry = new Entry ();
            host_box.PackStart (host_entry, true, true, 3);
            host_entry.Text = this.plugin.Host;
            host_entry.Changed += new EventHandler (Host_Changed);

            HBox port_box = new HBox ();
            port_box.PackStart (new Label (AddinManager.CurrentLocalizer.GetString ("Port:")), false, false, 3);
            port_spin = new SpinButton (1, 65535, 1);
            port_box.PackStart (port_spin, true, true, 3);
            port_spin.Value = this.plugin.Port;
            port_spin.Changed += new EventHandler (Port_Changed);

            Frame lcdproc_frame = new Frame (AddinManager.CurrentLocalizer.GetString ("LCDProc Daemon:"));
            lcdproc_box.PackStart (host_box);
            lcdproc_box.PackStart (port_box);
            lcdproc_frame.Add (lcdproc_box);
            lcdproc_frame.ShowAll ();

            VBox.PackStart (lcdproc_frame, false, false, 3);
            AddButton (Stock.Close, ResponseType.Close);
        }
예제 #15
0
파일: Flags.cs 프로젝트: orf53975/stetic
        public void Initialize(PropertyDescriptor prop)
        {
            if (!prop.PropertyType.IsEnum)
            {
                throw new ApplicationException("Flags editor does not support editing values of type " + prop.PropertyType);
            }

            property = prop.Label;
            Spacing  = 3;

            // For small enums, the editor is a list of checkboxes inside a frame
            // For large enums (>5), use a selector dialog.

            enm = Registry.LookupEnum(prop.PropertyType.FullName);

            if (enm.Values.Length < 6)
            {
                Gtk.VBox vbox = new Gtk.VBox(true, 3);

                tips  = new Gtk.Tooltips();
                flags = new Hashtable();

                foreach (Enum value in enm.Values)
                {
                    EnumValue eval = enm[value];
                    if (eval.Label == "")
                    {
                        continue;
                    }

                    Gtk.CheckButton check = new Gtk.CheckButton(eval.Label);
                    tips.SetTip(check, eval.Description, eval.Description);
                    uint uintVal = (uint)(int)eval.Value;
                    flags[check]   = uintVal;
                    flags[uintVal] = check;

                    check.Toggled += FlagToggled;
                    vbox.PackStart(check, false, false, 0);
                }

                Gtk.Frame frame = new Gtk.Frame();
                frame.Add(vbox);
                frame.ShowAll();
                PackStart(frame, true, true, 0);
            }
            else
            {
                flagsLabel            = new Gtk.Entry();
                flagsLabel.IsEditable = false;
                flagsLabel.HasFrame   = false;
                flagsLabel.ShowAll();
                PackStart(flagsLabel, true, true, 0);

                Gtk.Button but = new Gtk.Button("...");
                but.Clicked += OnSelectFlags;
                but.ShowAll();
                PackStart(but, false, false, 0);
            }
        }
예제 #16
0
        void InitializeGTK()
        {
            Widget viewFrame = new Gtk.Frame();

            base.DesignerWidget     = viewFrame;
            base.PropertyGridWidget = new Gtk.Label("PropertyGrid");
            _gtkContainer           = viewFrame;
        }
예제 #17
0
 public DataGridView()
     : base()
 {
     frame = new Gtk.Frame ();
     grid = new DataGrid ();
     frame.Add (grid);
     frame.ShowAll ();
 }
예제 #18
0
		public DemoStockBrowser () : base ("Stock Icons and Items")
		{
			SetDefaultSize (-1, 500);
			BorderWidth = 8;

			HBox hbox = new HBox (false, 8);
			Add (hbox);

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

			ListStore model = CreateModel ();

			TreeView treeview = new TreeView (model);
			sw.Add (treeview);

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

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

			Alignment align = new Alignment (0.5f, 0.0f, 0.0f, 0.0f);
			hbox.PackEnd (align, false, false, 0);

			Frame frame = new Frame ("Selected Item");
			align.Add (frame);

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

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

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

			ShowAll ();
		}
예제 #19
0
 internal DesignSurfaceViewContent(string designerFile)
 {
     _loaded            = false;
     _designerFile      = designerFile;
     _propertyGridFrame = new Gtk.Frame();
     _propertyGridFrame.Show();
     _surfaceFrame = new DesignSurfaceViewFrame(_propertyGridFrame);
     _surfaceFrame.Show();
 }
예제 #20
0
		public void Initialise (MonoDevelopProxy proxy, Frame designerFrame)
		{
			System.Diagnostics.Trace.WriteLine ("Creating AspNetEdit EditorHost");
			host = new EditorHost (proxy);
			host.Initialise ();
			System.Diagnostics.Trace.WriteLine ("Created AspNetEdit EditorHost");
			
			//StartGuiThread ();
			Gtk.Application.Invoke ( delegate { LoadGui (designerFrame); });
		}
예제 #21
0
        private void build()
        {
            this.SetDefaultSize(1000, 600);

            this.vbox1 = new VBox();

            this.toolbar1 = new Toolbar();
            this.toolbar1.ToolbarStyle     = ToolbarStyle.BothHoriz;
            this.newcharbutton             = new ToolButton(Stock.New);
            this.newcharbutton.Label       = "New";
            this.newcharbutton.TooltipText = "New Character";
            this.newcharbutton.IsImportant = true;
            this.newcharbutton.Clicked    += HandleNewcharbuttonClicked;
            this.toolbar1.Add(this.newcharbutton);
            this.savecharbutton             = new ToolButton(Stock.Save);
            this.savecharbutton.Label       = "Save";
            this.savecharbutton.TooltipText = "Save Character";
            this.savecharbutton.Clicked    += HandleSavecharbuttonClicked;
            this.toolbar1.Add(this.savecharbutton);
            this.printcharbutton             = new ToolButton(Stock.Print);
            this.printcharbutton.Label       = "Print";
            this.printcharbutton.TooltipText = "Print Character";
            this.printcharbutton.Clicked    += HandlePrintcharbuttonClicked;
            this.toolbar1.Add(this.printcharbutton);
            this.toolbar1.Add(new SeparatorToolItem());
            this.rollbutton             = new ToolButton(Stock.Refresh);
            this.rollbutton.Label       = "Roll";
            this.rollbutton.TooltipText = "Roll Characteristics";
            this.rollbutton.IsImportant = true;
            this.rollbutton.Clicked    += HandleRollbuttonClicked;
            this.toolbar1.Add(this.rollbutton);
            this.aboutbutton             = new ToolButton(Stock.About);
            this.aboutbutton.Label       = "About";
            this.aboutbutton.TooltipText = "About Adeptus";
            this.aboutbutton.Clicked    += HandleAboutbuttonClicked;
            SeparatorToolItem sti = new SeparatorToolItem();

            sti.Draw   = false;
            sti.Expand = true;
            this.toolbar1.Add(sti);
            this.toolbar1.Add(this.aboutbutton);

            this.frame1 = new Frame();
            this.frame1.Add(new Image(Gdk.Pixbuf.LoadFromResource("Adeptus.Gui.EmperorVHorus.jpg")));

            this.statusbar1 = new Statusbar();
            this.statusbar1.Push(0, "Ready");

            this.vbox1.PackStart(this.toolbar1, false, true, 0);
            this.vbox1.PackStart(this.frame1, true, true, 0);
            this.vbox1.PackEnd(this.statusbar1, false, true, 0);

            this.Add(this.vbox1);
        }
예제 #22
0
파일: Flags.cs 프로젝트: Kalnor/monodevelop
		public void Initialize (PropertyDescriptor prop)
		{
			if (!prop.PropertyType.IsEnum)
				throw new ApplicationException ("Flags editor does not support editing values of type " + prop.PropertyType);
				
			property = prop.Label;
			Spacing = 3;

			// For small enums, the editor is a list of checkboxes inside a frame
			// For large enums (>5), use a selector dialog.

			enm = Registry.LookupEnum (prop.PropertyType.FullName);
			
			if (enm.Values.Length < 6) 
			{
				Gtk.VBox vbox = new Gtk.VBox (true, 3);

				flags = new Hashtable ();

				foreach (Enum value in enm.Values) {
					EnumValue eval = enm[value];
					if (eval.Label == "")
						continue;

					Gtk.CheckButton check = new Gtk.CheckButton (eval.Label);
					check.TooltipText = eval.Description;
					uint uintVal = (uint) Convert.ToInt32 (eval.Value);
					flags[check] = uintVal;
					flags[uintVal] = check;
					
					check.Toggled += FlagToggled;
					vbox.PackStart (check, false, false, 0);
				}

				Gtk.Frame frame = new Gtk.Frame ();
				frame.Add (vbox);
				frame.ShowAll ();
				PackStart (frame, true, true, 0);
			} 
			else 
			{
				flagsLabel = new Gtk.Entry ();
				flagsLabel.IsEditable = false;
				flagsLabel.HasFrame = false;
				flagsLabel.ShowAll ();
				PackStart (flagsLabel, true, true, 0);
				
				Gtk.Button but = new Gtk.Button ("...");
				but.Clicked += OnSelectFlags;
				but.ShowAll ();
				PackStart (but, false, false, 0);
			}
		}
예제 #23
0
		public DemoDrawingArea () : base ("Drawing Area")
		{
			BorderWidth = 8;

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

			// Create the checkerboard area
			Label label = new Label ("<u>Checkerboard pattern</u>");
			label.UseMarkup = true;
			vbox.PackStart (label, false, false, 0);

			Frame frame = new Frame ();
			frame.ShadowType = ShadowType.In;
			vbox.PackStart (frame, true, true, 0);

			DrawingArea da = new DrawingArea ();
			// set a minimum size
			da.SetSizeRequest (100,100);
			frame.Add (da);
			da.ExposeEvent += new ExposeEventHandler (CheckerboardExpose);

			// Create the scribble area
			label = new Label ("<u>Scribble area</u>");
			label.UseMarkup = true;
			vbox.PackStart (label, false, false, 0);

			frame = new Frame ();
			frame.ShadowType = ShadowType.In;
			vbox.PackStart (frame, true, true, 0);

			da = new DrawingArea ();
			// set a minimum size
			da.SetSizeRequest (100, 100);
			frame.Add (da);

			// Signals used to handle backing pixmap
			da.ExposeEvent += new ExposeEventHandler (ScribbleExpose);
			da.ConfigureEvent += new ConfigureEventHandler (ScribbleConfigure);

			// Event signals
			da.MotionNotifyEvent += new MotionNotifyEventHandler (ScribbleMotionNotify);
			da.ButtonPressEvent += new ButtonPressEventHandler (ScribbleButtonPress);


			// Ask to receive events the drawing area doesn't normally
			// subscribe to
			da.Events |= EventMask.LeaveNotifyMask | EventMask.ButtonPressMask |
				EventMask.PointerMotionMask | EventMask.PointerMotionHintMask;

			ShowAll ();
		}
예제 #24
0
		public void Attach (DockToolbar bar)
		{
			this.bar = bar;
			bar.FloatingDock = this;
			Frame f = new Frame ();
			f.Shadow = ShadowType.Out;
			f.Add (bar);
			Add (f);
			f.Show ();
			bar.Show ();
			Show ();
		}
예제 #25
0
		public static Gtk.Window Create ()
		{
			window = new Dialog ();
			window.Title = "Sized groups";
			window.Resizable = false;
			
			VBox vbox = new VBox (false, 5);
			window.VBox.PackStart (vbox, true, true, 0);
			vbox.BorderWidth = 5;

			size_group = new SizeGroup (SizeGroupMode.Horizontal);

			Frame frame = new Frame ("Color Options");
			vbox.PackStart (frame, true, true, 0);

			Table table = new Table (2, 2, false);
			table.BorderWidth = 5;
			table.RowSpacing = 5;
			table.ColumnSpacing = 10;
			frame.Add (table);

			string [] colors = {"Red", "Green", "Blue", };
			string [] dashes = {"Solid", "Dashed", "Dotted", };
			string [] ends = {"Square", "Round", "Arrow", };

			Add_Row (table, 0, size_group, "_Foreground", colors);
			Add_Row (table, 1, size_group, "_Background", colors);

			frame = new Frame ("Line Options");
			vbox.PackStart (frame, false, false, 0);

			table = new Table (2, 2, false);
			table.BorderWidth = 5;
			table.RowSpacing = 5;
			table.ColumnSpacing = 10;
			frame.Add (table);

			Add_Row (table, 0, size_group, "_Dashing", dashes);
			Add_Row (table, 1, size_group, "_Line ends", ends);

			CheckButton check_button = new CheckButton ("_Enable grouping");
			vbox.PackStart (check_button, false, false, 0);
			check_button.Active = true;
			check_button.Toggled += new EventHandler (Button_Toggle_Cb);

			Button close_button = new Button (Stock.Close);
			close_button.Clicked += new EventHandler (Close_Button);
			window.ActionArea.PackStart (close_button, false, false, 0);
			
			window.ShowAll ();
			return window;
		}
예제 #26
0
파일: VideoView.cs 프로젝트: GNOME/banter
        public VideoView()
        {
            preview_pos = PreviewPos.ButtonRight;

            VBox vbox = new VBox(false, 0);
            vbox.Show();

            Frame frame = new Frame();
            //frame.BorderWidth = 5;
            frame.Show();

            vbox.Add(frame);

            mainView = new Gtk.EventBox();
            mainView.WidthRequest = 400;
            mainView.HeightRequest = 300;
            mainView.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255,255,255));
            mainView.ModifyBg (Gtk.StateType.Active, new Gdk.Color (255,255,255));
            mainView.Show();

            //this.WidthRequest = 333; // 500; //250;
            //this.HeightRequest = 250; // 375; //187; 250
            preview = new Gtk.DrawingArea ();
            preview.WidthRequest = 120; // 75; //150;
            preview.HeightRequest = 90; // 56; //112;
            preview.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (0,0,0));
            preview.ModifyBg (Gtk.StateType.Active, new Gdk.Color (0,0,0));
            preview.Show();

            fix = new Gtk.Fixed ();
            fix.Put (preview, space, space);
            fix.Show();
            mainView.Add(fix);

            frame.Add(mainView);

            //			Label label = new Label(Catalog.GetString("Video Chat in progress..."));

            //			label.Show();
            //			vbox.PackStart(label, false, true, 0);

            Button button = new Button(Catalog.GetString("End Call"));
            button.Clicked += OnCloseVideoClicked;
            button.Show();
            vbox.PackStart(button, false, false, 5);

            this.Add(vbox);
            mainView.SizeAllocated += OnSizeAllocated;
            //			this.SizeRequested += OnsizeRequested;
            this.QueueResize ();
            MovePreview ();
        }
		public RemoteDesignerProcess ()
		{
			Application.Init ();
			
			designerFrame = new Gtk.Frame ();
			propGridFrame = new Gtk.Frame ();
			designerFrame.Shadow = ShadowType.None;
			propGridFrame.Shadow = ShadowType.None;
			designerFrame.BorderWidth = 0;
			
			designerFrame.Show ();
			propGridFrame.Show ();
		}
예제 #28
0
      private void InitializeComponent()
      {
         this.Title = "Search Errors";
         this.Modal = false;
         this.WindowPosition = Gtk.WindowPosition.CenterOnParent;
         this.Resizable = true;
         this.SetDefaultSize(480, 320);         
         this.IconName = Stock.DialogError;
         this.AddButton(Stock.Close, Gtk.ResponseType.Close);

         Gtk.Frame treeFrame = new Gtk.Frame();
         treeFrame.Shadow = ShadowType.In;
         Gtk.ScrolledWindow treeWin = new Gtk.ScrolledWindow();
         tvErrors = new Gtk.TreeView ();
         tvErrors.SetSizeRequest(480,200);
         tvErrors.Selection.Mode = SelectionMode.Single;

         tvErrors.AppendColumn(CreateTreeViewColumn("Name", 60, 0));
         tvErrors.AppendColumn(CreateTreeViewColumn("Located In", 200, 1));

         lsErrors = new Gtk.ListStore(typeof (string), typeof (string), typeof(string));
         tvErrors.Model = lsErrors;
         tvErrors.Selection.Changed += new EventHandler(tvErrors_Selection_Changed);
                  
         treeWin.Add(tvErrors);
         treeFrame.BorderWidth = 0;
         treeFrame.Add(treeWin);

         for (int i=0; i< alErrors.Count; i++)
         {
            MessageEventArgs args = (MessageEventArgs)alErrors[i];
            if (args.ErrorFile == null)
               lsErrors.AppendValues("General Error", string.Empty, args.Message);
            else
               lsErrors.AppendValues(args.ErrorFile.Name, args.ErrorFile.DirectoryName, args.Message);
         }

         Gtk.Frame txtFrame = new Gtk.Frame();
         txtFrame.Shadow = ShadowType.In;
         Gtk.ScrolledWindow txtScrollWin = new Gtk.ScrolledWindow();
         txtErrorDetails = new TextView();
         txtErrorDetails.WrapMode = Gtk.WrapMode.WordChar;
         txtErrorDetails.Editable = false;
         txtScrollWin.Add(txtErrorDetails);
         txtFrame.BorderWidth = 0;
         txtFrame.Add(txtScrollWin);

         this.VBox.PackStart(treeFrame, true, true, 3);
         this.VBox.PackEnd(txtFrame, true, true, 3);
         this.VBox.ShowAll();
      }
예제 #29
0
        private void InitializeComponent()
        {
            this.Title = "Search Errors";
             this.Modal = false;
             this.WindowPosition = Gtk.WindowPosition.CenterOnParent;
             this.Resizable = true;
             this.SetDefaultSize(480, 320);
             this.IconName = Stock.DialogError;
             this.AddButton(Stock.Close, Gtk.ResponseType.Close);

             Gtk.Frame treeFrame = new Gtk.Frame();
             treeFrame.Shadow = ShadowType.In;
             Gtk.ScrolledWindow treeWin = new Gtk.ScrolledWindow();
             tvErrors = new Gtk.TreeView ();
             tvErrors.SetSizeRequest(480,200);
             tvErrors.Selection.Mode = SelectionMode.Single;

             tvErrors.AppendColumn(CreateTreeViewColumn("Name", 60, 0));
             tvErrors.AppendColumn(CreateTreeViewColumn("Located In", 200, 1));

             lsErrors = new Gtk.ListStore(typeof (string), typeof (string), typeof(string));
             tvErrors.Model = lsErrors;
             tvErrors.Selection.Changed += new EventHandler(tvErrors_Selection_Changed);

             treeWin.Add(tvErrors);
             treeFrame.BorderWidth = 0;
             treeFrame.Add(treeWin);

             for (int i=0; i< alErrors.Count; i++)
             {
            MessageEventArgs args = (MessageEventArgs)alErrors[i];
            if (args.ErrorFile == null)
               lsErrors.AppendValues("General Error", string.Empty, args.Message);
            else
               lsErrors.AppendValues(args.ErrorFile.Name, args.ErrorFile.DirectoryName, args.Message);
             }

             Gtk.Frame txtFrame = new Gtk.Frame();
             txtFrame.Shadow = ShadowType.In;
             Gtk.ScrolledWindow txtScrollWin = new Gtk.ScrolledWindow();
             txtErrorDetails = new TextView();
             txtErrorDetails.WrapMode = Gtk.WrapMode.WordChar;
             txtErrorDetails.Editable = false;
             txtScrollWin.Add(txtErrorDetails);
             txtFrame.BorderWidth = 0;
             txtFrame.Add(txtScrollWin);

             this.VBox.PackStart(treeFrame, true, true, 3);
             this.VBox.PackEnd(txtFrame, true, true, 3);
             this.VBox.ShowAll();
        }
예제 #30
0
		public static int Main (string[] args)
		{
			Application.Init ();
			Gtk.Window win = new Gtk.Window ("Scribble");
			win.DeleteEvent += delegate { Application.Quit (); };
			win.BorderWidth = 8;
			Frame frm = new Frame (null);
			frm.ShadowType = ShadowType.In;
			frm.Add (new ScribbleArea ());
			win.Add (frm);
			win.ShowAll ();
			Application.Run ();
			return 0;
		}
        public DeclarationViewWindow()
            : base(WindowType.Popup)
        {
            overloads = new ArrayList ();
            this.AllowShrink = false;
            this.AllowGrow = false;

            headlabel = new HeaderWidget ();
            //			headlabel.LineWrap = true;
            //			headlabel.Xalign = 0;

            bodylabel = new Label ("");
            bodylabel.LineWrap = true;
            bodylabel.Xalign = 0;

            VBox vb = new VBox (false, 0);
            vb.PackStart (headlabel, true, true, 0);
            vb.PackStart (bodylabel, true, true, 3);

            left = new Arrow (ArrowType.Left, ShadowType.None);
            right = new Arrow (ArrowType.Right, ShadowType.None);

            HBox hb = new HBox (false, 0);
            hb.Spacing = 4;
            hb.PackStart (left, false, true, 0);
            hb.PackStart (vb, true, true, 0);
            hb.PackStart (right, false, true, 0);

            helplabel = new Label ("");
            helplabel.Xpad = 2;
            helplabel.Ypad = 2;
            helplabel.Xalign = 1;
            helplabel.UseMarkup = true;
            helplabel.Markup = "";

            helpbox = new VBox (false, 0);
            helpbox.PackStart (new HSeparator (), false, true, 0);
            helpbox.PackStart (helplabel, false, true, 0);

            VBox vb2 = new VBox (false, 0);
            vb2.Spacing = 4;
            vb2.PackStart (hb, true, true, 0);
            vb2.PackStart (helpbox, false, true, 0);

            Frame frame = new Frame ();
            frame.Add (vb2);

            this.Add (frame);
        }
예제 #32
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public TalkFrame(UserInfo userInfo)
        {
            // Initialize User Info
            this.userInfo = userInfo;

            // VPaned Position
            this.Position = 120;

            Gtk.Frame frame;

            // Output Text View
            this.talkView = new TalkView();

            // Output Scrolled Window
            this.scrolledWindowOut                  = new Gtk.ScrolledWindow(null, null);
            this.scrolledWindowOut.ShadowType       = Gtk.ShadowType.None;
            this.scrolledWindowOut.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            this.scrolledWindowOut.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            this.scrolledWindowOut.Add(this.talkView);

            // Output Frame
            frame            = new Gtk.Frame();
            frame.Shadow     = ShadowType.EtchedOut;
            frame.ShadowType = ShadowType.EtchedOut;
            frame.Add(this.scrolledWindowOut);
            this.Add1(frame);

            // Input Text View
            this.inputView = new Gtk.TextView();
            this.inputView.HeightRequest    = 25;
            this.inputView.KeyReleaseEvent += new KeyReleaseEventHandler(OnKeyReleaseEvent);

            // Input Scrolled Window
            this.scrolledWindowIn                  = new Gtk.ScrolledWindow(null, null);
            this.scrolledWindowIn.ShadowType       = Gtk.ShadowType.None;
            this.scrolledWindowIn.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            this.scrolledWindowIn.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            this.scrolledWindowIn.Add(this.inputView);

            // Input Frame
            frame            = new Gtk.Frame();
            frame.Shadow     = ShadowType.EtchedOut;
            frame.ShadowType = ShadowType.EtchedOut;
            frame.Add(this.scrolledWindowIn);
            this.Add2(frame);

            // Show All
            this.ShowAll();
        }
예제 #33
0
		public void CreateGui() 
		{
			dialog = new Dialog ();
			dialog.Title = "Login";
			dialog.BorderWidth = 3;
			dialog.VBox.BorderWidth = 5;
			dialog.HasSeparator = false;

			Frame frame = new Frame ("Connection");
			string image = Stock.DialogInfo;
			
			HBox hbox = new HBox (false, 2);
			hbox.BorderWidth = 5;
			hbox.PackStart (new Gtk.Image (image, IconSize.Dialog), true, true, 0);
		
			Table table = new Table (2, 3, false);
			hbox.PackStart (table);
			table.ColumnSpacing = 4;
			table.RowSpacing = 4;
			Label label = null;

			label = Label.NewWithMnemonic ("_Provider");
			table.Attach (label, 0, 1, 0, 1);
			providerOptionMenu = CreateProviderOptionMenu();
			table.Attach (providerOptionMenu, 1, 2, 0, 1);
			
			label = Label.NewWithMnemonic ("_Connection String");
			table.Attach (label, 0, 1, 1, 2);
			connection_entry = new Entry ();
			table.Attach (connection_entry, 1, 2, 1, 2);

			frame.Add (hbox);

			dialog.VBox.PackStart (frame, true, true, 0);

			Button button = null;
			button = new Button(Stock.Ok);
			button.Clicked += new EventHandler (Connect_Action);
			button.CanDefault = true;
			dialog.ActionArea.PackStart (button, true, true, 0);
			button.GrabDefault ();

			button = new Button(Stock.Cancel);
			button.Clicked += new EventHandler (Dialog_Cancel);
			dialog.ActionArea.PackStart (button, true, true, 0);
			dialog.Modal = true;

			dialog.ShowAll ();
		}
예제 #34
0
        public ImageGeneratorPanel()
            : base(3, 2, false)
        {
            presets = new List<ImageGenerator>(ImageGenerator.Samples.list());
            presetsNames = (from preset in presets select preset.Name).ToList();
            presetComboBox = new ComboBox(presetsNames.ToArray());
            presetComboBox.Changed += delegate
            {
                int active = presetComboBox.Active;
                if (active >= 0) {
                    Generator = presets[active];
                }
            };

            ColumnSpacing = RowSpacing = BorderWidth = 5;

            spotFunctionPanel = new SpotFunctionPanel();

            effectsLabel = new Label() { Xalign = 0.0f };

            Frame spotFunctionFrame = new Frame("Spot function")
            {
                BorderWidth = 5
            };
            spotFunctionFrame.Add(spotFunctionPanel);

            Attach(new Label("Preset:") { Xalign = 0.0f }, 0, 1, 0, 1,
                AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);
            Attach(presetComboBox, 1, 2, 0, 1,
                AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);

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

            Attach(new Label("Effects:") { Xalign = 0.0f },
                0, 2, 2, 3,
                AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);

            Attach(effectsLabel, 0, 2, 3, 4,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            ShowAll();
        }
예제 #35
0
		public DemoDialog () : base ("Dialogs")
		{
			BorderWidth = 8;

			Frame frame = new Frame ("Dialogs");
			Add (frame);

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

			// Standard message dialog
			HBox hbox = new HBox (false,8);
			vbox.PackStart (hbox, false, false, 0);
			Button button = new Button ("_Message Dialog");
			button.Clicked += new EventHandler (MessageDialogClicked);
			hbox.PackStart (button, false, false, 0);
			vbox.PackStart (new HSeparator(), false, false, 0);

			// Interactive dialog
			hbox = new HBox (false, 8);
			vbox.PackStart (hbox, false, false, 0);
			VBox vbox2 = new VBox (false, 0);

			button = new Button ("_Interactive Dialog");
			button.Clicked += new EventHandler (InteractiveDialogClicked);
			hbox.PackStart (vbox2, false, false, 0);
			vbox2.PackStart (button, false, false, 0);

			Table table = new Table (2, 2, false);
			table.RowSpacing = 4;
			table.ColumnSpacing = 4;
			hbox.PackStart (table, false, false, 0);

			Label label = new Label ("_Entry1");
			table.Attach (label, 0, 1, 0, 1);
			entry1 = new Entry ();
			table.Attach (entry1, 1, 2, 0, 1);
			label.MnemonicWidget = entry1;

			label = new Label ("E_ntry2");
			table.Attach (label,0,1,1,2);
			entry2 = new Entry ();
			table.Attach (entry2, 1, 2, 1, 2);
			label.MnemonicWidget = entry2;

			ShowAll ();
		}
예제 #36
0
        public EntryPopup () : base (Gtk.WindowType.Popup)
        {
            CanFocus = true;
            Resizable = false;
            TypeHint = Gdk.WindowTypeHint.Utility;
            Modal = true;

            Frame frame = new Frame ();
            frame.Shadow = ShadowType.EtchedIn;
            Add (frame);

            hbox = new HBox () { Spacing = 6 };
            text_entry = new Entry();
            hbox.PackStart (text_entry, true, true, 0);
            hbox.BorderWidth = 3;

            frame.Add (hbox);
            frame.ShowAll ();

            text_entry.Text = String.Empty;
            text_entry.CanFocus = true;

            //TODO figure out why this event does not get raised
            text_entry.FocusOutEvent += (o, a) => {
                if (hide_when_focus_lost) {
                    HidePopup ();
                }
            };

            text_entry.KeyReleaseEvent += delegate (object o, KeyReleaseEventArgs args) {
                if (args.Event.Key == Gdk.Key.Escape ||
                    args.Event.Key == Gdk.Key.Return ||
                    args.Event.Key == Gdk.Key.Tab) {

                    HidePopup ();
                }

                InitializeDelayedHide ();
            };

            text_entry.KeyPressEvent += (o, a) => OnKeyPressed (a);

            text_entry.Changed += (o, a) => {
                if (GdkWindow.IsVisible) {
                    OnChanged (a);
                }
            };
        }
예제 #37
0
		internal AspNetEditViewContent (IViewContent viewContent)
		{
			this.viewContent = viewContent;

			designerFrame = new Frame ();
			designerFrame.CanFocus = true;
			designerFrame.Shadow = ShadowType.Out;
			designerFrame.BorderWidth = 1;
			
			viewContent.WorkbenchWindow.Closing += new WorkbenchWindowEventHandler(workbenchWindowClosingHandler);
			
			outlineStore = null;
			outlineView = null;
			
			designerFrame.Show ();
		}
예제 #38
0
        public Dialog(VariableSet variables, LayoutSet layouts, 
		  Variable<Layout> layout, Variable<ProviderFactory> loader)
            : base("PicturePackage", variables)
        {
            _layout = layout;
              _loader = loader;

              layouts.Load();

              var hbox = new HBox(false, 12) {BorderWidth = 12};
              VBox.PackStart(hbox, true, true, 0);

              var vbox = new VBox(false, 12);
              hbox.PackStart(vbox, false, false, 0);

              _sf = new SourceFrame(loader);
              vbox.PackStart(_sf, false, false, 0);

              vbox.PackStart(new DocumentFrame(variables, layouts), false, false, 0);

              vbox.PackStart(new LabelFrame(variables), false, false, 0);

              var frame = new Frame();
              hbox.PackStart(frame, true, true, 0);

              var fbox = new VBox() {BorderWidth = 12};
              frame.Add(fbox);

              _preview = new Preview(this, variables)
            {
              WidthRequest = 400,
              HeightRequest = 500,
              TooltipText = _("Right click to select picture")
            };
              fbox.Add(_preview);

              _preview.ButtonPressEvent += PreviewClicked;
              _preview.DragDataReceived += OnDragDataReceived;

              layouts.Selected = layouts[0];
              _layout.Value = layouts[0];
              layouts.SelectEvent += SetLayout;

              DialogState = DialogStateType.SrcImgInvalid;

              loader.ValueChanged += delegate {RedrawPreview();};
        }
예제 #39
0
		static void Main ()
		{
			Application.Init ();
			window = new Window ("Gtk# Widget viewer");
			window.DeleteEvent += new DeleteEventHandler (Window_Delete);
			window.SetDefaultSize (250, 200);
			
			VBox box1 = new VBox (false, 0);
			window.Add (box1);
			
			box2 = new VBox (false, 5);
			box2.BorderWidth = 10;
			
			Frame frame = new Frame ("Select a widget");
			frame.BorderWidth = 5;
			frame.Add (box2);
			
			box1.PackStart (frame, true, true, 0);

			AddButton ("Bi-directional flipping", new EventHandler (Flipping));
			AddButton ("Check Buttons", new EventHandler (Check_Buttons));
			AddButton ("Color Selection", new EventHandler (Color_Selection));
			AddButton ("Combo Box", new EventHandler (Combo_Box));
			AddButton ("New Combo Box", new EventHandler (New_Combo_Box));
			AddButton ("Dialog", new EventHandler (Dialog));
			AddButton ("File Selection", new EventHandler (File_Selection));
			AddButton ("Menus", new EventHandler (Menus));
			AddButton ("Radio Buttons", new EventHandler (Radio_Buttons));
			AddButton ("Range Controls", new EventHandler (Range_Controls));
			AddButton ("Size Groups", new EventHandler (Size_Groups));
			AddButton ("Statusbar", new EventHandler (Statusbar));
			AddButton ("Toolbar", new EventHandler (Toolbar));
			
			box1.PackStart (new HSeparator (), false, false, 0);
			
			box2 = new VBox (false, 10);
			box2.BorderWidth = 10;
			box1.PackStart (box2, false, false, 0);

			Button close_button = new Button (Stock.Close);
			close_button.Clicked += new EventHandler (Close_Button);
			box2.PackStart (close_button, true, true, 0);

			window.ShowAll ();
			Application.Run ();
		}
예제 #40
0
		public DemoPanes () : base ("Panes")
		{
			VBox vbox = new VBox (false, 0);
			Add (vbox);

			VPaned vpaned = new VPaned ();
			vbox.PackStart (vpaned, true, true, 0);
			vpaned.BorderWidth = 5;

			HPaned hpaned = new HPaned ();
			vpaned.Add1 (hpaned);

		        Frame frame = new Frame ();
		        frame.ShadowType = ShadowType.In;
			frame.SetSizeRequest (60, 60);
			hpaned.Add1 (frame);

			Gtk.Button button = new Button ("_Hi there");
			frame.Add (button);

			frame = new Frame ();
			frame.ShadowType = ShadowType.In;
			frame.SetSizeRequest (80, 60);
			hpaned.Add2 (frame);

			frame = new Frame ();
			frame.ShadowType = ShadowType.In;
			frame.SetSizeRequest (60, 80);
			vpaned.Add2 (frame);

			// Now create toggle buttons to control sizing
			vbox.PackStart (CreatePaneOptions (hpaned,
							   "Horizontal",
							   "Left",
							   "Right"),
					false, false, 0);

			vbox.PackStart (CreatePaneOptions (vpaned,
							   "Vertical",
							   "Top",
							   "Bottom"),
					false, false, 0);

			ShowAll ();
		}
예제 #41
0
    public ImageFileFrame(FileInfo fileInfo)
        : base(fileInfo.Name)
    {
        string filename = String.Format("{0}/{1}", fileInfo.DirectoryName, fileInfo.Name);

        Pixbuf pixbuf = new Pixbuf(filename);

        pixbuf = pixbuf.ScaleSimple(64, 64, InterpType.Bilinear);

        Gtk.Frame inner_frame = new Gtk.Frame(String.Empty);

        Gtk.Image image = new Gtk.Image(pixbuf);

        inner_frame.Add(image);
        inner_frame.ShadowType  = ShadowType.In;
        inner_frame.BorderWidth = 10;
        this.Add(inner_frame);
        this.ShadowType = ShadowType.Out;
    }
        protected void ShowText(string markup)
        {
            Label label = new Label();

            label.Markup = markup;

            Frame padFrame = new Gtk.Frame();

            padFrame.Add(label);
            padFrame.BorderWidth = 10;
            padFrame.Shadow      = ShadowType.None;

            ScrolledWindow scrollW = new ScrolledWindow();

            scrollW.AddWithViewport(padFrame);
            scrollW.BorderWidth = 0;
            scrollW.ShadowType  = ShadowType.None;
            scrollW.ShowAll();
            DesignerWidget = scrollW;
        }
예제 #43
0
        // Constructor

        public WarpEditor(MainWindow main)
        {
            mainWindow = main;

            Gtk.Builder builder = new Builder();
            builder.AddFromString(Helper.ReadResourceFile("LynnaLab.Glade.WarpEditor.ui"));
            builder.Autoconnect(this);

            mainVBox               = (Gtk.Box)builder.GetObject("mainVBox");
            destInfoLabel          = (Gtk.Label)builder.GetObject("destInfoLabel");
            warpSourceTypeLabel    = (Gtk.Label)builder.GetObject("warpSourceTypeLabel");
            valueEditorContainer   = (Gtk.Container)builder.GetObject("valueEditorContainer");
            destEditorContainer    = (Gtk.Container)builder.GetObject("destEditorContainer");
            warpSourceBoxContainer = (Gtk.Container)builder.GetObject("warpSourceBoxContainer");
            warpSourceFrame        = (Gtk.Frame)builder.GetObject("warpSourceFrame");
            warpDestFrame          = (Gtk.Frame)builder.GetObject("warpDestFrame");
            infoBarHolder          = (Gtk.Box)builder.GetObject("infoBarHolder");

            base.Child = (Gtk.Widget)builder.GetObject("WarpEditor");

            infoBar = new InfoBar();
            infoBarHolder.Add(infoBar);
        }
예제 #44
0
        public DateEdit(System.DateTime time, DateEditFlags flags)
        {
            datetime          = new DateTimeZone(time);
            datetime.Changed += HandleDateTimeZoneChanged;
            this.flags        = flags;

            date_entry            = new Gtk.Entry();
            date_entry.WidthChars = 10;
            date_entry.Changed   += HandleDateEntryChanged;
            PackStart(date_entry, true, true, 0);

            Gtk.HBox b_box = new Gtk.HBox();
            b_box.PackStart(new Gtk.Label(Catalog.GetString("Calendar")), true, true, 0);
            b_box.PackStart(new Gtk.Arrow(Gtk.ArrowType.Down, Gtk.ShadowType.Out), true, false, 0);
            date_button          = new Gtk.Button(b_box);
            date_button.Clicked += HandleCalendarButtonClicked;
            PackStart(date_button, false, false, 0);

            calendar              = new Gtk.Calendar();
            calendar.DaySelected += HandleCalendarDaySelected;
            Gtk.Frame frame = new Gtk.Frame();
            frame.Add(calendar);
            cal_popup = new Gtk.Window(Gtk.WindowType.Popup);
            cal_popup.DestroyWithParent = true;
            cal_popup.Add(frame);
            cal_popup.Shown      += HandleCalendarPopupShown;
            cal_popup.GrabNotify += HandlePopupGrabNotify;
            frame.Show();
            calendar.Show();

            time_entry            = new Gtk.Entry();
            time_entry.WidthChars = 8;
            time_entry.Changed   += HandleTimeEntryChanged;
            PackStart(time_entry, true, true, 0);

            Gtk.CellRendererText timecell = new Gtk.CellRendererText();
            time_combo       = new Gtk.ComboBox();
            time_store       = new Gtk.TreeStore(typeof(string), typeof(int), typeof(int));
            time_combo.Model = time_store;
            time_combo.PackStart(timecell, true);
            time_combo.SetCellDataFunc(timecell, new CellLayoutDataFunc(TimeCellFunc));
            time_combo.Realized += FillTimeCombo;
            time_combo.Changed  += HandleTimeComboChanged;
            PackStart(time_combo, false, false, 0);

            zone_entry            = new Gtk.Entry();
            zone_entry.IsEditable = false;
            zone_entry.MaxLength  = 6;
            zone_entry.WidthChars = 6;
            PackStart(zone_entry, true, true, 0);

            Gtk.CellRendererText offsetcell = new Gtk.CellRendererText();
            offset_combo       = new Gtk.ComboBox();
            offset_combo.Model = new Gtk.TreeStore(typeof(string), typeof(int));
            offset_combo.PackStart(offsetcell, true);
            offset_combo.SetCellDataFunc(offsetcell, new CellLayoutDataFunc(OffsetCellFunc));
            FillOffsetCombo();
            offset_combo.Changed += HandleOffsetComboChanged;
            PackStart(offset_combo, false, false, 0);

            Update();
            ShowAll();
        }
예제 #45
0
        private void InitializeComponent()
        {
            quitButton         = new Gtk.Button();
            nextPlotButton     = new Gtk.Button();
            prevPlotButton     = new Gtk.Button();
            printButton        = new Gtk.Button();
            exampleNumberLabel = new Gtk.Label();

            // Create the two display panes for the samples
            plotWidget = new PlotWidget();
            infoBox    = new Gtk.TextView();

            quitButton.Name = "quitButton";
            //quitButton.TabIndex = 14;
            quitButton.Label    = "Close";
            quitButton.Clicked += new System.EventHandler(quitButton_Click);

            nextPlotButton.Name = "nextPlotButton";
            //nextPlotButton.TabIndex = 17;
            nextPlotButton.Label    = "Next";
            nextPlotButton.Clicked += new System.EventHandler(nextPlotButton_Click);

            printButton.Name = "printButton";
            //printButton.TabIndex = 9;
            printButton.Label    = "Print";
            printButton.Clicked += new System.EventHandler(printButton_Click);

            prevPlotButton.Name = "prevPlotButton";
            //prevPlotButton.TabIndex = 15;
            prevPlotButton.Label    = "Prev";
            prevPlotButton.Clicked += new System.EventHandler(prevPlotButton_Click);

            exampleNumberLabel.Name = "exampleNumberLabel";

            infoBox.Name = "infoBox";
            //infoBox.TabIndex = 18;

            SetSizeRequest(632, 520);
            //
            // Define 11x8 table on which to lay out the plot, test buttons, etc
            //
            layout             = new Gtk.Table(11, 8, true);
            layout.BorderWidth = 4;
            Add(layout);

            infoFrame            = new Frame();
            infoFrame.ShadowType = Gtk.ShadowType.In;
            infoFrame.Add(infoBox);

            AttachOptions opt = AttachOptions.Expand | AttachOptions.Fill;
            uint          xpad = 2, ypad = 10;

            layout.Attach(infoFrame, 0, 8, 9, 11);
            layout.Attach(plotWidget, 0, 8, 0, 8);
            layout.Attach(quitButton, 3, 4, 8, 9, opt, opt, xpad, ypad);
            layout.Attach(printButton, 2, 3, 8, 9, opt, opt, xpad, ypad);
            layout.Attach(prevPlotButton, 0, 1, 8, 9, opt, opt, xpad, ypad);
            layout.Attach(exampleNumberLabel, 4, 5, 8, 9);
            layout.Attach(nextPlotButton, 1, 2, 8, 9, opt, opt, xpad, ypad);
            Name = "PlotSurface Samples";
        }
예제 #46
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();
        }
예제 #47
0
        // TODO: pass in a label which it will update with the name from the combobox?
        public ComboBoxFromConstants(bool showHelp = true, bool vertical = false, bool showSpin = true)
        {
            this.Name = "LynnaLab.ComboBoxFromConstants";

            Gtk.Box box2 = new Gtk.HBox();
            box2.Spacing = 6;

            // Container child LynnaLab.ComboBoxFromConstants.Gtk.Container+ContainerChild
            if (vertical)
            {
                this.box1 = new Gtk.VBox();
            }
            else
            {
                this.box1 = new Gtk.HBox();
            }
            // Container child box1.Gtk.Box+BoxChild
            this.spinButton                          = new LynnaLab.SpinButtonHexadecimal();
            this.spinButton.CanFocus                 = true;
            this.spinButton.Name                     = "spinButton";
            this.spinButton.Adjustment.Upper         = 255D;
            this.spinButton.Adjustment.PageIncrement = 16D;
            this.spinButton.Adjustment.StepIncrement = 1D;
            this.spinButton.ClimbRate                = 1D;
            this.spinButton.Digits                   = 2;
            this.spinButton.Numeric                  = true;
            if (showSpin)
            {
                box2.Add(spinButton);
                box2.SetChildPacking(spinButton, expand: false, fill: false, padding: 0, pack_type: Gtk.PackType.Start);
                box1.Add(box2);
            }

            // Container child box1.Gtk.Box+BoxChild
            this.combobox1      = new Gtk.ComboBoxText();
            this.combobox1.Name = "combobox1";
            this.box1.Add(this.combobox1);
            box1.SetChildPacking(this.combobox1, false, false, 0, Gtk.PackType.Start);

            this.spinButton.ValueChanged += new System.EventHandler(this.OnSpinButtonValueChanged);
            this.combobox1.Changed       += new System.EventHandler(this.OnCombobox1Changed);

            if (showHelp)
            {
                // When clicking the "help" button, create a popup with documentation for
                // possible values. (It checks for a "@values" field in the documentation.)
                Gtk.Button helpButton = new Gtk.Button("?");
                helpButton.CanFocus = false;
                helpButton.Clicked += delegate(object sender, EventArgs e) {
                    if (DefaultDocumentation == null)
                    {
                        return;
                    }

                    DocumentationDialog d = new DocumentationDialog(DefaultDocumentation);
                    d.Run();
                    d.Dispose();
                };

                box2.PackStart(helpButton, false, false, 0);
            }

            Gtk.Frame frame = new Gtk.Frame();
            frame.Add(box1);
            this.Add(frame);
        }
예제 #48
0
 public void SetGtkFrame(Gtk.Frame myFrame)
 {
     this.myFrame = myFrame;
 }
예제 #49
0
        /// <summary>Crea las hojas de las opciones, la parte central
        /// del diálogo.</summary>
        /// <returns>El notebook de las opciones.</returns>

        private Gtk.Widget CrearNotebook()
        {
            Gtk.Notebook notebook = new Gtk.Notebook();
            notebook.BorderWidth = 10;

            // Panel de configuración del ensamblador.

            cbAdvertencias = new Gtk.CheckButton(
                Ventana.GetText("D_Conf_MostrarAdv"));

            Gtk.Frame frmEnsamblador =
                new Gtk.Frame(Ventana.GetText("D_Conf_Ensamblador"));
            VBox panelEnsamblador = new VBox(false, 5);

            panelEnsamblador.PackStart(cbAdvertencias);
            frmEnsamblador.Add(panelEnsamblador);

            // Panel de Memoria de control.

            rbMemoriaDef = new RadioButton(null,
                                           Ventana.GetText("D_Conf_MemDef"));
            rbMemoriaUsu = new RadioButton(rbMemoriaDef,
                                           Ventana.GetText("D_Conf_MemUsu"));

            rbMemoriaDef.Toggled   += new EventHandler(rbToggled1);
            rbMemoriaUsu.Toggled   += new EventHandler(rbToggled2);
            lblMemoriaAlt           = new Gtk.Entry("");
            lblMemoriaAlt.Sensitive = false;
            btnFichero          = new Gtk.Button(Ventana.GetText("D_Conf_Explorar"));
            btnFichero.Clicked += new EventHandler(btnFicheroClicked);

            Gtk.Frame frmMemoria =
                new Gtk.Frame(Ventana.GetText("D_Conf_Memoria"));
            VBox panelMemoria = new Gtk.VBox(false, 5);

            panelMemoria.PackStart(rbMemoriaDef);
            panelMemoria.PackStart(rbMemoriaUsu);
            panelMemoria.PackStart(lblMemoriaAlt);
            panelMemoria.PackStart(btnFichero);
            frmMemoria.Add(panelMemoria);


            // Panel del simulador.

            Gtk.Frame frmSimulador =
                new Gtk.Frame(Ventana.GetText("D_Conf_Simulador"));
            VBox panelSimulador = new VBox(false, 5);

            panelSimulador.PackStart(
                new Gtk.Label(Ventana.GetText("D_Conf_Tiempo")));

            sbTiempo = new Gtk.SpinButton(
                new Adjustment(1000.0, 50.0, 5000.0, 10.0, 100.0, 1.0),
                1.0,
                0);
            sbTiempo.Numeric = true;

            panelSimulador.PackStart(sbTiempo);
            frmSimulador.Add(panelSimulador);


            //  ----

            notebook.AppendPage(
                frmSimulador,
                new Gtk.Label(Ventana.GetText("D_Conf_Simulador")));

            notebook.AppendPage(
                frmEnsamblador,
                new Gtk.Label(Ventana.GetText("D_Conf_Ensamblador")));

            notebook.AppendPage(
                frmMemoria,
                new Gtk.Label(Ventana.GetText("D_Conf_Memoria")));

            return(notebook);
        }
예제 #50
0
        /// <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();
        }
예제 #51
0
        private void AddBackgroundsSelectionWidget()
        {
            Gtk.Frame fframe, gframe, hfframe;
            EventBox  febox, gebox, hfebox;
            HBox      fieldBox, halfFieldBox, goalBox;
            HBox      periodsBox;
            Button    periodsButton;

            fframe = new Gtk.Frame("<b>" + Catalog.GetString("Field background") + "</b>");
            (fframe.LabelWidget as Label).UseMarkup = true;
            fframe.ShadowType = ShadowType.None;
            hfframe           = new Gtk.Frame("<b>" + Catalog.GetString("Half field background") + "</b>");
            (hfframe.LabelWidget as Label).UseMarkup = true;
            hfframe.ShadowType = ShadowType.None;
            gframe             = new Gtk.Frame("<b>" + Catalog.GetString("Goal background") + "</b>");
            (gframe.LabelWidget as Label).UseMarkup = true;
            gframe.ShadowType = ShadowType.None;
            periodsFrame      = new Frame("<b>" + Catalog.GetString("Game periods") + "</b>");
            (periodsFrame.LabelWidget as Label).UseMarkup = true;
            periodsFrame.ShadowType = ShadowType.None;

            febox           = new EventBox();
            fieldBox        = new HBox();
            fReset          = new Button(Catalog.GetString("Reset"));
            fReset.Clicked += (sender, e) => {
                Template.FieldBackground = null;
                SetFieldImage(null);
            };
            febox.ButtonPressEvent += OnFieldImageClicked;
            fieldImage              = new Gtk.Image();
            SetFieldImage(null);

            hfebox           = new EventBox();
            halfFieldBox     = new HBox();
            hfReset          = new Button(Catalog.GetString("Reset"));
            hfReset.Clicked += (sender, e) => {
                Template.HalfFieldBackground = null;
                SetHalfFieldImage(null);
            };
            hfebox.ButtonPressEvent += OnHalfFieldImageClicked;
            halffieldImage           = new Gtk.Image();
            SetHalfFieldImage(null);

            gebox           = new EventBox();
            goalBox         = new HBox();
            gReset          = new Button(Catalog.GetString("Reset"));
            gReset.Clicked += (sender, e) => {
                Template.GoalBackground = null;
                SetGoalImage(null);
            };
            gebox.ButtonPressEvent += OnGoalImageClicked;
            goalImage = new Gtk.Image();
            SetGoalImage(null);

            periodsBox    = new HBox();
            periodsButton = new Button("gtk-edit");
            periodsLabel  = new Label();
            periodsBox.PackStart(periodsLabel);
            periodsBox.PackStart(periodsButton);
            periodsButton.Clicked += HandlePeriodsClicked;

            febox.Add(fieldImage);
            hfebox.Add(halffieldImage);
            gebox.Add(goalImage);

            fieldBox.PackStart(febox, true, true, 0);
            fieldBox.PackStart(fReset, false, false, 0);
            halfFieldBox.PackStart(hfebox, true, true, 0);
            halfFieldBox.PackStart(hfReset, false, false, 0);
            goalBox.PackStart(gebox, true, true, 0);
            goalBox.PackStart(gReset, false, false, 0);

            fframe.Add(fieldBox);
            hfframe.Add(halfFieldBox);
            gframe.Add(goalBox);
            periodsFrame.Add(periodsBox);

            box = new VBox();
            box.PackStart(fframe, false, false, 0);
            box.PackStart(hfframe, false, false, 0);
            box.PackStart(gframe, false, false, 0);
            box.PackStart(periodsFrame, false, false, 0);
            box.ShowAll();
            box.Sensitive = false;
            AddUpperWidget(box);
        }
        /// <summary>
        /// Required designer variable.
        /// </summary>
        //private System.ComponentModel.IContainer components = null;

        /*
         * /// <summary>
         * /// Clean up any resources being used.
         * /// </summary>
         * /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
         * protected override void Dispose(bool disposing)
         * {
         *      if (disposing && (components != null))
         *      {
         *              components.Dispose();
         *      }
         *      base.Dispose();
         * }
         */
        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginWindow));

            this.checkBox2 = new Gtk.CheckButton();
            this.checkBox1 = new Gtk.CheckButton();

            this.cancelButton = new Gtk.Button();
            this.loginButton  = new Gtk.Button();


            //
            // checkBox2
            //
            this.checkBox2.Active = true;
            this.checkBox2.Name   = "checkBox2";
            this.checkBox2.Label  = "Graphical Menu";
            this.checkBox2.Xalign = 0;

            //
            // checkBox1
            //
            this.checkBox1.Active = false;
            this.checkBox1.Name   = "checkBox1";
            this.checkBox1.Label  = "Don\'t save password";
            this.checkBox1.Xalign = 0;

            /*
             * //
             * // nickname_label
             * //
             * this.nickname_label.Name = "nickname_label";
             * this.nickname_label.Xalign = 0;
             * this.nickname_label.SetSizeRequest(73, 23);
             * this.nickname_label.Text = "Nickname:";
             *
             * //
             * // nickname
             * //
             * this.nickname.Name = "nickname";
             * this.nickname.Text = "Guest";
             */

            //
            // button1
            //
            this.cancelButton.SetSizeRequest(80, 25);
            this.cancelButton.Label    = "Cancel";
            this.cancelButton.Clicked += new System.EventHandler(this.Close);

            //
            // refreshButton
            //
            this.refreshButton      = new Gtk.Button();
            this.refreshButton.Name = "refreshButton";
            this.refreshButton.SetSizeRequest(80, 25);
            this.refreshButton.Label    = "Refresh";
            this.refreshButton.Clicked += new System.EventHandler(this.refreshButton_Click);

            //
            // LoginButton
            //
            this.loginButton.Name = "LoginButton";
            this.loginButton.SetSizeRequest(80, 25);
            this.loginButton.Label    = "Connect";
            this.loginButton.Clicked += new System.EventHandler(this.loginButton_Click);

            /*
             * //
             * // port
             * //
             * this.port.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(123)))), ((int)(((byte)(76)))));
             * this.port.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             * this.port.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(184)))), ((int)(((byte)(142)))));
             * this.port.Location = new System.Drawing.Point(215, 101);
             * this.port.Margin = new System.Windows.Forms.Padding(0);
             * this.port.MaximumSize = new System.Drawing.Size(50, 25);
             * this.port.Name = "port";
             * this.port.Size = new System.Drawing.Size(50, 21);
             * this.port.TabIndex = 9;
             * this.port.Text = "14922";
             * this.port.TextChanged += new System.EventHandler(this.port_TextChanged);
             * //
             * // port_label
             * //
             * this.port_label.AutoSize = true;
             * this.port_label.BackColor = System.Drawing.Color.Transparent;
             * this.port_label.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(52)))), ((int)(((byte)(16)))));
             * this.port_label.Location = new System.Drawing.Point(183, 101);
             * this.port_label.Name = "port_label";
             * this.port_label.Size = new System.Drawing.Size(29, 15);
             * this.port_label.TabIndex = 8;
             * this.port_label.Text = "Port";
             * //
             * // server
             * //
             * this.server.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(155)))), ((int)(((byte)(123)))), ((int)(((byte)(76)))));
             * this.server.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             * this.server.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(184)))), ((int)(((byte)(142)))));
             * this.server.Location = new System.Drawing.Point(27, 119);
             * this.server.Name = "server";
             * this.server.Size = new System.Drawing.Size(170, 21);
             * this.server.TabIndex = 7;
             * this.server.Text = "listserver.graalonline.com";
             * //
             * // server_label
             * //
             * this.server_label.AutoSize = true;
             * this.server_label.BackColor = System.Drawing.Color.Transparent;
             * this.server_label.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(52)))), ((int)(((byte)(16)))));
             * this.server_label.Location = new System.Drawing.Point(36, 94);
             * this.server_label.Name = "server_label";
             * this.server_label.Size = new System.Drawing.Size(42, 15);
             * this.server_label.TabIndex = 6;
             * this.server_label.Text = "Server";
             * this.server_label.Click += new System.EventHandler(this.server_label_Click);
             *
             */

            //
            // ServerWindow
            //
            Table table  = new Table(2, 1, false);
            Table table2 = new Table(1, 2, false);

            table2.RowSpacing = 1;
            Label spacer = new Label();

            spacer.SetSizeRequest(10, 1);
            table2.Attach(spacer, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 5, 1);

            //table2.Attach(this.nickname_label, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 5, 1);
            this.logText = new Gtk.Entry();
            this.logText.SetSizeRequest(230, 230);
            this.tree = new Gtk.NodeView();

            this.tree.SetSizeRequest(230, 230);

            this.musicListStore = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(int));
            //this.tree.Selection.Changed += new System.EventHandler(OnSelectionChanged);

            this.tree.CursorChanged    += new System.EventHandler(OnSelectionChanged);
            this.tree.ButtonPressEvent += new ButtonPressEventHandler(delegate(object o, ButtonPressEventArgs args)
            {
                System.Console.WriteLine(args.ToString());
            });
            Gtk.CellRendererPixbuf pixbufrender = new Gtk.CellRendererPixbuf();
            TreeViewColumn         TypeCol      = this.tree.AppendColumn("", new Gtk.CellRendererPixbuf(), "pixbuf", 0);

            TypeCol.SortIndicator = true;
            TypeCol.SortColumnId  = 0;
            Gtk.CellRendererPixbuf cellpb = new Gtk.CellRendererPixbuf();
            Gtk.CellRendererText   cell   = new Gtk.CellRendererText();
            TypeCol.PackStart(cellpb, false);
            TypeCol.PackStart(cell, false);

            TreeViewColumn NameCol = this.tree.AppendColumn("Name", new Gtk.CellRendererText(), "text", 1);

            NameCol.SortIndicator = true;
            NameCol.SortColumnId  = 1;
            TreeViewColumn PCCol = this.tree.AppendColumn("Players", new Gtk.CellRendererText(), "text", 2);

            PCCol.SortIndicator = true;
            PCCol.SortColumnId  = 2;

            this.tree.FixedHeightMode  = false;
            this.tree.HeadersClickable = true;
            this.tree.SearchColumn     = 1;
            this.tree.EnableSearch     = true;
            this.tree.EnableTreeLines  = true;
            this.tree.ShowExpanders    = true;
            //this.tree.Vadjustment.
            musicListStore.AppendValues("", "Loading...", "");

            Gtk.Frame frame2 = new Gtk.Frame();
            this.tree.Model = musicListStore;

            this.GtkScrolledWindow            = new global::Gtk.ScrolledWindow();
            this.GtkScrolledWindow.Name       = "GtkScrolledWindow";
            this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));

            // Container child GtkScrolledWindow.Gtk.Container+ContainerChild

            this.GtkScrolledWindow.Add(this.tree);
            frame2.Add(this.GtkScrolledWindow);
            table2.Attach(this.logText, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 5, 1);
            table2.Attach(frame2, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 5, 1);


            HBox hbox = new HBox(true, 5);

            table.BorderWidth = 0;
            table.SetSizeRequest(100, 100);
            Frame frame = new Frame();

            frame.Label = " Servers ";
            //frame.Add(new Label());
            frame.Add(table2);
            table.Attach(frame, 0, 1, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 5, 5);

            hbox.Add(this.cancelButton);
            hbox.Add(this.refreshButton);
            hbox.Add(this.loginButton);

            Alignment halign = new Alignment(1, 0, 0, 0);

            halign.Add(hbox);
            table.Attach(halign, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 5, 5);
            this.Add(table);

            this.SetSizeRequest(520, 350);

            this.DoubleBuffered = true;

            this.Icon = global::Gdk.Pixbuf.LoadFromResource("OpenGraal.GraalIM.Resources.rcicon.ico");

            this.Name = "ServerWindow";
            this.SetPosition(Gtk.WindowPosition.Center);
            this.Title        = "Graal Servers";
            this.DeleteEvent += ServerWindow_Closed;
            this.Hidden      += ServerWindow_hide;
        }
예제 #53
0
        void ReloadObjectBoxes()
        {
            objectBoxDict.Clear();
            objectBoxContainer.Foreach((c) => c.Dispose());

            Gtk.Grid grid = new Gtk.Grid();
            grid.ColumnSpacing = 6;
            grid.RowSpacing    = 6;

            int left = 0, top = 0;

            foreach (ObjectGroup group in topObjectGroup.GetAllGroups())
            {
                var objectBox = new ObjectBox(group);

                Gtk.Box box = new Gtk.HBox();

                objectBox.AddTileSelectedHandler(delegate(object sender, int index) {
                    if (!disableBoxCallback)
                    {
                        SelectObject(objectBox.ObjectGroup, index);
                    }
                });

                objectBox.Halign = Gtk.Align.Center;
                objectBoxDict.Add(group, objectBox);

                Gtk.Frame frame = new Gtk.Frame();
                frame.Label  = GetGroupName(group);
                frame.Halign = Gtk.Align.Center;
                frame.Add(objectBox);

                if (group.GetGroupType() == ObjectGroupType.Shared)
                {
                    box.Add(frame);
                    Gtk.Button button = new Button(new Gtk.Image(Stock.Remove, IconSize.Button));
                    button.Halign = Gtk.Align.Center;
                    button.Valign = Gtk.Align.Center;

                    button.Clicked += (sender, args) => {
                        if (selectedObjectGroup == group)
                        {
                            selectedObjectGroup = null;
                            activeObject        = null;
                            selectedIndex       = -1;
                        }
                        topObjectGroup.RemoveGroup(group);
                        ReloadObjectBoxes();
                    };

                    box.Add(button);
                }
                else
                {
                    box.Add(frame);
                }
                grid.Attach(box, left, top, 1, 1);
                left++;
                if (left == 2)
                {
                    left = 0;
                    top++;
                }
            }

            objectBoxContainer.Add(grid);
            SelectObject(TopObjectGroup, -1);
            this.ShowAll();
        }
예제 #54
0
        private Gtk.VBox GenerateResults()

        {
            VBox box = new VBox();

            Gdk.Color white = new Gdk.Color(255, 255, 255);

            Gdk.Color black = new Gdk.Color(0, 0, 0);

            Gdk.Color blue = new Gdk.Color(0, 0, 255);



            // Match Colors

            btnMatchForeColor = new ColorButton(blue);

            btnMatchBackColor = new ColorButton(white);

            btnMatchForeColor.ColorSet += new EventHandler(btnMatchForeColor_ColorSet);

            btnMatchBackColor.ColorSet += new EventHandler(btnMatchBackColor_ColorSet);



            Frame matchFrame = new Frame("Results Match");

            matchFrame.BorderWidth = 5;

            HBox frameBox = new HBox();

            frameBox.BorderWidth = 5;



            HBox foreBox = new HBox(false, 3);

            btnMatchForeColor.WidthRequest = 100;

            foreBox.PackStart(new Label("Fore Color"), false, false, 3);

            foreBox.PackStart(btnMatchForeColor, false, true, 3);



            HBox backBox = new HBox(false, 3);

            btnMatchBackColor.WidthRequest = 100;

            backBox.PackStart(new Label("Back Color"), false, false, 3);

            backBox.PackStart(btnMatchBackColor, false, true, 3);



            frameBox.PackStart(foreBox, true, true, 5);

            frameBox.PackStart(backBox, true, true, 5);

            matchFrame.Add(frameBox);



            // Window Colors

            btnResultsForeColor = new ColorButton(black);

            btnResultsBackColor = new ColorButton(white);

            btnResultsForeColor.ColorSet += new EventHandler(btnResultsForeColor_ColorSet);

            btnResultsBackColor.ColorSet += new EventHandler(btnResultsBackColor_ColorSet);



            Frame resultsFrame = new Frame("Results Window");

            resultsFrame.BorderWidth = 5;

            frameBox = new HBox();

            frameBox.BorderWidth = 5;



            foreBox = new HBox(false, 3);

            btnResultsForeColor.WidthRequest = 100;

            foreBox.PackStart(new Label("Fore Color"), false, false, 3);

            foreBox.PackStart(btnResultsForeColor, false, true, 3);



            backBox = new HBox(false, 3);

            btnResultsBackColor.WidthRequest = 100;

            backBox.PackStart(new Label("Back Color"), false, false, 3);

            backBox.PackStart(btnResultsBackColor, false, true, 3);



            frameBox.PackStart(foreBox, true, true, 5);

            frameBox.PackStart(backBox, true, true, 5);

            resultsFrame.Add(frameBox);



            // Results display

            Frame results = new Frame("Results Preview");

            results.BorderWidth = 5;

            Frame ScrolledWindowFrm = new Gtk.Frame();

            ScrolledWindowFrm.Shadow = ShadowType.In;

            ScrolledWindowFrm.BorderWidth = 5;

            txtResults = new TextView();

            txtResults.Buffer.Text = "(21)  Example results line and, match, displayed";
            txtResults.Editable    = false;

            ScrolledWindowFrm.HeightRequest = 50;

            ScrolledWindowFrm.Add(txtResults);

            results.Add(ScrolledWindowFrm);



            box.PackStart(matchFrame, false, true, 3);

            box.PackStart(resultsFrame, false, true, 3);

            box.PackEnd(results, false, true, 3);

            return(box);
        }