當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。