public void SetCurrentImage(bool isCheck) { this.isCheck = isCheck; this.imageWidget.Image = !isCheck?ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.unLock.png") : ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.lock.png"); Services.EventsService.GetEvent <ScaleLockedChangeEvent>().Publish(isCheck); }
public ColorImage() { this.imageWidget = new ImageView(); this.imageWidget.WidthRequest = 15; this.imageWidget.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.Arrow.png"); this.Add((Widget)this.imageWidget); this.ShowAll(); }
private void InitButtonPixbuf() { this.filter_button.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.ResourcePanelResource.search.png"); this.clear_button.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.ResourcePanelResource.Close.png"); Gdk.Color backGroundColor = this.filter_button.ImageWidget.BackGroundColor; Gdk.Color focusBackGroundColor = this.filter_button.ImageWidget.FocusBackGroundColor; this.filter_button.ImageWidget.BackGroundColor = focusBackGroundColor; this.filter_button.ImageWidget.FocusBackGroundColor = backGroundColor; this.clear_button.ImageWidget.BackGroundColor = focusBackGroundColor; this.clear_button.ImageWidget.FocusBackGroundColor = backGroundColor; }
public new void Init(string imageUnCheck, string imageCheck, int tag) { this.ImageCheck = imageCheck; this.ImageUnCheck = imageUnCheck; this.Tag = tag; this.checkedImage = ImageIcon.GetIcon(imageCheck); this.uncheckedImage = ImageIcon.GetIcon(imageUnCheck); this.imageWidget.Image = this.uncheckedImage; this.imageWidget.WidthRequest = 24; this.imageWidget.HeightRequest = 24; this.imageWidget.Show(); }
public Widget ResolveEditor(PropertyItem item = null) { this._table = new Table(2u, 1u, false); this._checkButton = new CheckButtonEx(); this._checkButton.Label = "九宫格"; this._sudukuTable = new Table(2u, 2u, false); this._tableRight = new Table(3u, 1u, false); this._tableBottom = new Table(1u, 3u, false); this._left = new EntryIntEx(); this._left.Name = "left"; this._right = new EntryIntEx(); this._right.Name = "right"; this._top = new EntryIntEx(); this._top.Name = "top"; this._bottom = new EntryIntEx(); this._bottom.Name = "bottom"; this._left.WidthRequest = (this._right.WidthRequest = (this._top.WidthRequest = (this._bottom.WidthRequest = 30))); this._left.IntegerNum = (this._right.IntegerNum = (this._top.IntegerNum = (this._bottom.IntegerNum = 0))); this._imageWidget = new ImageView(); this._imageWidget.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.ComponentResource.Multi.png"); this._tableRight.Attach(this._top, 0u, 1u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); Label label = new Label(); label.WidthRequest = 5; this._tableRight.Attach(label, 0u, 1u, 1u, 2u, AttachOptions.Fill, AttachOptions.Expand, 0u, 0u); this._tableRight.Attach(this._bottom, 0u, 1u, 2u, 3u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._tableRight.ShowAll(); this._tableBottom.Attach(this._left, 0u, 1u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); Label label2 = new Label(); label2.WidthRequest = 5; this._tableBottom.Attach(label2, 1u, 2u, 0u, 1u, AttachOptions.Fill, AttachOptions.Expand, 0u, 0u); this._tableBottom.Attach(this._right, 2u, 3u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._tableBottom.ShowAll(); this._sudukuTable.Attach(this._imageWidget, 0u, 1u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._sudukuTable.Attach(this._tableRight, 1u, 2u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._sudukuTable.Attach(this._tableBottom, 0u, 1u, 1u, 2u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._sudukuTable.ShowAll(); this._table.Attach(this._checkButton, 0u, 1u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._table.Attach(this._sudukuTable, 0u, 1u, 1u, 2u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._table.ShowAll(); this._left.EntryValueChanged += new EventHandler <EntryIntEventArgs>(this.EntryValueChanged); this._right.EntryValueChanged += new EventHandler <EntryIntEventArgs>(this.EntryValueChanged); this._top.EntryValueChanged += new EventHandler <EntryIntEventArgs>(this.EntryValueChanged); this._top.EntryValueChanged += new EventHandler <EntryIntEventArgs>(this.EntryValueChanged); this._checkButton.Clicked += new EventHandler(this._checkButton_Clicked); return(this._table); }
public ImageCombox() { this.imageWidget = new ImageView(); this.imageWidget.WidthRequest = 10; this.imageWidget.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.Arrow.png"); this.Add((Widget)this.imageWidget); CheckMenuItem checkMenuItem1 = new CheckMenuItem(string.Format("%{0}", (object)LanguageInfo.Property_ParentPercentage)); checkMenuItem1.ButtonPressEvent += new ButtonPressEventHandler(this.item1_ButtonPressEvent); CheckMenuItem checkMenuItem2 = new CheckMenuItem(LanguageInfo.NewFile_Pixel); checkMenuItem2.ButtonPressEvent += new ButtonPressEventHandler(this.item2_ButtonPressEvent); this._contentMenu.Add((Widget)checkMenuItem1); this._contentMenu.Add((Widget)checkMenuItem2); this.ShowAll(); }
public void Refresh() { if (this._propertyItem != null) { this.resourceFile = (this._propertyDescriptor.GetValue(this._propertyItem.Instance) as ResourceFile); string arg; if (this._propertyItem.ResourceFilterDescriptor == null) { arg = ".png,jpg"; } else { arg = string.Join(",", this._propertyItem.ResourceFilterDescriptor.FileFilter); } if (this.resourceFile != null) { if (this.resourceFile.IsDefault) { this.imageWidget.TooltipText = string.Format("{0}{1}", LanguageInfo.Display_SupportFileTypes, arg); } else { this.imageWidget.TooltipText = string.Format("{0}{1}\r\n{2}", LanguageInfo.Display_SupportFileTypes, arg, this.resourceFile.FullPath); } Xwt.Drawing.Image image = (this.resourceFile.PreviewImageInfo == null) ? null : this.resourceFile.PreviewImageInfo.Image; if (image != null) { double width = this.resourceFile.PreviewImageInfo.Size.Width; double height = this.resourceFile.PreviewImageInfo.Size.Height; this.ScaleImage(image); if (this._propertyDescriptor.Name == "LabelAtlasFileImage_CNB") { this._propertyItem.Instance.GetType().GetProperty("CharWidth").SetValue(this._propertyItem.Instance, (int)(width / 12.0), null); this._propertyItem.Instance.GetType().GetProperty("CharHeight").SetValue(this._propertyItem.Instance, (int)height, null); } } } else { this.imageWidget.TooltipText = string.Format("{0}{1}", LanguageInfo.Display_SupportFileTypes, arg); this.imageWidget.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.NormalImage.png"); this.imageWidget.QueueDraw(); } } }
private void InitiaFileType() { this.SetWigetPropeties(new FileTypeInfo(ImageIcon.GetIcon("CocoStudio.ControlLib.Resource.sence.png"), "Scene", EFileType.Scene, ".csd", LanguageInfo.NewFile_Scene) { Description = LanguageInfo.NewFile_SceneDes }, 0, null); this.SetWigetPropeties(new FileTypeInfo(ImageIcon.GetIcon("CocoStudio.ControlLib.Resource.layer.png"), "Layer", EFileType.Layer, ".csd", LanguageInfo.NewFile_Layer) { Description = LanguageInfo.NewFile_LayerDes }, 1, null); this.SetWigetPropeties(new FileTypeInfo(ImageIcon.GetIcon("CocoStudio.ControlLib.Resource.node.png"), "Node", EFileType.Node, ".csd", LanguageInfo.Display_Component_Entity) { Description = LanguageInfo.NewFile_NodeDes }, 2, null); this.SetWigetPropeties(new FileTypeInfo(ImageIcon.GetIcon("CocoStudio.ControlLib.Resource.plist.png"), "Plist", EFileType.Plist, ".csi", LanguageInfo.NewFile_Plist) { Description = LanguageInfo.NewFile_PlistDes }, 3, null); base.ShowAll(); }
public FilpEditorWidget() { this.alignment1 = new Alignment(0.5f, 0.5f, 1f, 1f); this.alignment1.Name = "alignment1"; this.table1 = new Table(1U, 2U, false); this.table1.Name = "table1"; this.table1.ColumnSpacing = 6U; this.btnS = new ToggleButtonImage(); this.btnS.CheckedImage = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.horizontalFilp.png"); this.btnS.UnCheckedImage = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.horizontalFilp.png"); this.btnS.CanFocus = true; this.btnS.Name = "btnS"; this.btnS.SetSizeRequest(22, 22); this.table1.Add((Widget)this.btnS); Table.TableChild tableChild1 = (Table.TableChild) this.table1[(Widget)this.btnS]; tableChild1.XOptions = AttachOptions.Fill; tableChild1.YOptions = AttachOptions.Fill; this.btnV = new ToggleButtonImage(); this.btnV.CheckedImage = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.verticalFilp.png"); this.btnV.UnCheckedImage = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.verticalFilp.png"); this.btnV.CanFocus = true; this.btnV.Name = "btnV"; this.btnV.SetSizeRequest(22, 22); this.table1.Add((Widget)this.btnV); Table.TableChild tableChild2 = (Table.TableChild) this.table1[(Widget)this.btnV]; tableChild2.LeftAttach = 1U; tableChild2.RightAttach = 2U; tableChild2.XOptions = AttachOptions.Fill; tableChild2.YOptions = AttachOptions.Fill; this.alignment1.Add((Widget)this.table1); this.Add((Widget)this.alignment1); if (this.Child != null) { this.Child.ShowAll(); } this.Hide(); this.ReadLanuageConfigFile(); this.btnS.CheckChanged += new EventHandler(this.btnS_Clicked); this.btnV.CheckChanged += new EventHandler(this.btnV_Clicked); }
public void SetImage(object current, int num = 1, string rootType = "") { string str1 = string.Empty; if (current != null) { str1 = current.GetType().Name; } if (string.IsNullOrEmpty(str1)) { str1 = "MultiObject"; } this._imageWidget.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.ComponentResource." + str1.Substring(0, str1.Length - 6) + ".png"); this._imageWidget.ShowAll(); if (num > 1) { Label label = new Label(); this.labelTable.Attach((Widget)label, 0U, 1U, 0U, 1U, AttachOptions.Expand, AttachOptions.Fill, 0U, 0U); label.Show(); label.Text = string.Format("{0}{1}", (object)num, (object)LanguageInfo.ImageText); } else { foreach (object customAttribute in current.GetType().GetCustomAttributes(false)) { if (customAttribute is DisplayNameAttribute) { string str2 = LanguageOption.GetValueBykey((customAttribute as DisplayNameAttribute).DisplayName); if (!string.IsNullOrEmpty(rootType)) { str2 = rootType; } if (str2.Length > 8) { Label label1 = new Label(); Label label2 = new Label(); this.labelTable.Attach((Widget)label1, 0U, 1U, 0U, 1U, AttachOptions.Expand, AttachOptions.Fill, 0U, 0U); this.labelTable.Attach((Widget)label2, 0U, 1U, 1U, 2U, AttachOptions.Expand, AttachOptions.Fill, 0U, 0U); label1.Show(); label2.Show(); int num1 = 0; for (int index = 1; index < str2.Length; ++index) { if ((int)str2[index] >= 65 && (int)str2[index] <= 90) { num1 = index; break; } } label1.Text = str2.Substring(0, num1); label2.Text = str2.Substring(num1, str2.Length - num1); break; } Label label = new Label(); this.labelTable.Attach((Widget)label, 0U, 1U, 0U, 1U, AttachOptions.Expand, AttachOptions.Fill, 0U, 0U); label.Show(); label.Text = str2; break; } } } }