コード例 #1
0
        public Spec(InvoiceSpec ispec, Table table, uint row)
        {
            description = new Entry();
            number = new Entry();
            price = new Entry();
            total = new Entry();

            number.Changed += new EventHandler(UpdateTotal);
            price.Changed += new EventHandler(UpdateTotal);
            total.Changed += new EventHandler(TotalChanged);

            number.SetUsize(NumberEntryWidth, -2);
            price.SetUsize(NumberEntryWidth, -2);
            total.SetUsize(NumberEntryWidth, -2);
            description.SetUsize(300, -2);

            table.Attach(description, 0, 1, row, row+1,
                         AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
            table.Attach(number, 1, 2, row, row+1, 0, 0, 0, 0);
            table.Attach(price,  2, 3, row, row+1, 0, 0, 0, 0);
            table.Attach(total,  3, 4, row, row+1, 0, 0, 0, 0);

            description.Text =  ispec.beskrivning;
            if (ispec.antal.Length > 0)				  number.Text = ispec.antal;
            price.Text = ispec.styckpris;
            total.Text = ispec.belopp;
        }
コード例 #2
0
        /// <summary>
        /// Replaces Windows Form Designer code
        /// </summary>
        private void InitializeComponent()
        {
            SetSizeRequest(192, 240);           // Define MenuForm size
            //
            // Define an 8x6 table on which to lay out the test buttons, etc
            //
            Gtk.Table layout = new Gtk.Table(8, 6, true);
            layout.BorderWidth   = 8;
            layout.ColumnSpacing = 2;
            layout.RowSpacing    = 2;
            Add(layout);

            // Create menu components, then add to layout
            //
            // DemosLabel
            //
            demosLabel = new Gtk.Label("Demos");
            layout.Attach(demosLabel, 0, 2, 0, 1);
            //
            // plotSurface2DDemoButton
            //
            plotSurface2DDemoButton          = new Gtk.Button("PlotSurface2D Demo");
            plotSurface2DDemoButton.Clicked += new System.EventHandler(this.plotSurface2DDemoButton_Click);
            layout.Attach(plotSurface2DDemoButton, 0, 6, 1, 2);
            //
            // multiPlotDemoButton
            //
            multiPlotDemoButton          = new Gtk.Button("Multi Plot Demo");
            multiPlotDemoButton.Clicked += new System.EventHandler(this.runDemoButton_Click);
            layout.Attach(multiPlotDemoButton, 0, 6, 2, 3);
            //
            // testsLabel
            //
            testsLabel = new Gtk.Label("Tests");
            layout.Attach(testsLabel, 0, 2, 3, 4);
            //
            // TestSelectComboBox
            //
            //
            TestSelectComboBox = ComboBox.NewText();
            TestSelectComboBox.AppendText("Axis Test");
            TestSelectComboBox.AppendText("PlotSurface2D");
            layout.Attach(TestSelectComboBox, 0, 6, 4, 5);
            //
            // RunTestButton
            //
            RunTestButton          = new Gtk.Button("Run Selected Test");
            RunTestButton.Clicked += new System.EventHandler(this.RunTestButton_Click);
            layout.Attach(RunTestButton, 0, 6, 5, 6);
            //
            // quitButton
            //
            quitButton          = new Gtk.Button("Quit");
            quitButton.Clicked += new System.EventHandler(this.quitButton_Click);
            layout.Attach(quitButton, 2, 4, 7, 8, 0, 0, 0, 0);
            //
            // Gtk.Window events
            //
            this.Destroyed += new EventHandler(MenuForm_Destroyed);
        }
コード例 #3
0
ファイル: FileConditionsPanel.cs プロジェクト: moscrif/ide
        public FileConditionsWidget(FilePropertisData fcd)
        {
            this.Build();
            project = fcd.Project;
            filepath = fcd.Filename;

            fi_old = project.FilesProperty.Find(x => x.SystemFilePath == filepath);

            conditionRules = new List<ConditionRule>();
            conditionRules_Old = new List<ConditionRule>();

            if (fi_old != null)
            if (fi_old.ConditionValues != null)
                conditionRules_Old = fi_old.ConditionValues;

            int rowCount = project.ConditoinsDefine.Count;
            //Table tableSystem = new Table((uint)(2),(uint)2,false);
            Table table = new Table((uint)(rowCount + 3),(uint)2,false);

            GenerateContent(ref table, MainClass.Settings.Platform.Name, 1, MainClass.Settings.Platform,false);//tableSystem
            GenerateContent(ref table, MainClass.Settings.Resolution.Name, 2,MainClass.Settings.Resolution,true); //project.Resolution);//tableSystem
            int i = 3;//1;

            foreach (Condition cd in project.ConditoinsDefine) {

                GenerateContent(ref table, cd.Name, i, cd,false);

                i++;
            }
            vbox2.PackEnd(table, true, true, 0);
            this.ShowAll();
        }
コード例 #4
0
        /// <summary>
        /// Creates a Gtk.Widget that's used to configure the service.  This
        /// will be used in the Synchronization Preferences.  Preferences should
        /// not automatically be saved by a GConf Property Editor.  Preferences
        /// should be saved when SaveConfiguration () is called.
        /// </summary>
        public override Gtk.Widget CreatePreferencesControl()
        {
            Gtk.Table table = new Gtk.Table(1, 2, false);
            table.RowSpacing    = 5;
            table.ColumnSpacing = 10;

            // Read settings out of gconf
            string syncPath;

            if (GetConfigSettings(out syncPath) == false)
            {
                syncPath = string.Empty;
            }

            Label l = new Label(Catalog.GetString("_Folder Path:"));

            l.Xalign = 1;
            table.Attach(l, 0, 1, 0, 1,
                         Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         0, 0);

            pathButton = new FileChooserButton(Catalog.GetString("Select Synchronization Folder..."),
                                               FileChooserAction.SelectFolder);
            l.MnemonicWidget = pathButton;
            pathButton.SetFilename(syncPath);

            table.Attach(pathButton, 1, 2, 0, 1,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         0, 0);

            table.ShowAll();
            return(table);
        }
コード例 #5
0
        public void Refresh(Rekening[] rekeningen)
        {
            if (table != null)
            {
                Remove(table);
            }

            // Bereken afmetingen van de tabel
            int aantalRekeningen = rekeningen.Length;
            uint columns = (uint)Math.Ceiling(Math.Sqrt((double)aantalRekeningen));
            uint rows = (uint)Math.Floor(Math.Sqrt((double)aantalRekeningen));
            table = new Table(rows, columns, true);

            uint index = 0;
            foreach(var rekening in rekeningen)
            {
                RekeningWidget rekeningWidget = new RekeningWidget(rekening);
                rekeningWidget.Clicked += handleRekeningWidgetClicked;

                // Bereken rekening widget posities
                uint thisColumn = index % columns;
                uint thisRow = (index - thisColumn) / columns;
                table.Attach(rekeningWidget, thisColumn, thisColumn + 1, thisRow, thisRow + 1);

                index++;
            }

            Add(table);
        }
コード例 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Scrabble.GUI.Info"/> class.
        /// </summary>
        /// <param name='g'>
        /// G.
        /// </param>
        public Info(Game.Game g)
        {
            this.Label       = "Score";
            this.BorderWidth = 5;
            this.game        = g;

            this.HeightRequest = 99;
            this.WidthRequest  = 120;

            scoresTable = new Gtk.Table(6, 2, true);
            scoreValues = new Gtk.Label[6 * 2];
            for (int i = 0; i < this.game.players.Length; i++)
            {
                scoreValues[i]     = new Label(game.players[i].Name);
                scoreValues[i + 6] = new Label("0");
                scoresTable.Attach(scoreValues[i], 0, 1, (uint)i, (uint)i + 1);
                scoresTable.Attach(scoreValues[i + 6], 1, 2, (uint)i, (uint)i + 1);
            }
            for (int i = this.game.players.Length; i < 6; i++)
            {
                scoreValues[i]     = new Label( );
                scoreValues[i + 6] = new Label( );
                scoresTable.Attach(scoreValues[i], 0, 1, (uint)i, (uint)i + 1);
                scoresTable.Attach(scoreValues[i + 6], 1, 2, (uint)i, (uint)i + 1);
            }
            scoresTable.BorderWidth = 3;
            this.Add(scoresTable);

            this.ShowAll();
        }
コード例 #7
0
        public MatrixThresholdFilterDialog(
            MatrixThresholdFilter existingModule)
            : base(existingModule)
        {
            module = modifiedModule as MatrixThresholdFilter;
            if (module == null) {
                modifiedModule = new MatrixThresholdFilter();
                module = modifiedModule as MatrixThresholdFilter;
            }

            matrixPanel = new ThresholdMatrixPanel(
                (uint)module.Matrix.Height,
                (uint)module.Matrix.Width);
            matrixPanel.Matrix = module.Matrix.DefinitionMatrix;
            matrixPanel.Scaled = !module.Matrix.Incremental;

            table = new Table(2, 1, false)
                { ColumnSpacing = 5, RowSpacing = 5, BorderWidth = 5 };
            table.Attach(new Label("Threshold matrix:") { Xalign = 0.0f },
                0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink,
                0, 0);
            table.Attach(matrixPanel, 0, 1, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand, 0, 0);
            table.ShowAll();
            VBox.PackStart(table);
        }
コード例 #8
0
ファイル: Tile.cs プロジェクト: haugjan/banshee-hacks
        public Tile ()
        {
            Table table = new Table (2, 2, false);
            table.ColumnSpacing = 6;
            table.RowSpacing = 2;
            table.BorderWidth = 2;

            PrimaryLabel = new Label ();
            SecondaryLabel = new Label ();

            table.Attach (image, 0, 1, 0, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            table.Attach (PrimaryLabel, 1, 2, 0, 1,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);
            table.Attach (SecondaryLabel, 1, 2, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            table.ShowAll ();
            Add (table);

            PrimaryLabel.Xalign = 0.0f;
            PrimaryLabel.Yalign = 0.0f;

            SecondaryLabel.Xalign = 0.0f;
            SecondaryLabel.Yalign = 0.0f;

            StyleSet += delegate {
                PrimaryLabel.ModifyFg (StateType.Normal, Style.Text (StateType.Normal));
                SecondaryLabel.ModifyFg (StateType.Normal, Hyena.Gui.GtkUtilities.ColorBlend (
                    Style.Foreground (StateType.Normal), Style.Background (StateType.Normal)));
            };

            Relief = ReliefStyle.None;
        }
コード例 #9
0
        public VectorErrorFilterDialog(VectorErrorFilter existingModule)
            : base(existingModule)
        {
            module = modifiedModule as VectorErrorFilter;
            if (module == null) {
                modifiedModule = new VectorErrorFilter();
                module = modifiedModule as VectorErrorFilter;
            }

            vectorPanel = new ErrorVectorPanel((uint)module.Matrix.Width);
            vectorPanel.BareMatrix = module.Matrix.DefinitionMatrix;
            vectorPanel.Divisor = module.Matrix.Divisor;
            vectorPanel.UseCustomDivisor = false;
            vectorPanel.SourceOffsetX = module.Matrix.SourceOffsetX;

            table = new Table(2, 1, false)
                { ColumnSpacing = 5, RowSpacing = 5, BorderWidth = 5 };
            table.Attach(new Label("Error vector:") { Xalign = 0.0f },
                0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            table.Attach(vectorPanel, 0, 1, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand, 0, 0);
            table.ShowAll();
            VBox.PackStart(table);
        }
コード例 #10
0
		public HeightMapSizeDialog( DoneCallback source )
		{
            this.source = source;

			window = new Window ("Heightmap width and height:");
			window.SetDefaultSize (200, 100);

            Table table = new Table( 3, 2, false );
            table.BorderWidth = 20;
            table.RowSpacing = 20;
            table.ColumnSpacing = 20;
            window.Add(table);

            table.Attach(new Label("Width:"), 0, 1, 0, 1);
            table.Attach(new Label("Height:"), 0, 1, 1, 2);

            widthcombo = new Combo();
            widthcombo.PopdownStrings = new string[]{"4","8","12","16","20","24","28","32"};
            table.Attach(widthcombo, 1, 2, 0, 1);

            heightcombo = new Combo();
            heightcombo.PopdownStrings = new string[]{"4","8","12","16","20","24","28","32"};
            table.Attach(heightcombo, 1, 2, 1, 2);

			Button button = new Button (Stock.Ok);
			button.Clicked += new EventHandler (OnOkClicked);
			button.CanDefault = true;
			
            table.Attach(button, 1, 2, 2, 3);

            window.Modal = true;
            window.ShowAll();
		}
コード例 #11
0
ファイル: MyWidget.cs プロジェクト: nerea123/ad
 public void separaFilas(Table tabla,int espacio)
 {
     int row=(int)tabla.NRows;
         for(int i=0;i<row;i++){
         tabla.SetRowSpacing((uint)i,(uint)espacio);
         }
 }
コード例 #12
0
        private void AddTabAndSlidersFor(Type t)
        {
            Table table = new Table(1,1,false);
            notebook.AppendPage(table, new Label(t.Name));
            uint fieldCount = 0;
            foreach (var field in t.GetFields()) {
                if (field.FieldType == typeof(float) &&
                    field.IsPublic && field.IsStatic) {
                    HScale hscale = new HScale(0, 1, 0.01);
                    hscale.Digits = 2;
                    foreach (var attribute in field.GetCustomAttributes(false)) {
                        if (attribute is RangeAttribute) {
                            var range = (RangeAttribute)attribute;
                            hscale.Adjustment.Upper = range.m_max;
                            hscale.Adjustment.Lower = range.m_min;
                            hscale.Digits = range.m_places;
                            break;
                        }
                    }
                    hscale.Value = (float)field.GetValue(null);
                    var localField = field;
                    hscale.ValueChanged += (obj, args) => {
                        localField.SetValue(null, (float)hscale.Value);
                    };

                    table.Resize(fieldCount+1, 2);
                    Label label = new Label(field.Name);
                    table.Attach(label , 0, 1, fieldCount, fieldCount+1);
                    table.Attach(hscale, 1, 2, fieldCount, fieldCount+1);
                    table.Homogeneous = false;
                    table.ShowAll();
                    fieldCount++;
                }
            }
        }
コード例 #13
0
		Widget CreateEntry (Table table, string text, bool password)
		{
			var lab = new Label (text);
			lab.Xalign = 0;
			table.Attach (lab, 0, 1, r, r + 1);
			var tc = (Table.TableChild)table [lab];
			tc.XOptions = AttachOptions.Shrink;

			var e = new Entry ();
			Widget editor = e;
			e.ActivatesDefault = true;
			if (password)
				e.Visibility = false;

			e.Changed += delegate {
				if (password) {
					if (upcred != null)
						upcred.Password = e.Text ?? "";
					else
						sshcred.Passphrase = e.Text ?? "";
				} else {
					if (upcred != null)
						upcred.Username = e.Text;
				}
			};

			if (editor != null) {
				table.Attach (editor, 1, 2, r, r + 1);
				tc = (Table.TableChild)table [lab];
				tc.XOptions = AttachOptions.Fill;
			}
			r++;
			return editor;
		}
コード例 #14
0
        public CodeCompilationPanel()
        {
            InitializeComponent();
            vbox = new VBox();
            var hboxTmp = new HBox();
            hboxTmp.PackStart (codeGenerationLabel, false, false, 0);
            vbox.PackStart (hboxTmp, false, false, 12);

            hboxTmp = new HBox();
            var tableOutputOptions = new Table (4, 2, false);
            tableOutputOptions.Attach (outputLabel, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tableOutputOptions.Attach (outputAssembly, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 3);
            tableOutputOptions.Attach (labelOutputDir, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tableOutputOptions.Attach (outputDirectory, 1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand , AttachOptions.Fill, 0, 3);
            tableOutputOptions.Attach (labelCompileTarget, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tableOutputOptions.Attach (compileTargetCombo, 1, 2, 2, 3, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 3);
            tableOutputOptions.Attach (labelCulture, 0, 1, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tableOutputOptions.Attach (culture, 1, 2, 3, 4, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 3);
            hboxTmp.PackStart (tableOutputOptions, true, true, 6);
            vbox.PackStart (hboxTmp, false, false, 0);

            hboxTmp = new HBox ();
            hboxTmp.PackStart (labelWarnings, false, false, 0);
            vbox.PackStart (hboxTmp, false, false, 12);
            hboxTmp = new HBox();
            hboxTmp.PackStart (checkDebug, false, false, 6);
            vbox.PackStart (hboxTmp, false, false, 0);
            hboxTmp = new HBox();
            hboxTmp.PackStart (checkDucky, false, false, 6);
            vbox.PackStart (hboxTmp, false, false, 0);

            vbox.ShowAll ();
        }
コード例 #15
0
ファイル: DebugView.cs プロジェクト: dlbeer/olishell
        public DebugView(Settings set, DebugManager mgr)
        {
            debugManager = mgr;
            layout = new Table(2, 2, false);
            runStop = new Button("Interrupt");
            command = new Entry();
            log = new ConsoleLog(set);

            command.Activated += OnCommand;
            runStop.Clicked += OnRunStop;

            layout.Attach(log.View, 0, 2, 0, 1,
              AttachOptions.Fill,
              AttachOptions.Expand | AttachOptions.Fill,
              4, 4);
            layout.Attach(command, 0, 1, 1, 2,
              AttachOptions.Fill | AttachOptions.Expand,
              AttachOptions.Fill,
              4, 4);
            layout.Attach(runStop, 1, 2, 1, 2,
              AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            runStop.SetSizeRequest(80, -1);

            command.Sensitive = false;
            runStop.Sensitive = false;

            mgr.MessageReceived += OnDebugOutput;
            mgr.DebuggerBusy += OnBusy;
            mgr.DebuggerReady += OnReady;
            mgr.DebuggerStarted += OnStarted;
            mgr.DebuggerExited += OnExited;
            layout.Destroyed += OnDestroy;
        }
コード例 #16
0
		public CredentialsDialog (string uri, SupportedCredentialTypes type, Credentials cred)
		{
			this.Build ();

			this.UseNativeContextMenus ();

			labelTop1.Text = string.Format (labelTop1.Text, uri);

			var table = new Table (0, 0, false);
			table.ColumnSpacing = 6;
			vbox.PackStart (table, true, true, 0);

			Widget firstEditor = null;
			switch (type) {
			case SupportedCredentialTypes.UsernamePassword:
				upcred = (UsernamePasswordCredentials)cred;
				firstEditor = CreateEntry (table, "Username:"******"Password:"******"Passphrase:", true);
				break;
			}
			table.ShowAll ();
			Focus = firstEditor;
			Default = buttonOk;
		}
コード例 #17
0
ファイル: LoginDialog.cs プロジェクト: sergi/Wakame
        void BuildDialogUI()
        {
            // Add an HBox to the dialog's VBox.
              HBox hbox = new HBox (false, 8);
              hbox.BorderWidth = 8;
              this.VBox.PackStart (hbox, false, false, 0);

              // Add an Image widget to the HBox using a stock 'info' icon.
              Image stock = new Image (Stock.DialogInfo, IconSize.Dialog);
              hbox.PackStart (stock, false, false, 0);

              // Here we are using a Table to contain the other widgets.
              // Notice that the Table is added to the hBox.
              Table table = new Table (2, 2, false);
              table.RowSpacing = 4;
              table.ColumnSpacing = 4;
              hbox.PackStart (table, true, true, 0);

              Label label = new Label ("_Username");
              table.Attach (label, 0, 1, 0, 1);
              table.Attach (usernameEntry, 1, 2, 0, 1);
              label.MnemonicWidget = usernameEntry;

              label = new Label ("_Password");
              table.Attach (label, 0, 1, 1, 2);
              table.Attach (passwordEntry , 1, 2, 1, 2);
              label.MnemonicWidget = passwordEntry ;
              hbox.ShowAll ();

              // Add OK and Cancel Buttons.
              this.AddButton(Stock.Ok, ResponseType.Ok);
              this.AddButton(Stock.Cancel, ResponseType.Cancel);
        }
コード例 #18
0
        /// <summary>Crea una instancia de la clase.</summary>

        public PanelMemoria() : base(false, 0)
        {
            VBox vb = new VBox(false, 0);

            Gtk.Table tabla = new Gtk.Table(MemoriaPrincipal.TAMANO, 5, true);
            for (short i = 0; i < MemoriaPrincipal.TAMANO; i++)
            {
                direcciones[i] =
                    new Gtk.Label(Conversiones.ToHexString(i));
                contenido[i] =
                    new Gtk.Label(Conversiones.ToHexString((short)0));

                tabla.Attach(direcciones[i], 1, 2, (uint)i, (uint)i + 1);
                tabla.Attach(contenido[i], 3, 4, (uint)i, (uint)i + 1);
            }
            vb.PackStart(tabla);
            ScrolledWindow sw = new ScrolledWindow();

            sw.AddWithViewport(vb);

            Gtk.Table t2 = new Gtk.Table(4, 1, true);
            t2.Attach(new Gtk.Label(Ventana.GetText("PMem_Contenido")),
                      0, 1, 0, 1);
            t2.Attach(sw, 0, 1, 1, 3);
            t2.Attach(new Gtk.Label(""), 0, 1, 3, 4);

            this.PackStart(t2);
        }
コード例 #19
0
ファイル: ImageBrowserGtk.cs プロジェクト: retahc/old-code
    static void Main(string [] args)
    {
        Application.Init();

        if (args.Length <= 0)
        {
            Console.WriteLine("\nUSAGE: ImageBrowser.exe <directory>\n");
            return;
        }

        string dir = args [0];

        Gtk.Window         window = new Gtk.Window("Image Browser");
        Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow(new Adjustment(IntPtr.Zero), new Adjustment(IntPtr.Zero));

        ArrayList images = GetItemsFromDirectory(dir);

        Gtk.Table table = PopulateTable(images);

        window.Title = String.Format("{0}: {1} ({2} images)", window.Title, dir, images.Count);
        window.SetDefaultSize(300, 200);
        window.DeleteEvent += Window_Delete;
        scroll.AddWithViewport(table);
        scroll.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
        window.Add(scroll);
        window.ShowAll();
        Application.Run();
    }
コード例 #20
0
ファイル: Summa.Gui.TagWindow.cs プロジェクト: wfarr/newskit
        public TagWindow()
            : base(WindowType.Toplevel)
        {
            Tags = new ArrayList();

            Title = "Manage your tags";
            BorderWidth = 5;
            DeleteEvent += OnClose;
            Resizable = false;

            vbox = new VBox();
            vbox.Spacing = 6;
            Add(vbox);

            table = new Table(2, 2, false);
            table.RowSpacing = 6;
            vbox.PackStart(table, false, false, 0);

            bbox = new HButtonBox();
            bbox.Layout = ButtonBoxStyle.End;

            AddTagsCombobox();
            AddFeedTreeView();
            AddButtons();
            vbox.PackStart(bbox, false, false, 0);

            Database.FeedChanged += OnFeedChanged;
        }
コード例 #21
0
ファイル: info.cs プロジェクト: Kedrigern/scrabble
        /// <summary>
        /// Initializes a new instance of the <see cref="Scrabble.GUI.Info"/> class.
        /// </summary>
        /// <param name='g'>
        /// G.
        /// </param>
        public Info(Game.Game g)
        {
            this.Label = "Score";
            this.BorderWidth = 5;
            this.game = g;

            this.HeightRequest = 99;
            this.WidthRequest = 120;

            scoresTable = new Gtk.Table( 6, 2, true );
            scoreValues = new Gtk.Label[ 6*2 ];
            for( int i=0; i < this.game.players.Length; i++) {
                scoreValues[ i ] = new Label( game.players[i].Name );
                scoreValues[ i+6 ] = new Label( "0" );
                scoresTable.Attach( scoreValues[i], 0 , 1, (uint) i, (uint) i+1);
                scoresTable.Attach( scoreValues[i+6] , 1, 2, (uint) i, (uint) i+1 );
            }
            for( int i=this.game.players.Length; i < 6; i++) {
                scoreValues[ i ] = new Label( );
                scoreValues[ i+6 ] = new Label( );
                scoresTable.Attach( scoreValues[i], 0 , 1, (uint) i, (uint) i+1);
                scoresTable.Attach( scoreValues[i+6] , 1, 2, (uint) i, (uint) i+1 );
            }
            scoresTable.BorderWidth = 3;
            this.Add( scoresTable );

            this.ShowAll();
        }
コード例 #22
0
		/// <summary>
		/// Creates a Gtk.Widget that's used to configure the service.  This
		/// will be used in the Synchronization Preferences.  Preferences should
		/// not automatically be saved by a GConf Property Editor.  Preferences
		/// should be saved when SaveConfiguration () is called.
		/// </summary>
		public override Gtk.Widget CreatePreferencesControl (EventHandler requiredPrefChanged)
		{
			Gtk.Table table = new Gtk.Table (1, 2, false);
			table.RowSpacing = 5;
			table.ColumnSpacing = 10;

			// Read settings out of gconf
			string syncPath;
			if (GetConfigSettings (out syncPath) == false)
				syncPath = string.Empty;

			Label l = new Label (Catalog.GetString ("_Folder Path:"));
			l.Xalign = 1;
			table.Attach (l, 0, 1, 0, 1,
			              Gtk.AttachOptions.Fill,
			              Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
			              0, 0);

			pathButton = new FileChooserButton (Catalog.GetString ("Select Synchronization Folder..."),
			                                    FileChooserAction.SelectFolder);
			pathButton.CurrentFolderChanged += requiredPrefChanged;
			l.MnemonicWidget = pathButton;
			pathButton.SetFilename (syncPath);

			table.Attach (pathButton, 1, 2, 0, 1,
			              Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
			              Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
			              0, 0);

			table.ShowAll ();
			return table;
		}
コード例 #23
0
        public AddNodeDialog(SimulatorInterface simulatorInterface)
        {
            this.Build ();
            this.simulatorInterface = simulatorInterface;
            ScrolledWindow sw = new ScrolledWindow ();
            sw.ShadowType = ShadowType.EtchedIn;
            sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
            sw.HeightRequest = 250;

            VBox.PackStart (sw, true, true, 0);
            Table table = new Table ((uint)(BasicNode.NodeLabels.Length), 2, true);
            sw.AddWithViewport (table);
            for (int i = 0; i < BasicNode.NodeLabels.Length; i++)
            {
                labels.Add (new Label (BasicNode.NodeLabels[i]));
                table.Attach (labels[i], 0, 1, (uint)(i), (uint)(i) + 1);
                entries.Add (new SpinButton (0, 80, 1));
                entries[i].ClimbRate = 1;
                entries[i].Numeric = true;
                table.Attach (entries[i], 1, 2, (uint)(i), (uint)(i) + 1);
            }
            buttonOk.Clicked += new EventHandler (AddNode);
            buttonCancel.Clicked += new EventHandler (Cancel);
            this.SetDefaultSize (340, 300);
            this.Modal = true;
            this.ShowAll ();
        }
コード例 #24
0
        /// <summary>
        /// Creates a Gtk.Widget that's used to configure the service.  This
        /// will be used in the Synchronization Preferences.  Preferences should
        /// not automatically be saved by a GConf Property Editor.  Preferences
        /// should be saved when SaveConfiguration () is called.
        /// </summary>
        public override Gtk.Widget CreatePreferencesControl(EventHandler requiredPrefChanged)
        {
            Gtk.Table table = new Gtk.Table(3, 2, false);
            table.RowSpacing    = 5;
            table.ColumnSpacing = 10;

            // Read settings out of gconf
            string server, folder, username;
            int    port;

            GetConfigSettings(out server, out folder, out username, out port);
            if (server == null)
            {
                server = string.Empty;
            }
            if (port > -1 && port != 22)
            {
                server += ":" + port.ToString();
            }
            if (folder == null)
            {
                folder = string.Empty;
            }
            if (username == null)
            {
                username = string.Empty;
            }

            serverEntry          = new Entry();
            serverEntry.Text     = server;
            serverEntry.Changed += requiredPrefChanged;
            AddRow(table, serverEntry, Catalog.GetString("Se_rver:"), 0);

            usernameEntry      = new Entry();
            usernameEntry.Text = username;
            AddRow(table, usernameEntry, Catalog.GetString("User_name:"), 1);

            folderEntry      = new Entry();
            folderEntry.Text = folder;
            AddRow(table, folderEntry, Catalog.GetString("_Folder Path (optional):"), 2);

            // Text for label describing setup required for SSH sync addin to work
            string sshInfo = Catalog.GetString("SSH synchronization requires an existing SSH key for this " +
                                               "server and user, added to a running SSH daemon.");
            Label l = new Label();

            l.UseMarkup = true;
            l.Markup    = string.Format("<span size=\"small\">{0}</span>",
                                        sshInfo);
            l.Wrap = true;

            VBox vbox = new VBox(false, 5);

            vbox.PackStart(table);
            vbox.PackStart(l);
            vbox.ShowAll();

            return(vbox);
        }
コード例 #25
0
        /// <summary>
        /// server gui stuff:
        /// server path
        /// server username + password
        /// check server ssl certificate yes/no
        /// </summary>
        /// <param name="insertTo"></param>
        /// <param name="defaultSpacing"></param>
        void SetupGuiServerRelated(Gtk.Box insertTo, int defaultSpacing)
        {
            Gtk.Table customBox = new Gtk.Table(3, 2, false);

            // somehow you can't change the default spacing or set it for all rows
            for (int i = 0; i < 3; i++)
            {
                customBox.SetRowSpacing((uint)i, (uint)defaultSpacing);
            }

            // insert the labels
            customBox.Attach(new Gtk.Label(Catalog.GetString("Server path:")), 0, 1, 0, 1);
            customBox.Attach(new Gtk.Label(Catalog.GetString("Username:"******"Password:"******"SaveConfiguration" is called
            //IPropertyEditor serverEditor = Services.Factory.CreatePropertyEditorEntry(
            //	AddinPreferences.SYNC_PRIVATENOTES_SERVERPATH, server_path);
            //serverEditor.Setup();

            server_user = new Gtk.Entry();
            customBox.Attach(server_user, 1, 2, 1, 2);
            string serverUser = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERUSER) as String;

            server_user.Text = serverUser;
            // NO EDITOR! because we only save when "SaveConfiguration" is called
            //IPropertyEditor userEditor = Services.Factory.CreatePropertyEditorEntry(
            // AddinPreferences.SYNC_PRIVATENOTES_SERVERUSER, server_user);
            //userEditor.Setup();

            server_pass = new Gtk.Entry();
            server_pass.InvisibleChar = '*';
            server_pass.Visibility    = false;
            customBox.Attach(server_pass, 1, 2, 2, 3);
            string serverpass = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERPASS) as String;

            server_pass.Text = serverpass;
            // NO EDITOR! because we only save when "SaveConfiguration" is called
            //IPropertyEditor passEditor = Services.Factory.CreatePropertyEditorEntry(
            // AddinPreferences.SYNC_PRIVATENOTES_SERVERPASS, server_pass);
            //passEditor.Setup();

            check_ssl = new Gtk.CheckButton(Catalog.GetString("Check servers SSL certificate"));
            insertTo.PackStart(check_ssl);

            // set up check-ssl certificate stuff
            object value = Preferences.Get(AddinPreferences.SYNC_PRIVATENOTES_SERVERCHECKSSLCERT);

            if (value == null || value.Equals(true))
            {
                check_ssl.Active = true;
            }
        }
コード例 #26
0
ファイル: ArrayButton.cs プロジェクト: pepe81/edcs
        public ArrayButton()
        {
            this.Build ();
            table = new Table((uint)rows,(uint)colums, true);
            Add(table);

            refresh();
        }
コード例 #27
0
 private void CrearBotonCartaEnTabla(Gtk.Table tabla,
                                     uint filaInicio,
                                     uint filaFin,
                                     uint columnaInicio,
                                     uint columnaFin
                                     )
 {
 }
コード例 #28
0
ファイル: PreferencesDialog.cs プロジェクト: dlbeer/olishell
        public PreferencesDialog(Settings set, Window parent,
				 string argsOver)
        {
            settings = set;
            argsOverride = argsOver;

            dialog = new Dialog("Preferences", parent,
            DialogFlags.Modal | DialogFlags.DestroyWithParent,
            new object[]{Gtk.Stock.Close, -1});

            var table = new Table(4, 3, false);

            sUseBundledDebugger = new CheckButton("Use bundled MSPDebug");
            sUseBundledDebugger.Clicked += OnBundledState;
            table.Attach(sUseBundledDebugger, 0, 3, 0, 1,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            Label lbl;

            lbl = new Label("MSPDebug path:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 1, 2, AttachOptions.Fill, 0, 4, 4);
            sMSPDebugPath = new Entry();
            table.Attach(sMSPDebugPath, 1, 2, 1, 2,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);
            chooseMSPDebug = new Button("Choose...");
            chooseMSPDebug.Clicked += OnChoose;
            table.Attach(chooseMSPDebug, 2, 3, 1, 2,
             AttachOptions.Fill, 0, 4, 4);

            lbl = new Label("MSPDebug arguments:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 2, 3, AttachOptions.Fill, 0, 4, 4);
            sMSPDebugArgs = new Entry();
            sMSPDebugArgs.Sensitive = (argsOverride == null);
            table.Attach(sMSPDebugArgs, 1, 3, 2, 3,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            lbl = new Label("Console font:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 3, 4, AttachOptions.Fill, 0, 4, 4);
            sConsoleFont = new FontButton();
            table.Attach(sConsoleFont, 1, 3, 3, 4,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            table.ShowAll();
            ((Container)dialog.Child).Add(table);

            chooseDialog = new FileChooserDialog("Choose MSPDebug binary",
            dialog, FileChooserAction.Open,
            new object[]{Stock.Cancel, ResponseType.Cancel,
                 Stock.Ok, ResponseType.Ok});
            chooseDialog.DefaultResponse = ResponseType.Ok;
        }
コード例 #29
0
        public override bool GetPreferenceTabWidget(PreferencesDialog parent,
                                                    out string tabLabel,
                                                    out Gtk.Widget preferenceWidget)
        {
            Gtk.Label      label;
            Gtk.SpinButton menuNoteCountSpinner;
            Gtk.Alignment  align;
            int            menuNoteCount;

            // Addin's tab caption
            tabLabel = Catalog.GetString("Advanced");

            Gtk.VBox opts_list = new Gtk.VBox(false, 12);
            opts_list.BorderWidth = 12;
            opts_list.Show();

            align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 1.0f);
            align.Show();
            opts_list.PackStart(align, false, false, 0);

            Gtk.Table table = new Gtk.Table(1, 2, false);
            table.ColumnSpacing = 6;
            table.RowSpacing    = 6;
            table.Show();
            align.Add(table);


            // Menu Note Count option
            label = new Gtk.Label(Catalog.GetString("Minimum number of notes to show in Recent list (maximum 18)"));

            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();

            table.Attach(label, 0, 1, 0, 1);

            menuNoteCount = (int)Preferences.Get(Preferences.MENU_NOTE_COUNT);
            // we have a hard limit of 18 set, thus not allowing anything bigger than 18
            menuNoteCountSpinner       = new Gtk.SpinButton(1, 18, 1);
            menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;

            menuNoteCountSpinner.Show();
            table.Attach(menuNoteCountSpinner, 1, 2, 0, 1);

            menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;

            if (opts_list != null)
            {
                preferenceWidget = opts_list;
                return(true);
            }
            else
            {
                preferenceWidget = null;
                return(false);
            }
        }
コード例 #30
0
		private void BuildInterface() {
			string category = null;
			
			uint count = 0;
			
			foreach (EffectMember i in this.mMembers) {
				if (i.Category != category) {
					category = i.Category;
					count++;
				}
				
				count++;
			}
			
			category = null;
			
			Table table = new Table(count, 2, false);
			
			uint row = 0;
			
			foreach (EffectMember i in this.mMembers) {
				Label l;
				
				if (i.Category != category) {
					category = i.Category;
					
					l = new Label();
					l.Markup = "<b>" + category + "</b>";
					l.Show();
					
					table.Attach(l, 0, 2, row, ++row,
					             AttachOptions.Expand | AttachOptions.Fill,
					             AttachOptions.Shrink, 5, 5);
				}
				
				l = new Label(i.DisplayName);
				l.Show();
				table.Attach(l, 0, 1, row, row + 1, AttachOptions.Fill,
				             AttachOptions.Shrink, 5, 5);
				
				MemberEditor editor = MemberEditor.Create(this.mEffect, i.Item);
				editor.Show();
				
				editor.MadeClean += this.OnEditorMadeClean;
				editor.MadeDirty += this.OnEditorMadeDirty;
				editor.Applied += this.OnEditorApplied;
				this.mEditors.Add(editor);
				
				if (!string.IsNullOrEmpty(i.Description))
					editor.TooltipText = i.Description;
				
				table.Attach(editor, 1, 2, row, ++row,
				             editor.XAttachment, editor.YAttachment, 5, 5);
			}
			
			this.SheetPane.AddWithViewport(table);
			table.Show();
		}
コード例 #31
0
		public CredentialsDialog (URIish uri, IEnumerable<CredentialItem> credentials)
		{
			this.Build ();
			this.credentials = credentials;
			
			labelTop.Text = string.Format (labelTop.Text, uri.ToString ());
			
			Gtk.Table table = new Gtk.Table (0, 0, false);
			table.ColumnSpacing = 6;
			vbox.PackStart (table, true, true, 0);
			
			uint r = 0;
			Widget firstEditor = null;
			foreach (CredentialItem c in credentials) {
				Label lab = new Label (c.GetPromptText () + ":");
				lab.Xalign = 0;
				table.Attach (lab, 0, 1, r, r + 1);
				Table.TableChild tc = (Table.TableChild) table [lab];
				tc.XOptions = AttachOptions.Shrink;
				
				Widget editor = null;
				
				if (c is CredentialItem.YesNoType) {
					CredentialItem.YesNoType cred = (CredentialItem.YesNoType) c;
					CheckButton btn = new CheckButton ();
					editor = btn;
					btn.Toggled += delegate {
						cred.SetValue (btn.Active);
					};
				}
				else if (c is CredentialItem.StringType || c is CredentialItem.CharArrayType) {
					CredentialItem cred = c;
					Entry e = new Entry ();
					editor = e;
					e.ActivatesDefault = true;
					if (cred.IsValueSecure ())
						e.Visibility = false;
					e.Changed += delegate {
						if (cred is CredentialItem.StringType)
							((CredentialItem.StringType)cred).SetValue (e.Text);
						else
							((CredentialItem.CharArrayType)cred).SetValue (e.Text.ToCharArray ());
					};
				}
				if (editor != null) {
					table.Attach (editor, 1, 2, r, r + 1);
					tc = (Table.TableChild) table [lab];
					tc.XOptions = AttachOptions.Fill;
					if (firstEditor == null)
						firstEditor = editor;
				}
				
				r++;
			}
			table.ShowAll ();
			Focus = firstEditor;
			Default = buttonOk;
		}
コード例 #32
0
        public void AttachToTable(Table t, uint row, uint maxCols)
        {
            if(maxCols < 3)
                throw new ArgumentOutOfRangeException("maxCols", "The minimum number of columns required is 3.");

            t.Attach(Low, 0, 1, row, row + 1, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 2, 6);
            t.Attach(Label, 1, maxCols - 1, row, row + 1, AttachOptions.Fill, AttachOptions.Fill | AttachOptions.Expand, 2, 6);
            t.Attach(High, maxCols - 1, maxCols, row, row + 1, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 2, 6);
        }
コード例 #33
0
ファイル: FolderView.cs プロジェクト: hol353/ApsimX
 public FolderView(ViewBase owner)
     : base(owner)
 {
     scroller = new ScrolledWindow();
     scroller.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
     table = new Table(1, 1, false);
     scroller.AddWithViewport(table);
     _mainWidget = scroller;
 }
コード例 #34
0
		public override bool GetPreferenceTabWidget (	PreferencesDialog parent,
								out string tabLabel,
								out Gtk.Widget preferenceWidget)
		{
			
			Gtk.Label label;
			Gtk.SpinButton menuNoteCountSpinner;
			Gtk.Alignment align;
			int menuNoteCount;

			// Addin's tab caption
			tabLabel = Catalog.GetString ("Advanced");
			
			Gtk.VBox opts_list = new Gtk.VBox (false, 12);
			opts_list.BorderWidth = 12;
			opts_list.Show ();
			
			align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 1.0f);
			align.Show ();
			opts_list.PackStart (align, false, false, 0);

			Gtk.Table table = new Gtk.Table (1, 2, false);
			table.ColumnSpacing = 6;
			table.RowSpacing = 6;
			table.Show ();
			align.Add (table);


			// Menu Note Count option
			label = new Gtk.Label (Catalog.GetString ("Minimum number of notes to show in Recent list (maximum 18)"));

			label.UseMarkup = true;
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.Show ();
			
			table.Attach (label, 0, 1, 0, 1);
		
			menuNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT);
			// we have a hard limit of 18 set, thus not allowing anything bigger than 18
			menuNoteCountSpinner = new Gtk.SpinButton (1, 18, 1);
			menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;
			
			menuNoteCountSpinner.Show ();
			table.Attach (menuNoteCountSpinner, 1, 2, 0, 1);
			
			menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;
			
			if (opts_list != null) {
				preferenceWidget = opts_list;
				return true;
			} else {
				preferenceWidget = null;
				return false;
			}
		}
コード例 #35
0
ファイル: DirPropertyWidget.cs プロジェクト: moscrif/ide
        private void AddControl(ref Table tbl, int top, Widget ctrl, string label)
        {
            Label lbl = new Label(label);
            lbl.Xalign = 1;
            lbl.Yalign = 0.5F;
            lbl.WidthRequest = 100;

            tbl.Attach(lbl,0,1,(uint)top,(uint)(top+1),AttachOptions.Shrink,AttachOptions.Shrink,2,2);
            tbl.Attach(ctrl,1,2,(uint)top,(uint)(top+1),AttachOptions.Fill|AttachOptions.Expand,AttachOptions.Fill,2,2);
        }
コード例 #36
0
        public MessageDialog(ArrayList list)
            : base(WindowType.Toplevel)
        {
            Title = "Error";
            IconName = "dialog-error";

            DeleteEvent += OnClose;

            Resizable = false;
            BorderWidth = 6;

            vbox = new VBox(false, 6);
            Add(vbox);
            hbox = new HBox(false, 6);

            vbox.PackStart(hbox);

            image = new Image(Stock.DialogError, IconSize.Dialog);
            hbox.PackStart(image);

            table = new Table(2, 3, false);
            table.RowSpacing = 6;
            hbox.PackEnd(table);

            label = new Label();
            label.Markup = "<big><b>Some feeds failed to import</b></big>";
            table.Attach(label, 1, 2, 0, 1);

            buffer = new TextBuffer(new TextTagTable());
            foreach ( string feed in list ) {
                buffer.Text = buffer.Text + feed+"\n";;
            }

            textview = new TextView(buffer);
            textview.Editable = false;
            textview.WrapMode = WrapMode.Word;
            textview.SetSizeRequest(400, 150);

            textviewsw = new ScrolledWindow(new Adjustment(0, 0, 0, 0, 0, 0), new Adjustment(0, 0, 0, 0, 0, 0));
            textviewsw.ShadowType = ShadowType.In;
            textviewsw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            textviewsw.Add(textview);
            table.Attach(textviewsw, 1, 2, 1, 2);

            bbox = new HButtonBox();
            bbox.Layout = ButtonBoxStyle.End;
            bbox.Spacing = 6;
            vbox.PackEnd(bbox);

            close_button = new Button(Stock.Close);
            close_button.Clicked += new EventHandler(OnClose);
            bbox.PackStart(close_button);

            TransientFor = (Browser)Summa.Core.Application.Browsers[0];
        }
コード例 #37
0
ファイル: Sharpener.cs プロジェクト: f-spot/f-spot-xplat
        protected override void BuildUI()
        {
            base.BuildUI();

            string title = Strings.Sharpen;

            dialog = new Gtk.Dialog(title, (Gtk.Window) this, DialogFlags.DestroyWithParent, new object[0])
            {
                BorderWidth = 12
            };
            dialog.VBox.Spacing = 6;

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

            table.Attach(SetFancyStyle(new Gtk.Label(Strings.AmountColon)), 0, 1, 0, 1);
            table.Attach(SetFancyStyle(new Gtk.Label(Strings.RadiusColon)), 0, 1, 1, 2);
            table.Attach(SetFancyStyle(new Gtk.Label(Strings.ThresholdColon)), 0, 1, 2, 3);

            SetFancyStyle(amount_spin    = new Gtk.SpinButton(0.00, 100.0, .01));
            SetFancyStyle(radius_spin    = new Gtk.SpinButton(1.0, 50.0, .01));
            SetFancyStyle(threshold_spin = new Gtk.SpinButton(0.0, 50.0, .01));
            amount_spin.Value            = .5;
            radius_spin.Value            = 5;
            threshold_spin.Value         = 0.0;

            amount_spin.ValueChanged    += HandleSettingsChanged;
            radius_spin.ValueChanged    += HandleSettingsChanged;
            threshold_spin.ValueChanged += HandleSettingsChanged;

            table.Attach(amount_spin, 1, 2, 0, 1);
            table.Attach(radius_spin, 1, 2, 1, 2);
            table.Attach(threshold_spin, 1, 2, 2, 3);

            var cancel_button = new Gtk.Button(Gtk.Stock.Cancel);

            cancel_button.Clicked += HandleCancelClicked;
            dialog.AddActionWidget(cancel_button, Gtk.ResponseType.Cancel);

            var ok_button = new Gtk.Button(Gtk.Stock.Ok);

            ok_button.Clicked += HandleOkClicked;
            dialog.AddActionWidget(ok_button, Gtk.ResponseType.Cancel);

            dialog.DeleteEvent += HandleCancelClicked;

            Destroyed += HandleLoupeDestroyed;

            table.ShowAll();
            dialog.VBox.PackStart(table);
            dialog.ShowAll();
        }
コード例 #38
0
		/// <summary>Default constructor.</summary>
		/// <param name="UnderlyingGallery">The underlying gallery.</param>
		public GalleryPopupWindow (Gallery UnderlyingGallery) : base (WindowType.Popup)
		{
			this.underlyingGallery = UnderlyingGallery;
			this.tiles = new List<Tile> ();
			this.mapping = new Dictionary<Tile, Tile> ();
			foreach(Tile t in UnderlyingGallery.Tiles)
			{
				Tile copy = t.Copy ();
				tiles.Add (copy);
				
				if(t == UnderlyingGallery.SelectedTile)
				{
					copy.Selected = true;
					selectedTile = t;
				}
				
				mapping.Add (copy, t);
			}
			
			int width = UnderlyingGallery.Allocation.Width;
			
			columns = (uint)(width / underlyingGallery.TileWidth);
			rows = (uint)Math.Ceiling ((double)tiles.Count / columns);
			
			this.tileTable = new Table (rows, columns, true);
			this.tileTable.HeightRequest = (int)rows * UnderlyingGallery.TileHeight;
			this.tileTable.WidthRequest = (int)columns * UnderlyingGallery.TileWidth;
			
			Viewport vp = new Viewport ();
			vp.Child = tileTable;
			
			this.internalWindow = new ScrolledWindow ();
			this.internalWindow.Child = vp;
			this.internalWindow.HeightRequest = Math.Min (this.tileTable.HeightRequest, MAX_HEIGHT) + SCROLLBAR_SIZE;
			this.internalWindow.WidthRequest = this.tileTable.WidthRequest + SCROLLBAR_SIZE;
			
			uint x = 0, y = 0;
			foreach(Tile t in tiles)
			{
				ExtraEventBox box = new ExtraEventBox ();
				box.AddEvents ((int)(Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask));
				box.Child = t;
				
				tileTable.Attach (box, x, x+1, y, y+1);
				t.Clicked += tile_Clicked;
				
				if(++x == columns)
				{
					x = 0;
					++y;
				}
			}
			
			this.Child = internalWindow;
		}
コード例 #39
0
ファイル: CategoriaListView.cs プロジェクト: nerea123/ad
 private void creaVentana()
 {
     window=new Window("Editar categoria");
     window.SetDefaultSize (300, 100);
     window.SetPosition(WindowPosition.Center);
     VBox vbox=new VBox();
     tabla=new Table(2,2,false);
     separaFilas(tabla,10);
     vbox.PackStart(tabla,false,false,0);
     window.Add(vbox);
 }
コード例 #40
0
        public RecommendationPane()
        {
            Visible = false;

            EventBox event_box = new EventBox ();
            event_box.ModifyBg(StateType.Normal, new Gdk.Color(0xff,0xff,0xff));

            main_box = new HBox ();
            main_box.BorderWidth = 5;

            similar_box = new VBox (false, 3);
            tracks_box = new VBox (false, 3);
            albums_box = new VBox (false, 3);

            Label similar_header = new Label ();
            similar_header.Xalign = 0;
            similar_header.Ellipsize = Pango.EllipsizeMode.End;
            similar_header.Markup = String.Format ("<b>{0}</b>", Catalog.GetString ("Recommended Artists"));
            similar_box.PackStart (similar_header, false, false, 0);

            tracks_header = new Label ();
            tracks_header.Xalign = 0;
            tracks_header.WidthChars = 25;
            tracks_header.Ellipsize = Pango.EllipsizeMode.End;
            tracks_box.PackStart (tracks_header, false, false, 0);

            albums_header = new Label ();
            albums_header.Xalign = 0;
            albums_header.WidthChars = 25;
            albums_header.Ellipsize = Pango.EllipsizeMode.End;
            albums_box.PackStart (albums_header, false, false, 0);

            similar_items_table = new Table (DEFAULT_SIMILAR_TABLE_ROWS, DEFAULT_SIMILAR_TABLE_COLS, false);
            similar_items_table.SizeAllocated += OnSizeAllocated;
            similar_box.PackEnd (similar_items_table, true, true, 0);

            tracks_items_box = new VBox (false, 0);
            tracks_box.PackEnd (tracks_items_box, true, true, 0);

            albums_items_box = new VBox (false, 0);
            albums_box.PackEnd (albums_items_box, true, true, 0);

            main_box.PackStart (similar_box, true, true, 5);
            main_box.PackStart (new VSeparator (), false, false, 0);
            main_box.PackStart (tracks_box, false, false, 5);
            main_box.PackStart (new VSeparator (), false, false, 0);
            main_box.PackStart (albums_box, false, false, 5);

            event_box.Add (main_box);
            Add (event_box);

            if (!Directory.Exists (CACHE_PATH))
                Directory.CreateDirectory (CACHE_PATH);
        }
コード例 #41
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public TopBar() : base(false, 2)
        {
            // Initialize Search Logo
            this.imageLogo        = StockIcons.GetImage("Search");
            this.imageLogo.Xalign = 0.1f;
            this.imageLogo.Yalign = 0.1f;
            this.imageLogo.Xpad   = 2;
            this.PackStart(this.imageLogo, false, false, 2);

            // Initialize Top VBox
            this.table = new Gtk.Table(3, 2, false);
            this.table.ColumnSpacing = 6;
            this.table.RowSpacing    = 2;
            this.PackStart(this.table, true, true, 2);

            Gtk.Label label;

            // Initialize Search Label
            label           = new Gtk.Label("<b>Search:</b>");
            label.UseMarkup = true;
            label.Xalign    = 1.0f;
            this.table.Attach(label, 0, 1, 0, 1);

            // Initialize Entry Search
            this.entrySearch = new Gtk.Entry();
            this.table.Attach(this.entrySearch, 1, 2, 0, 1);

            // Initialize Search By
            label           = new Gtk.Label("<b>By:</b>");
            label.UseMarkup = true;
            label.Xalign    = 1.0f;
            this.table.Attach(label, 0, 1, 1, 2);

            // Initialize Combo Search Type
            this.comboSearchType = ComboBox.NewText();
            AddSearchType();
            this.comboSearchType.Active = 0;
            this.table.Attach(this.comboSearchType, 1, 2, 1, 2);

            // Initialize Search By
            label           = new Gtk.Label("<b>User:</b>");
            label.UseMarkup = true;
            label.Xalign    = 1.0f;
            table.Attach(label, 0, 1, 2, 3);

            // Initialize Combo Search Type
            this.comboSearchUser = ComboBox.NewText();
            AddSearchUsers();
            this.comboSearchUser.Active = 0;
            this.table.Attach(this.comboSearchUser, 1, 2, 2, 3);

            this.ShowAll();
        }
コード例 #42
0
        public MenuMinMaxNoteCountPreference()
        {
            table = new Gtk.Table(2, 2, false);
            table.ColumnSpacing = 6;
            table.RowSpacing    = 6;
            table.Show();

            // Menu Min Note Count option
            menuMinNoteCountLabel = new Gtk.Label(Catalog.GetString("Minimum number of notes to show in Recent list"));

            menuMinNoteCountLabel.UseMarkup = true;
            menuMinNoteCountLabel.Justify   = Gtk.Justification.Left;
            menuMinNoteCountLabel.SetAlignment(0.0f, 0.5f);
            menuMinNoteCountLabel.Show();
            table.Attach(menuMinNoteCountLabel, 0, 1, 0, 1);

            menuMinNoteCount = (int)Preferences.Get(Preferences.MENU_NOTE_COUNT);
            menuMaxNoteCount = (int)Preferences.Get(Preferences.MENU_MAX_NOTE_COUNT);
            // This is to avoid having Max bigger than absolute maximum if someone changed the setting
            // outside of the Tomboy using e.g. gconf
            menuMaxNoteCount = (menuMaxNoteCount <= int.MaxValue ? menuMaxNoteCount : int.MaxValue);
            // This is to avoid having Min bigger than Max if someone changed the setting
            // outside of the Tomboy using e.g. gconf
            menuMinNoteCount = (menuMinNoteCount <= menuMaxNoteCount ? menuMinNoteCount : menuMaxNoteCount);

            menuMinNoteCountSpinner       = new Gtk.SpinButton(1, menuMaxNoteCount, 1);
            menuMinNoteCountSpinner.Value = menuMinNoteCount;
            menuMinNoteCountSpinner.Show();
            table.Attach(menuMinNoteCountSpinner, 1, 2, 0, 1);
            menuMinNoteCountSpinner.ValueChanged += UpdateMenuMinNoteCountPreference;

            // Menu Max Note Count option
            menuMaxNoteCountLabel = new Gtk.Label(Catalog.GetString("Maximum number of notes to show in Recent list"));

            menuMaxNoteCountLabel.UseMarkup = true;
            menuMaxNoteCountLabel.Justify   = Gtk.Justification.Left;
            menuMaxNoteCountLabel.SetAlignment(0.0f, 0.5f);
            menuMaxNoteCountLabel.Show();
            table.Attach(menuMaxNoteCountLabel, 0, 1, 1, 2);

            menuMaxNoteCountSpinner       = new Gtk.SpinButton(menuMinNoteCount, int.MaxValue, 1);
            menuMaxNoteCountSpinner.Value = menuMaxNoteCount;
            menuMaxNoteCountSpinner.Show();
            table.Attach(menuMaxNoteCountSpinner, 1, 2, 1, 2);
            menuMaxNoteCountSpinner.ValueChanged += UpdateMenuMaxNoteCountPreference;

            align = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 1.0f);
            align.Show();
            align.Add(table);
        }
コード例 #43
0
        public Base()
        {
            table               = new Gtk.Table(1, 2, false);
            table.RowSpacing    = 12;
            table.ColumnSpacing = 12;

            header_icon = new Gtk.Image();
            table.Attach(header_icon, 0, 1, 0, 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 5);

            header_label = new Gtk.Label();
            header_label.SetAlignment(0.0f, 0.5f);
            table.Attach(header_label, 1, 2, 0, 1, Gtk.AttachOptions.Fill | Gtk.AttachOptions.Expand, 0, 0, 5);

            table.ShowAll();

            Add(table);
        }
コード例 #44
0
ファイル: Ventana.cs プロジェクト: albfernandez/gSimple2
        /// <summary>Crea el notebook donde están los campos
        /// de edición de texto del ensamblador.</summary>
        /// <returns>El notebook.</returns>

        private Notebook CrearNotebook()
        {
            Notebook not = new Notebook();


            Gtk.HPaned panel1 = new Gtk.HPaned();
            panel1.Add1(CrearEditorEnsamblador());
            panel1.Add2(CrearResultadoEnsamblador());
            panel1.Position = 340;

            Gtk.VPaned panel2 = new Gtk.VPaned();
            panel2.Add1(panel1);
            panel2.Add2(CrearErroresEnsamblador());
            panel2.Position = 350;

            not.AppendPage(
                panel2,
                new Gtk.Label(GetText("Ventana_Notebook_Codigo"))
                );

            panelMemoria   = new PanelMemoria();
            panelRegistros = new PanelRegistros();

            Gtk.Table memreg = new Gtk.Table(1, 2, true);
            memreg.Attach(panelMemoria, 0, 1, 0, 1);
            memreg.Attach(panelRegistros, 1, 2, 0, 1);
            not.AppendPage(
                memreg,
                new Gtk.Label(
                    String.Format(
                        "{0} - {1}",
                        GetText("Ventana_Notebook_Memoria"),
                        GetText("Ventana_Notebook_Registros")
                        )
                    )
                );


            dArea = new PanelDibujo();
            not.AppendPage(
                dArea,
                new Gtk.Label(GetText("Ventana_Notebook_rdd"))
                );

            return(not);
        }
コード例 #45
0
ファイル: rack.cs プロジェクト: fredatgithub/scrabble-1
        /// <summary>
        /// Initializes a new instance of the <see cref="Scrabble.GUI.Rack"/> class.
        /// </summary>
        /// <param name='g'>
        /// G.
        /// </param>
        public Rack(Scrabble.Game.Game g) : base("Zásobník")
        {
            this.HeightRequest = 60;
            this.WidthRequest  = 350;

            this.labels      = new Gtk.Label[Scrabble.Game.InitialConfig.sizeOfRack];
            this.labelsHover = new Gtk.Table(1, (uint)Game.InitialConfig.sizeOfRack, true);
            for (uint i = 0; i < Game.InitialConfig.sizeOfRack; i++)
            {
                this.labels[i] = new Label();
                this.labelsHover.Attach(labels[i], i, i + 1, 0, 1);
            }

            this.labelsHover.ColumnSpacing = 6;
            this.labelsHover.BorderWidth   = 3;
            this.BorderWidth = 5;

            this.Add(this.labelsHover);
        }
コード例 #46
0
ファイル: ImageBrowserGtk.cs プロジェクト: retahc/old-code
    public static Gtk.Table PopulateTable(ArrayList items)
    {
        Gtk.Table table = new Gtk.Table(0, 0, false);
        uint      x     = 0;
        uint      y     = 0;

        foreach (object item in items)
        {
            if (x > 4)
            {
                x = 0;
                y++;
            }
            table.Attach(((Gtk.Widget)item), x, x + 1, y, y + 1, AttachOptions.Fill, AttachOptions.Fill, 5, 5);
            x++;
        }

        return(table);
    }
コード例 #47
0
        /// <summary>
        /// Creates a Gtk.Widget that's used to configure the service.  This
        /// will be used in the Synchronization Preferences.  Preferences should
        /// not automatically be saved by a GConf Property Editor.  Preferences
        /// should be saved when SaveConfiguration () is called.
        /// </summary>
        public override Gtk.Widget CreatePreferencesControl(EventHandler requiredPrefChanged)
        {
            Gtk.Table table = new Gtk.Table(3, 2, false);
            table.RowSpacing    = 5;
            table.ColumnSpacing = 10;

            // Read settings out of gconf
            string url, username, password;

            GetConfigSettings(out url, out username, out password);

            if (url == null)
            {
                url = string.Empty;
            }
            if (username == null)
            {
                username = string.Empty;
            }
            if (password == null)
            {
                password = string.Empty;
            }

            urlEntry          = new Entry();
            urlEntry.Text     = url;
            urlEntry.Changed += requiredPrefChanged;
            AddRow(table, urlEntry, Catalog.GetString("_URL:"), 0);

            usernameEntry          = new Entry();
            usernameEntry.Text     = username;
            usernameEntry.Changed += requiredPrefChanged;
            AddRow(table, usernameEntry, Catalog.GetString("User_name:"), 1);

            passwordEntry            = new Entry();
            passwordEntry.Text       = password;
            passwordEntry.Visibility = false;
            passwordEntry.Changed   += requiredPrefChanged;
            AddRow(table, passwordEntry, Catalog.GetString("_Password:"), 2);

            table.ShowAll();
            return(table);
        }
コード例 #48
0
        /// <summary>Crea una instancia de la clase.</summary>

        public PanelRegistros() : base(false, 0)
        {
            Gtk.Table tabla = new Gtk.Table(16, 5, true);
            VBox      vb    = new VBox(false, 0);

            for (int i = 0; i < 16; i++)
            {
                direcciones[i] =
                    new Gtk.Label(BancoRegistros.GetNombreRegistro(i));
                contenido[i] =
                    new Gtk.Label(Conversiones.ToHexString((short)0));
                tabla.Attach(direcciones[i], 1, 2, (uint)i, (uint)i + 1);
                tabla.Attach(contenido[i], 3, 4, (uint)i, (uint)i + 1);
            }
            vb.PackStart(new Gtk.Label
                             (Ventana.GetText("PReg_Contenido")));
            vb.PackStart(tabla);
            vb.PackStart(new Gtk.Label(""));
            this.PackStart(vb);
        }
コード例 #49
0
        // TODO: Centralize duplicated code
        private void AddRow(Gtk.Table table, Gtk.Widget widget, string labelText, uint row)
        {
            Gtk.Label l = new Gtk.Label(labelText);
            l.UseUnderline = true;
            l.Xalign       = 0.0f;
            l.Show();
            table.Attach(l, 0, 1, row, row + 1,
                         Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         0, 0);

            widget.Show();
            table.Attach(widget, 1, 2, row, row + 1,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         0, 0);

            l.MnemonicWidget = widget;

            // TODO: Tooltips
        }
コード例 #50
0
ファイル: ChatWindow.cs プロジェクト: vrosnet/logopathy
        public ChatWindow() : base(Gtk.WindowType.Toplevel)
        {
            this.Title        = "#gnome-hackers on irc.gimp.net - Logopathy";
            this.DeleteEvent += OnDeleteEvent;

            this.Table = new Gtk.Table(5, 5, false);
            this.Add(this.Table);

            this.ActionGroup = new Gtk.ActionGroup("General");
            SetUpActionGroup();

            UiManager = new Gtk.UIManager();
            UiManager.InsertActionGroup(this.ActionGroup, 0);
            AddAccelGroup(UiManager.AccelGroup);
            SetUpUiManager();

            this.MenuBar = UiManager.GetWidget("/MenuBar");
            this.Table.Attach(this.MenuBar, 0, 5, 0, 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

            MainPaned = new Gtk.HPaned();
            this.Table.Attach(MainPaned, 0, 5, 1, 2);

            LeftSidebar = new Gtk.VPaned();
            MainPaned.Pack1(LeftSidebar, true, true);

            ServerView   = new Logopathy.Gui.ServerListView();
            ServerViewSW = new Gtk.ScrolledWindow(new Gtk.Adjustment(0, 0, 0, 0, 0, 0), new Gtk.Adjustment(0, 0, 0, 0, 0, 0));
            ServerViewSW.Add(ServerView);
            LeftSidebar.Pack1(ServerViewSW, true, true);

            UserView   = new Logopathy.Gui.UserView();
            UserViewSW = new Gtk.ScrolledWindow(new Gtk.Adjustment(0, 0, 0, 0, 0, 0), new Gtk.Adjustment(0, 0, 0, 0, 0, 0));
            UserViewSW.Add(UserView);
            LeftSidebar.Pack2(UserViewSW, true, true);

            ChatNotebook = new Logopathy.Gui.ChatNotebook(new TpServer());
            MainPaned.Pack2(ChatNotebook, true, true);
        }
コード例 #51
0
        Gtk.Widget CreateAssembliesTable()
        {
            var box = new Gtk.VBox();

            box.PackStart(new Gtk.Label()
            {
                Markup = string.Format("<b>{0}</b>", GettextCatalog.GetString("Loaded Assemblies")),
                Xalign = 0
            });
            var table = new Gtk.Table(0, 0, false);

            table.ColumnSpacing = 3;
            uint line = 0;

            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic).OrderBy(a => a.FullName))
            {
                try {
                    var assemblyName = assembly.GetName();
                    table.Attach(new Gtk.Label(assemblyName.Name)
                    {
                        Xalign = 0
                    }, 0, 1, line, line + 1);
                    table.Attach(new Gtk.Label(assemblyName.Version.ToString())
                    {
                        Xalign = 0
                    }, 1, 2, line, line + 1);
                    table.Attach(new Gtk.Label(System.IO.Path.GetFullPath(assembly.Location))
                    {
                        Xalign = 0
                    }, 2, 3, line, line + 1);
                } catch {
                }
                line++;
            }
            box.PackStart(table, false, false, 0);
            box.ShowAll();
            return(box);
        }
コード例 #52
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        SetDefaultSize(200, -1);

        var table     = new Gtk.Table(5, 5, true);
        var separator = new Gtk.HSeparator();

        var label0 = new Gtk.Label("Select file to copy/move");

        _fileCopy  = new Gtk.FileChooserButton("Select A File", Gtk.FileChooserAction.Open);
        _radioCopy = new Gtk.RadioButton("Copy");
        _radioMove = new Gtk.RadioButton(_radioCopy, "Move");
        var copyButton = new Gtk.Button("Copy");

        Add(table);

        table.Attach(label0, 0, 4, 0, 1);
        table.Attach(_fileCopy, 0, 1, 1, 2);
        table.Attach(_radioCopy, 1, 2, 1, 2);
        table.Attach(_radioMove, 2, 3, 1, 2);
        table.Attach(copyButton, 3, 4, 1, 2);
        table.Attach(separator, 0, 4, 2, 3);

        var label1 = new Gtk.Label("Select destination for file(s)");

        _folder = new Gtk.FileChooserButton("Select A File", Gtk.FileChooserAction.SelectFolder);
        var pasteButton = new Gtk.Button("Paste");

        table.Attach(label1, 0, 4, 3, 4);
        table.Attach(_folder, 0, 1, 4, 5);
        table.Attach(pasteButton, 3, 4, 4, 5);

        DeleteEvent         += OnDeleteEvent;
        copyButton.Clicked  += OnCopyButtonClick;
        pasteButton.Clicked += OnPasteButtonClick;

        ShowAll();
    }
コード例 #53
0
        private void InitializeComponent()
        {
            //
            // costWidget
            //
            this.costWidget = new PlotWidget();
            //
            // volumeWidget
            //
            this.volumeWidget = new PlotWidget();
            //
            // closeButton
            //
            this.closeButton          = new Gtk.Button("Close");
            this.closeButton.Clicked += new System.EventHandler(this.closeButton_Click);

            //
            // FinancialDemo
            //
            this.SetSizeRequest(630, 450);
            //
            // Define a 10x10 table on which to lay out the plots and button
            //
            Gtk.Table layout = new Gtk.Table(10, 10, true);
            layout.BorderWidth = 4;
            Add(layout);

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

            layout.Attach(costWidget, 0, 10, 0, 6);
            layout.Attach(volumeWidget, 0, 10, 6, 9);
            layout.Attach(closeButton, 1, 2, 9, 10, opt, opt, xpad, ypad);
            this.Name = "PlotSurface2DDemo";

            this.Name = "FinancialDemo";
        }
コード例 #54
0
ファイル: Connection.cs プロジェクト: hadi77ir/monodm
        void InitializeComponent()
        {
            Gtk.Table table = new Gtk.Table(4, 2, false);
            // num retry delay
            numRetryDelay        = new Gtk.SpinButton(0, 10000, 1);
            numRetryDelay.Digits = 0;             //int only
            table.Attach(new Gtk.Label("Delay between retries: "), 0, 1, 0, 1);
            table.Attach(numRetryDelay, 1, 2, 0, 1);

            numMaxRetries        = new Gtk.SpinButton(0, 10, 1);
            numMaxRetries.Digits = 0;             //int only
            table.Attach(new Gtk.Label("Maximum number of retries: "), 0, 1, 1, 2);
            table.Attach(numMaxRetries, 1, 2, 1, 2);

            numMaxSegments = new SpinButton(0, 32, 1);
            table.Attach(new Gtk.Label("Maximum number of segments: "), 0, 1, 2, 3);
            table.Attach(numMaxSegments, 1, 2, 2, 3);

            numMinSegSize = new Gtk.SpinButton(100, double.MaxValue, 1);
            table.Attach(new Gtk.Label("Minimum size of a segment (bytes): "), 0, 1, 3, 4);
            table.Attach(numMinSegSize, 1, 2, 3, 4);

            PackStart(table, false, false, 0);
        }
コード例 #55
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";
        }
コード例 #56
0
        public CredentialsDialog(URIish uri, IEnumerable <CredentialItem> credentials)
        {
            this.Build();

            labelTop.Text = string.Format(labelTop.Text, uri.ToString());

            Gtk.Table table = new Gtk.Table(0, 0, false);
            table.ColumnSpacing = 6;
            vbox.PackStart(table, true, true, 0);

            uint   r           = 0;
            Widget firstEditor = null;

            foreach (CredentialItem c in credentials)
            {
                Label lab = new Label(c.GetPromptText() + ":");
                lab.Xalign = 0;
                table.Attach(lab, 0, 1, r, r + 1);
                Table.TableChild tc = (Table.TableChild)table [lab];
                tc.XOptions = AttachOptions.Shrink;

                Widget editor = null;

                if (c is CredentialItem.YesNoType)
                {
                    CredentialItem.YesNoType cred = (CredentialItem.YesNoType)c;
                    if (credentials.Count(i => i is CredentialItem.YesNoType) == 1)
                    {
                        singleYesNoCred = cred;
                        buttonOk.Hide();
                        buttonYes.Show();
                        buttonNo.Show();
                        // Remove the last colon
                        lab.Text = lab.Text.Substring(0, lab.Text.Length - 1);
                    }
                    else
                    {
                        CheckButton btn = new CheckButton();
                        editor       = btn;
                        btn.Toggled += delegate
                        {
                            cred.SetValue(btn.Active);
                        };
                    }
                }
                else if (c is CredentialItem.StringType || c is CredentialItem.CharArrayType)
                {
                    CredentialItem cred = c;
                    Entry          e    = new Entry();
                    editor             = e;
                    e.ActivatesDefault = true;
                    if (cred.IsValueSecure())
                    {
                        e.Visibility = false;
                    }
                    e.Changed += delegate
                    {
                        if (cred is CredentialItem.StringType)
                        {
                            ((CredentialItem.StringType)cred).SetValue(e.Text);
                        }
                        else
                        {
                            ((CredentialItem.CharArrayType)cred).SetValue(e.Text.ToCharArray());
                        }
                    };

                    if (c is CredentialItem.Username)
                    {
                        e.Text = uri.GetUser() ?? "";
                    }
                }
                if (editor != null)
                {
                    table.Attach(editor, 1, 2, r, r + 1);
                    tc          = (Table.TableChild)table [lab];
                    tc.XOptions = AttachOptions.Fill;
                    if (firstEditor == null)
                    {
                        firstEditor = editor;
                    }
                }

                r++;
            }
            table.ShowAll();
            Focus   = firstEditor;
            Default = buttonOk;
        }
コード例 #57
0
        public Gtk.Widget Create()
        {
            table = new Gtk.Table((uint)rows, (uint)cols, false);

            Gtk.Label title = new Label();
            title.Markup = this.titleMarkup;
            // label starting at left with SetAlignment also needs AttachOptions.Fill for it to work
            title.SetAlignment(0f, 0.5f);
            table.Attach(title, 0, (uint)cols, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            // add some spacing so cell content won't touch
            table.ColumnSpacing = table.RowSpacing = 0;

            const uint AxisPadX = 2;
            const uint AxisPadY = 2;

            // x axis
            axisWidgetsX = new Widget[countX];
            for (uint i = 0; i < countX; i++)
            {
                Gtk.Label label = new Label();
                label.Text = axisX[i].ToString();

                axisWidgetsX[i] = label;
                table.Attach(label, DataColLeft + i, DataColLeft + 1 + i, DataRowTop - 1, DataRowTop, AttachOptions.Shrink, AttachOptions.Shrink, AxisPadX, AxisPadY);
            }

            // y axis
            axisWidgetsY = new Widget[countY];
            for (uint i = 0; i < countY; i++)
            {
                Gtk.Label label = new Label();
                label.Text = axisY[i].ToString();
                label.SetAlignment(1f, 0f);

                axisWidgetsY[i] = label;
                table.Attach(label, DataColLeft - 1, DataColLeft, DataRowTop + i, DataRowTop + 1 + i, AttachOptions.Fill, AttachOptions.Shrink, AxisPadX, AxisPadY);
            }

            // values
            int countZ = values.Length;

            valueWidgets = new Widget[countZ];
            for (uint i = 0; i < countZ; i++)
            {
                float        val    = values[i];
                Gtk.Widget   label  = new Label(val.ToString(this.formatValues));
                BorderWidget widget = new BorderWidget();

                // ShadowType differences might be minimal
                if (val >= this.valuesMax)
                {
                    widget.Shadow = ShadowType.EtchedOut;
                }
                else if (val <= this.valuesMin)
                {
                    widget.Shadow = ShadowType.EtchedOut;
                }

                widget.Color = CalcColor(val);
                widget.Add(label);

                valueWidgets[i] = widget;
                uint row = DataRowTop + i / (uint)this.countX;
                uint col = DataColLeft + i % (uint)this.countX;

                table.Attach(widget, col, col + 1, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            }

            // x axis name
            Gtk.Label titleX = new Gtk.Label();
            titleX.Markup = "<b>" + this.axisMarkupX + "</b>";
            //titleX.SetAlignment (0.5f, 0.5f);
            table.Attach(titleX, DataColLeft, (uint)cols, DataRowTop - 2, DataRowTop - 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

            // y axis name
            Gtk.Label titleY = new Gtk.Label();
            // Turning on any wrap property causes 0 angle!
            //titleY.Wrap = true;
            //titleY.LineWrap = true;
            //titleY.LineWrapMode = Pango.WrapMode.WordChar;
            titleY.Angle  = 90;
            titleY.Markup = "<b>" + this.axisMarkupY + "</b>";

            //titleY.SetAlignment (0.5f, 0.5f);
            table.Attach(titleY, 0, 1, DataRowTop, (uint)rows, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

            //table.Homogeneous = true;
            return(table);
        }
コード例 #58
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Scrabble.GUI.StartWindow"/> class.
        /// </summary>
        public StartWindow() : base(Gtk.WindowType.Toplevel)
        {
            #region Basic window properties
            // Basic window properties
            this.Title        = "Scrabble - Základní nastavení";
            this.Name         = "ConfigWindow";
            this.DeleteEvent += OnDeleteEvent;
            this.SetPosition(WindowPosition.Center);
            this.DefaultWidth  = 410;
            this.DefaultHeight = 280;
            this.Icon          = Scrabble.Game.InitialConfig.icon;
            #endregion

            this.numberOfPlayers = 2;

            // Own thread for loading dictionary
            this.statusb = new Gtk.Statusbar();
            this.statusb.Push(statusb.GetContextId("Slovník"), "Načítám slovník");
            this.tdic = new Thread(LoadDictionary);
            this.tdic.Start();

            // infoText (top)
            this.infoText = new Gtk.Label("Základní nastavení hry.\n" +
                                          "Nastavte prosím počet hráčů, jejich jména a určete zda za ně bude hrát umělá inteligence. " +
                                          "Také můžete nastavit, kteří hráči se připojují vzdáleně.");
            this.infoText.Wrap = true;

            // First config line (number of players, client)
            this.upperHbox = new HBox(false, 5);
            this.l1        = new Label("Počet hráčů");
            this.upperHbox.PackStart(l1);
            this.l2                = new Label(", nebo:");
            this.entryNum          = new SpinButton(2, 5, 1);
            this.entryNum.Changed += OnNumberOfPlayerChange;
            client             = new CheckButton();
            client.Clicked    += IamClient;
            client.Label       = "připojit se ke vzdálené hře";
            client.TooltipText = "Pokud zaškrnete, tak se program bude chovat pouze jako client a připojí se k hře vedené na jiném PC.";
            upperHbox.Add(entryNum);
            upperHbox.Add(l2);
            upperHbox.PackEnd(client);
            upperHbox.BorderWidth  = 10;
            upperHbox.WidthRequest = 20;

            // Table with config for each player (dynamic size)
            table = new Gtk.Table(5, 7, false);
            table.Attach(new Gtk.Label("Jméno hráče:"), 1, 2, 0, 1);
            table.Attach(new Gtk.Label("CPU"), 2, 3, 0, 1);
            table.Attach(new Gtk.Label("Network"), 3, 4, 0, 1);
            ipLabel = new Gtk.Label("IP");
            table.Attach(ipLabel, 4, 5, 0, 1);

            labels    = new Gtk.Label[5];
            entryes   = new Gtk.Entry[5];
            CPUchecks = new Gtk.CheckButton[5];
            MPchecks  = new Gtk.CheckButton[5];
            IPs       = new Gtk.Entry[5];
            for (int i = 0; i < 5; i++)
            {
                labels [i]      = new Gtk.Label((i + 1).ToString());
                labels [i].Name = string.Format("l {0}", i);
                table.Attach(labels [i], 0, 1, (uint)i + 1, (uint)i + 2);
                entryes [i]             = new Gtk.Entry(12);
                entryes [i].Text        = "Hráč " + (i + 1).ToString();
                entryes [i].TooltipText = "Vložte jméno hráče.";
                table.Attach(entryes [i], 1, 2, (uint)i + 1, (uint)i + 2);
                CPUchecks [i]             = new Gtk.CheckButton();
                CPUchecks [i].Name        = string.Format("c {0}", i);
                CPUchecks [i].TooltipText = "Pokud je zaškrtnuto, tak za hráče bude hrát počítač.";
                ((Gtk.CheckButton)CPUchecks [i]).Clicked += OnCpuChange;
                table.Attach(CPUchecks [i], 2, 3, (uint)i + 1, (uint)i + 2);
                MPchecks [i]             = new Gtk.CheckButton();
                MPchecks [i].Name        = string.Format("n {0}", i);
                MPchecks [i].TooltipText = "Pokud je zaškrtnuto, tak se počítá s tím, že se tento hráč připojí vzdáleně. ";
                ((Gtk.CheckButton)MPchecks [i]).Clicked += OnNetChange;
                table.Attach(MPchecks [i], 3, 4, (uint)i + 1, (uint)i + 2);
                IPs [i]            = new Gtk.Entry(15);
                IPs [i].Text       = "192.168.0.X";
                IPs [i].WidthChars = 15;
                IPs [i].Sensitive  = false;
                table.Attach(IPs [i], 4, 5, (uint)i + 1, (uint)i + 2);
            }
            this.CPUchecks[0].Hide();

            ok             = new Button("Hotovo");
            ok.Clicked    += Done;
            ok.BorderWidth = 5;
            ok.TooltipText = "Potvrzením začne hra. Může se stát, že program bude ještě chvíli načítat slovník.";
            table.Attach(ok, 0, 5, 6, 7);

            // Main vbox (where all is)
            this.mainVbox = new Gtk.VBox(false, 5);

            this.mainVbox.PackStart(infoText);
            this.mainVbox.Add(upperHbox);
            this.mainVbox.Spacing = 5;
            this.mainVbox.Add(table);
            this.mainVbox.PackEnd(statusb);

            this.mainVbox.BorderWidth = 9;
            this.Add(mainVbox);
            this.mainVbox.ShowAll();

            for (int i = 2; i < numberOfPlayers + 3; i++)
            {
                labels [i].Hide();
                entryes [i].Hide();
                CPUchecks [i].Hide();
                MPchecks [i].Hide();
                IPs [i].Hide();
            }
            ipLabel.Hide();

            foreach (Gtk.Entry e in IPs)
            {
                e.Hide();
            }

            this.CPUchecks[0].Hide();
            this.MPchecks[0].Hide();
        }
コード例 #59
0
        private void GenerateContent(ref Gtk.Table tableSystem, string label, int xPos, Condition cd, bool isResolution)
        {
            ListStore lstorePlatform = new ListStore(typeof(int), typeof(int), typeof(string));

            int selectRule = 0;

            if (conditionRules_Old.Count > 0)
            {
                ConditionRule cr = conditionRules_Old.Find(x => x.ConditionId == cd.Id);
                if (cr != null)
                {
                    selectRule = cr.RuleId;
                }
            }

            Label lblPlatform = new Label(label);

            lblPlatform.Name   = "lbl_" + label;
            lblPlatform.Xalign = 1F;
            lblPlatform.Yalign = 0.5F;

            ComboBox cboxPlatform = new ComboBox();

            cboxPlatform.Name = "cd_" + label;

            CellRendererText textRenderer = new CellRendererText();

            cboxPlatform.PackStart(textRenderer, true);
            cboxPlatform.AddAttribute(textRenderer, "text", 2);

            cboxPlatform.WidthRequest = 200;
            cboxPlatform.Model        = lstorePlatform;

            tableSystem.Attach(lblPlatform, 0, 1, (uint)(xPos - 1), (uint)xPos, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
            tableSystem.Attach(cboxPlatform, 1, 2, (uint)(xPos - 1), (uint)xPos, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);

            TreeIter selectIter = lstorePlatform.AppendValues(0, cd.Id, "Unset");

            foreach (Rule rl in cd.Rules)
            {
                if (!isResolution)
                {
                    if (rl.Id == selectRule)
                    {
                        selectIter = lstorePlatform.AppendValues(rl.Id, cd.Id, rl.Name);
                    }
                    else
                    {
                        lstorePlatform.AppendValues(rl.Id, cd.Id, rl.Name);
                    }
                }
                else
                {
                    string name = String.Format("{0} ({1}x{2})", rl.Name, rl.Width, rl.Height);
                    if (rl.Id == selectRule)
                    {
                        selectIter = lstorePlatform.AppendValues(rl.Id, cd.Id, name);
                    }
                    else
                    {
                        lstorePlatform.AppendValues(rl.Id, cd.Id, name);
                    }
                }
            }
            cboxPlatform.SetActiveIter(selectIter);

            cboxPlatform.Changed += delegate(object sender, EventArgs e) {
                if (sender == null)
                {
                    return;
                }

                ComboBox combo = sender as ComboBox;

                TreeIter iter;
                if (combo.GetActiveIter(out iter))
                {
                    int ruleId = (int)combo.Model.GetValue(iter, 0);
                    int condId = (int)combo.Model.GetValue(iter, 1);
                    if (ruleId != 0)
                    {
                        ConditionRule cr = conditionRules.Find(x => x.ConditionId == condId);                                //cd.Id);
                        if (cr != null)
                        {
                            cr.RuleId = ruleId;
                        }
                        else
                        {
                            conditionRules.Add(new ConditionRule(condId, ruleId));
                        }
                    }
                    else
                    {
                        ConditionRule cr = conditionRules.Find(x => x.ConditionId == condId);
                        if (cr != null)
                        {
                            conditionRules.Remove(cr);
                        }
                    }
                    isChanged = true;
                }
            };
        }
コード例 #60
0
ファイル: class_public.cs プロジェクト: nagyistge/osiris
        public ProgressBarSample()
        {
            Gtk.HSeparator  separator;
            Gtk.Table       table;
            Gtk.Button      button;
            Gtk.CheckButton check;
            Gtk.VBox        vbox;

            //Application.Init ();

            /* Allocate memory for the data that is passed to the callbacks*/
            pdata = new ProgressData();
            pdata.activity_mode    = false;
            pdata.window           = new Gtk.Window(Gtk.WindowType.Toplevel);
            pdata.window.Resizable = true;

            pdata.window.DeleteEvent += destroy_progress;
            pdata.window.Title        = "GtkProgressBar";
            pdata.window.BorderWidth  = 0;

            vbox             = new Gtk.VBox(false, 5);
            vbox.BorderWidth = 10;
            pdata.window.Add(vbox);
            vbox.Show();

            /* Create a centering alignment object */
            Gtk.Alignment align = new Gtk.Alignment(1, 1, 0, 0);
            vbox.PackStart(align, false, false, 5);
            align.Show();

            /* Create the GtkProgressBar */
            pdata.pbar      = new Gtk.ProgressBar();
            pdata.pbar.Text = "";
            align.Add(pdata.pbar);
            pdata.pbar.Show();

            /* Add a timer callback to update the value of the progress bar*/
            pdata.timer = GLib.Timeout.Add(10000, new GLib.TimeoutHandler(progress_timeout));


            separator = new Gtk.HSeparator();
            vbox.PackStart(separator, false, false, 0);
            separator.Show();

            /* rows, columns, homogeneous */
            table = new Gtk.Table(2, 3, false);
            vbox.PackStart(table, false, true, 0);
            table.Show();

            /* Add a check button to select displaying of the trough text*/
            check = new Gtk.CheckButton("Query cada 1 minuto");
            table.Attach(check, 0, 1, 0, 1,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_show_text;
            check.Show();

            /* Add a check button to toggle activity mode */
            check = new Gtk.CheckButton("Activity mode");
            table.Attach(check, 0, 1, 1, 2,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_activity_mode;
            check.Active   = true;
            check.Show();

            /* Add a check button to toggle orientation */
            check = new Gtk.CheckButton("Right to Left");
            table.Attach(check, 0, 1, 2, 3,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_orientation;
            check.Show();

            /* Add a button to exit the program */
            button          = new Gtk.Button("close");
            button.Clicked += button_click;
            vbox.PackStart(button, false, false, 0);

            /* This makes it so the button is the default. */
            button.CanDefault = true;

            /* This grabs this button to be the default button. Simply hitting
             * the "Enter" key will cause this button to activate. */
            button.GrabDefault();
            button.Show();

            pdata.window.ShowAll();

            //Application.Run ();
        }