当前位置: 首页>>代码示例>>C#>>正文


C# Expander.Add方法代码示例

本文整理汇总了C#中Expander.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Expander.Add方法的具体用法?C# Expander.Add怎么用?C# Expander.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Expander的用法示例。


在下文中一共展示了Expander.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DialogError

		public DialogError(string message, Exception e, Window parent) : base("Error", parent, DialogFlags.Modal, Stock.Ok, ResponseType.Ok)
		{
			HBox hbox = new HBox();
			Image icon = new Image(Stock.DialogError,IconSize.Dialog);
			Label label = new Label(message);
			Expander exp = new Expander("Details");
			ScrolledWindow sw = new ScrolledWindow();
			TextView tview = new TextView();
			
			hbox.BorderWidth = 6;
			hbox.Spacing = 6;
			label.SetAlignment(0f, 0.5f);
			exp.BorderWidth = 6;
			tview.Buffer.Text = e.Message;
			tview.Buffer.Text += "\n";
			tview.Buffer.Text += e.StackTrace;
			
			sw.Add(tview);
			exp.Add(sw);
			hbox.PackStart(icon, false, false, 0);
			hbox.PackStart(label, true, true, 0);
			this.VBox.PackStart(hbox, false, false, 0);
			this.VBox.PackStart(exp, true, true, 0);
			this.ShowAll();
			
		}
开发者ID:hpbaotho,项目名称:supos,代码行数:26,代码来源:DialogError.cs

示例2: FaceSidebarWidget

        public FaceSidebarWidget()
        {
            instance = this;

            mainVBox = new VBox();
            //mainVBox.Spacing = 6;
            //faceVBox = new VBox();
            faceVPane = new VPaned();

            pleaseSelectPictureLabel = new Label ();
            pleaseSelectPictureLabel.Markup = SelectImageMarkup;
            //headerLabel =  new Label (Catalog.GetString ("Not Implemented Yet"));
            mainVBox.PackStart(pleaseSelectPictureLabel,false,false,0);

            knownFaceExpander = new Expander("In this photo:");

            //faceVBox.PackStart(knownFaceExpander,true,true,0);
            //faceVPane.Add(knownFaceExpander);
            knownFaceScrolledWindow = new ScrolledWindow();
            knownFaceExpander.Add(knownFaceScrolledWindow);
            faceVPane.Pack1(knownFaceExpander,true,true);
            //knownFaceExpander.HeightRequest = 30;
            //			faceHandleBox = new HandleBox();
            //			faceHandleBox.HandlePosition = PositionType.Top;
            //			faceVBox.PackStart(faceHandleBox,false,false,0);

            unknownFaceExpander = new Expander("Who's also in this photo");
            //faceVBox.PackStart(unknownFaceExpander,true,true,0);
            //faceVPane.Add(unknownFaceExpander);

            unknownFaceScrolledWindow = new ScrolledWindow();
            unknownFaceExpander.Add(unknownFaceScrolledWindow);
            faceVPane.Pack2(unknownFaceExpander,true,true);
            //unknownFaceExpander.HeightRequest = 30;
            mainVBox.PackStart(faceVPane,true,true,0);

            detectFaceButton = new Button(Catalog.GetString("Re-Detect Face From This Picture"));
            mainVBox.PackEnd(detectFaceButton,false,false,0);
            detectFaceButton.Clicked += DetectFaceButtonClicked;

            addFaceButton = new Button(manualAddFaceString);
            mainVBox.PackEnd(addFaceButton,false,false,0);
            addFaceButton.Clicked += AddFaceButtonClicked;

            knownFaceScrolledWindow.Visible = false;
            unknownFaceScrolledWindow.Visible = false;

            knownFaceExpander.ResizeMode = ResizeMode.Parent;
            unknownFaceExpander.ResizeMode = ResizeMode.Parent;
            Log.Debug("HeightR");

            ShadowType = ShadowType.None;
            BorderWidth = 0;
            //AddWithViewport(pleaseSelectPictureLabel);
            AddWithViewport (mainVBox);
            //mainVBox.Visible = false;
            ShowAll();
        }
开发者ID:kanitw,项目名称:facespot,代码行数:58,代码来源:FaceSidebarWidget.cs

示例3: DirPropertyWidget

        public DirPropertyWidget(FilePropertisData fpd)
        {
            project = fpd.Project;
            fiOld = project.FilesProperty.Find(x => x.SystemFilePath == fpd.Filename);
            if (fiOld == null){
                fiOld =new FileItem(fpd.Filename,false);
                fiOld.IsDirectory = true;
                project.FilesProperty.Add(fiOld);
            }
            if (fiOld.ConditionValues == null)
                fiOld.ConditionValues = new System.Collections.Generic.List<ConditionRule>();

            Table mainTable = new Table(2,1,false);
            Table propertyTable = new Table(5,2,false);

            Label lblFN =GetLabel(System.IO.Path.GetFileName(fiOld.SystemFilePath)); // new Label(System.IO.Path.GetFileName(fiOld.SystemFilePath));

            Entry entr = new Entry(fiOld.SystemFilePath);
            entr.IsEditable = false;

            Entry entrFullPath = new Entry(MainClass.Workspace.GetFullPath(fiOld.SystemFilePath));
            entrFullPath.IsEditable = false;

            Label lblPrj = GetLabel(project.ProjectName); //new Label(project.ProjectName);

            AddControl(ref propertyTable,0,lblFN,"Name ");
            AddControl(ref propertyTable,1,entr,"Relative Path ");
            AddControl(ref propertyTable,2,entrFullPath,"Full Path ");
            AddControl(ref propertyTable,3,lblPrj,"Project ");

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

            GenerateContent(ref conditionsTable, MainClass.Settings.Platform.Name, 1, MainClass.Settings.Platform,false);//tableSystem
            GenerateContent(ref conditionsTable, MainClass.Settings.Resolution.Name, 2,MainClass.Settings.Resolution,true); //project.Resolution);//tableSystem
            int i = 3;
            foreach (Condition cd in project.ConditoinsDefine) {
                GenerateContent(ref conditionsTable, cd.Name, i, cd,false);
                i++;
            }
            Expander exp1 = new Expander("General");
            exp1.Expanded = true;
            exp1.Add(propertyTable);

            Expander exp2 = new Expander("Conditions");
            exp2.Expanded = true;
            exp2.Add(conditionsTable);

            mainTable.Attach(exp1,0,1,0,1,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);
            mainTable.Attach(exp2,0,1,1,2,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);

            this.PackStart(mainTable,true,true,0);
            this.ShowAll();
        }
开发者ID:moscrif,项目名称:ide,代码行数:54,代码来源:DirPropertyWidget.cs

示例4: Dialog

        public Dialog(VariableSet variables)
            : base(_("UpdateCheck"), variables)
        {
            var vbox = new VBox(false, 12) {BorderWidth = 12};
              VBox.PackStart(vbox, true, true, 0);

              var table = new GimpTable(4, 3)
            {ColumnSpacing = 6, RowSpacing = 6};
              vbox.PackStart(table, true, true, 0);

              table.Attach(new GimpCheckButton(_("Check _GIMP"),
                       GetVariable<bool>("check_gimp")),
               0, 1, 0, 1);

              table.Attach(new GimpCheckButton(_("Check G_IMP#"),
                       GetVariable<bool>("check_gimp_sharp")),
               0, 1, 1, 2);

              table.Attach(new GimpCheckButton(_("Check _Unstable Releases"),
                       GetVariable<bool>("check_unstable")),
               0, 1, 2, 3);

              var enableProxy = GetVariable<bool>("enable_proxy");
              var httpProxy = GetVariable<string>("http_proxy");
              var port = GetVariable<string>("port");

              string tmp = Gimp.RcQuery("update-enable-proxy");
              enableProxy.Value = (tmp != null || tmp == "true");
              httpProxy.Value =  Gimp.RcQuery("update-http-proxy") ?? "";
              port.Value = Gimp.RcQuery("update-port") ?? "";

              var expander = new Expander(_("Proxy settings"));
              var proxyBox = new VBox(false, 12);

              proxyBox.Add(new GimpCheckButton(_("Manual proxy configuration"),
                       enableProxy));

              var hbox = new HBox(false, 12) {Sensitive = enableProxy.Value};
              proxyBox.Add(hbox);

              hbox.Add(new Label(_("HTTP Proxy:")));
              hbox.Add(new GimpEntry(httpProxy));

              hbox.Add(new Label(_("Port:")));
              hbox.Add(new GimpEntry(port) {WidthChars = 4});

              enableProxy.ValueChanged += delegate
            {
              hbox.Sensitive = enableProxy.Value;
            };

              expander.Add(proxyBox);
              table.Attach(expander, 0, 1, 3, 4);
        }
开发者ID:unhammer,项目名称:gimp-sharp,代码行数:54,代码来源:Dialog.cs

示例5: CreateMoreOptionsExpander

 private Widget CreateMoreOptionsExpander(string defaultDomainID)
 {
     optionsExpander = new Expander(Util.GS("More options"));
        optionsExpander.Activated += new EventHandler(OnOptionsExpanded);
        Table optionsTable = new Table(2, 3, false);
        optionsExpander.Add(optionsTable);
        optionsTable.ColumnSpacing = 10;
        optionsTable.RowSpacing = 10;
        optionsTable.SetColSpacing(0, 30);
        Label l = new Label(Util.GS("iFolder Account:"));
        l.Xalign = 0;
        optionsTable.Attach(l, 1,2,0,1,
     AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        domainComboBox = ComboBox.NewText();
        optionsTable.Attach(domainComboBox, 2,3,0,1,
     AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
        int defaultDomain = 0;
        for (int x = 0; x < domains.Length; x++)
        {
     domainComboBox.AppendText(domains[x].Name);
     if (defaultDomainID != null)
     {
      if (defaultDomainID == domains[x].ID)
       defaultDomain = x;
     }
     else
      defaultDomain = x;
        }
        domainComboBox.Active = defaultDomain;
        l = new Label(Util.GS("Description:"));
        l.Xalign = 0;
        optionsTable.Attach(l, 1,2,1,2,
     AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        descriptionTextView = new TextView();
        descriptionTextView.LeftMargin = 4;
        descriptionTextView.RightMargin = 4;
        descriptionTextView.Editable = true;
        descriptionTextView.CursorVisible = true;
        descriptionTextView.AcceptsTab = false;
        descriptionTextView.WrapMode = WrapMode.WordChar;
        ScrolledWindow sw = new ScrolledWindow();
        sw.ShadowType = ShadowType.EtchedIn;
        sw.Add(descriptionTextView);
        optionsTable.Attach(sw, 2,3,1,2,
     AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
        optionsTable.ShowAll();
        return optionsExpander;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:48,代码来源:DragCreateDialog.cs

示例6: ErrorListDialog

        public ErrorListDialog () : base (Catalog.GetString ("Error"))
        {
            var table = new Table (3, 2, false) {
                RowSpacing = 12,
                ColumnSpacing = 16
            };

            table.Attach (icon_image = new Image () {
                    IconName = "dialog-error",
                    IconSize = (int)IconSize.Dialog,
                    Yalign = 0.0f
                }, 0, 1, 0, 3, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            table.Attach (header_label = new Label () { Xalign = 0.0f }, 1, 2, 0, 1,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            table.Attach (message_label = new Hyena.Widgets.WrapLabel (), 1, 2, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            var scrolled_window = new ScrolledWindow () {
                HscrollbarPolicy = PolicyType.Automatic,
                VscrollbarPolicy = PolicyType.Automatic,
                ShadowType = ShadowType.In
            };

            list_view = new TreeView () {
                HeightRequest = 120,
                WidthRequest = 200
            };
            scrolled_window.Add (list_view);

            table.Attach (details_expander = new Expander (Catalog.GetString ("Details")),
                1, 2, 2, 3,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand,
                0, 0);
            details_expander.Add (scrolled_window);

            VBox.PackStart (table, true, true, 0);
            VBox.Spacing = 12;
            VBox.ShowAll ();

            details_expander.Activated += OnConfigureGeometry;
            Realized += OnConfigureGeometry;
        }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:47,代码来源:ErrorListDialog.cs

示例7: DeviceDescriptionInfo

 public DeviceDescriptionInfo (Device device)
 {
     this.Build ();
     
     deviceType.Text = device.Type.ToString ();
     udn.Text = device.Udn;
     friendlyName.Text = device.FriendlyName;
     manufacturer.Text = device.Manufacturer;
     manufacturerUrl.Text = device.ManufacturerUrl != null ? device.ManufacturerUrl.ToString () : null;
     modelName.Text = device.ModelName;
     modelNumber.Text = device.ModelNumber;
     modelUrl.Text = device.ModelUrl != null ? device.ModelUrl.ToString () : null;
     serialNumber.Text = device.SerialNumber;
     upc.Text = device.Upc;
     foreach (var icon in device.Icons) {
         var expander = new Expander (string.Format ("{0}, {1}x{2}x{3}", icon.MimeType, icon.Width, icon.Height, icon.Depth));
         expander.Add (new LazyIcon (icon));
         iconBox.PackStart (expander, true, true, 0);
     }
 }
开发者ID:pacificIT,项目名称:mono-upnp,代码行数:20,代码来源:DeviceDescriptionInfo.cs

示例8: DemoExpander

		public DemoExpander () : base ("Demo Expander", null, DialogFlags.DestroyWithParent)
		{
			Resizable = false;

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

			vbox.PackStart (new Label ("Expander demo. Click on the triangle for details."), false, false, 0);

			// Create the expander
			Expander expander = new Expander ("Details");
			expander.Add (new Label ("Details can be shown or hidden."));
			vbox.PackStart (expander, false, false, 0);

			AddButton (Stock.Close, ResponseType.Close);

			ShowAll ();
			Run ();
			Destroy ();
		}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:21,代码来源:DemoExpander.cs

示例9: OnMapped

 protected virtual void OnMapped (object sender, System.EventArgs e)
 {
     if (!mapped) {
         mapped = true;
         ThreadPool.QueueUserWorkItem (state => {
             Gtk.Widget widget;
             try {
                 widget = provider.ProvideInfo (device);
             } catch (Exception exception) {
                 var box = new VBox ();
                 box.PackStart (new Gtk.Label ("Failed to Load " + provider.Name), true, true, 0);
                 var expander = new Expander ("Error");
                 expander.Add (new Label (exception.ToString ()));
                 box.PackStart (expander, true, true, 0);
                 widget = box;
             }
             Gtk.Application.Invoke ((o, a) => {
                 alignment.Remove (alignment.Child);
                 alignment.Add (widget);
                 ShowAll ();
             });
         });
     }
 }
开发者ID:pacificIT,项目名称:mono-upnp,代码行数:24,代码来源:LazyDeviceInfo.cs

示例10: Init

 internal void Init(Gtk.Window parent,
 DialogType type,
 ButtonSet buttonSet,
 string title,
 string statement,
 string secondaryStatement,
 string details)
 {
     this.Title = title;
       this.HasSeparator = false;
       this.Resizable = false;
       this.Modal = true;
       if(parent != null)
        this.TransientFor = parent;
       HBox h = new HBox();
       h.BorderWidth = 10;
       h.Spacing = 10;
       dialogImage = new Image();
       switch(type)
       {
        case DialogType.Error:
     dialogImage.SetFromStock(Gtk.Stock.DialogError, IconSize.Dialog);
     break;
        case DialogType.Question:
     dialogImage.SetFromStock(Gtk.Stock.DialogQuestion, IconSize.Dialog);
     break;
        case DialogType.Warning:
     dialogImage.SetFromStock(Gtk.Stock.DialogWarning, IconSize.Dialog);
     break;
        default:
        case DialogType.Info:
     dialogImage.SetFromStock(Gtk.Stock.DialogInfo, IconSize.Dialog);
     break;
       }
       dialogImage.SetAlignment(0.5F, 0);
       h.PackStart(dialogImage, false, false, 0);
       VBox v = new VBox();
       v.Spacing = 10;
       Label l = new Label();
       l.LineWrap = true;
       l.UseMarkup = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       l.Markup = "<span weight=\"bold\" size=\"larger\">" + GLib.Markup.EscapeText(statement) + "</span>";
       v.PackStart(l);
       l = new Label(secondaryStatement);
       l.LineWrap = true;
       l.Selectable = false;
       l.CanFocus = false;
       l.Xalign = 0; l.Yalign = 0;
       v.PackStart(l, true, true, 8);
       if (details != null)
       {
        detailsExpander = new Expander(Util.GS("_Details"));
        v.PackStart(detailsExpander, false, false, 0);
        TextView textView = new TextView();
        textView.Editable = false;
        textView.WrapMode = WrapMode.Char;
        TextBuffer textBuffer = textView.Buffer;
        textBuffer.Text = details;
        showDetailsScrolledWindow = new ScrolledWindow();
        detailsExpander.Add(showDetailsScrolledWindow);
        showDetailsScrolledWindow.AddWithViewport(textView);
        showDetailsScrolledWindow.Visible = false;
       }
       extraWidgetVBox = new VBox(false, 0);
       v.PackStart(extraWidgetVBox, false, false, 0);
       extraWidgetVBox.NoShowAll = true;
       extraWidget = null;
       h.PackEnd(v);
       h.ShowAll();
       this.VBox.Add(h);
       Widget defaultButton;
       switch(buttonSet)
       {
        default:
        case ButtonSet.Ok:
     defaultButton = this.AddButton(Stock.Ok, ResponseType.Ok);
     break;
        case ButtonSet.OkCancel:
     this.AddButton(Stock.Cancel, ResponseType.Cancel);
     defaultButton = this.AddButton(Stock.Ok, ResponseType.Ok);
     break;
        case ButtonSet.YesNo:
     this.AddButton(Stock.No, ResponseType.No);
     defaultButton = this.AddButton(Stock.Yes, ResponseType.Yes);
     break;
       }
       defaultButton.CanDefault = true;
       defaultButton.GrabFocus();
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:92,代码来源:iFolderMsgDialog.cs

示例11: SetupWidgets

        private void SetupWidgets()
        {
            histogram_expander = new Expander (Catalog.GetString ("Histogram"));
            histogram_expander.Activated += delegate(object sender, EventArgs e) {
                ContextSwitchStrategy.SetHistogramVisible (Context, histogram_expander.Expanded);
                UpdateHistogram ();
            };
            histogram_expander.StyleSet += delegate(object sender, StyleSetArgs args) {
                Gdk.Color c = this.Toplevel.Style.Backgrounds[(int)Gtk.StateType.Active];
                histogram.RedColorHint = (byte)(c.Red / 0xff);
                histogram.GreenColorHint = (byte)(c.Green / 0xff);
                histogram.BlueColorHint = (byte)(c.Blue / 0xff);
                histogram.BackgroundColorHint = 0xff;
                UpdateHistogram ();
            };
            histogram_image = new Gtk.Image ();
            histogram = new Histogram ();
            histogram_expander.Add (histogram_image);

            Add (histogram_expander);

            info_expander = new Expander (Catalog.GetString ("Image Information"));
            info_expander.Activated += (sender, e) => {
                ContextSwitchStrategy.SetInfoBoxVisible (Context, info_expander.Expanded);
            };

            info_table = new Table (head_rows, 2, false) { BorderWidth = 0 };

            AddLabelEntry (null, null, null, null,
                           photos => { return String.Format (Catalog.GetString ("{0} Photos"), photos.Length); });

            AddLabelEntry (null, Catalog.GetString ("Name"), null,
                           (photo, file) => { return photo.Name ?? String.Empty; }, null);

            version_list = new ListStore (typeof(IPhotoVersion), typeof(string), typeof(bool));
            version_combo = new ComboBox ();
            CellRendererText version_name_cell = new CellRendererText ();
            version_name_cell.Ellipsize = Pango.EllipsizeMode.End;
            version_combo.PackStart (version_name_cell, true);
            version_combo.SetCellDataFunc (version_name_cell, new CellLayoutDataFunc (VersionNameCellFunc));
            version_combo.Model = version_list;
            version_combo.Changed += OnVersionComboChanged;

            AddEntry (null, Catalog.GetString ("Version"), null, version_combo, 0.5f,
                      (widget, photo, file) => {
                            version_list.Clear ();
                            version_combo.Changed -= OnVersionComboChanged;

                            int count = 0;
                            foreach (IPhotoVersion version in photo.Versions) {
                                version_list.AppendValues (version, version.Name, true);
                                if (version == photo.DefaultVersion)
                                    version_combo.Active = count;
                                count++;
                            }

                            if (count <= 1) {
                                version_combo.Sensitive = false;
                                version_combo.TooltipText = Catalog.GetString ("(No Edits)");
                            } else {
                                version_combo.Sensitive = true;
                                version_combo.TooltipText =
                                    String.Format (Catalog.GetPluralString ("(One Edit)", "({0} Edits)", count - 1),
                                                   count - 1);
                            }
                            version_combo.Changed += OnVersionComboChanged;
                       }, null);

            AddLabelEntry ("date", Catalog.GetString ("Date"), Catalog.GetString ("Show Date"),
                           (photo, file) => {
                               return String.Format ("{0}{2}{1}",
                                                     photo.Time.ToShortDateString (),
                                                     photo.Time.ToShortTimeString (),
                                                     Environment.NewLine); },
                           photos => {
                                IPhoto first = photos[photos.Length - 1];
                                IPhoto last = photos[0];
                                if (first.Time.Date == last.Time.Date) {
                                    //Note for translators: {0} is a date, {1} and {2} are times.
                                    return String.Format (Catalog.GetString ("On {0} between \n{1} and {2}"),
                                                          first.Time.ToShortDateString (),
                                                          first.Time.ToShortTimeString (),
                                                          last.Time.ToShortTimeString ());
                                } else {
                                    return String.Format (Catalog.GetString ("Between {0} \nand {1}"),
                                                          first.Time.ToShortDateString (),
                                                          last.Time.ToShortDateString ());
                                }
                           });

            AddLabelEntry ("size", Catalog.GetString ("Size"), Catalog.GetString ("Show Size"),
                           (photo, metadata) => {
                                int width = metadata.Properties.PhotoWidth;
                                int height = metadata.Properties.PhotoHeight;

                                if (width != 0 && height != 0)
                                    return String.Format ("{0}x{1}", width, height);
                                else
                                    return Catalog.GetString ("(Unknown)");
                           }, null);
//.........这里部分代码省略.........
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:101,代码来源:InfoBox.cs

示例12: BuildWindow

        private void BuildWindow()
        {
            this.Resizable = false;

            BorderWidth = 6;
            VBox.Spacing = 12;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

            HBox box = new HBox();
            box.BorderWidth = 6;
            box.Spacing = 12;

            Image image = new Image (PodcastPixbufs.PodcastIcon48);
            image.Yalign = 0.0f;

            box.PackStart(image, false, true, 0);

            VBox content_box = new VBox();
            content_box.Spacing = 12;

            Label header = new Label();
            header.Markup = "<big><b>" + GLib.Markup.EscapeText (Catalog.GetString (
                                "Subscribe to New Podcast Feed")) + "</b></big>";
            header.Justify = Justification.Left;
            header.SetAlignment(0.0f, 0.0f);

            Label message = new Label (Catalog.GetString (
                                           "Please enter the URL of the podcast you wish to subscribe to"));
            message.Wrap = true;
            message.Justify = Justification.Left;
            message.SetAlignment (0.0f, 0.0f);

            Expander advanced_expander = new Expander ("Advanced");

            VBox expander_children = new VBox();
            expander_children.BorderWidth = 6;
            expander_children.Spacing = 6;

            Label sync_text = new Label (Catalog.GetString (
                                             "When new episodes are available:  "));
            sync_text.SetAlignment (0.0f, 0.0f);
            sync_text.Justify = Justification.Left;

            sync_combo = new SyncPreferenceComboBox ();

            expander_children.PackStart (sync_text);
            expander_children.PackStart (sync_combo);

            advanced_expander.Add (expander_children);

            url_entry = new Entry ();
            url_entry.ActivatesDefault = true;

            Table table = new Table (1, 2, false);
            table.RowSpacing = 6;
            table.ColumnSpacing = 12;

            table.Attach(new Label (Catalog.GetString ("URL:")), 0, 1, 0, 1,
                         AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

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

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

            content_box.PackStart (header, false, true, 0);
            content_box.PackStart (message, false, true, 0);

            content_box.PackStart (table, false, true, 0);

            box.PackStart (content_box, false, true, 0);

            AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
            AddButton (Catalog.GetString ("Subscribe"), ResponseType.Ok, true);

            box.ShowAll ();
            VBox.Add (box);
        }
开发者ID:jrmuizel,项目名称:banshee-unofficial-plugins,代码行数:81,代码来源:PodcastSubscribeDialog.cs

示例13: MetadataDisplayWidget

        public MetadataDisplayWidget()
        {
            main_vbox = new VBox ();
            main_vbox.Spacing = 6;

            metadata_message = new Label (String.Empty);
            metadata_message.UseMarkup = true;
            metadata_message.LineWrap = true;
            metadata_vbox = new VBox ();
            metadata_vbox.Spacing = 6;

            main_vbox.PackStart (metadata_vbox, false, false, 0);
            AddWithViewport (metadata_message);
            ((Viewport)Child).ShadowType = ShadowType.None;
            BorderWidth = 3;

            display = State.message;
            ExposeEvent += HandleExposeEvent;

            open_list = new List<string> ();

            // Create Expander and TreeView for
            // extended metadata
            var tree_view = new TreeView ();
            tree_view.HeadersVisible = false;
            tree_view.RulesHint = true;

            var col = new TreeViewColumn ();
            col.Sizing = TreeViewColumnSizing.Autosize;
            CellRenderer colr = new CellRendererText ();
            col.PackStart (colr, false);

            col.AddAttribute (colr, "markup", 0);

            tree_view.AppendColumn (col);

            extended_metadata = new ListStore (typeof(string));
            tree_view.Model = extended_metadata;

            var expander = new Expander (String.Format ("<span weight=\"bold\"><small>{0}</small></span>", Catalog.GetString ("Extended Metadata")));
            expander.UseMarkup = true;
            expander.Add (tree_view);
            expander.Expanded = true;

            main_vbox.PackStart (expander, false, false, 6);
            expander.ShowAll ();

            update_delay = new DelayedOperation (Update);
            update_delay.Start ();
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:50,代码来源:MetadataDisplay.cs

示例14: BuildUI

        private void BuildUI()
        {
            // The BorderWidth situation here is a bit nuts b/c the
            // ActionArea's is set to 5.  So we work everything else out
            // so it all totals to 12.
            //
            // WIDGET           BorderWidth
            // Dialog           5
            //   VBox           2
            //     inner_vbox   5 => total = 12
            //     ActionArea   5 => total = 12
            BorderWidth = 5;
            base.VBox.BorderWidth = 0;

            // This spacing is 2 b/c the inner_vbox and ActionArea should be
            // 12 apart, and they already have BorderWidth 5 each
            base.VBox.Spacing = 2;

            inner_vbox = new VBox () { Spacing = 12, BorderWidth = 5, Visible = true };
            base.VBox.PackStart (inner_vbox, true, true, 0);

            Visible = false;
            HasSeparator = false;

            var table = new Table (3, 2, false) {
                RowSpacing = 12,
                ColumnSpacing = 16
            };

            table.Attach (new Image () {
                    IconName = "dialog-error",
                    IconSize = (int)IconSize.Dialog,
                    Yalign = 0.0f
                }, 0, 1, 0, 3, AttachOptions.Shrink, AttachOptions.Fill | AttachOptions.Expand, 0, 0);

            table.Attach (header_label = new Label () { Xalign = 0.0f }, 1, 2, 0, 1,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            table.Attach (message_label = new Hyena.Widgets.WrapLabel (), 1, 2, 1, 2,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Shrink, 0, 0);

            var scrolled_window = new ScrolledWindow () {
                HscrollbarPolicy = PolicyType.Automatic,
                VscrollbarPolicy = PolicyType.Automatic,
                ShadowType = ShadowType.In
            };

            list_view = new TreeView () {
                HeightRequest = 120,
                WidthRequest = 200
            };
            scrolled_window.Add (list_view);

            table.Attach (details_expander = new Expander (Catalog.GetString ("Details")),
                1, 2, 2, 3,
                AttachOptions.Fill | AttachOptions.Expand,
                AttachOptions.Fill | AttachOptions.Expand,
                0, 0);
            details_expander.Add (scrolled_window);

            VBox.PackStart (table, true, true, 0);
            VBox.Spacing = 12;
            VBox.ShowAll ();

            accel_group = new AccelGroup ();
            AddAccelGroup (accel_group);

            Button button = new Button (Stock.Close);
            button.CanDefault = true;
            button.UseStock = true;
            button.Show ();
            button.Clicked += (o, a) => {
                Destroy ();
            };

            AddActionWidget (button, ResponseType.Close);

            DefaultResponse = ResponseType.Close;
            button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Return, 0, AccelFlags.Visible);
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:82,代码来源:ImportFailureDialog.cs

示例15: ExceptionDialog

        public ExceptionDialog(Exception e) : base()
        {
            debugInfo = BuildExceptionMessage(e);
           
            HasSeparator = false;
            BorderWidth = 5;
            Resizable = false;
            Title = Catalog.GetString("F-Spot Encountered a Fatal Error");
            
            VBox.Spacing = 12;
            ActionArea.Layout = ButtonBoxStyle.End;

            accel_group = new AccelGroup();
		    AddAccelGroup(accel_group);
        
            HBox hbox = new HBox(false, 12);
            hbox.BorderWidth = 5;
            VBox.PackStart(hbox, false, false, 0);
        
            Image image = new Image(Stock.DialogError, IconSize.Dialog);
            image.Yalign = 0.0f;
            hbox.PackStart(image, true, true, 0);

            VBox label_vbox = new VBox(false, 0);
            label_vbox.Spacing = 12;
            hbox.PackStart(label_vbox, false, false, 0);

            Label label = new Label(String.Format("<b><big>{0}</big></b>", GLib.Markup.EscapeText(Title)));
            label.UseMarkup = true;
            label.Justify = Justification.Left;
            label.LineWrap = true;
            label.SetAlignment(0.0f, 0.5f);
            label_vbox.PackStart(label, false, false, 0);

            label = new Label(e.Message);
                
            label.UseMarkup = true;
            label.Justify = Gtk.Justification.Left;
            label.LineWrap = true;
            label.SetAlignment(0.0f, 0.5f);
            label_vbox.PackStart(label, false, false, 0);

            Label details_label = new Label(String.Format("<b>{0}</b>", 
                GLib.Markup.EscapeText(Catalog.GetString("Error Details"))));
            details_label.UseMarkup = true;
            Expander details_expander = new Expander("Details");
            details_expander.LabelWidget = details_label;
            label_vbox.PackStart(details_expander, true, true, 0);

            ScrolledWindow scroll = new ScrolledWindow();
            TextView view = new TextView();
            
            scroll.HscrollbarPolicy = PolicyType.Automatic;
            scroll.VscrollbarPolicy = PolicyType.Automatic;
            scroll.AddWithViewport(view);
            
            scroll.SetSizeRequest(450, 250);
			
			view.Editable = false;
			view.Buffer.Text = debugInfo;
			
			details_expander.Add(scroll);
			
            hbox.ShowAll();

			AddButton(Stock.Close, ResponseType.Close, true);
        }
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:67,代码来源:ExceptionDialog.cs


注:本文中的Expander.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。