本文整理汇总了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;
}
示例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;
}
示例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);
};
}
示例4: Add
public void Add(Widget w)
{
var page = w as IPageView;
if (page != null)
{
Add(w, page.DisplayName);
page.DisplayNameChanged += Page_NameChanged;
}
}
示例5: ShowWidget
public void ShowWidget(string name, Widget widget)
{
Clear();
_closeButton.Label = name;
if (widget != null)
{
PackStart(_closeButtonBox);
PackStart(widget);
}
}
示例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();
}
示例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";
}
示例8: OnChildPlacementChanged
internal void OnChildPlacementChanged(Widget child)
{
Backend.UpdateChildPlacement (child.GetBackend ());
if (!BackendHost.EngineBackend.HandlesSizeNegotiation)
Widget.QueueWindowSizeNegotiation (this);
}
示例9: AddChild
protected override void AddChild (Widget parent, Widget child)
{
var exp = (Expander)parent;
exp.Expanded = true;
exp.Content = child;
}
示例10: AddChild
protected override void AddChild (Widget parent, Widget child)
{
((Frame)parent).Content = child;
}
示例11: DragOperation
internal DragOperation(Widget w)
{
source = w;
AllowedActions = DragDropAction.All;
}
示例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);
}
}
示例13: RegisterChild
protected void RegisterChild(Widget w)
{
if (children == null)
children = new List<Widget> ();
w.Parent = this;
children.Add (w);
}
示例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);
}
示例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();
}