Пример #1
0
        public static String entrada(String texto, String valorInicial)
        {
            MessageDialog dialog = new MessageDialog(null,
                                                     DialogFlags.Modal | DialogFlags.DestroyWithParent,
                                                     MessageType.Question, ButtonsType.OkCancel, texto);

            dialog.Title = "Informa";
            dialog.SetPosition(WindowPosition.Center);

            Entry txtEntrada = new Entry(10);

            txtEntrada.Text = valorInicial;
            txtEntrada.Show();
            dialog.VBox.PackEnd(txtEntrada);
            dialog.DefaultResponse = ResponseType.Ok;

            int retorno = dialog.Run();

            valorInicial = txtEntrada.Text;
            dialog.Destroy();

            if (retorno == (int)ResponseType.Ok)
            {
                return(valorInicial);
            }
            else
            {
                return("");
            }
        }
Пример #2
0
    public HelloWorld()
    {
        win       = new Window();
        win.Title = "Hello World";
        win.Name  = "EWL_WINDOW";
        win.Class = "EWLWindow";
        win.SizeRequest(200, 100);
        win.DeleteEvent += winDelete;

        win.Show();

        lbl = new Entry();
        //lbl.SetFont("/usr/share/fonts/ttf/western/Adeventure.ttf", 12);
        //lbl.SetColor(255, 0 , 0 , 255);
        //lbl.Style = "soft_shadow";
        //lbl.SizeRequest(win.Width, win.Height);
        //lbl.Disable();
        lbl.ChangedEvent += new EwlEventHandler(txtChanged);
        lbl.Text          = "Enlightenment";

        Console.WriteLine(lbl.Text);
        Console.WriteLine(lbl.Text);

        lbl.TabOrderPush();

        win.Append(lbl);

        lbl.Show();
    }
Пример #3
0
        public void Show()
        {
            DispatcherHelpers.RunOnDispatcher(() =>
            {
                _popup.SetContent(_box);
                _popup.Show();

                _box.PackEnd(_label);
                _box.PackEnd(_entry);
                _box.PackEnd(_button);

                _box.Show();

                _label.Show();
                _entry.Show();
                _button.Show();

                _label.AlignmentX = 0.5;
                _label.AlignmentY = 0.25;
                _label.WeightX    = 1;
                _label.WeightY    = 1;

                _entry.AlignmentX = 0.5;
                _entry.AlignmentY = 0.5;
                _entry.WeightX    = 1;
                _entry.WeightY    = 1;

                _button.AlignmentX = 0.5;
                _button.AlignmentY = 0.65;
                _button.WeightX    = 1;
                _button.WeightY    = 1;
            });
        }
Пример #4
0
   public HelloWorld() 
     {      
	win = new Window();
	win.Title = "Hello World";
	win.Name = "EWL_WINDOW";
	win.Class = "EWLWindow";
	win.SizeRequest(200, 100);
	win.DeleteEvent += winDelete;
	
	win.Show();
	
	lbl = new Entry();
	//lbl.SetFont("/usr/share/fonts/ttf/western/Adeventure.ttf", 12);
	//lbl.SetColor(255, 0 , 0 , 255);
	//lbl.Style = "soft_shadow";
	//lbl.SizeRequest(win.Width, win.Height);
	//lbl.Disable();
	lbl.ChangedEvent += new EwlEventHandler(txtChanged);
	lbl.Text = "Enlightenment";
	
	Console.WriteLine(lbl.Text);
	Console.WriteLine(lbl.Text);
	
	lbl.TabOrderPush();
	
	win.Append(lbl);
	
	lbl.Show();
	
     }
Пример #5
0
        public override void Run(Window window)
        {
            Background bg = new Background(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Color      = Color.Black
            };

            bg.Show();
            window.AddResizeObject(bg);

            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new Box(window);

            box.Geometry = window.GetInnerSquare();
            box.Show();

            Check check = new Check(window)
            {
                AlignmentX = -1,
                AlignmentY = 0.9,
                WeightX    = 1,
                WeightY    = 0.1,
                Text       = "Select All",
            };

            check.Show();

            Entry entry = new Entry(window)
            {
                AlignmentX   = -1,
                AlignmentY   = 0.1,
                WeightX      = 1,
                WeightY      = 1,
                IsSingleLine = true,
                Text         = "Hello, Tizen !!!"
            };

            entry.Show();

            check.StateChanged += (object sender, CheckStateChangedEventArgs e) =>
            {
                if (e.NewState == true)
                {
                    entry.SelectAll();
                }
                else
                {
                    entry.SelectNone();
                }
            };

            box.PackEnd(check);
            box.PackEnd(entry);
        }
Пример #6
0
        public static HBox TextEntryField(string fieldName, string value, EventHandler callback, bool deferred = false, ValueType valType = ValueType.Str)
        {
            HBox box = new HBox(false, 20);

            Label label = new Label(fieldName);

            box.PackStart(label, false, false, 0);
            label.Show();

            Entry entry = new Entry();

            entry.WidthRequest = 200;
            box.PackStart(entry, false, false, 0);
            entry.Text = value;

            if (valType != ValueType.Str)
            {
                deferred = true;
            }

            if (deferred)
            {
                DeferredEventHelper h = new DeferredEventHelper(callback, DeferredEvents, valType);
                entry.Changed += h.Fired;
            }
            else
            {
                entry.Changed += callback;
            }
            entry.Show();

            return(box);
        }
Пример #7
0
        private void RecreateLocationsTable()
        {
            for (int i = tblLocations.Children.Length - 1; i >= 0; i--)
            {
                tblLocations.Remove(tblLocations.Children [i]);
            }

            uint index = 0;

            foreach (Location location in locations)
            {
                string name = location.Name;
                Entry  oldEntry;
                if (entries.TryGetValue(location, out oldEntry))
                {
                    name = oldEntry.Text;
                }

                Entry txtName = new Entry(name)
                {
                    WidthChars = 30
                };
                txtName.Show();
                entries [location] = txtName;

                tblLocations.Attach(txtName, index % 2, (index % 2) + 1, index / 2, (index / 2) + 1, AttachOptions.Fill, AttachOptions.Fill, 10, 0);

                index++;
            }
        }
Пример #8
0
        private Box CreateTopBar(Window window)
        {
            // Create Box for address bar
            Box topBar = new Box(window)
            {
                AlignmentX   = -1,
                AlignmentY   = 0,
                WeightX      = 1,
                WeightY      = 0,
                IsHorizontal = true
            };

            topBar.Show();

            // Create address entry
            _addressEntry = new Entry(window)
            {
                AlignmentX   = -1,
                AlignmentY   = -1,
                WeightX      = 1,
                WeightY      = 1,
                IsSingleLine = true,
                Scrollable   = true,
                Text         = _defaultUrl
            };
            _addressEntry.SetInputPanelLayout(InputPanelLayout.Url);
            _addressEntry.Activated += (s, e) =>
            {
                _webview.LoadUrl(((Entry)s).Text);
            };
            _addressEntry.Show();

            // Create reload button
            _reloadButton = new Button(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 0.3,
                WeightY    = 1,
                Text       = "Reload"
            };
            _reloadButton.Clicked += (s, e) =>
            {
                if (_reloadButton.Text.Equals("Reload"))
                {
                    _webview.Reload();
                }
                else if (_reloadButton.Text.Equals("Stop"))
                {
                    _webview.StopLoading();
                }
            };
            _reloadButton.Show();

            topBar.PackEnd(_addressEntry);
            topBar.PackEnd(_reloadButton);

            return(topBar);
        }
Пример #9
0
 public ToolbarEntry() : base()
 {
     entry            = new Entry();
     entry.Activated += new EventHandler(OnActivated);
     this.Add(entry);
     entry.Show();
     this.ShowAll();
 }
Пример #10
0
        public MessageEntry(string title, string dialogIcon, string message, string messageIcon)
            : base(title, dialogIcon, message, messageIcon)
        {
            txtEntry.Show();
            vboContents.PackStart(txtEntry, false, true, 5);

            algDialogMessage.BottomPadding = 0;
            Buttons = MessageButtons.OKCancel;
        }
Пример #11
0
 public ToolbarEntry(ICommand cmd) : base(cmd)
 {
     entry            = new Entry();
     entry.Activated += new EventHandler(OnActivated);
     entry.Text       = cmd.Properties.Text;
     this.Add(entry);
     entry.Show();
     this.ShowAll();
 }
Пример #12
0
        private Widget CreateEditWidget()
        {
            statusEntry = new Entry();
            statusEntry.ModifyBg(StateType.Normal, Style.Background(StateType.Active));
            statusEntry.Activated     += OnStatusEntryActivated;
            statusEntry.KeyPressEvent += OnStatusEntryKeyPressEvent;
            statusEntry.Show();

            return(statusEntry);
        }
Пример #13
0
        void CreateWidget()
        {
            Homogeneous = false;
            Spacing     = 1;

            Add(date_entry = new Entry()
            {
                WidthChars = 10, IsEditable = true
            });
            date_entry.Changed += HandleDateEntryChanged;
            date_entry.Show();
            var    bbox = new HBox();
            Widget w;

            bbox.Add(w = calendar_label = new Label(Catalog.GetString("Calendar")));
            w.Show();
            bbox.Add(w = new Arrow(ArrowType.Down, ShadowType.Out));
            w.Show();
            bbox.Show();
            Add(date_button      = new Button(bbox));
            date_button.Clicked += HandleCalendarButtonClicked;
            date_button.Show();
            Add(time_entry = new Entry()
            {
                WidthChars = 12, IsEditable = true
            });
            time_entry.Changed += HandleTimeEntryChanged;
            time_entry.Show();
            Add(offset_entry = new Entry()
            {
                WidthChars = 6, IsEditable = true
            });
            offset_entry.Changed += HandleOffsetEntryChanged;
            offset_entry.Show();

            calendar                         = new Calendar();
            calendar.DaySelected            += HandleCalendarDaySelected;
            calendar.DaySelectedDoubleClick += HandleCalendarDaySelectedDoubleClick;
            var frame = new Frame();

            frame.Add(calendar);
            calendar.Show();
            calendar_popup = new Window(WindowType.Popup)
            {
                DestroyWithParent = true, Resizable = false
            };
            calendar_popup.Add(frame);
            calendar_popup.DeleteEvent      += HandlePopupDeleted;
            calendar_popup.KeyPressEvent    += HandlePopupKeyPressed;
            calendar_popup.ButtonPressEvent += HandlePopupButtonPressed;
            frame.Show();

            UpdateWidget();
        }
Пример #14
0
 void toggleFiltering(object sender, EventArgs e)
 {
     if (filterVisible)
     {
         filterEntry.Text = "";
         base.Remove(filterEntry);
     }
     else
     {
         base.PackStart(filterEntry, false, false, 4);
         filterEntry.Show();
         filterEntry.GrabFocus();
     }
     filterVisible = !filterVisible;
 }
Пример #15
0
        public AddLevelWindow(Window parent) :
            base(WindowType.Toplevel)
        {
            Parent = parent;
            Modal  = true;

            SetDefaultSize(200, 50);
            SetPosition(WindowPosition.Center);

            /* Set a handler for delete_event that immediately
             * exits GTK. */
            DeleteEvent += delete_event;


            /* Create a 2x2 table */
            HBox layout = new HBox(false, 30);

            /* Put the table in the main window */
            Add(layout);

            Label NameLabel = new Label("Level Name");

            layout.Add(NameLabel);
            NameLabel.Show();


            NameInput = new Entry();
            NameInput.WidthRequest = 200;
            layout.Add(NameInput);
            NameInput.Show();

            Button cancelButton = new Button("Cancel");

            cancelButton.Clicked     += CancelButton_Clicked;
            cancelButton.WidthRequest = 50;
            layout.Add(cancelButton);
            cancelButton.Show();

            Button doneButton = new Button("Done");

            doneButton.Clicked     += DoneButton_Clicked;
            doneButton.WidthRequest = 50;
            layout.Add(doneButton);
            doneButton.Show();

            layout.Show();
            ShowAll();
        }
Пример #16
0
        public override void Render(CellContext context, StateType state, double cellWidth, double cellHeight, CellPosition position)
        {
            CellPosition editPos = ParentColumn.ParentListView.EditedCell;

            if (editPos == position)
            {
                entry.SizeRequest();
                entry.SizeAllocate(context.Area);

                if (restartEdit)
                {
                    entry.SelectRegion(0, -1);
                    entry.HasFocus = true;
                    entry.GrabFocus();
                    restartEdit = false;
                }
                entry.Show();
            }
            else
            {
                string cellText = ObjectToString(boundObject);
                if (string.IsNullOrEmpty(cellText))
                {
                    return;
                }

                PangoStyle style = parentColumn.ParentListView.QueryCellStyle(state, position);

                context.Layout.Width     = (int)((cellWidth - hPadding * 2) * Pango.Scale.PangoScale);
                context.Layout.Ellipsize = EllipsizeMode;
                context.Layout.Alignment = alignment;

                context.Layout.SetMarkup(style.GetMarkup(cellText));
                int text_width;
                int text_height;
                context.Layout.GetPixelSize(out text_width, out text_height);

                context.Context.MoveTo(hPadding, ((int)cellHeight - text_height) / 2);
                Cairo.Color color = context.Theme.Colors.GetWidgetColor(
                    context.TextAsForeground ? GtkColorClass.Foreground : GtkColorClass.Text, state);
                color.A = context.Sensitive ? 1.0 : 0.3;

                context.Context.Color = color;
                context.Context.ShowLayout(context.Layout);
            }
        }
        private HBox BuildLimitFooter()
        {
            HBox limitFooter = new HBox();

            limitFooter.Show();
            limitFooter.Spacing = 5;

            limitCheckBox = new CheckButton("Limit to");
            limitCheckBox.Show();
            limitCheckBox.Toggled += OnLimitCheckBoxToggled;
            limitFooter.PackStart(limitCheckBox, false, false, 0);

            limitEntry = new Entry("25");
            limitEntry.Show();
            limitEntry.SetSizeRequest(50, -1);
            limitFooter.PackStart(limitEntry, false, false, 0);

            limitComboBox = ComboBox.NewText();
            limitComboBox.Show();
            foreach (string criteria in model.LimitCriteria)
            {
                limitComboBox.AppendText(criteria);
            }
            limitComboBox.Active = 0;
            limitFooter.PackStart(limitComboBox, false, false, 0);

            Label orderLabel = new Label("selected by");

            orderLabel.Show();
            limitFooter.PackStart(orderLabel, false, false, 0);

            orderComboBox = ComboBox.NewText();
            orderComboBox.Show();
            foreach (string order in model.OrderCriteria)
            {
                orderComboBox.AppendText(order);
            }
            orderComboBox.Active = 0;
            limitFooter.PackStart(orderComboBox, false, false, 0);

            limitCheckBox.Active = false;
            OnLimitCheckBoxToggled(limitCheckBox, null);

            return(limitFooter);
        }
Пример #18
0
 private void toggleFiltering(object sender, EventArgs e)
 {
     if (!filterToggleButton.Active && (base.Children.Length == 3))
     {
         filterEntry.Text = "";
         base.Remove(filterEntry);
     }
     else if (base.Children.Length == 2)
     {
         base.PackStart(filterEntry, false, false, 4);
         filterEntry.Show();
         filterEntry.GrabFocus();
     }
     else
     {
         throw new Exception("Unexpected number of widgets");
     }
 }
Пример #19
0
        static Entry PutSingleInput(Component component, PropertyInfo field, InputPurpose fillter, Fixed fixd, ref int offset)
        {
            //Label
            Label lbl = new Label();

            lbl.Name = "lbl";
            lbl.Text = field.Name;

            fixd.Put(lbl, 0, offset);
            lbl.Show();
            offset += 20;

            //Field
            Entry entry = new Entry();

            entry.WidthRequest = 180;
            entry.Name         = "entry";
            fixd.Put(entry, 0, offset);
            entry.Show();
            entry.InputPurpose = fillter;
            offset            += 40;
            entry.Text         = field.GetValue(component).ToString();

            entry.Changed += (s, e) => {
                if (field.PropertyType == typeof(int))
                {
                    int value = 0;
                    int.TryParse(entry.Text, out value);
                    field.SetValue(component, value);
                }
                else if (field.PropertyType == typeof(float))
                {
                    float value = 0;
                    float.TryParse(entry.Text, out value);
                    field.SetValue(component, value);
                }
                else if (field.PropertyType == typeof(string))
                {
                    field.SetValue(component, entry.Text);
                }
            };

            return(entry);
        }
Пример #20
0
/*		private void OnStatusComboKeyPress (object sender, KeyPressEventArgs args)
 *              {
 *                      if (args.Event.Key == Gdk.Key.Return) {
 *                              if (PersonManager.Me != null) {
 *                                      Logger.Debug ("FIXME: Set \"my\" status to: {0}",
 *                                                      statusComboBoxEntry.ActiveText);
 *                                      PersonManager.Me.Presence.Message =
 *                                                      statusComboBoxEntry.ActiveText;
 *                              }
 *                      }
 *              }
 */
/*		private void OnStatusComboChanged (object sender, EventArgs args)
 *              {
 *                      Logger.Debug ("OnStatusComboChanged");
 *              }
 */
        private Widget CreateSidebarSearchEntry()
        {
            VBox vbox = new VBox(false, 0);

            Label l = new Label(
                string.Format("<span size=\"large\">{0}</span>",
                              Catalog.GetString("Filter")));

            l.UseMarkup = true;
            l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected));
            l.Xalign = 0;
            l.Show();
            vbox.PackStart(l, false, false, 0);

            searchEntry = new Entry();
            searchEntry.SelectRegion(0, -1);
            searchEntry.CanFocus = true;
            searchEntry.Changed += OnSearchEntryChanged;
            searchEntry.Show();

            Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu);

            stopImage.SetAlignment(0.5F, 0.0F);

            cancelSearchButton           = new Button(stopImage);
            cancelSearchButton.Relief    = ReliefStyle.None;
            cancelSearchButton.Sensitive = false;
            cancelSearchButton.Clicked  += OnCancelSearchButton;
            cancelSearchButton.Show();

            HBox searchHBox = new HBox(false, 4);

            searchHBox.PackStart(searchEntry, true, true, 0);
            searchHBox.PackStart(cancelSearchButton, false, false, 0);

            searchHBox.Show();
            vbox.PackStart(searchHBox, false, false, 0);

            return(vbox);
        }
Пример #21
0
        private String entryDialog(String body, String defau)
        {
            MessageDialog d     = new MessageDialog(this, DialogFlags.Modal, MessageType.Question, ButtonsType.OkCancel, body);
            Entry         entry = new Entry();

            entry.Buffer.Text = defau;
            entry.Show();
            d.ContentArea.PackEnd(entry, true, true, 10);
            //d.Activate += _ => d.Respond(ResponseType.Ok);
            int    r    = d.Run();
            String text = entry.Buffer.Text;

            d.Destroy();
            if (r == (int)ResponseType.Ok)
            {
                return(text);
            }
            else
            {
                return("");
            }
        }
Пример #22
0
    Widget MakeStringItem(BuildServices services, string prompt, MBString res)
    {
        HBox box = new HBox();

        box.Show();

        Label label = new Label(prompt);

        label.Show();
        label.Xalign = 1.0F;

        Entry entry = new Entry(res.Value);

        entry.Show();
        entry.Data[result_key]   = res;
        entry.Data[services_key] = services;
        entry.Changed           += new EventHandler(OnStringChanged);

        box.PackStart(label, true, true, 2);
        box.PackStart(entry, false, true, 2);
        return(box);
    }
Пример #23
0
        public void PasswordProvider(PdfPasswordProviderArgs args)
        {
            // This method is called from some random thread, but we need
            // to do the dialog on the GUI thread; use the reset_event
            // to block this thread until the user is done with the dialog.
            ThreadAssist.BlockingProxyToMain(delegate {
                Log.Debug("Password requested to open document");
                var dialog = new Hyena.Widgets.HigMessageDialog(
                    Window, DialogFlags.Modal, MessageType.Question, ButtonsType.None,
                    Catalog.GetString("Document is Encrypted"),
                    Catalog.GetString("Enter the document's password to open it:")
                    );
                dialog.Image = Gtk.IconTheme.Default.LoadIcon("dialog-password", 48, 0);

                var password_entry = new Entry()
                {
                    Visibility = false
                };
                password_entry.Show();
                dialog.LabelVBox.PackStart(password_entry, false, false, 12);

                dialog.AddButton(Stock.Cancel, ResponseType.Cancel, false);
                dialog.AddButton(Stock.Ok, ResponseType.Ok, true);

                var response    = (ResponseType)dialog.Run();
                string password = password_entry.Text;
                dialog.Destroy();

                if (response == ResponseType.Ok)
                {
                    args.Password = Document.Password = password;
                }
                else
                {
                    Log.Information("Password dialog cancelled");
                    args.Abort = true;
                }
            });
        }
Пример #24
0
        Func <object> BuildArgumentEntry(Argument a)
        {
            Label lbl = new Label();
            Entry ety = new Entry();

            DType t = Mapper.DTypeFromString(a.Type);

            lbl.Text   = string.Format("{0} ({1}) : ", a.Name, Mapper.DTypeToStr(t));
            lbl.Xalign = 0;

            argumentTable.Attach(lbl, 0, 1, rowIndex, rowIndex + 1);
            argumentTable.Attach(ety, 1, 2, rowIndex, rowIndex + 1);
            rowIndex++;

            lbl.Show();
            ety.Show();
            argumentTable.ShowAll();

            return((Func <object>) delegate {
                object result = Mapper.Convert(t, ety.Text);

                return result;
            });
        }
Пример #25
0
        public AccountLoginForm(Account account) : base(1, 2, false)
        {
            this.account = account;

            BorderWidth   = 5;
            RowSpacing    = 5;
            ColumnSpacing = 5;

            Label username_label = new Label(Catalog.GetString("Username:"));

            username_label.Xalign = 1.0f;
            username_label.Show();

            username_entry = new Entry();
            username_entry.Show();

            Attach(username_label, 0, 1, 0, 1, AttachOptions.Fill,
                   AttachOptions.Shrink, 0, 0);

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

            username_entry.Text = account.UserName ?? String.Empty;
        }
Пример #26
0
        public override void Run(Window window)
        {
            Background bg = new Background(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Color      = Color.Black
            };

            bg.Show();
            window.AddResizeObject(bg);

            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new Box(window);

            box.Geometry = window.GetInnerSquare();
            box.Show();

            var capital1 = new Entry(window)
            {
                AlignmentX  = -1,
                AlignmentY  = 0,
                WeightX     = 1,
                WeightY     = 1,
                Text        = " Word",
                AutoCapital = AutoCapital.Word
            };

            var capital2 = new Entry(window)
            {
                AlignmentX  = -1,
                AlignmentY  = 0,
                WeightX     = 1,
                WeightY     = 1,
                Text        = "Sentence",
                AutoCapital = AutoCapital.Sentence
            };

            var capital3 = new Entry(window)
            {
                AlignmentX  = -1,
                AlignmentY  = 0,
                WeightX     = 1,
                WeightY     = 1,
                Text        = "All",
                AutoCapital = AutoCapital.All
            };

            var getText = new Entry(window)
            {
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1,
                Text       = "get cursor content test",
            };

            var label = new Label(window)
            {
                AlignmentX = -1,
                AlignmentY = 0,
                WeightX    = 1,
                WeightY    = 1,
            };

            getText.CursorChanged += (s, e) =>
            {
                label.Text = getText.GetCursorContent();
            };

            box.PackEnd(capital1);
            box.PackEnd(capital2);
            box.PackEnd(capital3);
            box.PackEnd(getText);
            box.PackEnd(label);

            capital1.Show();
            capital2.Show();
            capital3.Show();
            getText.Show();
            label.Show();
        }
Пример #27
0
    void HandleTbStaffClicked(object sender, EventArgs e)
    {
        //set up search input
        tbSearch=new Entry ();
        tbSearch.KeyReleaseEvent+= HandleTbSearchKeyReleaseEvent;
        viewPortLeft.Remove(viewPortLeft.Child);

        hboxSearch = new HBox ();
        vboxVpLeft = new VBox ();

        Button btSearchGo = new Button ();
        btSearchGo.Clicked+= HandleBtSearchGoClicked;

        btSearchGo.Label="Go";
        viewPortLeft.Remove(viewPortLeft.Child);
        Label lbStaff = new Label ();
        lbStaff.Text="im the staff bit";

        viewPortLeft.Add(vboxVpLeft);
        hboxSearch.PackStart(tbSearch,true,true,1);
        hboxSearch.PackStart(btSearchGo,false,false,1);
        vboxVpLeft.PackStart(hboxSearch,false,false,1);
        viewPortLeft.Show();
        lbStaff.Show();
        tbSearch.Show();
        vboxVpLeft.ShowAll();

        Console.WriteLine("staff clicked");
    }
Пример #28
0
                public UrlDialog(Gtk.
						  Window
						  par)
                    : base(Catalog.
							     GetString
							     ("Open URL"),
							     par,
							     DialogFlags.
							     Modal,
							     Catalog.
							     GetString
							     ("Cancel"),
							     ResponseType.
							     Cancel,
							     Catalog.
							     GetString
							     ("Open"),
							     ResponseType.
							     Accept)
                {
                    urlEntry = new Entry ();
                    urlEntry.WidthChars = 80;
                    urlEntry.Show ();
                    VBox.PackStart (urlEntry, true, true,
                            4);
                }
Пример #29
0
 void Agregar( object o, EventArgs args )
 {
     // crear dialogo
     Dialog dialog = new Dialog ("Agregar", window, Gtk.DialogFlags.DestroyWithParent);
     dialog.Modal = true;
     dialog.AddButton ("Aceptar", ResponseType.Ok);
     dialog.AddButton ("Cerrar", ResponseType.Close);
     Label lab = new Label("Información que desea agregar:");
     lab.Show();
     dialog.VBox.PackStart (lab , true, true, 5 );
     Table table = new Table (2, 2, false);
     Label labNombre = new Label("Nombre:");
     labNombre.Show();
     table.Attach(labNombre , 0, 1, 0, 1);
     entryNombre = new Entry();
     entryNombre.Show();
     table.Attach(entryNombre, 1, 2, 0, 1);
     Label labApe = new Label("Apellidos:");
     labApe.Show();
     table.Attach(labApe , 0, 1, 1, 2);
     entryApe = new Entry();
     entryApe.Show();
     table.Attach(entryApe , 1, 2, 1, 2);
     table.Show();
     dialog.VBox.PackStart (table, true, true, 5 );
     dialog.Response += new ResponseHandler (on_dialog_agregar);
     dialog.Run ();
     dialog.Destroy ();
 }
Пример #30
0
	Widget MakeStringItem (BuildServices services, string prompt, MBString res) {
		HBox box = new HBox ();
		box.Show ();

		Label label = new Label (prompt);
		label.Show ();
		label.Xalign = 1.0F;

		Entry entry = new Entry (res.Value);
		entry.Show ();
		entry.Data[result_key] = res;
		entry.Data[services_key] = services;
		entry.Changed += new EventHandler (OnStringChanged);

		box.PackStart (label, true, true, 2);
		box.PackStart (entry, false, true, 2);
		return box;
	}
Пример #31
0
    public void atualizarAutomato(string[] vetorEstados, string[] vetorSimbolos)
    {
        if (temTabela)
        {
            tabela.Destroy();
        }
        tabela             = new Table((uint)vetorEstados.Length, (uint)vetorSimbolos.Length, false);
        tabela.BorderWidth = 0;
        scrolledwindow1.Add(tabela);
        uint inc1 = 2;

        for (int i = 0; i < vetorSimbolos.Length; i++)
        {
            Label lbl2 = new Label(vetorSimbolos[i]);
            if (vetorSimbolos.Length == 1)
            {
                tabela.Attach(lbl2, 1, 3, 0, 1);
            }
            else
            {
                tabela.Attach(lbl2, (uint)i, inc1 + 1, 0, 1);
            }
            lbl2.Show();
            inc1++;
        }
        uint inc2 = 2;

        for (int i = 0; i < vetorEstados.Length; i++)
        {
            Label lbl3 = new Label(vetorEstados[i]);
            if (vetorEstados.Length == 1)
            {
                tabela.Attach(lbl3, 0, 2, 1, 3);
            }
            else
            {
                tabela.Attach(lbl3, 0, 1, (uint)i, inc2 + 1);
            }
            lbl3.Show();
            inc2++;
        }
        for (int i = 0; i < vetorSimbolos.Length; i++)
        {
            for (int j = 0; j < vetorEstados.Length; j++)
            {
                Entry txt = new Entry();
                txt.WidthChars = 5;
                if (vetorSimbolos.Length == 1 && vetorEstados.Length == 1)
                {
                    tabela.Attach(txt, 1, (uint)i + 3, 1, (uint)j + 3, AttachOptions.Expand, AttachOptions.Fill, 0, 0);
                }
                else if (vetorSimbolos.Length == 1)
                {
                    tabela.Attach(txt, 1, (uint)i + 3, (uint)j, (uint)j + 3, AttachOptions.Expand, AttachOptions.Fill, 0, 0);
                }
                else if (vetorEstados.Length == 1)
                {
                    tabela.Attach(txt, (uint)i, (uint)i + 3, 1, (uint)j + 3, AttachOptions.Expand, AttachOptions.Fill, 0, 0);
                }
                else
                {
                    tabela.Attach(txt, (uint)i, (uint)i + 3, (uint)j, (uint)j + 3, AttachOptions.Expand, AttachOptions.Fill, 0, 0);
                }
                txt.Show();
                ElementosAutomato elementos = new ElementosAutomato();
                elementos.estado1 = vetorEstados [j];
                elementos.estado2 = txt;
                elementos.simbolo = vetorSimbolos [i];
                entradas.Add(elementos);
            }
        }
        tabela.Show();
        temTabela = true;
    }
Пример #32
0
        private void Init()
        {
            Logger.Debug("Called Init");
            this.Icon = Utilities.GetIcon("giver-48", 48);
            // Update the window title
            this.Title = string.Format("Giver Preferences");

            //this.DefaultSize = new Gdk.Size (300, 500);
            this.VBox.Spacing     = 0;
            this.VBox.BorderWidth = 0;
            this.SetDefaultSize(450, 100);


            this.AddButton(Stock.Close, Gtk.ResponseType.Ok);
            this.DefaultResponse = ResponseType.Ok;


            // Start with an event box to paint the background white
            EventBox eb = new EventBox();

            eb.Show();
            eb.BorderWidth = 0;
            eb.ModifyBg(StateType.Normal, new Gdk.Color(255, 255, 255));
            eb.ModifyBase(StateType.Normal, new Gdk.Color(255, 255, 255));

            VBox mainVBox = new VBox();

            mainVBox.BorderWidth = 10;
            mainVBox.Spacing     = 5;
            mainVBox.Show();
            eb.Add(mainVBox);
            this.VBox.PackStart(eb);

            Label label = new Label();

            label.Show();
            label.Justify = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.LineWrap     = false;
            label.UseMarkup    = true;
            label.UseUnderline = false;
            label.Markup       = "<span weight=\"bold\" size=\"large\">Your Name</span>";
            mainVBox.PackStart(label, true, true, 0);

            // Name Box at the top of the Widget
            HBox nameBox = new HBox();

            nameBox.Show();
            nameEntry = new Entry();
            nameEntry.Show();
            nameBox.PackStart(nameEntry, true, true, 0);
            nameBox.Spacing = 10;
            mainVBox.PackStart(nameBox, false, false, 0);

            label = new Label();
            label.Show();
            label.Justify = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.LineWrap     = false;
            label.UseMarkup    = true;
            label.UseUnderline = false;
            label.Markup       = "<span weight=\"bold\" size=\"large\">Your Picture</span>";
            mainVBox.PackStart(label, true, true, 0);

            Gtk.Table table = new Table(4, 3, false);
            table.Show();
            // None Entry
            noneButton = new RadioButton((Gtk.RadioButton)null);
            noneButton.Show();
            table.Attach(noneButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            VBox vbox = new VBox();

            vbox.Show();
            Gtk.Image image = new Image(Utilities.GetIcon("computer", 48));
            image.Show();
            vbox.PackStart(image, false, false, 0);
            label = new Label("None");
            label.Show();
            vbox.PackStart(label, false, false, 0);
            table.Attach(vbox, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            vbox = new VBox();
            vbox.Show();
            table.Attach(vbox, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            // Local Entry
            localButton = new RadioButton(noneButton);
            localButton.Show();
            table.Attach(localButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            vbox = new VBox();
            vbox.Show();
            localImage = new Image(Utilities.GetIcon("stock_person", 48));
            localImage.Show();
            vbox.PackStart(localImage, false, false, 0);
            label = new Label("File");
            label.Show();
            vbox.PackStart(label, false, false, 0);
            table.Attach(vbox, 1, 2, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            photoButton = new Button("Change Photo");
            photoButton.Show();
            table.Attach(photoButton, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            // Web Entry
            webButton = new RadioButton(noneButton);
            webButton.Show();
            table.Attach(webButton, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            vbox = new VBox();
            vbox.Show();
            image = new Image(Utilities.GetIcon("web-browser", 48));
            image.Show();
            vbox.PackStart(image, false, false, 0);
            label = new Label("Web Link");
            label.Show();
            vbox.PackStart(label, false, false, 0);
            table.Attach(vbox, 1, 2, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            webEntry = new Entry();
            webEntry.Show();
            table.Attach(webEntry, 2, 3, 2, 3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            // Gravatar Entry
            gravatarButton = new RadioButton(noneButton);
            gravatarButton.Show();
            table.Attach(gravatarButton, 0, 1, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            vbox = new VBox();
            vbox.Show();
            image = new Image(Utilities.GetIcon("gravatar", 48));
            image.Show();
            vbox.PackStart(image, false, false, 0);
            label = new Label("Gravatar");
            label.Show();
            vbox.PackStart(label, false, false, 0);
            table.Attach(vbox, 1, 2, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            gravatarEntry = new Entry();
            gravatarEntry.Show();
            table.Attach(gravatarEntry, 2, 3, 3, 4, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            mainVBox.PackStart(table, true, true, 0);


            label = new Label();
            label.Show();
            label.Justify = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.LineWrap     = false;
            label.UseMarkup    = true;
            label.UseUnderline = false;
            label.Markup       = "<span weight=\"bold\" size=\"large\">Your File Location</span>";
            mainVBox.PackStart(label, true, true, 0);

            fileLocationButton = new FileChooserButton("Select storage location",
                                                       FileChooserAction.SelectFolder);
            fileLocationButton.Show();

            mainVBox.PackStart(fileLocationButton, true, true, 0);

            table = new Table(2, 3, false);
            table.Show();

            // Port number section
            label = new Label();
            label.Show();
            label.Justify = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.LineWrap     = false;
            label.UseMarkup    = true;
            label.UseUnderline = false;
            label.Markup       = "<span weight=\"bold\" size=\"large\">Port Number</span>";
            mainVBox.PackStart(label, true, true, 0);

            // any port Entry
            anyPortButton = new RadioButton((Gtk.RadioButton)null);
            anyPortButton.Show();
            table.Attach(anyPortButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

            vbox = new VBox();
            vbox.Show();

            label = new Label();
            label.Show();
            label.Justify = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.LineWrap     = false;
            label.UseMarkup    = true;
            label.UseUnderline = false;
            label.Markup       = "Any available port";
            vbox.PackStart(label, false, false, 0);
            table.Attach(vbox, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

            // fixed port Entry
            fixedPortButton = new RadioButton(anyPortButton);
            fixedPortButton.Show();
            table.Attach(fixedPortButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

            label = new Label();
            label.Show();
            label.Justify = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.LineWrap     = false;
            label.UseMarkup    = true;
            label.UseUnderline = false;
            label.Markup       = "Use a fixed port";
            table.Attach(label, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            portNumberEntry = new Entry();
            portNumberEntry.Show();
            table.Attach(portNumberEntry, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            mainVBox.PackStart(table, true, true, 0);

            DeleteEvent += WindowDeleted;
        }
Пример #33
0
        public override void Run(Window window)
        {
            Background bg = new Background(window)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
                Color      = Color.Black
            };

            bg.Show();
            window.AddResizeObject(bg);

            Conformant conformant = new Conformant(window);

            conformant.Show();
            Box box = new Box(window);

            box.Geometry = window.GetInnerSquare();
            box.Show();

            Entry entry = new Entry(window)
            {
                AlignmentX   = -1,
                AlignmentY   = 1,
                WeightX      = 1,
                WeightY      = 1,
                IsSingleLine = true,
                Text         = "Hello, Tizen"
            };

            var btn = new Button(window)
            {
                AlignmentX = -1,
                AlignmentY = 1,
                WeightX    = 1,
                WeightY    = 1,
                Text       = "Set Filter"
            };

            btn.Show();

            //var filter = new Entry.TextFilter(SetFilter);
            btn.Clicked += (s, e) =>
            {
                entry.AppendMarkUpFilter(SetFilter);
            };

            var btn1 = new Button(window)
            {
                AlignmentX = -1,
                AlignmentY = 1,
                WeightX    = 1,
                WeightY    = 1,
                Text       = "Remove Filter"
            };

            btn1.Show();
            btn1.Clicked += (s, e) =>
            {
                entry.RemoveMarkUpFilter(SetFilter);
            };

            //entry.AppendMarkUpFilter(new Entry.Filter(SetFilter));

            entry.Show();
            box.PackEnd(entry);
            box.PackEnd(btn);
            box.PackEnd(btn1);
        }
Пример #34
0
		public UserShortcutDialog (Gtk.Window parent, string binding_string) : base (null, parent, DialogFlags.DestroyWithParent)
		{
			Title = "KeyGrabber";
			Modal = true;
			HasSeparator = false;

			AddButton ("Ok", ResponseType.Ok);
			AddButton ("Cancel", ResponseType.Cancel);

			binding = binding_string;

			ctrl_button = new CheckButton ("Ctrl");
			int i = binding_string.IndexOf ("<ctrl>", StringComparison.InvariantCultureIgnoreCase);
			if (i != -1) {
				ctrl_button.Active = true;
				binding_string = binding_string.Remove (i, 6);
			}

			alt_button = new CheckButton ("Alt");
			i = binding_string.IndexOf ("<alt>", StringComparison.InvariantCultureIgnoreCase);
			if (i != -1) {
				alt_button.Active = true;
				binding_string = binding_string.Remove (i, 5);
			}

			entry = new Entry ();
			entry.Text = binding_string;

			HBox box = new HBox (false, 0);
			box.PackEnd (ctrl_button, true, false, 0);
			ctrl_button.Show ();
			box.PackEnd (alt_button, true, false, 0);
			alt_button.Show ();
			box.PackEnd (entry, true, false, 0);
			entry.Show ();

			VBox.PackStart (box, true, false, 0);
			box.Show ();
		}
Пример #35
0
        static void PutVectorInput(Component component, PropertyInfo property, Fixed fixd, ref int offset)
        {
            Label lbl = new Label();

            lbl.Name = "lbl";
            lbl.Text = property.Name;

            string[] namings = { "x", "y", "z", "w" };

            fixd.Put(lbl, 0, offset);
            lbl.Show();
            offset += 20;

            int          count   = 0;
            InputPurpose purpose = InputPurpose.Number;

            if (property.PropertyType == typeof(Vector2))
            {
                count = 2;
            }
            else if (property.PropertyType == typeof(Vector3))
            {
                count = 3;
            }
            else if (property.PropertyType == typeof(Vector4))
            {
                count = 4;
            }



            int offsetX = 0;

            for (int i = 0; i < count; i++)
            {
                Label lbl1 = new Label();
                lbl1.Name = "lbl";
                lbl1.Text = namings[i];
                fixd.Put(lbl1, offsetX, offset);
                lbl1.Show();
                offsetX += 15;

                Entry entry = new Entry();
                entry.WidthChars   = 4;
                entry.Name         = "entry";
                entry.InputPurpose = purpose;

                int n = i;
                if (property.PropertyType == typeof(Vector2))
                {
                    Vector2 val = (Vector2)property.GetValue(component);
                    entry.Text = val[i].ToString();
                    if (property.SetMethod != null)
                    {
                        entry.Changed += (s, e) =>
                        {
                            float value = 0;
                            float.TryParse(entry.Text, out value);
                            val[n] = value;
                            property.SetValue(component, val);
                        };
                    }
                }
                else if (property.PropertyType == typeof(Vector3))
                {
                    Vector3 val = (Vector3)property.GetValue(component);
                    entry.Text = val[i].ToString();
                    if (property.SetMethod != null)
                    {
                        entry.Changed += (s, e) =>
                        {
                            float value = 0;
                            float.TryParse(entry.Text, out value);
                            val[n] = value;
                            property.SetValue(component, val);
                        };
                    }
                }
                else if (property.PropertyType == typeof(Vector4))
                {
                    Vector4 val = (Vector4)property.GetValue(component);
                    entry.Text = val[i].ToString();
                    if (property.SetMethod != null)
                    {
                        entry.Changed += (s, e) =>
                        {
                            float value = 0;
                            float.TryParse(entry.Text, out value);
                            val[n] = value;
                            property.SetValue(component, val);
                        };
                    }
                }
                fixd.Put(entry, offsetX, offset);
                entry.Show();
                offsetX += 45;
            }
            offset += 40;
        }
Пример #36
0
        private EventBox CreateTable(string calegory, List <PropertyItem> propertyItem)
        {
            EventBox eventBox = new EventBox();
            Table    table    = new Table((uint)(propertyItem.Count + 1), 2u, false);
            Label    label    = new Label();

            label.HeightRequest = 16;
            table.Attach(label, 1u, 2u, 0u, 1u, AttachOptions.Expand, AttachOptions.Fill, 0u, 0u);
            label.Show();
            uint num = 1u;

            foreach (PropertyItem current in propertyItem)
            {
                ITypeEditor editor = this.em.GetEditor(current);
                Widget      widget;
                if (editor == null)
                {
                    widget = current.WidgetDate;
                }
                else
                {
                    current.TypeEditor = editor;
                    widget             = editor.ResolveEditor(current);
                }
                if (current.DiaplayName == "grid_sudoku_size" || current.DiaplayName == "Fill_color")
                {
                    if (widget == null)
                    {
                        num += 1u;
                    }
                    else
                    {
                        if (widget is Entry)
                        {
                            Entry entry = widget as Entry;
                            table.Add(entry);
                            entry.Show();
                        }
                        else
                        {
                            table.Add(widget);
                        }
                        widget.Show();
                        Table.TableChild tableChild = (Table.TableChild)table[widget];
                        tableChild.LeftAttach   = 0u;
                        tableChild.RightAttach  = 2u;
                        tableChild.TopAttach    = num;
                        tableChild.BottomAttach = num + 1u;
                        tableChild.XOptions     = (AttachOptions.Expand | AttachOptions.Fill);
                        tableChild.YOptions     = AttachOptions.Fill;
                        num += 1u;
                    }
                }
                else
                {
                    ContentLabel contentLabel = new ContentLabel(90);
                    contentLabel.SetLabelText(LanguageOption.GetValueBykey(current.DiaplayName));
                    table.Add(contentLabel);
                    contentLabel.Show();
                    Table.TableChild tableChild2 = (Table.TableChild)table[contentLabel];
                    tableChild2.TopAttach    = num;
                    tableChild2.BottomAttach = num + 1u;
                    tableChild2.XOptions     = AttachOptions.Fill;
                    tableChild2.YOptions     = AttachOptions.Fill;
                    if (widget == null)
                    {
                        num += 1u;
                    }
                    else
                    {
                        Alignment alignment = new Alignment(0.5f, 0.5f, 1f, 1f);
                        if (widget is Entry)
                        {
                            Entry entry = widget as Entry;
                            alignment.BottomPadding = 16u;
                            alignment.Add(entry);
                            entry.Show();
                            alignment.Show();
                            table.Add(alignment);
                        }
                        else
                        {
                            if (widget is INumberEntry)
                            {
                                if ((widget as INumberEntry).GetMenuVisble())
                                {
                                    alignment.BottomPadding = 8u;
                                }
                                else
                                {
                                    alignment.BottomPadding = 16u;
                                }
                            }
                            else
                            {
                                alignment.BottomPadding = 16u;
                            }
                            alignment.Add(widget);
                            widget.Show();
                            alignment.Show();
                            table.Add(alignment);
                        }
                        Table.TableChild tableChild = (Table.TableChild)table[alignment];
                        tableChild.LeftAttach   = 1u;
                        tableChild.RightAttach  = 2u;
                        tableChild.TopAttach    = num;
                        tableChild.BottomAttach = num + 1u;
                        tableChild.XOptions     = (AttachOptions.Expand | AttachOptions.Fill);
                        tableChild.YOptions     = AttachOptions.Fill;
                        num += 1u;
                    }
                }
            }
            table.ColumnSpacing = 10u;
            eventBox.Add(table);
            table.Show();
            eventBox.CanFocus = false;
            return(eventBox);
        }