public ResourceFileImport() { Gtk.Drag.DestSet((Widget)this, DestDefaults.All, this.target_tableWindows, DragAction.Copy | DragAction.Move | DragAction.Link); Gtk.Drag.SourceSet((Widget)this, ModifierType.Button1Mask, this.target_tableWindows, DragAction.Copy | DragAction.Move | DragAction.Link); this.DragMotion += new DragMotionHandler(this.ResourceFileImport_DragMotion); this.FileTable = new Table(1U, 3U, false); this.fileButton = new Button(); this.fileLabel = new Label(); this.fileButton.WidthRequest = 90; this.fileButton.HeightRequest = 25; this.fileLabel.Text = ""; this.fileLabel.MaxWidthChars = 20; this.linkLabel = new LabelLink((string)null); this.linkLabel.SetLabelText(""); this.linkLabel.SetLabelFontSize(12); this.linkLabel.AllowRightClick = false; this.linkLabel.LeftClicked += new EventHandler <LabelClickedEventArgs>(this.linkLabel_LeftClicked); this.fileButton.Label = this.ButtonText; this.FileTable.Attach((Widget)this.fileLabel, 0U, 1U, 0U, 1U, AttachOptions.Fill, AttachOptions.Fill, 0U, 0U); this.FileTable.Attach((Widget)this.linkLabel, 1U, 2U, 0U, 1U, AttachOptions.Fill, AttachOptions.Fill, 0U, 0U); this.FileTable.Attach((Widget)this.fileButton, 2U, 3U, 0U, 1U, AttachOptions.Fill, AttachOptions.Fill, 0U, 0U); this.fileButton.Show(); this.fileButton.Clicked += new EventHandler(this.fileButton_Clicked); this.Add((Widget)this.FileTable); this.ShowAll(); }
private Linkbase CreateLabelLinkbase(Taxonomy taxonomy, DiscoverableTaxonomySet dts) { var linkbase = new Linkbase(GetLinkbaseFileName(taxonomy, "lab")); var labelLink = new LabelLink(LinkbaseXNames.Label, LinkRoles.Generic); linkbase.AddLink(labelLink, dts); var locCount = 0; var labCount = 0; foreach (var extensionItem in ExtensionItems) { var locLabel = $"loc{locCount}"; locCount += 1; var locNode = CreateLocatorNode(locLabel, extensionItem, dts); labelLink.AddNode(locNode); foreach (var extensionLabel in extensionItem.Labels) { var labLabel = $"lab{labCount}"; labCount += 1; var labNode = new LabelNode(labLabel, extensionLabel.Role, extensionLabel.Text, extensionLabel.Language); labelLink.AddNode(labNode); var arc = new LabelArc(locNode, labNode); labelLink.AddArc(arc); } } return(linkbase); }
protected virtual void Build() { Gui.Initialize((Widget)this); this.HeightRequest = 175; this.Name = "CocoStudio.ControlLib.Windows.LoginDialog"; this.WindowPosition = WindowPosition.CenterOnParent; VBox vbox = this.VBox; vbox.Name = "dialog1_VBox"; vbox.BorderWidth = 2U; this.evtbx_border = new EventBox(); this.evtbx_border.Name = "evtbx_border"; this.evtbx_border.BorderWidth = 10U; this.table_main = new Table(4U, 2U, false); this.table_main.Name = "table_main"; this.table_main.RowSpacing = 6U; this.table_main.ColumnSpacing = 6U; this.hbox_firstRow = new HBox(); this.hbox_firstRow.Name = "hbox_firstRow"; this.hbox_firstRow.Spacing = 6; this.entry_Name = new Entry(); this.entry_Name.WidthRequest = 250; this.entry_Name.CanFocus = true; this.entry_Name.Name = "entry_Name"; this.entry_Name.IsEditable = true; this.entry_Name.InvisibleChar = '●'; this.hbox_firstRow.Add((Widget)this.entry_Name); Box.BoxChild boxChild1 = (Box.BoxChild) this.hbox_firstRow[(Widget)this.entry_Name]; boxChild1.Position = 0; boxChild1.Expand = false; this.link_RegisterAccount = new LabelLink((string)null); this.link_RegisterAccount.Events = EventMask.ButtonPressMask; this.link_RegisterAccount.Name = "link_RegisterAccount"; this.hbox_firstRow.Add((Widget)this.link_RegisterAccount); Box.BoxChild boxChild2 = (Box.BoxChild) this.hbox_firstRow[(Widget)this.link_RegisterAccount]; boxChild2.Position = 1; boxChild2.Expand = false; boxChild2.Fill = false; this.table_main.Add((Widget)this.hbox_firstRow); Table.TableChild tableChild1 = (Table.TableChild) this.table_main[(Widget)this.hbox_firstRow]; tableChild1.LeftAttach = 1U; tableChild1.RightAttach = 2U; tableChild1.XOptions = AttachOptions.Fill; tableChild1.YOptions = AttachOptions.Fill; this.hbox_fourthRow = new HBox(); this.hbox_fourthRow.Name = "hbox_fourthRow"; this.hbox_fourthRow.Spacing = 6; this.label_remark = new Label(); this.label_remark.Name = "label_remark"; this.label_remark.LabelProp = Catalog.GetString("(请使用CocoaChina账号登陆)"); this.hbox_fourthRow.Add((Widget)this.label_remark); Box.BoxChild boxChild3 = (Box.BoxChild) this.hbox_fourthRow[(Widget)this.label_remark]; boxChild3.Position = 0; boxChild3.Expand = false; boxChild3.Fill = false; this.table_main.Add((Widget)this.hbox_fourthRow); Table.TableChild tableChild2 = (Table.TableChild) this.table_main[(Widget)this.hbox_fourthRow]; tableChild2.TopAttach = 3U; tableChild2.BottomAttach = 4U; tableChild2.LeftAttach = 1U; tableChild2.RightAttach = 2U; tableChild2.XOptions = AttachOptions.Fill; tableChild2.YOptions = AttachOptions.Fill; this.hbox_secondRow = new HBox(); this.hbox_secondRow.Name = "hbox_secondRow"; this.hbox_secondRow.Spacing = 6; this.entry_PassWord = new PassWordEntry(); this.entry_PassWord.CanFocus = true; this.entry_PassWord.Name = "entry_PassWord"; this.entry_PassWord.IsEditable = true; this.entry_PassWord.InvisibleChar = '●'; this.hbox_secondRow.Add((Widget)this.entry_PassWord); ((Box.BoxChild) this.hbox_secondRow[(Widget)this.entry_PassWord]).Position = 0; this.link_ForgotPassword = new LabelLink((string)null); this.link_ForgotPassword.Events = EventMask.ButtonPressMask; this.link_ForgotPassword.Name = "link_ForgotPassword"; this.hbox_secondRow.Add((Widget)this.link_ForgotPassword); Box.BoxChild boxChild4 = (Box.BoxChild) this.hbox_secondRow[(Widget)this.link_ForgotPassword]; boxChild4.Position = 1; boxChild4.Expand = false; boxChild4.Fill = false; this.table_main.Add((Widget)this.hbox_secondRow); Table.TableChild tableChild3 = (Table.TableChild) this.table_main[(Widget)this.hbox_secondRow]; tableChild3.TopAttach = 1U; tableChild3.BottomAttach = 2U; tableChild3.LeftAttach = 1U; tableChild3.RightAttach = 2U; tableChild3.XOptions = AttachOptions.Fill; tableChild3.YOptions = AttachOptions.Fill; this.hbox_thirdRow = new HBox(); this.hbox_thirdRow.Name = "hbox_thirdRow"; this.hbox_thirdRow.Spacing = 6; this.checkbutton_password = new CheckButton(); this.checkbutton_password.CanFocus = true; this.checkbutton_password.Name = "checkbutton_password"; this.checkbutton_password.Label = Catalog.GetString("记住密码"); this.checkbutton_password.DrawIndicator = true; this.checkbutton_password.UseUnderline = true; this.hbox_thirdRow.Add((Widget)this.checkbutton_password); Box.BoxChild boxChild5 = (Box.BoxChild) this.hbox_thirdRow[(Widget)this.checkbutton_password]; boxChild5.Position = 0; boxChild5.Expand = false; this.checkbutton_AutoLogin = new CheckButton(); this.checkbutton_AutoLogin.CanFocus = true; this.checkbutton_AutoLogin.Name = "checkbutton_AutoLogin"; this.checkbutton_AutoLogin.Label = Catalog.GetString("自动登陆"); this.checkbutton_AutoLogin.DrawIndicator = true; this.checkbutton_AutoLogin.UseUnderline = true; this.hbox_thirdRow.Add((Widget)this.checkbutton_AutoLogin); Box.BoxChild boxChild6 = (Box.BoxChild) this.hbox_thirdRow[(Widget)this.checkbutton_AutoLogin]; boxChild6.Position = 1; boxChild6.Expand = false; this.table_main.Add((Widget)this.hbox_thirdRow); Table.TableChild tableChild4 = (Table.TableChild) this.table_main[(Widget)this.hbox_thirdRow]; tableChild4.TopAttach = 2U; tableChild4.BottomAttach = 3U; tableChild4.LeftAttach = 1U; tableChild4.RightAttach = 2U; tableChild4.XOptions = AttachOptions.Fill; tableChild4.YOptions = AttachOptions.Fill; this.label_Name = new Label(); this.label_Name.Name = "label_Name"; this.label_Name.Xalign = 1f; this.label_Name.LabelProp = Catalog.GetString("用户名"); this.table_main.Add((Widget)this.label_Name); Table.TableChild tableChild5 = (Table.TableChild) this.table_main[(Widget)this.label_Name]; tableChild5.XOptions = AttachOptions.Fill; tableChild5.YOptions = AttachOptions.Fill; this.label_PassWord = new Label(); this.label_PassWord.Name = "label_PassWord"; this.label_PassWord.Xalign = 1f; this.label_PassWord.LabelProp = Catalog.GetString("密码"); this.table_main.Add((Widget)this.label_PassWord); Table.TableChild tableChild6 = (Table.TableChild) this.table_main[(Widget)this.label_PassWord]; tableChild6.TopAttach = 1U; tableChild6.BottomAttach = 2U; tableChild6.XOptions = AttachOptions.Fill; tableChild6.YOptions = AttachOptions.Fill; this.evtbx_border.Add((Widget)this.table_main); vbox.Add((Widget)this.evtbx_border); Box.BoxChild boxChild7 = (Box.BoxChild)vbox[(Widget)this.evtbx_border]; boxChild7.Position = 0; boxChild7.Expand = false; boxChild7.Fill = false; HButtonBox actionArea = this.ActionArea; actionArea.Name = "dialog1_ActionArea"; actionArea.Spacing = 10; actionArea.BorderWidth = 5U; actionArea.LayoutStyle = ButtonBoxStyle.End; this.buttonCancel = new Button(); this.buttonCancel.CanDefault = true; this.buttonCancel.CanFocus = true; this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.UseStock = true; this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget((Widget)this.buttonCancel, -6); ButtonBox.ButtonBoxChild buttonBoxChild1 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonCancel]; buttonBoxChild1.Expand = false; buttonBoxChild1.Fill = false; this.buttonOk = new Button(); this.buttonOk.CanDefault = true; this.buttonOk.CanFocus = true; this.buttonOk.Name = "buttonOk"; this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget((Widget)this.buttonOk, -5); ButtonBox.ButtonBoxChild buttonBoxChild2 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.buttonOk]; buttonBoxChild2.Position = 1; buttonBoxChild2.Expand = false; buttonBoxChild2.Fill = false; if (this.Child != null) { this.Child.ShowAll(); } this.DefaultWidth = 412; this.DefaultHeight = 191; this.Show(); }