public ITUWidget CreateITUWidget() { ITUPopupButton btn = new ITUPopupButton(); btn.name = this.Name; btn.flags |= this.TabStop ? ITU.ITU_TAPSTOP : 0; btn.flags |= this.ResponseToUpKey ? ITU.ITU_RESPONSE_TO_UP_KEY : 0; PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this); btn.visible = (bool)properties["Visible"].GetValue(this); btn.active = false; btn.dirty = false; btn.alpha = this.Alpha; btn.tabIndex = this.TabIndex; btn.rect.x = this.Location.X; btn.rect.y = this.Location.Y; btn.rect.width = this.Size.Width; btn.rect.height = this.Size.Height; btn.color.alpha = this.BackColor.A; btn.color.red = this.BackColor.R; btn.color.green = this.BackColor.G; btn.color.blue = this.BackColor.B; btn.bound.x = 0; btn.bound.y = 0; btn.bound.width = 0; btn.bound.height = 0; if (this.BackgroundImage != null) { btn.staticSurf = ITU.CreateSurfaceNode(this.BackgroundImage as Bitmap, this.PixelFormat, this.Compress, this.External); if (this.External) { btn.flags |= ITU.ITU_EXTERNAL; } } ITUBorderWindow bwin = btn.bwin.widget as ITUBorderWindow; bwin.name = ""; bwin.visible = true; bwin.active = false; bwin.dirty = false; bwin.alpha = 255; bwin.rect.x = 0; bwin.rect.y = 0; bwin.rect.width = this.Size.Width; bwin.rect.height = this.Size.Height; bwin.color.alpha = this.FlatAppearance.BorderColor.A; bwin.color.red = this.FlatAppearance.BorderColor.R; bwin.color.green = this.FlatAppearance.BorderColor.G; bwin.color.blue = this.FlatAppearance.BorderColor.B; bwin.bound.x = 0; bwin.bound.y = 0; bwin.bound.width = 0; bwin.bound.height = 0; bwin.borderSize = this.FlatAppearance.BorderSize; ITUText text = btn.text.widget as ITUText; text.name = ""; text.visible = true; text.active = false; text.dirty = false; text.alpha = 255; text.rect.x = 0; text.rect.y = 0; using (Graphics cg = this.CreateGraphics()) { SizeF size = cg.MeasureString(this.Text, this.Font); text.rect.width = (int)Math.Ceiling(size.Width); text.rect.height = (int)Math.Ceiling(size.Height); } text.color.alpha = this.ForeColor.A; text.color.red = this.ForeColor.R; text.color.green = this.ForeColor.G; text.color.blue = this.ForeColor.B; text.bound.x = 0; text.bound.y = 0; text.bound.width = 0; text.bound.height = 0; text.fontWidth = (int)Math.Round(this.Font.Size * (this.Font.FontFamily.GetCellAscent(FontStyle.Regular) + this.Font.FontFamily.GetCellDescent(FontStyle.Regular)) / this.Font.FontFamily.GetEmHeight(FontStyle.Regular)); text.fontHeight = text.fontWidth; text.fontIndex = this.FontIndex; text.layout = ITULayout.ITU_LAYOUT_MIDDLE_CENTER; if (base.Font.Bold) { text.textFlags |= ITUText.ITU_TEXT_BOLD; } text.boldSize = this.BoldSize; string[] texts = new string[] { this.Text, this.Text1, this.Text2, this.Text3, this.Text4, this.Text5, this.Text6, this.Text7 }; text.stringSet = ITU.CreateStringSetNode(texts); btn.bgColor.alpha = this.BackColor.A; btn.bgColor.red = this.BackColor.R; btn.bgColor.green = this.BackColor.G; btn.bgColor.blue = this.BackColor.B; btn.focusColor.alpha = this.FlatAppearance.MouseOverBackColor.A; btn.focusColor.red = this.FlatAppearance.MouseOverBackColor.R; btn.focusColor.green = this.FlatAppearance.MouseOverBackColor.G; btn.focusColor.blue = this.FlatAppearance.MouseOverBackColor.B; if (this.FocusImage != null) { btn.staticFocusSurf = ITU.CreateSurfaceNode(this.FocusImage as Bitmap, this.PixelFormat, this.Compress, this.External); if (this.External) { btn.flags |= ITU.ITU_EXTERNAL; } } btn.pressColor.alpha = this.FlatAppearance.MouseDownBackColor.A; btn.pressColor.red = this.FlatAppearance.MouseDownBackColor.R; btn.pressColor.green = this.FlatAppearance.MouseDownBackColor.G; btn.pressColor.blue = this.FlatAppearance.MouseDownBackColor.B; if (this.PressImage != null) { btn.staticPressSurf = ITU.CreateSurfaceNode(this.PressImage as Bitmap, this.PixelFormat, this.Compress, this.External); if (this.External) { btn.flags |= ITU.ITU_EXTERNAL; } } btn.pressed = 0; btn.flags |= ITU.ITU_STRETCH; btn.totalframe = this.TotalFrame; btn.incPercent = this.IncreasePercent; btn.alphaPercent = this.AlphaPercent; btn.actions[0].action = (ITUActionType)this.Action01.Action; btn.actions[0].ev = (ITUEvent)this.Action01.Event; btn.actions[0].target = this.Action01.Target; btn.actions[0].param = this.Action01.Parameter; btn.actions[1].action = (ITUActionType)this.Action02.Action; btn.actions[1].ev = (ITUEvent)this.Action02.Event; btn.actions[1].target = this.Action02.Target; btn.actions[1].param = this.Action02.Parameter; btn.actions[2].action = (ITUActionType)this.Action03.Action; btn.actions[2].ev = (ITUEvent)this.Action03.Event; btn.actions[2].target = this.Action03.Target; btn.actions[2].param = this.Action03.Parameter; btn.actions[3].action = (ITUActionType)this.Action04.Action; btn.actions[3].ev = (ITUEvent)this.Action04.Event; btn.actions[3].target = this.Action04.Target; btn.actions[3].param = this.Action04.Parameter; btn.actions[4].action = (ITUActionType)this.Action05.Action; btn.actions[4].ev = (ITUEvent)this.Action05.Event; btn.actions[4].target = this.Action05.Target; btn.actions[4].param = this.Action05.Parameter; btn.actions[5].action = (ITUActionType)this.Action06.Action; btn.actions[5].ev = (ITUEvent)this.Action06.Event; btn.actions[5].target = this.Action06.Target; btn.actions[5].param = this.Action06.Parameter; btn.actions[6].action = (ITUActionType)this.Action07.Action; btn.actions[6].ev = (ITUEvent)this.Action07.Event; btn.actions[6].target = this.Action07.Target; btn.actions[6].param = this.Action07.Parameter; btn.actions[7].action = (ITUActionType)this.Action08.Action; btn.actions[7].ev = (ITUEvent)this.Action08.Event; btn.actions[7].target = this.Action08.Target; btn.actions[7].param = this.Action08.Parameter; btn.actions[8].action = (ITUActionType)this.Action09.Action; btn.actions[8].ev = (ITUEvent)this.Action09.Event; btn.actions[8].target = this.Action09.Target; btn.actions[8].param = this.Action09.Parameter; btn.actions[9].action = (ITUActionType)this.Action10.Action; btn.actions[9].ev = (ITUEvent)this.Action10.Event; btn.actions[9].target = this.Action10.Target; btn.actions[9].param = this.Action10.Parameter; btn.actions[10].action = (ITUActionType)this.Action11.Action; btn.actions[10].ev = (ITUEvent)this.Action11.Event; btn.actions[10].target = this.Action11.Target; btn.actions[10].param = this.Action11.Parameter; btn.actions[11].action = (ITUActionType)this.Action12.Action; btn.actions[11].ev = (ITUEvent)this.Action12.Event; btn.actions[11].target = this.Action12.Target; btn.actions[11].param = this.Action12.Parameter; btn.actions[12].action = (ITUActionType)this.Action13.Action; btn.actions[12].ev = (ITUEvent)this.Action13.Event; btn.actions[12].target = this.Action13.Target; btn.actions[12].param = this.Action13.Parameter; btn.actions[13].action = (ITUActionType)this.Action14.Action; btn.actions[13].ev = (ITUEvent)this.Action14.Event; btn.actions[13].target = this.Action14.Target; btn.actions[13].param = this.Action14.Parameter; btn.actions[14].action = (ITUActionType)this.Action15.Action; btn.actions[14].ev = (ITUEvent)this.Action15.Event; btn.actions[14].target = this.Action15.Target; btn.actions[14].param = this.Action15.Parameter; return(btn); }
public ITUWidget CreateITUWidget() { ITUCheckBox checkbox = new ITUCheckBox(); checkbox.name = this.Name; checkbox.flags |= this.TabStop ? ITU.ITU_TAPSTOP : 0; checkbox.flags |= this.ResponseToUpKey ? ITU.ITU_RESPONSE_TO_UP_KEY : 0; PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this); checkbox.visible = (bool)properties["Visible"].GetValue(this); checkbox.active = false; checkbox.dirty = false; checkbox.alpha = 255; checkbox.tabIndex = this.TabIndex; checkbox.rect.x = this.Location.X; checkbox.rect.y = this.Location.Y; checkbox.rect.width = this.Size.Width; checkbox.rect.height = this.Size.Height; checkbox.color.alpha = this.BackColor.A; checkbox.color.red = this.BackColor.R; checkbox.color.green = this.BackColor.G; checkbox.color.blue = this.BackColor.B; checkbox.bound.x = 0; checkbox.bound.y = 0; checkbox.bound.width = 0; checkbox.bound.height = 0; if (this.BackgroundImage != null) { checkbox.staticSurf = ITU.CreateSurfaceNode(this.BackgroundImage as Bitmap, this.PixelFormat, this.Compress, this.External); if (this.External) { checkbox.flags |= ITU.ITU_EXTERNAL; } } ITUBorderWindow bwin = checkbox.bwin.widget as ITUBorderWindow; bwin.name = ""; bwin.visible = true; bwin.active = false; bwin.dirty = false; bwin.alpha = 255; bwin.rect.x = 0; bwin.rect.y = 0; bwin.rect.width = this.Size.Width; bwin.rect.height = this.Size.Height; bwin.color.alpha = this.FlatAppearance.BorderColor.A; bwin.color.red = this.FlatAppearance.BorderColor.R; bwin.color.green = this.FlatAppearance.BorderColor.G; bwin.color.blue = this.FlatAppearance.BorderColor.B; bwin.bound.x = 0; bwin.bound.y = 0; bwin.bound.width = 0; bwin.bound.height = 0; bwin.borderSize = this.FlatAppearance.BorderSize; ITUText text = checkbox.text.widget as ITUText; text.flags = ITU.ITU_CLIP_DISABLED; text.name = ""; text.visible = true; text.active = false; text.dirty = false; text.alpha = 255; text.rect.x = 0; text.rect.y = 0; using (Graphics cg = this.CreateGraphics()) { SizeF size = cg.MeasureString(this.Text, this.Font); text.rect.width = (int)Math.Ceiling(size.Width); text.rect.height = (int)Math.Ceiling(size.Height); } text.color.alpha = this.ForeColor.A; text.color.red = this.ForeColor.R; text.color.green = this.ForeColor.G; text.color.blue = this.ForeColor.B; text.bound.x = 0; text.bound.y = 0; text.bound.width = 0; text.bound.height = 0; text.fontWidth = (int)Math.Round(this.Font.Size * (this.Font.FontFamily.GetCellAscent(FontStyle.Regular) + this.Font.FontFamily.GetCellDescent(FontStyle.Regular)) / this.Font.FontFamily.GetEmHeight(FontStyle.Regular)); text.fontHeight = text.fontWidth; text.fontIndex = this.FontIndex; text.layout = ITULayout.ITU_LAYOUT_MIDDLE_CENTER; if (base.Font.Bold) { text.textFlags |= ITUText.ITU_TEXT_BOLD; } text.boldSize = this.BoldSize; string[] texts = new string[] { this.Text, this.Text1, this.Text2, this.Text3, this.Text4, this.Text5, this.Text6, this.Text7 }; text.stringSet = ITU.CreateStringSetNode(texts); checkbox.bgColor.alpha = this.BackColor.A; checkbox.bgColor.red = this.BackColor.R; checkbox.bgColor.green = this.BackColor.G; checkbox.bgColor.blue = this.BackColor.B; checkbox.focusColor.alpha = this.FlatAppearance.MouseOverBackColor.A; checkbox.focusColor.red = this.FlatAppearance.MouseOverBackColor.R; checkbox.focusColor.green = this.FlatAppearance.MouseOverBackColor.G; checkbox.focusColor.blue = this.FlatAppearance.MouseOverBackColor.B; if (this.FocusImage != null) { checkbox.staticFocusSurf = ITU.CreateSurfaceNode(this.FocusImage as Bitmap, this.PixelFormat, this.Compress, this.External); if (this.External) { checkbox.flags |= ITU.ITU_EXTERNAL; } } checkbox.pressColor.alpha = this.FlatAppearance.MouseDownBackColor.A; checkbox.pressColor.red = this.FlatAppearance.MouseDownBackColor.R; checkbox.pressColor.green = this.FlatAppearance.MouseDownBackColor.G; checkbox.pressColor.blue = this.FlatAppearance.MouseDownBackColor.B; checkbox.pressed = 0; checkbox.checkedColor.alpha = this.FlatAppearance.CheckedBackColor.A; checkbox.checkedColor.red = this.FlatAppearance.CheckedBackColor.R; checkbox.checkedColor.green = this.FlatAppearance.CheckedBackColor.G; checkbox.checkedColor.blue = this.FlatAppearance.CheckedBackColor.B; checkbox.checkedFontColor.alpha = this.CheckedFontColor.A; checkbox.checkedFontColor.red = this.CheckedFontColor.R; checkbox.checkedFontColor.green = this.CheckedFontColor.G; checkbox.checkedFontColor.blue = this.CheckedFontColor.B; checkbox.orgFontColor.alpha = this.ForeColor.A; checkbox.orgFontColor.red = this.ForeColor.R; checkbox.orgFontColor.green = this.ForeColor.G; checkbox.orgFontColor.blue = this.ForeColor.B; if (this.CheckedImage != null) { checkbox.staticCheckedSurf = ITU.CreateSurfaceNode(this.CheckedImage as Bitmap, this.PixelFormat, this.Compress, this.External); if (this.External) { checkbox.flags |= ITU.ITU_EXTERNAL; } } checkbox._checked = this.Checked ? 1 : 0; if (this.FocusCheckedImage != null) { checkbox.staticFocusCheckedSurf = ITU.CreateSurfaceNode(this.FocusCheckedImage as Bitmap, this.PixelFormat, this.Compress, this.External); if (this.External) { checkbox.flags |= ITU.ITU_EXTERNAL; } } if (!this.SupportTouch) { checkbox.flags &= ~ITU.ITU_ENABLED; } checkbox.angle = this.Angle; checkbox.transformType = (ITUTransformType)this.TransformType; checkbox.transformX = this.TransformX; checkbox.transformY = this.TransformY; checkbox.actions[0].action = (ITUActionType)this.Action01.Action; checkbox.actions[0].ev = (ITUEvent)this.Action01.Event; checkbox.actions[0].target = this.Action01.Target; checkbox.actions[0].param = this.Action01.Parameter; checkbox.actions[1].action = (ITUActionType)this.Action02.Action; checkbox.actions[1].ev = (ITUEvent)this.Action02.Event; checkbox.actions[1].target = this.Action02.Target; checkbox.actions[1].param = this.Action02.Parameter; checkbox.actions[2].action = (ITUActionType)this.Action03.Action; checkbox.actions[2].ev = (ITUEvent)this.Action03.Event; checkbox.actions[2].target = this.Action03.Target; checkbox.actions[2].param = this.Action03.Parameter; checkbox.actions[3].action = (ITUActionType)this.Action04.Action; checkbox.actions[3].ev = (ITUEvent)this.Action04.Event; checkbox.actions[3].target = this.Action04.Target; checkbox.actions[3].param = this.Action04.Parameter; checkbox.actions[4].action = (ITUActionType)this.Action05.Action; checkbox.actions[4].ev = (ITUEvent)this.Action05.Event; checkbox.actions[4].target = this.Action05.Target; checkbox.actions[4].param = this.Action05.Parameter; checkbox.actions[5].action = (ITUActionType)this.Action06.Action; checkbox.actions[5].ev = (ITUEvent)this.Action06.Event; checkbox.actions[5].target = this.Action06.Target; checkbox.actions[5].param = this.Action06.Parameter; checkbox.actions[6].action = (ITUActionType)this.Action07.Action; checkbox.actions[6].ev = (ITUEvent)this.Action07.Event; checkbox.actions[6].target = this.Action07.Target; checkbox.actions[6].param = this.Action07.Parameter; checkbox.actions[7].action = (ITUActionType)this.Action08.Action; checkbox.actions[7].ev = (ITUEvent)this.Action08.Event; checkbox.actions[7].target = this.Action08.Target; checkbox.actions[7].param = this.Action08.Parameter; checkbox.actions[8].action = (ITUActionType)this.Action09.Action; checkbox.actions[8].ev = (ITUEvent)this.Action09.Event; checkbox.actions[8].target = this.Action09.Target; checkbox.actions[8].param = this.Action09.Parameter; checkbox.actions[9].action = (ITUActionType)this.Action10.Action; checkbox.actions[9].ev = (ITUEvent)this.Action10.Event; checkbox.actions[9].target = this.Action10.Target; checkbox.actions[9].param = this.Action10.Parameter; checkbox.actions[10].action = (ITUActionType)this.Action11.Action; checkbox.actions[10].ev = (ITUEvent)this.Action11.Event; checkbox.actions[10].target = this.Action11.Target; checkbox.actions[10].param = this.Action11.Parameter; checkbox.actions[11].action = (ITUActionType)this.Action12.Action; checkbox.actions[11].ev = (ITUEvent)this.Action12.Event; checkbox.actions[11].target = this.Action12.Target; checkbox.actions[11].param = this.Action12.Parameter; checkbox.actions[12].action = (ITUActionType)this.Action13.Action; checkbox.actions[12].ev = (ITUEvent)this.Action13.Event; checkbox.actions[12].target = this.Action13.Target; checkbox.actions[12].param = this.Action13.Parameter; checkbox.actions[13].action = (ITUActionType)this.Action14.Action; checkbox.actions[13].ev = (ITUEvent)this.Action14.Event; checkbox.actions[13].target = this.Action14.Target; checkbox.actions[13].param = this.Action14.Parameter; checkbox.actions[14].action = (ITUActionType)this.Action15.Action; checkbox.actions[14].ev = (ITUEvent)this.Action15.Event; checkbox.actions[14].target = this.Action15.Target; checkbox.actions[14].param = this.Action15.Parameter; return(checkbox); }