示例#1
0
 private void ConnectButton_Click(object sender, RoutedEventArgs e)
 {
     // Update IP and Port when connect button is clicked.
     IpText.GetBindingExpression(TextBox.TextProperty).UpdateSource();
     PortText.GetBindingExpression(TextBox.TextProperty).UpdateSource();
     this.Close();
 }
示例#2
0
        public IPv4Entry()
        {
            CanFocus = true;
            Spacing  = 2;

            int width, height;

            Icon.SizeLookup(icon_size, out width, out height);
            IconTheme theme = IconTheme.GetForScreen(Screen);

            DrawingCellHBox entrycontents = new DrawingCellHBox();

            entrycontents.PackStart(new DrawingCellNull(), true);
            entrycontents.Spacing = 0;

            labelcontents = new DrawingCellHBox();
            entrycontents.PackEnd(labelcontents, false);
            cells[0] = new IpText(this, DataPart.A);
            cells[1] = new IpText(this, DataPart.Separator);
            cells[2] = new IpText(this, DataPart.B);
            cells[3] = new IpText(this, DataPart.Separator);
            cells[4] = new IpText(this, DataPart.C);
            cells[5] = new IpText(this, DataPart.Separator);
            cells[6] = new IpText(this, DataPart.D);
            foreach (IpText t in cells)
            {
                labelcontents.PackEnd(t, false);
            }

            clearimg            = new DrawingCellActivePixbuf(theme.LoadIcon(Stock.Clear, width, 0));
            clearimg.Activated += delegate {
                OnClearData();
            };
            entrycontents.PackStart(clearimg, false);

            addimg            = new DrawingCellActivePixbuf(theme.LoadIcon(Stock.Add, width, 0));
            addimg.Activated += delegate {
                OnStartCalculator();
            };
            entrycontents.PackStart(addimg, false);

            entry         = new DrawingCellEntry(entrycontents);
            entry.SideCut = SideCut.Right;
            PackStart(entry, true);

            dropdown            = new DrawingCellButton(new DrawingCellComboArrow());
            dropdown.SideCut    = SideCut.Left;
            dropdown.Activated += delegate {
                OnDropDown();
            };
            PackEnd(dropdown, false);

/*			Gtk.Drag.DestSet (this, DestDefaults.All, ValidTargets, Gdk.DragAction.Copy);
 *                      DragDataReceived += HandleDragDataReceived;
 *
 *                      Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, ValidTargets, DragAction.Copy);
 *                      DragBegin += HandleDragBegin;
 *                      DragDataGet += HandleDragDataGet;*/
        }
		public IPv4Entry()
		{
			CanFocus = true;
			Spacing = 2;
			
			int width, height;
			Icon.SizeLookup(icon_size, out width, out height);
			IconTheme theme = IconTheme.GetForScreen(Screen);

			DrawingCellHBox entrycontents = new DrawingCellHBox();
			entrycontents.PackStart (new DrawingCellNull(), true);
			entrycontents.Spacing = 0;

			labelcontents = new DrawingCellHBox();
			entrycontents.PackEnd (labelcontents, false);
			cells[0] = new IpText (this, DataPart.A);
			cells[1] = new IpText (this, DataPart.Separator);
			cells[2] = new IpText (this, DataPart.B);
			cells[3] = new IpText (this, DataPart.Separator);
			cells[4] = new IpText (this, DataPart.C);
			cells[5] = new IpText (this, DataPart.Separator);
			cells[6] = new IpText (this, DataPart.D);
			foreach (IpText t in cells)
				labelcontents.PackEnd (t, false);

			clearimg = new DrawingCellActivePixbuf (theme.LoadIcon(Stock.Clear, width, 0));
			clearimg.Activated += delegate {
				OnClearData();
			};
			entrycontents.PackStart (clearimg, false);
			
			addimg = new DrawingCellActivePixbuf (theme.LoadIcon(Stock.Add, width, 0));
			addimg.Activated += delegate {
				OnStartCalculator();
			};
			entrycontents.PackStart (addimg, false);

			entry = new DrawingCellEntry (entrycontents);
			entry.SideCut = SideCut.Right;
			PackStart (entry, true);			

			dropdown = new DrawingCellButton (new DrawingCellComboArrow());
			dropdown.SideCut = SideCut.Left;
			dropdown.Activated += delegate {
				OnDropDown();
			};
			PackEnd (dropdown, false);
			
/*			Gtk.Drag.DestSet (this, DestDefaults.All, ValidTargets, Gdk.DragAction.Copy);
			DragDataReceived += HandleDragDataReceived;
			
			Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, ValidTargets, DragAction.Copy);
			DragBegin += HandleDragBegin;
			DragDataGet += HandleDragDataGet;*/
		}