示例#1
3
        public static void Main(string[] args)
        {
            uint rows = 5;
            uint columns = 5;
            uint spacing = 2;
            Application.Init ();
            Window win = new Window ("Minesweeper");
            var table = new global::Gtk.Table (rows, columns, false);
            table.RowSpacing = (spacing);
            table.ColumnSpacing = (spacing);
            for (uint row = 0; row < rows; row++) {
                for (uint column = 0; column < columns; column++) {
                    var button = new Button();

                    button.CanFocus = true;
                    button.Label = (string.Empty.PadLeft(5));
                    button.Clicked += new EventHandler(OnButtonClicked);
                    table.Attach(button, row, row+1,column, column+1);
                }
            }
            table.ShowAll();
            win.Add(table);
            win.Show ();
            Application.Run ();
        }
示例#2
0
        public void creaVentanaArticulo()
        {
            titulo="Añadir articulo";
            ventana(titulo);
            Label cat=new Label("Introduce el nombre del nuevo articulo: ");
            text= new Entry();
            ComboBox cb=new ComboBox();
            Label cat2=new Label("Selecciona la categoria: ");
            combot= new ComboBoxHelper(App.Instance.DbConnection,cb,"nombre","id",0,"categoria");
            tabla.Attach(cat,0,1,0,1);
            tabla.Attach(text,1,2,0,1);
            tabla.Attach(cat2,0,1,1,2);
            tabla.Attach(cb,1,2,1,2);
            Label pre=new Label("Introduce el precio del nuevo articulo: ");
            precio=new Entry();
            tabla.Attach(pre,0,1,2,3);
            tabla.Attach(precio,1,2,2,3);
            Button button=new Button("Añadir");
                    button.Clicked +=delegate{
                    añadirArticulo(App.Instance.DbConnection);
                    if(!enBlanco){
                        window.Destroy();
                        refresh();
                }
            };

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

			action.ConnectProxy (button);
			tips.SetTip (button, action.Tooltip, String.Empty);
			return button;
		}
示例#4
0
        public ProgressDialog(string title, CancelButtonType cancel_button_type, int total_count, Gtk.Window parent_window)
        {
            Title = title;
            this.total_count = total_count;

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

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

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

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

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

            Response += new ResponseHandler (HandleResponse);
        }
示例#5
0
        public ListPage(Notebook notebook, ModulesTreeInfo module)
        {
            this.notebook = notebook;
            this.module = module;

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

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

            notebook.AppendPage(this, headerbox);
            notebook.SetTabReorderable(this, true);
        }
		public NotificationMessage (string t, string m) : base (false, 5)
		{
			this.Style = style;

			BorderWidth = 5;

			icon = new Image (Stock.DialogInfo, IconSize.Dialog);
			this.PackStart (icon, false, true, 5);

			VBox vbox = new VBox (false, 5);
			this.PackStart (vbox, true, true, 0);

			title = new Label ();
			title.SetAlignment (0.0f, 0.5f);
			this.Title = t;
			vbox.PackStart (title, false, true, 0);

			message = new Label ();
			message.LineWrap = true;
			message.SetSizeRequest (500, -1); // ugh, no way to sanely reflow a gtk label
			message.SetAlignment (0.0f, 0.0f);
			this.Message = m;			
			vbox.PackStart (message, true, true, 0);

			action_box = new HBox (false, 3);

			Button hide_button = new Button (Catalog.GetString ("Hide"));
			hide_button.Clicked += OnHideClicked;
			action_box.PackEnd (hide_button, false, true, 0);

			Alignment action_align = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
			action_align.Add (action_box);
			vbox.PackStart (action_align, false, true, 0);
		}
示例#7
0
		public void Clear ()
		{
			if (contentBox != null)
				contentBox.Destroy ();
			
			noContentLabel = new Label ();
			noContentLabel.Text = noContentMessage;
			noContentLabel.Xalign = 0F;
			noContentLabel.Justify = Justification.Left;
			noContentLabel.SetPadding (6, 6);
			addButton = new Button ();
			addButton.Label = addMessage;
//			addButton.Relief = ReliefStyle.None;
			addButton.Clicked += delegate {
				OnCreateNew (EventArgs.Empty);
			};
			
			contentBox = new VBox ();
			contentBox.PackStart (this.noContentLabel, true, true, 6);
			var hbox = new HBox ();
			hbox.PackStart (addButton, false, false, 0);
			contentBox.PackEnd (hbox, false, false, 0);
			
			PackStart (contentBox, true, true, 6);
			
			ShowAll ();
		}
		public CanvasExample () {
			Gtk.Window win = new Gtk.Window ("Canvas example");
			win.DeleteEvent += new DeleteEventHandler (Window_Delete);

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

			vbox.PackStart (new Label ("Drag - move object.\n" +
						   "Double click - change color\n" +
						   "Right click - delete object"),
					false, false, 0);
			
			canvas = new Canvas ();
			canvas.SetSizeRequest (width, height);
			canvas.SetScrollRegion (0.0, 0.0, (double) width, (double) height);
			vbox.PackStart (canvas, false, false, 0);

			HBox hbox = new HBox (false, 0);
			vbox.PackStart (hbox, false, false, 0);

			Button add_button = new Button ("Add an object");
			add_button.Clicked += new EventHandler (AddObject);
			hbox.PackStart (add_button, false, false, 0);

			Button quit_button = new Button ("Quit");
			quit_button.Clicked += new EventHandler (Quit);
			hbox.PackStart (quit_button, false, false, 0);

			win.ShowAll ();
		}
示例#9
0
    //execution
    public PulseExecute(int personID, string personName, int sessionID, string type, double fixedPulse, int totalPulsesNum,  
			Chronopic cp, Gtk.TextView event_execute_textview_message, Gtk.Window app, int pDN, bool volumeOn,
			//double progressbarLimit, 
			ExecutingGraphData egd 
			)
    {
        this.personID = personID;
        this.personName = personName;
        this.sessionID = sessionID;
        this.type = type;
        this.fixedPulse = fixedPulse;
        this.totalPulsesNum = totalPulsesNum;

        this.cp = cp;
        this.event_execute_textview_message = event_execute_textview_message;
        this.app = app;

        this.pDN = pDN;
        this.volumeOn = volumeOn;
        //		this.progressbarLimit = progressbarLimit;
        this.egd = egd;

        fakeButtonUpdateGraph = new Gtk.Button();
        fakeButtonEventEnded = new Gtk.Button();
        fakeButtonFinished = new Gtk.Button();

        simulated = false;

        needUpdateEventProgressBar = false;
        needUpdateGraph = false;

        //initialize eventDone as a Pulse
        eventDone = new Pulse();
    }
示例#10
0
 public override Widget ConfigurationWidget()
 {
     VBox h = new VBox ();
     r = new HScale (0, 100, 1);
     r.ModifyBg (StateType.Selected, new Color (0xff, 0, 0));
     r.Value = 80;
     r.ValueChanged += SettingsChanged;
     h.Add (r);
     g = new HScale (0, 100, 1);
     g.ModifyBg (StateType.Selected, new Color (0, 0xff, 0));
     g.Value = 10;
     g.ValueChanged += SettingsChanged;
     h.Add (g);
     b = new HScale (0, 100, 1);
     b.ModifyBg (StateType.Selected, new Color (0, 0, 0xff));
     b.Value = 10;
     b.ValueChanged += SettingsChanged;
     h.Add (b);
     c = new Curve ();
     c.CurveType = CurveType.Spline;
     c.SetRange (0, 255, 0, 255);
     h.Add (c);
     Button btn = new Button (Gtk.Stock.Refresh);
     btn.Clicked += delegate {UpdatePreview ();};
     h.Add (btn);
     return h;
 }
 protected virtual void Build()
 {
     Gui.Initialize (this);
     // Widget BolPatcher.MenuGameWidget
     BinContainer.Attach (this);
     Name = "BolPatcher.MenuGameWidget";
     // Container child BolPatcher.MenuGameWidget.Gtk.Container+ContainerChild
     _frame1 = new Frame ();
     _frame1.Name = "frame1";
     _frame1.ShadowType = 0;
     // Container child frame1.Gtk.Container+ContainerChild
     _gtkAlignment = new Alignment (0F, 0F, 1F, 1F);
     _gtkAlignment.Name = "GtkAlignment";
     _gtkAlignment.LeftPadding = 12;
     // Container child GtkAlignment.Gtk.Container+ContainerChild
     _button2 = new Button ();
     _button2.CanFocus = true;
     _button2.Name = "button2";
     _button2.UseUnderline = true;
     _button2.Label = Catalog.GetString ("GtkButton");
     _gtkAlignment.Add (_button2);
     _frame1.Add (_gtkAlignment);
     _gtkLabel1 = new Label ();
     _gtkLabel1.Name = "GtkLabel1";
     _gtkLabel1.LabelProp = Catalog.GetString ("<b>GtkFrame</b>");
     _gtkLabel1.UseMarkup = true;
     _frame1.LabelWidget = _gtkLabel1;
     Add (_frame1);
     if ((Child != null)) {
         Child.ShowAll ();
     }
     Hide ();
 }
		public MonoMacPackagingSettingsDialog ()
		{
			this.Title = GettextCatalog.GetString ("Create Mac Installer");
			this.DestroyWithParent = true;
			this.Modal = true;
			
			settingsWidget.Show ();
			
			var al = new Alignment (0.5f, 0.5f, 1.0f, 1.0f) {
				TopPadding = 12,
				BottomPadding = 12,
				RightPadding = 12,
				LeftPadding = 12,
				Child = settingsWidget,
			};
			al.Show ();
			
			this.VBox.PackStart (al, true, true, 0);
			var okButton = new Button () {
				Label = GettextCatalog.GetString ("Create Package")
			};
			var cancelButton = new Button (Stock.Cancel);
			
			this.AddActionWidget (cancelButton, ResponseType.Cancel);
			this.AddActionWidget (okButton, ResponseType.Ok);
			this.ActionArea.ShowAll ();
		}
示例#13
0
		public ViewNameIcon() : base()
		{
			upbutton = new Button();
			upbutton.Add( new Image(Stock.GoUp, IconSize.Button) );
			upbutton.Clicked += OnUpClicked;
			downbutton = new Button();			
			downbutton.Add( new Image(Stock.GoDown, IconSize.Button) );
			downbutton.Clicked += OnDownClicked;
			swindow = new ScrolledWindow();
			view = new IconView();
			
			CellRendererPixbuf cellicon= new CellRendererPixbuf();
			CellRendererText celltext = new CellRendererText();
			celltext.Xalign=0.5f;
			view.PackStart(cellicon, false);
			view.SetCellDataFunc(cellicon, CellRenderFunctions.RenderIcon);
			view.PackStart(celltext, false);
			view.SetCellDataFunc(celltext, CellRenderFunctions.RenderName);
			view.SelectionMode = Gtk.SelectionMode.Browse;
			view.SelectionChanged += OnSelectionChanged;
			view.ItemActivated += OnRowActivated;
			swindow.Add(view);
			swindow.HscrollbarPolicy = PolicyType.Never;
			swindow.VscrollbarPolicy = PolicyType.Automatic;
			this.PackStart(upbutton, false, false, 0);
			this.PackStart(swindow, true, true, 0);
			this.PackStart(downbutton, false, false, 0);
			
			store = new StoreBase();
			view.Model=store.ViewModel;
			
			ShowAll();
		}
示例#14
0
		//private static Gdk.Pixmap pixmap = null;
		//private static Gtk.InputDialog inputDialog = null;

		public static int Main15 (string[] args) {
			Application.Init ();
			win = new Gtk.Window ("Scribble XInput Demo");
			win.DeleteEvent += new DeleteEventHandler (WindowDelete);

			vBox = new VBox (false, 0);
			win.Add (vBox);

			darea = new Gtk.DrawingArea ();
			darea.SetSizeRequest (200, 200);
			// darea.ExtensionEvents=ExtensionMode.Cursor;
			vBox.PackStart (darea, true, true, 0);
			
			//darea.ExposeEvent += new ExposeEventHandler (ExposeEvent);
			darea.ConfigureEvent += new ConfigureEventHandler (ConfigureEvent);
			darea.MotionNotifyEvent += new MotionNotifyEventHandler (MotionNotifyEvent);
			darea.ButtonPressEvent += new ButtonPressEventHandler (ButtonPressEvent);
			darea.Events = EventMask.ExposureMask | EventMask.LeaveNotifyMask |
				       EventMask.ButtonPressMask | EventMask.PointerMotionMask;

			inputButton = new Button("Input Dialog");
			vBox.PackStart (inputButton, false, false, 0);

			inputButton.Clicked += new EventHandler (InputButtonClicked);

			quitButton = new Button("Quit");
			vBox.PackStart (quitButton, false, false, 0);

			quitButton.Clicked += new EventHandler (QuitButtonClicked);
			
			win.ShowAll ();
			Application.Run ();
			return 0;
		}
示例#15
0
        private void ShowSetupPage()
        {
            Header = CmisSync.Properties_Resources.ResourceManager.GetString("Welcome", CultureInfo.CurrentCulture);
            Description = CmisSync.Properties_Resources.ResourceManager.GetString("Intro", CultureInfo.CurrentCulture);

            Add(new Label("")); // Page must have at least one element in order to show Header and Descripton

            Button cancel_button = new Button (cancelText);
            cancel_button.Clicked += delegate {
                Controller.SetupPageCancelled ();
            };

            Button continue_button = new Button (continueText)
            {
                Sensitive = false
            };

            continue_button.Clicked += delegate (object o, EventArgs args) {
                Controller.SetupPageCompleted ();
            };

            AddButton (cancel_button);
            AddButton (continue_button);

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

            Controller.CheckSetupPage ();
        }
示例#16
0
    public ExportDialog(Catalog catalog, bool searchOn)
        : base(Mono.Posix.Catalog.GetString ("Export"), null, DialogFlags.NoSeparator | DialogFlags.Modal)
    {
        this.catalog = catalog;
        this.templates = new Hashtable ();
        this.searchOn = searchOn;

        Glade.XML gxml = new Glade.XML (null, "dialogexport.glade", "hbox1", null);
        gxml.Autoconnect(this);

        cancelButton = (Button)this.AddButton (Gtk.Stock.Cancel, 0);
        okButton     = (Button)this.AddButton (Gtk.Stock.Ok, 1);
        cancelButton.Clicked += OnCancelButtonClicked;
        okButton.Clicked     += OnOkButtonClicked;

        VBox vBox = this.VBox;
        vBox.Add ((Box)gxml["hbox1"]);

        PopulateComboBox ();

        if (!searchOn) {
            radioButtonSearch.Sensitive = false;
        }

        radioButtonActive.Label = String.Format (Mono.Posix.Catalog.GetString ("Export the whole {0} catalog"),catalog.ShortDescription);

        this.ShowAll();
    }
示例#17
0
		public static Gtk.Window Create ()
		{
			window = new Window ("GtkCombo");
			window.SetDefaultSize (200, 100);

			VBox box1 = new VBox (false, 0);
			window.Add (box1);

			VBox box2 = new VBox (false, 10);
			box2.BorderWidth = 10;
			box1.PackStart (box2, true, true, 0);

			combo = new Gtk.Combo ();
			string[] pop = {"Foo", "Bar"};
			combo.PopdownStrings = pop;
			combo.Entry.Activated += new EventHandler (OnComboActivated);
			box2.PackStart (combo, true, true, 0);

			HSeparator separator = new HSeparator ();

			box1.PackStart (separator, false, false, 0);

			box2 = new VBox (false, 10);
			box2.BorderWidth = 10;
			box1.PackStart (box2, false, false, 0);

			Button button = new Button (Stock.Close);
			button.Clicked += new EventHandler (OnCloseClicked);
			button.CanDefault = true;
			
			box2.PackStart (button, true, true, 0);
			button.GrabDefault ();
			return window;
		}
示例#18
0
文件: TopBar.cs 项目: gsterjov/fusemc
        // create the TopBar widget
        public TopBar()
        {
            // create the widgets
            Button add_button = new Button (Stock.Add);
            Button remove_button = new Button (Stock.Remove);
            Label search_label = new Label ("Search:");

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

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

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

            // pack widgets
            this.PackStart (button_box, false, true, 0);
            this.PackStart (search_label, false, false, 5);
            this.PackStart (search, true, true, 0);
            this.PackStart (clear_box, false, false, 0);
        }
示例#19
0
 public AñadirNumPersonas(Label labelTotalMainWindow,Button botonNP)
     : base(Gtk.WindowType.Toplevel)
 {
     this.Build ();
     botonNuevoPedidoMainWindow = botonNP;
     totalMainWindow = labelTotalMainWindow;
 }
示例#20
0
        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;
        }
示例#21
0
        public MainWindow_Event()
            : base("")
        {
            SetDefaultSize(250, 200);
            SetPosition(WindowPosition.Center);

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

            Fixed fix = new Fixed();

            Button btn = new Button("Enter");
            btn.EnterNotifyEvent += OnEnter;

            _quit = new Button("Quit");
            //_quit.Clicked += OnClick;
            _quit.SetSizeRequest(80, 35);

            CheckButton cb = new CheckButton("connect");
            cb.Toggled += OnToggled;

            fix.Put(btn, 50, 20);
            fix.Put(_quit, 50, 50);
            fix.Put(cb, 120, 20);
            Add(fix);
            ShowAll();
        }
示例#22
0
		public TabLabel (Label label, Gtk.Image icon) : base (false, 0)
		{
			this.title = label;
			this.icon = icon;
			icon.Xpad = 2;

			EventBox eventBox = new EventBox ();
			eventBox.BorderWidth = 0;
			eventBox.VisibleWindow = false;
			eventBox.Add (icon);
			this.PackStart (eventBox, false, true, 0);

			titleBox = new EventBox ();
			titleBox.VisibleWindow = false;
			titleBox.Add (title);
			this.PackStart (titleBox, true, true, 0);

			Gtk.Rc.ParseString ("style \"MonoDevelop.TabLabel.CloseButton\" {\n GtkButton::inner-border = {0,0,0,0}\n }\n");
			Gtk.Rc.ParseString ("widget \"*.MonoDevelop.TabLabel.CloseButton\" style  \"MonoDevelop.TabLabel.CloseButton\"\n");
			Button button = new Button ();
			button.CanDefault = false;
			var closeIcon = new Xwt.ImageView (closeImage).ToGtkWidget ();
			button.Image = closeIcon;
			button.Relief = ReliefStyle.None;
			button.BorderWidth = 0;
			button.Clicked += new EventHandler(ButtonClicked);
			button.Name = "MonoDevelop.TabLabel.CloseButton";
			this.PackStart (button, false, true, 0);
			this.ClearFlag (WidgetFlags.CanFocus);
			this.BorderWidth = 0;

			this.ShowAll ();
		}
        public void GetToken()
        {
            window = new Gtk.Window ("packingdemo");
            window.Title = "CircleCi Indicator Configuration";
            window.WindowPosition = WindowPosition.Center;

            HBox hbox = new HBox ();

            VBox vbox = new VBox (false, 0);

            Label label = new Label ();
            label.Markup = "Please provide your CircleCi token.\nYou can get one <a href=\"https://circleci.com/account/api\">here</a>.";

            entry = new Entry ();

            Button okButton = new Button ("OK");

            vbox.PackStart (label, false, false, 20);
            vbox.PackStart (entry, false, false, 0);
            vbox.PackStart (okButton, false, false, 20);

            hbox.PackStart (vbox, false, false, 50);

            window.Add(hbox);

            entry.KeyReleaseEvent += HandleKeyReleaseEvent;
            okButton.Clicked += HandleClicked;;

            window.ShowAll ();
        }
示例#24
0
        public static void AddNewWordToDic(object sender, EventArgs e)
        {
            var win = new Gtk.Window("Přidej slovo");
            win.SetPosition( WindowPosition.Mouse );
            Label l = new Label();
            l.Text = "Vloží slovo do aktuálně načteného slovníku, avšak nezmění zdroj (např. soubor dic.txt )";

            Entry entry = new Entry();
            Button b = new Button("Přidej");
            VBox vbox = new VBox();
            HBox hbox = new HBox();
            vbox.BorderWidth = 10;

            vbox.PackStart( l );
            vbox.PackEnd( hbox );

            hbox.PackStart( entry );
            hbox.PackEnd( b );

            b.Clicked += delegate {
                game.dictionary.Add( entry.Text );
                win.HideAll();
                win.Destroy();
                win.Dispose();
            };

            win.Add(vbox);
            win.ShowAll();
        }
示例#25
0
        public void Initialize() {
            Window = (Window) _builder.GetObject("LauncherWindow");
            Window.Title = _setup.Title;
            Window.Hidden += (sender, eventArgs) => Application.Quit();
            Window.Show();
            PatchNotes = (TextView)_builder.GetObject("PatchNotes");
            ProgressBar = (ProgressBar) _builder.GetObject("ProgressBar");
            PlayButton = (Button) _builder.GetObject("PlayButton");
            PlayButton.Clicked += (sender, args) => {
                Program.StartGame(_setup);
            };

            HeaderImage = (Image)_builder.GetObject("HeaderImage");
            var headerLocation = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "LaunchHeader.png");
            if (File.Exists(headerLocation))
                HeaderImage.Pixbuf = new Gdk.Pixbuf(headerLocation);

            var changeLogFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "changelog.txt");
            string patchNotesText = "You're using a BETA version of our custom launcher. Please report all issues on the forum at http://onemoreblock.com/.";

            if (File.Exists(changeLogFile))
                patchNotesText += "\n\n" + File.ReadAllText(changeLogFile);

            PatchNotes.Buffer.Text = patchNotesText;

            Task.Run(() => CheckAndUpdate());
        }
示例#26
0
        public PasswordWindow()
            : base(WindowType.Toplevel)
        {
            Password = null;
            Cancelled = true;

            box = new HBox(true, 3);

            label = new Label("Wachtwoord:");
            box.PackStart(label);

            TextTagTable textTagTable = new TextTagTable();
            passwordField = new TextView(new TextBuffer(new TextTagTable()));
            box.PackStart(passwordField);

            button = new Button();
            button.Label = "Ok";
            button.Clicked += delegate {
                Password = passwordField.Buffer.Text;
                Cancelled = false;
                Hide();
            };
            box.PackStart(button);

            Add(box);
            ShowAll();
        }
示例#27
0
		private void AttachWidgets (TextView textView)
		{
			// This is really different from the C version, but the
			// C versions seems a little pointless.

			Button button = new Button ("Click Me");
			button.Clicked +=  new EventHandler(EasterEggCB);
			textView.AddChildAtAnchor (button, buttonAnchor);
			button.ShowAll ();

			ComboBox combo = ComboBox.NewText ();
			combo.AppendText ("Option 1");
			combo.AppendText ("Option 2");
			combo.AppendText ("Option 3");

 			textView.AddChildAtAnchor (combo, menuAnchor);

			HScale scale = new HScale (null);
			scale.SetRange (0,100);
			scale.SetSizeRequest (70, -1);
			textView.AddChildAtAnchor (scale, scaleAnchor);
			scale.ShowAll ();

			Gtk.Image image = Gtk.Image.LoadFromResource ("floppybuddy.gif");
			textView.AddChildAtAnchor (image, animationAnchor);
			image.ShowAll ();

			Entry entry = new Entry ();
			textView.AddChildAtAnchor (entry, entryAnchor);
			entry.ShowAll ();
		}
示例#28
0
		void IPadContent.Initialize (IPadWindow window)
		{
			this.window = window;
			window.Icon = icon;
			
			DockItemToolbar toolbar = window.GetToolbar (PositionType.Right);

			buttonStop = new Button (new Gtk.Image ("gtk-stop", IconSize.Menu));
			buttonStop.Clicked += new EventHandler (OnButtonStopClick);
			buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
			toolbar.Add (buttonStop);

			buttonClear = new Button (new Gtk.Image ("gtk-clear", IconSize.Menu));
			buttonClear.Clicked += new EventHandler (OnButtonClearClick);
			buttonClear.TooltipText = GettextCatalog.GetString ("Clear console");
			toolbar.Add (buttonClear);

			buttonPin = new ToggleButton ();
			buttonPin.Image = new Gtk.Image ((IconId)"md-pin-up", IconSize.Menu);
			buttonPin.Image.ShowAll ();
			buttonPin.Clicked += new EventHandler (OnButtonPinClick);
			buttonPin.TooltipText = GettextCatalog.GetString ("Pin output pad");
			toolbar.Add (buttonPin);
			toolbar.ShowAll ();
		}
示例#29
0
        public BebidasCalientesView(Label labelTotalMainWindow,Button botonNP)
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build ();

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

            dbConnection = ApplicationContext.Instance.DbConnection;

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

            IDataReader dataReader = dbCommand.ExecuteReader ();

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

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

            dataReader.Close ();
        }
        public PageNavigationEntry (TrackEditorDialog dialog, string completionTable, string completionColumn)
        {
            this.dialog = dialog;
            entry = new TextEntry (completionTable, completionColumn);
            entry.Changed += OnChanged;
            entry.Activated += EditNextTitle;
            entry.KeyPressEvent += delegate (object o, KeyPressEventArgs args) {
                if ((args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter) &&
                    (args.Event.State & Gdk.ModifierType.ControlMask) != 0 && dialog.CanGoBackward) {
                    dialog.NavigateBackward ();
                    entry.GrabFocus ();
                }
            };
            entry.Show ();

            Spacing = 1;
            PackStart (entry, true, true, 0);

            if (dialog.TrackCount > 1) {
                dialog.Navigated += delegate {
                    forward_button.Sensitive = dialog.CanGoForward;
                };
                forward_button = EditorUtilities.CreateSmallStockButton (Stock.GoForward);
                object tooltip_host = Hyena.Gui.TooltipSetter.CreateHost ();
                Hyena.Gui.TooltipSetter.Set (tooltip_host, forward_button, Catalog.GetString ("Advance to the next track and edit its title"));
                forward_button.Sensitive = dialog.CanGoForward;
                forward_button.Show ();
                forward_button.Clicked += EditNextTitle;
                PackStart (forward_button, false, false, 0);
            }
        }
        HBox GetSnackBarLayout(Container container, SnackBarOptions arguments)
        {
            var snackBarLayout = new HBox();

            snackBarLayout.ModifyBg(StateType.Normal, arguments.BackgroundColor.ToGtkColor());

            var message = new Gtk.Label(arguments.MessageOptions.Message);

            message.ModifyFont(new FontDescription {
                AbsoluteSize = arguments.MessageOptions.FontSize, Family = arguments.MessageOptions.FontFamily
            });
            message.ModifyFg(StateType.Normal, arguments.MessageOptions.Foreground.ToGtkColor());
            snackBarLayout.Add(message);
            snackBarLayout.SetChildPacking(message, false, false, 0, PackType.Start);

            foreach (var action in arguments.Actions)
            {
                var button = new Gtk.Button
                {
                    Label = action.Text
                };
                button.ModifyFont(new FontDescription {
                    AbsoluteSize = action.FontSize, Family = action.FontFamily
                });
                button.ModifyBg(StateType.Normal, action.BackgroundColor.ToGtkColor());
                button.ModifyFg(StateType.Normal, action.ForegroundColor.ToGtkColor());

                button.Clicked += async(sender, e) =>
                {
                    snackBarTimer.Stop();
                    await action.Action();

                    arguments.SetResult(true);
                    container.Remove(snackBarLayout);
                };

                snackBarLayout.Add(button);
                snackBarLayout.SetChildPacking(button, false, false, 0, PackType.End);
            }

            return(snackBarLayout);
        }
示例#32
0
        private void AddPersonRow(Person newPerson)
        {
            datatablePersons.NRows = RowNum + 1;

            Gtk.Label labelSurame = new Gtk.Label("Фамилия:");
            datatablePersons.Attach(labelSurame, (uint)0, (uint)1, RowNum, RowNum + 1, (AttachOptions)0, (AttachOptions)0, (uint)0, (uint)0);

            var nameDataEntry = new yEntry();

            nameDataEntry.Binding.AddBinding(newPerson, e => e.Lastname, w => w.Text).InitializeFromSource();
            nameDataEntry.WidthChars = 20;
            datatablePersons.Attach(nameDataEntry, (uint)1, (uint)2, RowNum, RowNum + 1, AttachOptions.Expand | AttachOptions.Fill, (AttachOptions)0, (uint)0, (uint)0);

            Gtk.Label labelName = new Gtk.Label("Имя:");
            datatablePersons.Attach(labelName, (uint)2, (uint)3, RowNum, RowNum + 1, (AttachOptions)0, (AttachOptions)0, (uint)0, (uint)0);

            var surnameDataEntry = new yEntry();

            surnameDataEntry.Binding.AddBinding(newPerson, e => e.Name, w => w.Text).InitializeFromSource();
            surnameDataEntry.WidthChars = 20;
            datatablePersons.Attach(surnameDataEntry, (uint)3, (uint)4, RowNum, RowNum + 1, AttachOptions.Expand | AttachOptions.Fill, (AttachOptions)0, (uint)0, (uint)0);

            Gtk.Label labelPatronymic = new Gtk.Label("Отчество:");
            datatablePersons.Attach(labelPatronymic, (uint)4, (uint)5, RowNum, RowNum + 1, (AttachOptions)0, (AttachOptions)0, (uint)0, (uint)0);

            var patronymicDataEntry = new yEntry();

            patronymicDataEntry.Binding.AddBinding(newPerson, e => e.PatronymicName, w => w.Text).InitializeFromSource();
            patronymicDataEntry.WidthChars = 20;
            datatablePersons.Attach(patronymicDataEntry, (uint)5, (uint)6, RowNum, RowNum + 1, AttachOptions.Expand | AttachOptions.Fill, (AttachOptions)0, (uint)0, (uint)0);

            Gtk.Button deleteButton = new Gtk.Button();
            Gtk.Image  image        = new Gtk.Image();
            image.Pixbuf          = Stetic.IconLoader.LoadIcon(this, "gtk-delete", global::Gtk.IconSize.Menu);
            deleteButton.Image    = image;
            deleteButton.Clicked += OnButtonDeleteClicked;
            datatablePersons.Attach(deleteButton, (uint)6, (uint)7, RowNum, RowNum + 1, (AttachOptions)0, (AttachOptions)0, (uint)0, (uint)0);

            datatablePersons.ShowAll();

            RowNum++;
        }
示例#33
0
        public override void Init()
        {
            Gtk.Label             label           = new Gtk.Label();
            Pango.FontDescription fontDescription = Pango.FontDescription.FromString(UIUtils.BUTTON_FONT);
            label.ModifyFont(fontDescription);
            label.ShowAll();

            _button               = new Gtk.Button(label);
            _button.CanFocus      = true;
            _button.UseUnderline  = true;
            _button.TooltipText   = GetCommandDescriptor()._command;
            _button.WidthRequest  = _buttonSize.X;
            _button.HeightRequest = _buttonSize.Y;
            _button.Show();
            _button.ButtonPressEvent   += OnButtonPressEvent;
            _button.ButtonReleaseEvent += OnButtonReleaseEvent;
            GetParent().Add(_button);

            Refresh();
        }
示例#34
0
    public ChronoJump(string [] args)
    {
        Application.Init();

        //start threading to show splash window
        SplashWindow.Show();
        createdSplashWin = true;

        fakeSplashButton          = new Gtk.Button();
        fakeSplashButton.Clicked += new EventHandler(on_splash_ended);

        LongoMatch.Video.Capturer.GstCameraCapturer.InitBackend("");

        thread = new Thread(new ThreadStart(sqliteThings));
        GLib.Idle.Add(new GLib.IdleHandler(PulseGTK));
        LogB.ThreadStart();
        thread.Start();

        Application.Run();
    }
示例#35
0
        void AppendCommand(CommandDescriptor cmd)
        {
            Gtk.Button button = new Gtk.Button(cmd.Label);
            button.Clicked += delegate(object o, EventArgs args) {
                cmd.Run(this.obj);
            };
            button.Show();
            Append(button, cmd.Description);

            if (cmd.HasDependencies)
            {
                editors[cmd.Name] = button;
                sensitives[cmd]   = cmd;
            }
            if (cmd.HasVisibility)
            {
                editors[cmd.Name] = button;
                invisibles[cmd]   = cmd;
            }
        }
    RepetitiveConditionsWindow()
    {
        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly(Util.GetGladePath() + "repetitive_conditions.glade", "repetitive_conditions", "chronojump");
        gladeXML.Autoconnect(this);

        //don't show until View is called
        repetitive_conditions.Hide();

        //put an icon to window
        UtilGtk.IconWindow(repetitive_conditions);

        FakeButtonClose = new Gtk.Button();

        createComboEncoderAutomaticVariable();

        bestSetValue = 0;

        putNonStandardIcons();
    }
示例#37
0
        public StartDaemon()
        {
            HeaderIconFromStock = Stock.DialogError;
            Header = Catalog.GetString("Search service not running");

            Append(Catalog.GetString("The search service does not appear to be running. " +
                                     "You can start it by clicking the button below."));

            Gtk.Button button = new Gtk.Button(Catalog.GetString("Start search service"));
            button.Clicked += OnStartDaemon;
            button.Show();

            Append(button);

            autostart_toggle        = new Gtk.CheckButton(Catalog.GetString("Automatically start service on login"));
            autostart_toggle.Active = true;
            autostart_toggle.Show();

            Append(autostart_toggle);
        }
示例#38
0
        void AddButton(string stock_id, Gtk.ResponseType response, bool is_default)
        {
            Gtk.Button button = new Gtk.Button(stock_id);
            button.CanDefault = true;
            button.Show();

            AddActionWidget(button, response);

            if (is_default)
            {
                DefaultResponse = response;

/*				button.AddAccelerator ("activate",
 *                                                     accel_group,
 *                                                     (uint) Gdk.Key.Escape,
 *                                                     0,
 *                                                     Gtk.AccelFlags.Visible);
 */
            }
        }
        public SongDuplicateView()
        {
            Gtk.ScrolledWindow Scroll = new Gtk.ScrolledWindow();
            Gtk.TreeView       Tree   = new Gtk.TreeView();
            Gtk.VBox           vbox   = new Gtk.VBox(false, 1);
            Gtk.HBox           hbox   = new Gtk.HBox(false, 1);
            Tree.RowActivated += OnRowClicked;
            //Buttons For Header
            Gtk.Button removeButton = new Gtk.Button();
            removeButton.Label    = AddinManager.CurrentLocalizer.GetString("Remove Selected Songs");
            removeButton.Clicked += OnRemoveCommand;
            Gtk.Button deleteButton = new Gtk.Button();
            deleteButton.Label    = AddinManager.CurrentLocalizer.GetString("Delete Selected Songs");
            deleteButton.Clicked += OnDeleteCommand;

            //Create 5 columns, first column is a checkbox, next 4 are text boxes
            Gtk.CellRendererToggle selectCell = new Gtk.CellRendererToggle();
            selectCell.Activatable = true;
            selectCell.Toggled    += OnSelectToggled;
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Select"), selectCell, "active", 0);
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Track Number"), new Gtk.CellRendererText(), "text", 1);
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Song Title"), new Gtk.CellRendererText(), "text", 2);
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Artist"), new Gtk.CellRendererText(), "text", 3);
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("Album"), new Gtk.CellRendererText(), "text", 4);
            Tree.AppendColumn(AddinManager.CurrentLocalizer.GetString("File"), new Gtk.CellRendererText(), "text", 5);
            // Remove From Library, Delete From Drive, Song Name, Artist Name, Album Name, Formated URI, Actual URI, Database Track ID
            MusicListStore = new Gtk.ListStore(typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(int));
            Tree.Model     = MusicListStore;
            //Pack the Tree in a scroll window
            Scroll.Add(Tree);
            //Pack the buttons in a hbox
            hbox.PackStart(removeButton, false, false, 0);
            hbox.PackStart(deleteButton, false, false, 0);
            //pack the hbox->buttons and Scroll->Tree in a Vbox, tell the Scroll window to Expand and Fill the vbox
            vbox.PackStart(hbox, false, false, 0);
            vbox.PackStart(Scroll, true, true, 0);
            //pack the vbox in the Rounded Frame
            Add(vbox);
            //Finally, show everything
            ShowAll();
        }
示例#40
0
    public SplashWindow()
    {
        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly(Util.GetGladePath() + "chronojump.glade", "splash_window", "chronojump");
        gladeXML.Autoconnect(this);

        //put an icon to window
        UtilGtk.IconWindow(splash_window);

        fakeButtonCancel  = new Gtk.Button();
        FakeButtonCreated = true;

        CancelButtonShow(false);
        hideAllProgressbars();

        //put logo image
        Pixbuf pixbuf;

        pixbuf            = new Pixbuf(null, Util.GetImagePath(false) + Constants.FileNameLogo320);
        image_logo.Pixbuf = pixbuf;
    }
示例#41
0
        public WelcomePageProjectBar()
        {
            SetPadding(3, 3, 12, 12);
            GradientBackground = false;
            BackgroundColor    = MonoDevelop.Ide.Gui.Styles.BaseBackgroundColor.ToGdkColor();

            HBox box = new HBox(false, 6);

            box.PackStart(messageLabel = new Gtk.Label()
            {
                Xalign = 0
            }, true, true, 0);
            backButton = new Gtk.Button();
            box.PackEnd(backButton, false, false, 0);

            backButton.Clicked += delegate {
                WelcomePageService.HideWelcomePage(true);
            };
            Add(box);
            UpdateContent();
        }
示例#42
0
    // end of Chronopic Automatic Firmware ---------------


    void prepareChronopicConnection()
    {
        check_multitest_show.Sensitive = false;
        frame_connection.Visible       = true;

        label_title.Text      = Catalog.GetString("Please touch the platform or click Chronopic <i>TEST</i> button");
        label_title.UseMarkup = true;

        button_cancel.Sensitive = true;

        fakeConnectionButton          = new Gtk.Button();
        fakeConnectionButton.Clicked += new EventHandler(on_chronopic_connection_ended);

        connecting             = true;
        needUpdateChronopicWin = false;
        thread = new Thread(new ThreadStart(waitChronopicStart));
        GLib.Idle.Add(new GLib.IdleHandler(PulseGTK));

        LogB.ThreadStart();
        thread.Start();
    }
示例#43
0
        public ProgressDialog(string title, CancelButtonType cancel_button_type, int totalCount, Gtk.Window parent_window)
        {
            this.WidthRequest = 350;
            Title             = title;
            this.totalCount   = totalCount;

            if (parent_window != null)
            {
                this.TransientFor = parent_window;
            }
            this.Modal = true;

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

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

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

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

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

            Response += new ResponseHandler(HandleResponse);
            ShowAll();
            while (Application.EventsPending())
            {
                Application.RunIteration();
            }
        }
            // FIXME clicking the spinbutton too fast seems to switch the view to browse

            public FaceBox(Gtk.Box tb, PhotoImageView vw) : base()
            {
                m_list     = new ArrayList();
                face_store = Core.Database.Faces;
                View       = vw;
                tag_store  = FSpot.Core.Database.Tags;

                Gtk.Label lab = new Gtk.Label("Face det:");
                lab.Show();
                tb.PackStart(lab, false, true, 0);

                face_button = new ToolbarButton();
                face_button.Add(new Gtk.Image("f-spot-sepia", IconSize.Button));
                tb.PackStart(face_button, false, true, 0);

                face_button.Clicked += HandleFaceButtonClicked;

                tag_entry = new Gtk.Entry("test");
                tag_entry.Show();
                tag_entry.Sensitive = false;
                tb.PackStart(tag_entry, false, true, 0);

                m_newtag_button = new  ToolbarButton();
                m_newtag_button.Add(new Gtk.Image("f-spot-new-tag", IconSize.Button));
                m_newtag_button.Show();
                m_newtag_button.Sensitive = false;
                tb.PackStart(m_newtag_button, false, true, 0);

                m_newtag_button.Clicked += HandleNewTagButtonClicked;

                m_spin = new SpinButton(1, 1, 1);
                m_spin.Show();
                m_spin.Sensitive = false;
                tb.PackStart(m_spin, false, true, 0);

                m_spin.Changed += HandleSpinChanged;

                //m.spin.ValueChanged += jesli w bazie, to pokaz jego tag
                //this.Add(tag_widget);
            }
示例#45
0
    private void createTable()
    {
        LogB.Debug("Persons count" + persons.Count.ToString());
        uint padding = 4;
        uint cols    = 4;      //each row has 4 columns
        uint rows    = Convert.ToUInt32(Math.Floor(persons.Count / (1.0 * cols)) + 1);
        int  count   = 0;

        label_selected_person_name.Text = "";
        SelectedPerson = null;
        personButtonsSensitive(false);
        vbox_button_delete_confirm.Visible = false;

        for (int row_i = 0; row_i < rows; row_i++)
        {
            for (int col_i = 0; col_i < cols; col_i++)
            {
                if (count >= persons.Count)
                {
                    return;
                }

                Person p = (Person)persons[count++];

                PersonPhotoButton ppb = new PersonPhotoButton(p);
                Gtk.Button        b   = ppb.CreateButton();
                b.Show();

                b.Clicked += new EventHandler(on_button_portrait_clicked);
                b.CanFocus = true;

                table1.Attach(b, (uint)col_i, (uint)col_i + 1, (uint)row_i, (uint)row_i + 1,
                              Gtk.AttachOptions.Fill,
                              Gtk.AttachOptions.Fill,
                              padding, padding);
            }
        }

        table1.ShowAll();
    }
示例#46
0
        private Gtk.Widget MakeEditPage()
        {
            Gtk.VBox vbox = new Gtk.VBox(false, 0);
            vbox.BorderWidth = 6;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType       = Gtk.ShadowType.EtchedIn;
            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;

            textView             = new Gtk.TextView();
            textView.WrapMode    = Gtk.WrapMode.Word;
            textView.Editable    = true;
            textView.Buffer.Text = text;
            textView.CanFocus    = true;
            textView.NoShowAll   = true;
            textView.SetSizeRequest(-1, 60);
            sw.Add(textView);
            sw.Show();
            vbox.PackStart(sw, true, true, 0);

            Gtk.HButtonBox hButtonBox = new Gtk.HButtonBox();
            hButtonBox.Layout = Gtk.ButtonBoxStyle.End;

            cancelButton           = new Gtk.Button(Gtk.Stock.Cancel);
            cancelButton.Clicked  += OnEditCanceled;
            cancelButton.NoShowAll = true;
            hButtonBox.PackStart(cancelButton, false, false, 0);

            saveButton           = new Gtk.Button(Gtk.Stock.Save);
            saveButton.Clicked  += OnSaveButtonClicked;
            saveButton.NoShowAll = true;
            hButtonBox.PackStart(saveButton, false, false, 0);

            hButtonBox.Show();
            vbox.PackStart(hButtonBox, false, false, 6);

            vbox.Show();
            return(vbox);
        }
示例#47
0
    protected void initializeThings()
    {
        button_selected     = new Gtk.Button();
        button_deleted_test = new Gtk.Button();

        createTreeView(treeview_more);

        treeview_more.Model = store;
        fillTreeView(treeview_more, store);

        //when executing test: show accept and cancel
        button_accept.Visible = testOrDelete;
        button_cancel.Visible = testOrDelete;
        //when deleting test type: show delete type and close
        button_delete_type.Visible = !testOrDelete;
        button_close.Visible       = !testOrDelete;

        button_accept.Sensitive      = false;
        button_delete_type.Sensitive = false;

        treeview_more.Selection.Changed += onSelectionEntry;
    }
示例#48
0
        private void CreateUi(string name)
        {
            Caption = new Label(name + " ");
            Close   = new Button
            {
                Image       = new Image(Stock.Close, IconSize.Menu),
                TooltipText = "Close Tab",
                Relief      = ReliefStyle.None
            };

            var rcStyle = new RcStyle
            {
                Xthickness = 0,
                Ythickness = 0,
            };

            Close.ModifyStyle(rcStyle);
            PackStart(Caption);
            PackStart(Close);
            ShowAll();
            //Close.Hide();
        }
示例#49
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Scrabble.GUI.Control"/> class.
        /// </summary>
        /// <param name='g'>
        /// G.
        /// </param>
        public Control(Scrabble.Game.Game g) : base("Tah")
        {
            this.HeightRequest = 60;
            this.WidthRequest  = 350;


            this.game        = g;
            this.BorderWidth = 5;

            reload          = new Gtk.Button("Reload");
            reload.Clicked += ReloadRack;
            pass            = new Gtk.Button("Vzdát se tahu");
            pass.Clicked   += delegate {
                this.game.changePlayer();
            };

            mainVbox = new Gtk.VBox();
            mainVbox.PackStart(reload);
            mainVbox.PackEnd(pass);

            this.Add(mainVbox);
        }
示例#50
0
        public void Show(ObjectValue val)
        {
            value       = val;
            visualizers = new List <ValueVisualizer> (DebuggingService.GetValueVisualizers(val));
            visualizers.Sort((v1, v2) => string.Compare(v1.Name, v2.Name, StringComparison.CurrentCultureIgnoreCase));
            buttons = new List <ToggleButton> ();

            Gtk.Button defaultVis = null;

            for (int i = 0; i < visualizers.Count; i++)
            {
                var button = new ToggleButton();
                button.Label    = visualizers [i].Name;
                button.Toggled += OnComboVisualizersChanged;
                if (visualizers [i].IsDefaultVisualizer(val))
                {
                    defaultVis = button;
                }
                hbox1.PackStart(button, false, false, 0);
                buttons.Add(button);
                button.CanFocus = false;
                button.Show();
            }

            if (defaultVis != null)
            {
                defaultVis.Click();
            }
            else if (buttons.Count > 0)
            {
                buttons [0].Click();
            }

            if (val.IsReadOnly || !visualizers.Any(v => v.CanEdit(val)))
            {
                buttonCancel.Label = Gtk.Stock.Close;
                buttonSave.Hide();
            }
        }
    private Gtk.HBox createHBoxStartAndLabel(Task t, Pixbuf pixbuf)
    {
        Gtk.Label l    = new Gtk.Label(t.ToString());
        HBox      hbox = new Gtk.HBox(false, 10);
        Button    button_start;

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

        button_start          = new Gtk.Button(image);
        button_start.Clicked += new EventHandler(button_start_clicked);

        hbox.PackStart(button_start, false, false, 0);
        hbox.PackStart(l, false, false, 0);

        list_tasks_fixed.Add(t);
        LogB.Information("createBoxStart....");
        LogB.Information(t.ToString());
        list_buttons_start.Add(button_start);

        return(hbox);
    }
        // ============================================
        // PRIVATE Methods
        // ============================================
        private void InitializeObject(bool download)
        {
            this.hbox = new Gtk.HBox(false, 2);
            this.Add(this.hbox);

            // Initialize Image Logo
            this.imageLogo = StockIcons.GetImage(((download == true) ? "Download": "Upload"));
            this.hbox.PackStart(this.imageLogo, false, false, 2);

            // Initialize Delete Button
            this.deleteButton          = new Gtk.Button(StockIcons.GetImage("DlTrash"));
            this.deleteButton.Relief   = ReliefStyle.None;
            this.deleteButton.Clicked += new EventHandler(OnDeleteClicked);
            this.hbox.PackEnd(this.deleteButton, false, false, 2);

            // Initialize VBox
            this.vbox = new Gtk.VBox(false, 2);
            this.hbox.PackStart(this.vbox, true, true, 2);

            // Initialize Name
            this.labelName           = new Gtk.Label();
            this.labelName.UseMarkup = true;
            this.labelName.Xalign    = 0.0f;
            this.vbox.PackStart(this.labelName, false, false, 2);

            // Initialize Status "5.8Mb of 8.1Mb (at 316.1Kb/s)"
            this.labelStatus           = new Gtk.Label();
            this.labelStatus.UseMarkup = true;
            this.labelStatus.Xalign    = 0.0f;
            this.vbox.PackStart(this.labelStatus, false, false, 2);

            // Initialize ProgressBar
            this.progressBar = new Gtk.ProgressBar();
            this.vbox.PackStart(this.progressBar, false, false, 2);

            this.vbox.PackStart(new Gtk.HSeparator(), false, false, 2);

            this.ShowAll();
        }
    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();
    }
示例#54
0
        public ThemedIconBrowser(Gtk.Window parent) :
            base("Select a Themed Icon", parent, Gtk.DialogFlags.Modal,
                 Gtk.Stock.Cancel, Gtk.ResponseType.Cancel,
                 Gtk.Stock.Ok, Gtk.ResponseType.Ok)
        {
            HasSeparator     = false;
            BorderWidth      = 12;
            VBox.Spacing     = 18;
            VBox.BorderWidth = 0;

            DefaultResponse = Gtk.ResponseType.Ok;

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

            entry            = new Gtk.Entry();
            entry.Activated += DoFind;
            hbox.PackStart(entry);

            Gtk.Button button = new Gtk.Button(Gtk.Stock.Find);
            button.Clicked += DoFind;
            hbox.PackStart(button, false, false, 0);

            ScrolledWindow scwin = new Gtk.ScrolledWindow();

            scwin.SizeRequested += ScrolledWindowSizeRequested;
            VBox.PackStart(scwin, true, true, 0);
            scwin.SetPolicy(Gtk.PolicyType.Never, Gtk.PolicyType.Automatic);
            scwin.ShadowType = Gtk.ShadowType.In;

            list = new ThemedIconList();
            scwin.Add(list);
            list.SelectionChanged += ListSelectionChanged;
            list.Activated        += ListActivated;
            SetResponseSensitive(Gtk.ResponseType.Ok, false);

            VBox.ShowAll();
        }
示例#55
0
        static void gtml_activate()
        {
            icons = new Gtk.IconFactory();
            icons.AddDefault();

            window              = new Gtk.Window(PN);
            window.DeleteEvent += new DeleteEventHandler(Window_Delete);
            window.SetDefaultSize(800, 120);
            window.Decorated = true;

            grid = new Gtk.Grid();
            grid.ColumnHomogeneous = true;

            Gtk.Image icon = new Gtk.Image();
            icon.IconName          = ("list-add-symbolic");
            import_button          = new Gtk.Button(icon);
            import_button.Clicked += new EventHandler(gtml_import_full);
            Gtk.Box naw = new Gtk.Box(Gtk.Orientation.Horizontal, 1);
            naw.PackStart(import_button, true, true, 1);
            naw.ShowAll();

            stack             = new Gtk.Notebook();
            stack.EnablePopup = true;
            stack.GroupName   = "Mozilla Programs";
            stack.Scrollable  = true;

            stack.SetActionWidget(naw, Gtk.PackType.End);

            stack.Hexpand = true;
            stack.Vexpand = true;

            grid.Attach(stack, 1, 1, 1, 1);
            gtml_reload();

            window.Add(grid);

            window.ShowAll();
        }
示例#56
0
    public static int GetPersonID(Gtk.Button b)
    {
        //access the vbox
        Gtk.VBox box = (Gtk.VBox)b.Child;

        //access the memebers of vbox
        Array box_elements = box.Children;

        //access uniqueID
        Gtk.Label l        = (Gtk.Label)box_elements.GetValue(1);   //the ID
        int       personID = Convert.ToInt32(l.Text);

        //LogB.Information("UniqueID: " + l.Text.ToString());

        //access name

        /*
         * l = (Gtk.Label) box_elements.GetValue(2); //the name
         * LogB.Information("Name: " + l.Text.ToString());
         */

        return(personID);
    }
示例#57
0
        public FileChangedBar(DataView dv)
        {
            dataView = dv;

            this.BorderWidth = 3;

            Gtk.Image img = new Gtk.Image(Gtk.Stock.DialogWarning, Gtk.IconSize.SmallToolbar);

            Gtk.Label label = new Gtk.Label(Catalog.GetString("This file has been changed on disk. You may choose to ignore the changes but reloading is the only safe option."));
            label.LineWrap = true;
            label.Wrap     = true;

            Gtk.Button buttonIgnore = new Gtk.Button(Catalog.GetString("Ignore"));
            buttonIgnore.Clicked += OnFileChangedIgnore;

            Gtk.Button buttonReload = new Gtk.Button(Catalog.GetString("Reload"));
            buttonReload.Clicked += OnFileChangedReload;

            this.PackStart(img, false, false, 4);
            this.PackStart(label, false, false, 10);
            this.PackStart(buttonIgnore, false, false, 10);
            this.PackStart(buttonReload, false, false, 10);
        }
示例#58
0
        public GroupSelector() : base()
        {
            SetFlag(WidgetFlags.NoWindow);

            background = Rectangle.Zero;
            glass      = new Glass(this);
            min_limit  = new Limit(this, Limit.LimitType.Min);
            max_limit  = new Limit(this, Limit.LimitType.Max);

            left = new Gtk.Button();
            //left.Add (new Gtk.Image (Gtk.Stock.GoBack, Gtk.IconSize.Button));
            left.Add(new Gtk.Arrow(Gtk.ArrowType.Left, Gtk.ShadowType.None));
            left.Relief = Gtk.ReliefStyle.None;
            //left.Clicked += HandleScrollLeft;
            left.Pressed            += HandleLeftPressed;
            left.ButtonReleaseEvent += HandleScrollReleaseEvent;
            left_delay = new DelayedOperation(50, new GLib.IdleHandler(HandleScrollLeft));

            right = new Gtk.Button();
            //right.Add (new Gtk.Image (Gtk.Stock.GoForward, Gtk.IconSize.Button));
            right.Add(new Gtk.Arrow(Gtk.ArrowType.Right, Gtk.ShadowType.None));
            right.Relief              = Gtk.ReliefStyle.None;
            right.Pressed            += HandleRightPressed;
            right.ButtonReleaseEvent += HandleScrollReleaseEvent;
            right_delay = new DelayedOperation(50, new GLib.IdleHandler(HandleScrollRight));
            //right.Clicked += HandleScrollRight;

            this.Put(left, 0, 0);
            this.Put(right, 100, 0);
            left.Show();
            right.Show();

            CanFocus = true;

            Mode = RangeType.Min;
            UpdateButtons();
        }
示例#59
0
        // ============================================
        // PROTECTED Methods
        // ============================================

        // ============================================
        // PRIVATE Methods
        // ============================================
        private void InitializeObject()
        {
            // Initialize Image Logo
            this.imageLogo      = new Gtk.Image();
            this.imageLogo.Xpad = 5;
            this.PackStart(this.imageLogo, false, false, 2);

            // Initialize Delete Button
            this.deleteButton          = new Gtk.Button(StockIcons.GetImage("DlTrash"));
            this.deleteButton.Relief   = ReliefStyle.None;
            this.deleteButton.Clicked += new EventHandler(OnDeleteClicked);
            this.PackEnd(this.deleteButton, false, false, 2);

            // Initialize VBox
            this.vbox = new Gtk.VBox(false, 2);
            this.PackStart(this.vbox, true, true, 2);

            // Initialize Name
            this.labelName           = new Gtk.Label();
            this.labelName.UseMarkup = true;
            this.labelName.Xalign    = 0.0f;
            this.vbox.PackStart(this.labelName, false, false, 2);

            // Initialize Status "6.1Mb of 10.1Mb (60%)"
            this.labelStatus           = new Gtk.Label();
            this.labelStatus.UseMarkup = true;
            this.labelStatus.Xalign    = 0.0f;
            this.vbox.PackStart(this.labelStatus, false, false, 2);

            // Initialize ProgressBar
            this.progressBar = new Gtk.ProgressBar();
            this.vbox.PackStart(this.progressBar, false, false, 2);

            this.vbox.PackStart(new Gtk.HSeparator(), false, false, 2);

            this.ShowAll();
        }
示例#60
0
        private void Build()
        {
            var mainVox = new Gtk.VBox();

            var removeButton = new Gtk.Button(Gtk.Stock.Remove);
            var editButton   = new Gtk.Button(Gtk.Stock.Edit);

            removeButton.Clicked += this.OnClickRemove;
            editButton.Clicked   += this.OnClickEdit;

            var hBox = new Gtk.HBox();

            hBox.PackStart(removeButton, false, false, 0);
            hBox.PackStart(editButton, false, false, 0);

            mainVox.PackStart(hBox, false, false, 10);

            //List
            this.notesTreeView = new TreeView(this.measurementsListStore);

            ScrolledWindow sw = new ScrolledWindow();

            sw.ShadowType = ShadowType.EtchedIn;
            sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            sw.Add(notesTreeView);

            this.AddListColumns();

            mainVox.PackStart(sw, true, true, 0);


            //Wrap
            PackStart(mainVox, true, true, 0);

            //Update state and render
            this.OnViewBuilt();
        }