示例#1
0
        public CellRendererComboBox()
        {
            Mode |= Gtk.CellRendererMode.Editable;
            Entry dummyEntry = new Gtk.Entry();

            rowHeight = dummyEntry.SizeRequest().Height;
        }
        CodeCompletionContext ICompletionWidget.CreateCodeCompletionContext(int triggerOffset)
        {
            CodeCompletionContext c = new CodeCompletionContext();

            c.TriggerLine       = 0;
            c.TriggerOffset     = triggerOffset;
            c.TriggerLineOffset = c.TriggerOffset;
            c.TriggerTextHeight = editEntry.SizeRequest().Height;
            c.TriggerWordLength = currentCompletionData.ExpressionLenght;

            int x, y;
            int tx, ty;

            editEntry.GdkWindow.GetOrigin(out x, out y);
            editEntry.GetLayoutOffsets(out tx, out ty);
            int cp = editEntry.TextIndexToLayoutIndex(editEntry.Position);

            Pango.Rectangle rect = editEntry.Layout.IndexToPos(cp);
            tx += Pango.Units.ToPixels(rect.X) + x;
            y  += editEntry.Allocation.Height;

            c.TriggerXCoord = tx;
            c.TriggerYCoord = y;
            return(c);
        }
 public CellRendererCatalogSelector (String model)
 {
     Mode |= Gtk.CellRendererMode.Editable;
     Entry dummyEntry = new Gtk.Entry ();
     rowHeight = dummyEntry.SizeRequest ().Height;
     combo = new CatalogSelector ();
     combo.Model = model;
     combo.Changed += SelectionChanged;
 }
示例#4
0
        public CellRendererProperty(TreeView tree)
        {
            this.tree = tree;
            Xalign    = 0;
            Xpad      = 3;

            Mode |= Gtk.CellRendererMode.Editable;
            Entry dummyEntry = new Gtk.Entry();

            dummyEntry.HasFrame = false;
            rowHeight           = dummyEntry.SizeRequest().Height;
        }
        public LevelRangeWidget(string label, int low, int high)
        {
            IConfigSource config = new DotNetConfigSource(DotNetConfigSource.GetFullConfigPath());

            int entrySize = config.Configs["defaults"].GetInt("entrySize");
            int entryWidth = config.Configs["defaults"].GetInt("entryWidth");

            Low = new Entry(entrySize);
            Low.SetSizeRequest(entryWidth, Low.SizeRequest().Height);
            Low.WidthChars = entrySize;
            Low.IsEditable = false;
            Low.CanFocus = false;

            Label = new Label(label);
            Label.Justify = Justification.Center;
            Label.SetSizeRequest(150, Label.SizeRequest().Height);

            High = new Entry(entrySize);
            High.SetSizeRequest(entryWidth, High.SizeRequest().Height);
            High.WidthChars = entrySize;
            High.IsEditable = false;
            High.CanFocus = false;
        }
 private Widget CreateServerPage()
 {
     VBox vbox = new VBox(false, 0);
        Table table = new Table(6, 2, false);
        vbox.PackStart(table, true, true, 0);
        table.ColumnSpacing = 12;
        table.RowSpacing = 6;
        table.BorderWidth = 12;
        Label l = new Label(Util.GS("Name:"));
        table.Attach(l,
        0,1, 0,1,
        AttachOptions.Shrink | AttachOptions.Fill,
        0,0,0);
        l.Xalign = 0;
        l = new Label(domain.Name);
        table.Attach(l,
        1,2, 0,1,
        AttachOptions.Expand | AttachOptions.Fill,
        0,0,0);
        l.UseUnderline = false;
        l.Xalign = 0;
        l = new Label(Util.GS("Address:"));
        table.Attach(l,
        0,1, 1,2,
        AttachOptions.Expand | AttachOptions.Fill,
        0,0,0);
        l.Xalign = 0;
        l.Yalign = 0;
        ServerAddressEntry = new Entry();
        table.Attach(ServerAddressEntry,
        1,2, 1,2,
        AttachOptions.Shrink | AttachOptions.Fill,
        0,0,0);
        l.UseUnderline = false;
        l.MnemonicWidget = ServerAddressEntry;
        l = new Label(Util.GS("(You can change the address if you are offline)"));
        table.Attach(l,
        1,2, 2,3,
        AttachOptions.Shrink | AttachOptions.Fill,
        0,0,0);
        l.LineWrap = true;
        l.Wrap = true;
        l.Xalign = 0;
        l.Sensitive = false;
        Requisition req = ServerAddressEntry.SizeRequest();
        l.WidthRequest = req.Width;
        ScrolledWindow sw = new ScrolledWindow();
        table.Attach(sw,
        0,2, 3,4,
        AttachOptions.Expand | AttachOptions.Fill,
        0,0,0);
        sw.ShadowType = Gtk.ShadowType.EtchedIn;
        ServerDescriptionTextView = new TextView();
        if(domain.Description != null)
     ServerDescriptionTextView.Buffer.Text = domain.Description;
        ServerDescriptionTextView.WrapMode = Gtk.WrapMode.Word;
        ServerDescriptionTextView.Editable = false;
        ServerDescriptionTextView.Sensitive = false;
        ServerDescriptionTextView.CursorVisible = false;
        ServerDescriptionTextView.RightMargin = 5;
        ServerDescriptionTextView.LeftMargin = 5;
        sw.Add(ServerDescriptionTextView);
        return vbox;
 }
		public CellRendererComboBox ()
		{
			Mode |= Gtk.CellRendererMode.Editable;
			Entry dummyEntry = new Gtk.Entry ();
			rowHeight = dummyEntry.SizeRequest ().Height;
		}
示例#8
0
        public CellRendererProperty(TreeView tree)
        {
            this.tree = tree;
            Xalign = 0;
            Xpad = 3;

            Mode |= Gtk.CellRendererMode.Editable;
            Entry dummyEntry = new Gtk.Entry ();
            dummyEntry.HasFrame = false;
            rowHeight = dummyEntry.SizeRequest ().Height;
        }