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


C# ScrolledWindow.Activate方法代码示例

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


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

示例1: ModelerCanvasWidget

        public ModelerCanvasWidget(ModelerCanvas owner, modelController controller)
        {
            this.Build ();
            _owner = owner;
            _controller = controller;
            VBox mainVbox = new VBox (false, 6);
            mainVbox.BorderWidth = 6;
            this.Add(mainVbox);

            //Create Toolbar
            Toolbar toolbar = new Toolbar ();
            toolbar.Name = "toolbar";
            toolbar.ShowArrow = true;
            toolbar.IconSize = Gtk.IconSize.LargeToolbar;
            toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            toolbar.Sensitive=true;
            toolbar.Activate();
            mainVbox.Add(toolbar);
            Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(mainVbox[toolbar]));
            w1.Position = 0;
            w1.Expand = false;
            w1.Fill = true;

            //Create SCrollWindow
            mainScrolledWindow = new ScrolledWindow();
            mainScrolledWindow.Activate();
            mainScrolledWindow.SetPolicy( Gtk.PolicyType.Always,Gtk.PolicyType.Always);
            mainScrolledWindow.CanFocus = true;
            mainScrolledWindow.Name = "mainScrolledWindow";
            mainScrolledWindow.ShadowType = ((Gtk.ShadowType)(1));
            mainVbox.Add(mainScrolledWindow);
            Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(mainVbox[mainScrolledWindow]));
             			w2.Position = 1;
            w2.Fill=true;
            w2.Expand=true;

            //Create Toolbar Buttons

            //Add New Table
            buttonNew = new ToolButton(new Gtk.Image (Gtk.Stock.New, IconSize.Button),"Add Table");
            buttonNew.Sensitive = true;
            buttonNew.TooltipMarkup = "Add a new empty table";
            buttonNew.IsImportant = true;
            buttonNew.Clicked += new EventHandler (OnbuttonNewActionActivated);
            buttonNew.Activate();
            buttonNew.Show();
            toolbar.Add (buttonNew);
            //Create a Relationship between two tables
            buttonRelationship = new ToolButton(new Gtk.Image (Gtk.Stock.New, IconSize.Button),"Relationship");
            buttonRelationship.Sensitive = true;
            buttonRelationship.TooltipMarkup = "Add a new relationship between tables";
            buttonRelationship.IsImportant = true;
            buttonRelationship.Clicked += new EventHandler (OnbuttonRelationshipActivated);
            buttonRelationship.Activate();
            buttonRelationship.Show();
            toolbar.Add (buttonRelationship);
            //Delete Selected Figure(s)
            buttonDelete = new ToolButton(new Gtk.Image (Gtk.Stock.New, IconSize.Button),"Remove");
            buttonDelete.Sensitive = true;
                buttonDelete.TooltipMarkup = "Remove selected figure(s) from diagram (table or relationship)";
            buttonDelete.IsImportant = true;
            buttonDelete.Clicked += new EventHandler (buttonDeleteRelationshipActivated);
            buttonDelete.Activate();
            buttonDelete.Show();
            toolbar.Add (buttonDelete);
            //Select Active Database
            comboConnections = new DatabaseConnectionContextComboBox ();
            selectedConnection = comboConnections.DatabaseConnection;
            comboConnections.Changed += new EventHandler (ConnectionChanged);
            ToolItem comboItem = new ToolItem ();
            comboItem.Child = comboConnections;
            comboItem.Show();
            toolbar.Add (new SeparatorToolItem ());
            toolbar.Add (comboItem);
            //Show all items
            mainVbox.ShowAll ();
        }
开发者ID:xiul,项目名称:Monodevelop-Database-Modeler-Addin,代码行数:77,代码来源:ModelerCanvasWidget.cs


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