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


C# Xwt.Widget类代码示例

本文整理汇总了C#中Xwt.Widget的典型用法代码示例。如果您正苦于以下问题:C# Widget类的具体用法?C# Widget怎么用?C# Widget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ExtractValueFrom

        public override object ExtractValueFrom(Widget widget)
        {
            CheckBox cb = widget as CheckBox;
            if (cb != null) {
                return cb.State == CheckBoxState.On;
            }

            return null;
        }
开发者ID:jfreax,项目名称:BAIMP,代码行数:9,代码来源:OptionBool.cs

示例2: FileProcessDialog

        /// <summary>Initialize FileProcessDialog with a custom widget inside</summary>
        /// <param name="ProgressBox">Link to the xwt widget, which should be displayed in the FileProcessDialog.</param>
        public FileProcessDialog(ref Widget ProgressBox)
        {
            Title = Localizator.GetString("FileProgressDialogTitle");
            cmdCancel.Label = Localizator.GetString("Cancel");
            Decorated = false;

            Layout.PackStart(ProgressBox, true, true);
            Layout.PackStart(cmdCancel, false, false);
            Content = Layout;
        }
开发者ID:Break-Neck,项目名称:fcmd,代码行数:12,代码来源:FileProcessDialog.cs

示例3: Popover

 public Popover(WindowFrame parent, Widget child, Position arrowPosition)
 {
     this.arrowPosition = arrowPosition;
     backend = WidgetRegistry.CreateBackend<IPopoverBackend> (GetType ());
     backend.Init ((IWindowFrameBackend) WidgetRegistry.GetBackend (parent),
                   (IWidgetBackend) WidgetRegistry.GetBackend (child), arrowPosition);
     backend.Closed += (sender, e) => {
         if (Closed != null)
             Closed (this, EventArgs.Empty);
     };
 }
开发者ID:silwol,项目名称:xwt,代码行数:11,代码来源:Popover.cs

示例4: Add

        public void Add(Widget w)
        {
            var page = w as IPageView;

            if (page != null)
            {
                Add(w, page.DisplayName);

                page.DisplayNameChanged += Page_NameChanged;
            }
        }
开发者ID:ParkitectNexus,项目名称:ParkitectNexusClient,代码行数:11,代码来源:MainNotebook.cs

示例5: ShowWidget

        public void ShowWidget(string name, Widget widget)
        {
            Clear();

            _closeButton.Label = name;

            if (widget != null)
            {
                PackStart(_closeButtonBox);
                PackStart(widget);
            }
        }
开发者ID:ParkitectNexus,项目名称:ParkitectNexusClient,代码行数:12,代码来源:SidebarContainer.cs

示例6: AddChild

 public new void AddChild(Widget widget)
 {
     if (widget == null)
         return;
         int addIndex = 0;
         for (int i = 0; i < children.Count; i++)
         {
             if (compareControls(widget, children[i]))
                 break;
             addIndex = i + 1;
         }
         children.Insert(addIndex, widget);
         base.AddChild(widget);
     Layout();
 }
开发者ID:fourtf,项目名称:4Plug,代码行数:15,代码来源:PluginWidgetLayout.cs

示例7: ApplyStyle

        /// <summary>Apply the specified selector (style) to the specified widget</summary>
        /// <param name="Widget">The widget that should "got" the style</param>
        /// <param name="Pattern">The specified selector with the desired style</param>
        public void ApplyStyle(Widget Widget, string Pattern)
        {
            if (Widget.GetType() == typeof(Label)) { ApplyStyle((Label)Widget, Pattern); return; }
            if (Widget.GetType() == typeof(Box)) { ApplyStyle((Box)Widget, Pattern); return; }

            Selector Selector = CSS[Pattern];

            if (Selector.Declarations["background-color"].Value != "inherit")
            Widget.BackgroundColor =
            Utilities.GetXwtColor(
                Selector.Declarations["background-color"].Value
            );

            if (Selector.Declarations["font-family"].Value != "inherit")
            Widget.Font = Font.FromName(
                Selector.Declarations["font-family"].Value
            );

            Widget.Visible = Selector.Declarations["display"].Value != "none";
        }
开发者ID:rdterner,项目名称:fcmd,代码行数:23,代码来源:Stylist.cs

示例8: OnChildPlacementChanged

 internal void OnChildPlacementChanged(Widget child)
 {
     Backend.UpdateChildPlacement (child.GetBackend ());
     if (!BackendHost.EngineBackend.HandlesSizeNegotiation)
         Widget.QueueWindowSizeNegotiation (this);
 }
开发者ID:vladimirvaragic,项目名称:xwt,代码行数:6,代码来源:Window.cs

示例9: AddChild

		protected override void AddChild (Widget parent, Widget child)
		{
			var exp = (Expander)parent;
			exp.Expanded = true;
			exp.Content = child;
		}
开发者ID:m13253,项目名称:xwt,代码行数:6,代码来源:ExpanderTests.cs

示例10: AddChild

		protected override void AddChild (Widget parent, Widget child)
		{
			((Frame)parent).Content = child;
		}
开发者ID:m13253,项目名称:xwt,代码行数:4,代码来源:FrameTests.cs

示例11: DragOperation

 internal DragOperation(Widget w)
 {
     source = w;
     AllowedActions = DragDropAction.All;
 }
开发者ID:shines77,项目名称:xwt,代码行数:5,代码来源:DragOperation.cs

示例12: HandleSamplesTreeSelectionChanged

        void HandleSamplesTreeSelectionChanged(object sender, EventArgs e)
        {
            if (samplesTree.SelectedRow != null) {
                if (currentSample != null)
                    sampleBox.Remove (currentSample);
                Sample s = store.GetNavigatorAt (samplesTree.SelectedRow).GetValue (widgetCol);
                if (s.Type != null) {
                    if (s.Widget == null)
                        s.Widget = (Widget)Activator.CreateInstance (s.Type);
                    sampleBox.PackStart (s.Widget, true);
                }

            //	Console.WriteLine (System.Xaml.XamlServices.Save (s.Widget));
                currentSample = s.Widget;
                Dump (currentSample, 0);
            }
        }
开发者ID:shines77,项目名称:xwt,代码行数:17,代码来源:MainWindow.cs

示例13: RegisterChild

 protected void RegisterChild(Widget w)
 {
     if (children == null)
         children = new List<Widget> ();
     w.Parent = this;
     children.Add (w);
 }
开发者ID:joncham,项目名称:xwt,代码行数:7,代码来源:Widget.cs

示例14: MarkDestroyed

 void MarkDestroyed(Widget w)
 {
     var wbk = Toolkit.GetBackend (w);
     var bk = wbk as WidgetBackend;
     if (bk == null) {
         var ew = wbk as Xwt.Widget;
         if (ew == null)
             return;
         bk = Toolkit.GetBackend (ew) as WidgetBackend;
         if (bk == null)
             return;
     }
     bk.destroyed = true;
     foreach (var c in w.Surface.Children)
         MarkDestroyed (c);
 }
开发者ID:mono,项目名称:xwt,代码行数:16,代码来源:WidgetBackend.cs

示例15: VEd

        public VEd()
        {
            for (int i = 1; i < 11; i++)
            {
                KeybHelpButtons[i] = new KeyboardHelpButton();
                KeybHelpButtons[i].FKey = "F" + i;
                KeybHelpButtons[i].Text = Localizator.GetString("FCVE_F" + i);
                KeybHelpButtons[i].CanGetFocus = false;
                KeybHelpButtons[i].Clicked += KeyboardHelpButton_Clicked;
                KeybHelpButtons[i].Tag = i;
                KeyBoardHelp.PackStart(KeybHelpButtons[i], true, WidgetPlacement.Fill, WidgetPlacement.Fill, 0,1,0,1);
            }

            Title = "File Commander VE";
            Content = Layout;

            CommandBox.KeyReleased += CommandBox_KeyReleased;
            Layout.KeyReleased += Layout_KeyReleased;

            mnuFile.SubMenu = new Menu();
            mnuFile.SubMenu.Items.Add(mnuFileNew);
            mnuFile.SubMenu.Items.Add(mnuFileOpen);
            mnuFile.SubMenu.Items.Add(mnuFileReload);
            mnuFile.SubMenu.Items.Add(mnuFileSave);
            mnuFile.SubMenu.Items.Add(new SeparatorMenuItem());
            mnuFile.SubMenu.Items.Add(mnuFilePrint);
            mnuFile.SubMenu.Items.Add(mnuFilePrintPreview);
            mnuFile.SubMenu.Items.Add(mnuFilePrintSettings);
            mnuFile.SubMenu.Items.Add(new SeparatorMenuItem());
            mnuFile.SubMenu.Items.Add(mnuFileClose);

            mnuEdit.SubMenu = new Menu();
            mnuEdit.SubMenu.Items.Add(mnuEditCut);
            mnuEdit.SubMenu.Items.Add(mnuEditCopy);
            mnuEdit.SubMenu.Items.Add(mnuEditPaste);
            mnuEdit.SubMenu.Items.Add(new SeparatorMenuItem());
            mnuEdit.SubMenu.Items.Add(mnuEditSelectAll);
            mnuEdit.SubMenu.Items.Add(new SeparatorMenuItem());
            mnuEdit.SubMenu.Items.Add(mnuEditFindReplace);
            mnuEdit.SubMenu.Items.Add(mnuEditFindNext);

            mnuViewSettings.Clicked += (o, ea) => {
                new VEsettings().Run();
                Plugin.ShowToolbar = Settings.Default.VE_ShowToolbar;
                KeyBoardHelp.Visible = Settings.Default.ShowKeybrdHelp;
                CommandBox.Visible = Settings.Default.VE_ShowCmdBar;
            };
            mnuView.SubMenu = new Menu();
            mnuView.SubMenu.Items.Add(mnuViewSettings);

            mnuHelp.SubMenu = new Menu();
            mnuHelp.SubMenu.Items.Add(mnuHelpHelpme);
            mnuHelp.SubMenu.Items.Add(mnuHelpAbout);

            MainMenu = new Menu();
            MainMenu.Items.Add(mnuFile);
            MainMenu.Items.Add(mnuEdit);
            MainMenu.Items.Add(mnuView);
            MainMenu.Items.Add(mnuFormat);
            MainMenu.Items.Add(mnuHelp);

            mnuFileOpen.Clicked += (o, ea) => { OpenFile(); };
            mnuFilePrint.Clicked += (o, ea) => { SendCommand("print"); };
            mnuFilePrintSettings.Clicked += (o, ea) => { SendCommand("pagesetup"); };
            mnuFilePrintPreview.Clicked += (o, ea) => { SendCommand("print preview"); };
            mnuFileClose.Clicked += (o, ea) => { Exit(); };
            mnuEditCut.Clicked += (o, ea) => { SendCommand("cut selected"); };
            mnuEditCopy.Clicked += (o, ea) => { SendCommand("copy selected"); };
            mnuEditPaste.Clicked += (o, ea) => { SendCommand("paste clipboard"); };
            mnuEditSelectAll.Clicked += (o, ea) => { SendCommand("select *"); };
            mnuEditFindReplace.Clicked += (o, ea) => { SendCommand("findreplace"); };
            mnuEditFindNext.Clicked += (o, ea) => { SendCommand("findreplace last"); };
            mnuHelpAbout.Clicked += mnuHelpAbout_Clicked;

            CloseRequested += VEd_CloseRequested;

            Localizator.LocalizationChanged += (o, ea) => Localize();

            PluginBody = new Spinner { Animate = true };
            BuildLayout();
            Localize();
        }
开发者ID:Break-Neck,项目名称:fcmd,代码行数:82,代码来源:VEd.cs


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