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


C# HBox.ReorderChild方法代码示例

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


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

示例1: SparkleDiffWindow


//.........这里部分代码省略.........

                    ViewLeft  = new LeftRevisionView  ();
                    ViewRight = new RightRevisionView ();

                    string output = process.StandardOutput.ReadToEnd ();
                    string [] revisions_info = Regex.Split (output.Trim (), "\n");

                    int i = 0;
                    foreach (string revision_info in revisions_info) {

                        string [] parts = Regex.Split (revision_info.Trim (), "\t");

                        int timestamp = int.Parse (parts [0]);
                        string author = parts [1];
                        string email  = parts [2];

                        string date;
                        // TRANSLATORS: This is a format specifier according to System.Globalization.DateTimeFormatInfo
                        if (i == 0)
                            date = "Latest Revision";
                        else
                            date = String.Format (_("{0} at {1}"),
                                   UnixTimestampToDateTime (timestamp).ToString (_("ddd MMM d, yyyy")),
                                   UnixTimestampToDateTime (timestamp).ToString (_("H:mm")));

                        face_collection.AddFace (email);

                        ViewLeft.AddRow  (face_collection.GetFace (email, 32), author, date);
                        ViewRight.AddRow (face_collection.GetFace (email, 32), author, date);

                        i++;

                    }

                    ViewLeft.SetImage  (new RevisionImage (file_path, Revisions [1]));
                    ViewRight.SetImage (new RevisionImage (file_path, Revisions [0]));

                    ViewLeft.IconView.SelectionChanged += delegate {

                        ViewLeft.SetImage  (new RevisionImage (file_path, Revisions [ViewLeft.GetSelected ()]));

                        ViewLeft.ScrolledWindow.Hadjustment = ViewRight.ScrolledWindow.Hadjustment;
                        ViewLeft.ScrolledWindow.Vadjustment = ViewRight.ScrolledWindow.Vadjustment;

                        HookUpViews ();

                    };

                    ViewRight.IconView.SelectionChanged += delegate {

                        ViewRight.SetImage  (new RevisionImage (file_path, Revisions [ViewRight.GetSelected ()]));

                        ViewRight.ScrolledWindow.Hadjustment = ViewLeft.ScrolledWindow.Hadjustment;
                        ViewRight.ScrolledWindow.Vadjustment = ViewLeft.ScrolledWindow.Vadjustment;

                        HookUpViews ();

                    };

                    ViewLeft.ToggleButton.Clicked += delegate {
                        if (ViewLeft.ToggleButton.Active)
                            DetachViews ();
                        else
                            HookUpViews ();
                    };

                    ViewRight.ToggleButton.Clicked += delegate {
                        if (ViewLeft.ToggleButton.Active)
                            DetachViews ();
                        else
                            HookUpViews ();
                    };

                layout_horizontal.PackStart (ViewLeft);
                layout_horizontal.PackStart (ViewRight);

                ResizeToViews ();

                // Order time view according to the user's reading direction
                if (Direction == Gtk.TextDirection.Rtl)
                    layout_horizontal.ReorderChild (ViewLeft, 1);

                HookUpViews ();

                HButtonBox dialog_buttons  = new HButtonBox ();
                dialog_buttons.Layout      = ButtonBoxStyle.End;
                dialog_buttons.BorderWidth = 0;

                    Button close_button = new Button (Stock.Close);
                    close_button.Clicked += delegate (object o, EventArgs args) {
                        Environment.Exit (0);
                    };

                dialog_buttons.Add (close_button);

            layout_vertical.PackStart (layout_horizontal, true, true, 0);
            layout_vertical.PackStart (dialog_buttons, false, false, 0);

            Add (layout_vertical);
        }
开发者ID:Sascha833,项目名称:TestProjekt,代码行数:101,代码来源:SparkleDiffWindow.cs

示例2: Reparent

            private void Reparent (Widget widget, HBox box, int index)
            {
                if (widget.Parent == box) {
                    return;
                }

                if (widget.Parent == null) {
                    box.PackStart (widget, false, false, 0);
                } else {
                    widget.Reparent (box);
                    box.SetChildPacking (widget, false, false, 0, PackType.Start);
                }

                box.ReorderChild (widget, index);
                widget.Show ();
            }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:16,代码来源:HomeView.cs


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