public ITUWidget CreateITUWidget() { ITUScrollText widget = new ITUScrollText(); widget.name = this.Name; PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this); widget.visible = (bool)properties["Visible"].GetValue(this); widget.active = false; widget.dirty = false; widget.alpha = 255; widget.rect.x = this.Location.X; widget.rect.y = this.Location.Y; widget.rect.width = this.Size.Width; widget.rect.height = this.Size.Height; widget.color.alpha = this.ForeColor.A; widget.color.red = this.ForeColor.R; widget.color.green = this.ForeColor.G; widget.color.blue = this.ForeColor.B; widget.bound.x = 0; widget.bound.y = 0; widget.bound.width = 0; widget.bound.height = 0; widget.bgColor.alpha = this.BackColor.A; widget.bgColor.red = this.BackColor.R; widget.bgColor.green = this.BackColor.G; widget.bgColor.blue = this.BackColor.B; widget.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)); widget.fontHeight = widget.fontWidth; widget.fontIndex = this.FontIndex; if (base.Font.Bold) { widget.textFlags |= ITUText.ITU_TEXT_BOLD; } widget.boldSize = this.BoldSize; string[] texts = new string[] { this.Text, this.Text1, this.Text2, this.Text3, this.Text4, this.Text5, this.Text6, this.Text7 }; widget.stringSet = ITU.CreateStringSetNode(texts); widget.width = this.Size.Width; widget.scrollDelay = this.ScrollDelay; widget.stopDelay = this.StopDelay; return(widget); }
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() { ITUWheel wheel = new ITUWheel(); wheel.type = ITUWidgetType.ITU_WHEEL; wheel.name = this.Name; wheel.flags |= this.TabStop ? ITU.ITU_TAPSTOP : 0; wheel.flags |= this.Touchable ? ITU.ITU_TOUCHABLE : 0; PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this); wheel.visible = (bool)properties["Visible"].GetValue(this); wheel.active = false; wheel.dirty = false; wheel.alpha = 255; wheel.tabIndex = this.TabIndex; wheel.rect.x = this.Location.X; wheel.rect.y = this.Location.Y; wheel.rect.width = this.Size.Width; wheel.rect.height = this.Size.Height; wheel.color.alpha = this.BackAlpha; wheel.color.red = this.BackColor.R; wheel.color.green = this.BackColor.G; wheel.color.blue = this.BackColor.B; wheel.bound.x = 0; wheel.bound.y = 0; wheel.bound.width = 0; wheel.bound.height = 0; /* * for (int i = 0; i < this.ItemCount / 2; i++) * { * ITUText text = new ITUText(); * * text.flags = ITU.ITU_CLIP_DISABLED; * text.name = ""; * text.visible = true; * text.active = false; * text.dirty = text.visible ? true : false; * text.alpha = 255; * text.rect.x = 0; * text.rect.y = 0; * text.rect.width = this.Size.Width; * text.rect.height = this.ItemHeight; * 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.bgColor.alpha = 0; * text.bgColor.red = 0; * text.bgColor.green = 0; * text.bgColor.blue = 0; * text.fontHeight = (int)this.Font.SizeInPoints; * text.fontIndex = this.FontIndex; * * string[] texts = new string[] { "" }; * text.stringSet = ITU.CreateStringSetNode(texts); * * switch (this.TextAlign) * { * case ContentAlignment.BottomLeft: * text.layout = ITULayout.ITU_LAYOUT_BOTTOM_LEFT; * break; * * case ContentAlignment.MiddleLeft: * text.layout = ITULayout.ITU_LAYOUT_MIDDLE_LEFT; * break; * * case ContentAlignment.TopLeft: * text.layout = ITULayout.ITU_LAYOUT_TOP_LEFT; * break; * * case ContentAlignment.BottomCenter: * text.layout = ITULayout.ITU_LAYOUT_BOTTOM_CENTER; * break; * * case ContentAlignment.MiddleCenter: * text.layout = ITULayout.ITU_LAYOUT_MIDDLE_CENTER; * break; * * case ContentAlignment.TopCenter: * text.layout = ITULayout.ITU_LAYOUT_TOP_CENTER; * break; * * case ContentAlignment.BottomRight: * text.layout = ITULayout.ITU_LAYOUT_BOTTOM_RIGHT; * break; * * case ContentAlignment.MiddleRight: * text.layout = ITULayout.ITU_LAYOUT_MIDDLE_RIGHT; * break; * * case ContentAlignment.TopRight: * text.layout = ITULayout.ITU_LAYOUT_TOP_RIGHT; * break; * * default: * text.layout = ITULayout.ITU_LAYOUT_DEFAULT; * break; * } * WidgetNode node = new WidgetNode(); * node.widget = text; * wheel.items.Add(node); * } */ int index = 0; foreach (object item in this.Items) { ITUText text = new 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; text.rect.width = this.Size.Width; text.rect.height = this.ItemHeight; 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.bgColor.alpha = 0; text.bgColor.red = 0; text.bgColor.green = 0; text.bgColor.blue = 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; if (base.Font.Bold) { text.textFlags |= ITUText.ITU_TEXT_BOLD; } text.boldSize = this.BoldSize; string[] texts = new string[8]; texts[0] = item.ToString(); if (this.Items1.Count > index) { texts[1] = this.Items1[index].ToString(); } if (this.Items2.Count > index) { texts[2] = this.Items2[index].ToString(); } if (this.Items3.Count > index) { texts[3] = this.Items3[index].ToString(); } if (this.Items4.Count > index) { texts[4] = this.Items4[index].ToString(); } if (this.Items5.Count > index) { texts[5] = this.Items5[index].ToString(); } if (this.Items6.Count > index) { texts[6] = this.Items6[index].ToString(); } if (this.Items7.Count > index) { texts[7] = this.Items7[index].ToString(); } text.stringSet = ITU.CreateStringSetNode(texts); switch (this.TextAlign) { case ContentAlignment.BottomLeft: text.layout = ITULayout.ITU_LAYOUT_BOTTOM_LEFT; break; case ContentAlignment.MiddleLeft: text.layout = ITULayout.ITU_LAYOUT_MIDDLE_LEFT; break; case ContentAlignment.TopLeft: text.layout = ITULayout.ITU_LAYOUT_TOP_LEFT; break; case ContentAlignment.BottomCenter: text.layout = ITULayout.ITU_LAYOUT_BOTTOM_CENTER; break; case ContentAlignment.MiddleCenter: text.layout = ITULayout.ITU_LAYOUT_MIDDLE_CENTER; break; case ContentAlignment.TopCenter: text.layout = ITULayout.ITU_LAYOUT_TOP_CENTER; break; case ContentAlignment.BottomRight: text.layout = ITULayout.ITU_LAYOUT_BOTTOM_RIGHT; break; case ContentAlignment.MiddleRight: text.layout = ITULayout.ITU_LAYOUT_MIDDLE_RIGHT; break; case ContentAlignment.TopRight: text.layout = ITULayout.ITU_LAYOUT_TOP_RIGHT; break; default: text.layout = ITULayout.ITU_LAYOUT_DEFAULT; break; } WidgetNode node = new WidgetNode(); node.widget = text; wheel.items.Add(node); index++; } /* * for (int i = 0; i < this.ItemCount / 2; i++) * { * ITUText text = new ITUText(); * * text.flags = ITU.ITU_CLIP_DISABLED; * text.name = ""; * text.visible = true; * text.active = false; * text.dirty = text.visible ? true : false; * text.alpha = 255; * text.rect.x = 0; * text.rect.y = 0; * text.rect.width = this.Size.Width; * text.rect.height = this.ItemHeight; * 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.bgColor.alpha = 0; * text.bgColor.red = 0; * text.bgColor.green = 0; * text.bgColor.blue = 0; * text.fontHeight = (int)this.Font.SizeInPoints; * text.fontIndex = this.FontIndex; * * string[] texts = new string[] { "" }; * text.stringSet = ITU.CreateStringSetNode(texts); * * switch (this.TextAlign) * { * case ContentAlignment.BottomLeft: * text.layout = ITULayout.ITU_LAYOUT_BOTTOM_LEFT; * break; * * case ContentAlignment.MiddleLeft: * text.layout = ITULayout.ITU_LAYOUT_MIDDLE_LEFT; * break; * * case ContentAlignment.TopLeft: * text.layout = ITULayout.ITU_LAYOUT_TOP_LEFT; * break; * * case ContentAlignment.BottomCenter: * text.layout = ITULayout.ITU_LAYOUT_BOTTOM_CENTER; * break; * * case ContentAlignment.MiddleCenter: * text.layout = ITULayout.ITU_LAYOUT_MIDDLE_CENTER; * break; * * case ContentAlignment.TopCenter: * text.layout = ITULayout.ITU_LAYOUT_TOP_CENTER; * break; * * case ContentAlignment.BottomRight: * text.layout = ITULayout.ITU_LAYOUT_BOTTOM_RIGHT; * break; * * case ContentAlignment.MiddleRight: * text.layout = ITULayout.ITU_LAYOUT_MIDDLE_RIGHT; * break; * * case ContentAlignment.TopRight: * text.layout = ITULayout.ITU_LAYOUT_TOP_RIGHT; * break; * * default: * text.layout = ITULayout.ITU_LAYOUT_DEFAULT; * break; * } * WidgetNode node = new WidgetNode(); * node.widget = text; * wheel.items.Add(node); * } */ wheel.focusColor.alpha = this.FocusColor.A; wheel.focusColor.red = this.FocusColor.R; wheel.focusColor.green = this.FocusColor.G; wheel.focusColor.blue = this.FocusColor.B; wheel.normalColor.alpha = this.ForeColor.A; wheel.normalColor.red = this.ForeColor.R; wheel.normalColor.green = this.ForeColor.G; wheel.normalColor.blue = this.ForeColor.B; wheel.tempy = 0; wheel.shift_one = 0; wheel.sliding = 0; wheel.scal = 0; wheel.moving_step = 0; wheel.inside = 0; wheel.slide_step = 2; //this.Speed; wheel.slide_itemcount = 0; // this.SlideCount; wheel.idle = 0; wheel.focusIndex = this.FocusIndex; wheel.itemCount = 7; // this.ItemCount; wheel.totalframe = this.TotalFrame; if (this.Draggable) { wheel.flags |= ITU.ITU_DRAGGABLE; } wheel.fontHeight = (int)this.Font.SizeInPoints; wheel.focusFontHeight = this.FocusFontHeight; if (this.Cycle) { wheel.cycle_tor = 1; } else { wheel.cycle_tor = 0; } wheel.cycle_arr_count = 0; wheel.maxci = 0; wheel.minci = 0; wheel.layout_ci = 0; wheel.fix_count = 0; wheel.focus_c = 0; wheel.focus_dev = 0; if (this.FontSquare) { wheel.fontsquare = 1; } else { wheel.fontsquare = 0; } for (int i = 0; i < ITU.ITU_WHEEL_CYCLE_ARR_LIMIT; i++) { wheel.cycle_arr[i] = 0; } wheel.actions[0].action = (ITUActionType)this.Action01.Action; wheel.actions[0].ev = (ITUEvent)this.Action01.Event; wheel.actions[0].target = this.Action01.Target; wheel.actions[0].param = this.Action01.Parameter; wheel.actions[1].action = (ITUActionType)this.Action02.Action; wheel.actions[1].ev = (ITUEvent)this.Action02.Event; wheel.actions[1].target = this.Action02.Target; wheel.actions[1].param = this.Action02.Parameter; wheel.actions[2].action = (ITUActionType)this.Action03.Action; wheel.actions[2].ev = (ITUEvent)this.Action03.Event; wheel.actions[2].target = this.Action03.Target; wheel.actions[2].param = this.Action03.Parameter; wheel.actions[3].action = (ITUActionType)this.Action04.Action; wheel.actions[3].ev = (ITUEvent)this.Action04.Event; wheel.actions[3].target = this.Action04.Target; wheel.actions[3].param = this.Action04.Parameter; wheel.actions[4].action = (ITUActionType)this.Action05.Action; wheel.actions[4].ev = (ITUEvent)this.Action05.Event; wheel.actions[4].target = this.Action05.Target; wheel.actions[4].param = this.Action05.Parameter; wheel.actions[5].action = (ITUActionType)this.Action06.Action; wheel.actions[5].ev = (ITUEvent)this.Action06.Event; wheel.actions[5].target = this.Action06.Target; wheel.actions[5].param = this.Action06.Parameter; wheel.actions[6].action = (ITUActionType)this.Action07.Action; wheel.actions[6].ev = (ITUEvent)this.Action07.Event; wheel.actions[6].target = this.Action07.Target; wheel.actions[6].param = this.Action07.Parameter; wheel.actions[7].action = (ITUActionType)this.Action08.Action; wheel.actions[7].ev = (ITUEvent)this.Action08.Event; wheel.actions[7].target = this.Action08.Target; wheel.actions[7].param = this.Action08.Parameter; wheel.actions[8].action = (ITUActionType)this.Action09.Action; wheel.actions[8].ev = (ITUEvent)this.Action09.Event; wheel.actions[8].target = this.Action09.Target; wheel.actions[8].param = this.Action09.Parameter; wheel.actions[9].action = (ITUActionType)this.Action10.Action; wheel.actions[9].ev = (ITUEvent)this.Action10.Event; wheel.actions[9].target = this.Action10.Target; wheel.actions[9].param = this.Action10.Parameter; wheel.actions[10].action = (ITUActionType)this.Action11.Action; wheel.actions[10].ev = (ITUEvent)this.Action11.Event; wheel.actions[10].target = this.Action11.Target; wheel.actions[10].param = this.Action11.Parameter; wheel.actions[11].action = (ITUActionType)this.Action12.Action; wheel.actions[11].ev = (ITUEvent)this.Action12.Event; wheel.actions[11].target = this.Action12.Target; wheel.actions[11].param = this.Action12.Parameter; wheel.actions[12].action = (ITUActionType)this.Action13.Action; wheel.actions[12].ev = (ITUEvent)this.Action13.Event; wheel.actions[12].target = this.Action13.Target; wheel.actions[12].param = this.Action13.Parameter; wheel.actions[13].action = (ITUActionType)this.Action14.Action; wheel.actions[13].ev = (ITUEvent)this.Action14.Event; wheel.actions[13].target = this.Action14.Target; wheel.actions[13].param = this.Action14.Parameter; wheel.actions[14].action = (ITUActionType)this.Action15.Action; wheel.actions[14].ev = (ITUEvent)this.Action15.Event; wheel.actions[14].target = this.Action15.Target; wheel.actions[14].param = this.Action15.Parameter; return(wheel); }
public ITUWidget CreateITUWidget() { ITUTableListBox listbox = new ITUTableListBox(); listbox.type = ITUWidgetType.ITU_TABLELISTBOX; listbox.name = this.Name; listbox.flags |= this.TabStop ? ITU.ITU_TAPSTOP : 0; listbox.flags |= this.HasLongPress ? ITU.ITU_HAS_LONG_PRESS : 0; PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this); listbox.visible = (bool)properties["Visible"].GetValue(this); listbox.active = false; listbox.dirty = false; listbox.alpha = 255; listbox.tabIndex = this.TabIndex; listbox.rect.x = this.Location.X; listbox.rect.y = this.Location.Y; listbox.rect.width = this.Size.Width; listbox.rect.height = this.Size.Height; listbox.color.alpha = this.BackAlpha; listbox.color.red = this.BackColor.R; listbox.color.green = this.BackColor.G; listbox.color.blue = this.BackColor.B; listbox.bound.x = 0; listbox.bound.y = 0; listbox.bound.width = 0; listbox.bound.height = 0; for (int i = 0; i < this.ItemCount; i++) { object item; if (i < this.Items.Count) { item = this.Items[i]; } else { item = null; } ITUScrollText text = new ITUScrollText(); text.name = ""; text.visible = true; text.active = false; text.dirty = false; text.alpha = 255; text.rect.x = 0; text.rect.y = 0; text.rect.width = this.Size.Width; text.rect.height = this.ItemHeight; 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.bgColor.alpha = 0; text.bgColor.red = 0; text.bgColor.green = 0; text.bgColor.blue = 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; if (base.Font.Bold) { text.textFlags |= ITUText.ITU_TEXT_BOLD; } text.boldSize = this.BoldSize; string[] texts = new string[1]; if (item == null) { texts[0] = ""; } else { texts[0] = item.ToString(); } text.stringSet = ITU.CreateStringSetNode(texts); text.width = this.Size.Width; switch (this.TextAlign) { case ContentAlignment.BottomLeft: text.layout = ITULayout.ITU_LAYOUT_BOTTOM_LEFT; break; case ContentAlignment.MiddleLeft: text.layout = ITULayout.ITU_LAYOUT_MIDDLE_LEFT; break; case ContentAlignment.TopLeft: text.layout = ITULayout.ITU_LAYOUT_TOP_LEFT; break; case ContentAlignment.BottomCenter: text.layout = ITULayout.ITU_LAYOUT_BOTTOM_CENTER; break; case ContentAlignment.MiddleCenter: text.layout = ITULayout.ITU_LAYOUT_MIDDLE_CENTER; break; case ContentAlignment.TopCenter: text.layout = ITULayout.ITU_LAYOUT_TOP_CENTER; break; case ContentAlignment.BottomRight: text.layout = ITULayout.ITU_LAYOUT_BOTTOM_RIGHT; break; case ContentAlignment.MiddleRight: text.layout = ITULayout.ITU_LAYOUT_MIDDLE_RIGHT; break; case ContentAlignment.TopRight: text.layout = ITULayout.ITU_LAYOUT_TOP_RIGHT; break; default: text.layout = ITULayout.ITU_LAYOUT_DEFAULT; break; } text.scrollDelay = this.ScrollDelay; text.stopDelay = this.StopDelay; text.scrollTextState = 1; WidgetNode node = new WidgetNode(); node.widget = text; listbox.items.Add(node); } listbox.focusColor.alpha = this.FocusColor.A; listbox.focusColor.red = this.FocusColor.R; listbox.focusColor.green = this.FocusColor.G; listbox.focusColor.blue = this.FocusColor.B; listbox.focusFontColor.alpha = this.FocusFontColor.A; listbox.focusFontColor.red = this.FocusFontColor.R; listbox.focusFontColor.green = this.FocusFontColor.G; listbox.focusFontColor.blue = this.FocusFontColor.B; listbox.orgFontColor.alpha = this.ForeColor.A; listbox.orgFontColor.red = this.ForeColor.R; listbox.orgFontColor.green = this.ForeColor.G; listbox.orgFontColor.blue = this.ForeColor.B; listbox.readFontColor.alpha = this.ReadFontColor.A; listbox.readFontColor.red = this.ReadFontColor.R; listbox.readFontColor.green = this.ReadFontColor.G; listbox.readFontColor.blue = this.ReadFontColor.B; listbox.scrollDelay = this.ScrollDelay; listbox.stopDelay = this.StopDelay; listbox.totalframe = this.TotalFrame; listbox.slidePage = this.SlidePage; if (this.Draggable) { listbox.flags |= ITU.ITU_DRAGGABLE; } listbox.actions[0].action = (ITUActionType)this.Action01.Action; listbox.actions[0].ev = (ITUEvent)this.Action01.Event; listbox.actions[0].target = this.Action01.Target; listbox.actions[0].param = this.Action01.Parameter; listbox.actions[1].action = (ITUActionType)this.Action02.Action; listbox.actions[1].ev = (ITUEvent)this.Action02.Event; listbox.actions[1].target = this.Action02.Target; listbox.actions[1].param = this.Action02.Parameter; listbox.actions[2].action = (ITUActionType)this.Action03.Action; listbox.actions[2].ev = (ITUEvent)this.Action03.Event; listbox.actions[2].target = this.Action03.Target; listbox.actions[2].param = this.Action03.Parameter; listbox.actions[3].action = (ITUActionType)this.Action04.Action; listbox.actions[3].ev = (ITUEvent)this.Action04.Event; listbox.actions[3].target = this.Action04.Target; listbox.actions[3].param = this.Action04.Parameter; listbox.actions[4].action = (ITUActionType)this.Action05.Action; listbox.actions[4].ev = (ITUEvent)this.Action05.Event; listbox.actions[4].target = this.Action05.Target; listbox.actions[4].param = this.Action05.Parameter; listbox.actions[5].action = (ITUActionType)this.Action06.Action; listbox.actions[5].ev = (ITUEvent)this.Action06.Event; listbox.actions[5].target = this.Action06.Target; listbox.actions[5].param = this.Action06.Parameter; listbox.actions[6].action = (ITUActionType)this.Action07.Action; listbox.actions[6].ev = (ITUEvent)this.Action07.Event; listbox.actions[6].target = this.Action07.Target; listbox.actions[6].param = this.Action07.Parameter; listbox.actions[7].action = (ITUActionType)this.Action08.Action; listbox.actions[7].ev = (ITUEvent)this.Action08.Event; listbox.actions[7].target = this.Action08.Target; listbox.actions[7].param = this.Action08.Parameter; listbox.actions[8].action = (ITUActionType)this.Action09.Action; listbox.actions[8].ev = (ITUEvent)this.Action09.Event; listbox.actions[8].target = this.Action09.Target; listbox.actions[8].param = this.Action09.Parameter; listbox.actions[9].action = (ITUActionType)this.Action10.Action; listbox.actions[9].ev = (ITUEvent)this.Action10.Event; listbox.actions[9].target = this.Action10.Target; listbox.actions[9].param = this.Action10.Parameter; listbox.actions[10].action = (ITUActionType)this.Action11.Action; listbox.actions[10].ev = (ITUEvent)this.Action11.Event; listbox.actions[10].target = this.Action11.Target; listbox.actions[10].param = this.Action11.Parameter; listbox.actions[11].action = (ITUActionType)this.Action12.Action; listbox.actions[11].ev = (ITUEvent)this.Action12.Event; listbox.actions[11].target = this.Action12.Target; listbox.actions[11].param = this.Action12.Parameter; listbox.actions[12].action = (ITUActionType)this.Action13.Action; listbox.actions[12].ev = (ITUEvent)this.Action13.Event; listbox.actions[12].target = this.Action13.Target; listbox.actions[12].param = this.Action13.Parameter; listbox.actions[13].action = (ITUActionType)this.Action14.Action; listbox.actions[13].ev = (ITUEvent)this.Action14.Event; listbox.actions[13].target = this.Action14.Target; listbox.actions[13].param = this.Action14.Parameter; listbox.actions[14].action = (ITUActionType)this.Action15.Action; listbox.actions[14].ev = (ITUEvent)this.Action15.Event; listbox.actions[14].target = this.Action15.Target; listbox.actions[14].param = this.Action15.Parameter; return(listbox); }
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); }
public ITUWidget CreateITUWidget() { ITUTextBox widget = new ITUTextBox(); widget.name = this.Name; widget.flags |= this.TabStop ? ITU.ITU_TAPSTOP : 0; PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this); widget.visible = (bool)properties["Visible"].GetValue(this); widget.active = false; widget.dirty = false; widget.alpha = 255; widget.tabIndex = this.TabIndex; widget.rect.x = this.Location.X; widget.rect.y = this.Location.Y; widget.rect.width = this.Size.Width; widget.rect.height = this.Size.Height; widget.color.alpha = this.ForeColor.A; widget.color.red = this.ForeColor.R; widget.color.green = this.ForeColor.G; widget.color.blue = this.ForeColor.B; widget.bound.x = 0; widget.bound.y = 0; widget.bound.width = 0; widget.bound.height = 0; widget.bgColor.alpha = this.BackAlpha; widget.bgColor.red = this.BackColor.R; widget.bgColor.green = this.BackColor.G; widget.bgColor.blue = this.BackColor.B; widget.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)); widget.fontHeight = widget.fontWidth; widget.fontIndex = this.FontIndex; if (base.Font.Bold) { widget.textFlags |= ITUText.ITU_TEXT_BOLD; } widget.boldSize = this.BoldSize; string[] texts = new string[] { this.Text, this.Text1, this.Text2, this.Text3, this.Text4, this.Text5, this.Text6, this.Text7 }; widget.stringSet = ITU.CreateStringSetNode(texts); widget.maxLen = this.MaxLength; widget.textboxFlags = 0; if (this.UseSystemPasswordChar) { widget.textboxFlags |= ITUTextBox.ITU_TEXTBOX_PASSWORD; } if (this.ShowCursor) { widget.textboxFlags |= ITUTextBox.ITU_TEXTBOX_CURSOR; } if (this.CharacterCasing == CharacterCasing.Upper) { widget.textboxFlags |= ITUTextBox.ITU_TEXTBOX_UPPER; } if (this.CharacterCasing == CharacterCasing.Lower) { widget.textboxFlags |= ITUTextBox.ITU_TEXTBOX_LOWER; } if (this.Multiline) { widget.textboxFlags |= ITUTextBox.ITU_TEXTBOX_MULTILINE; } if (this.WordWrap) { widget.textboxFlags |= ITUTextBox.ITU_TEXTBOX_WORDWRAP; } widget.fgColor.alpha = this.TextColor.A; widget.fgColor.red = this.TextColor.R; widget.fgColor.green = this.TextColor.G; widget.fgColor.blue = this.TextColor.B; widget.defColor.alpha = this.ForeColor.A; widget.defColor.red = this.ForeColor.R; widget.defColor.green = this.ForeColor.G; widget.defColor.blue = this.ForeColor.B; widget.focusColor.alpha = this.FocusColor.A; widget.focusColor.red = this.FocusColor.R; widget.focusColor.green = this.FocusColor.G; widget.focusColor.blue = this.FocusColor.B; widget.lineHeight = this.LineHeight; widget.actions[0].action = (ITUActionType)this.Action01.Action; widget.actions[0].ev = (ITUEvent)this.Action01.Event; widget.actions[0].target = this.Action01.Target; widget.actions[0].param = this.Action01.Parameter; widget.actions[1].action = (ITUActionType)this.Action02.Action; widget.actions[1].ev = (ITUEvent)this.Action02.Event; widget.actions[1].target = this.Action02.Target; widget.actions[1].param = this.Action02.Parameter; widget.actions[2].action = (ITUActionType)this.Action03.Action; widget.actions[2].ev = (ITUEvent)this.Action03.Event; widget.actions[2].target = this.Action03.Target; widget.actions[2].param = this.Action03.Parameter; widget.actions[3].action = (ITUActionType)this.Action04.Action; widget.actions[3].ev = (ITUEvent)this.Action04.Event; widget.actions[3].target = this.Action04.Target; widget.actions[3].param = this.Action04.Parameter; widget.actions[4].action = (ITUActionType)this.Action05.Action; widget.actions[4].ev = (ITUEvent)this.Action05.Event; widget.actions[4].target = this.Action05.Target; widget.actions[4].param = this.Action05.Parameter; widget.actions[5].action = (ITUActionType)this.Action06.Action; widget.actions[5].ev = (ITUEvent)this.Action06.Event; widget.actions[5].target = this.Action06.Target; widget.actions[5].param = this.Action06.Parameter; widget.actions[6].action = (ITUActionType)this.Action07.Action; widget.actions[6].ev = (ITUEvent)this.Action07.Event; widget.actions[6].target = this.Action07.Target; widget.actions[6].param = this.Action07.Parameter; widget.actions[7].action = (ITUActionType)this.Action08.Action; widget.actions[7].ev = (ITUEvent)this.Action08.Event; widget.actions[7].target = this.Action08.Target; widget.actions[7].param = this.Action08.Parameter; widget.actions[8].action = (ITUActionType)this.Action09.Action; widget.actions[8].ev = (ITUEvent)this.Action09.Event; widget.actions[8].target = this.Action09.Target; widget.actions[8].param = this.Action09.Parameter; widget.actions[9].action = (ITUActionType)this.Action10.Action; widget.actions[9].ev = (ITUEvent)this.Action10.Event; widget.actions[9].target = this.Action10.Target; widget.actions[9].param = this.Action10.Parameter; widget.actions[10].action = (ITUActionType)this.Action11.Action; widget.actions[10].ev = (ITUEvent)this.Action11.Event; widget.actions[10].target = this.Action11.Target; widget.actions[10].param = this.Action11.Parameter; widget.actions[11].action = (ITUActionType)this.Action12.Action; widget.actions[11].ev = (ITUEvent)this.Action12.Event; widget.actions[11].target = this.Action12.Target; widget.actions[11].param = this.Action12.Parameter; widget.actions[12].action = (ITUActionType)this.Action13.Action; widget.actions[12].ev = (ITUEvent)this.Action13.Event; widget.actions[12].target = this.Action13.Target; widget.actions[12].param = this.Action13.Parameter; widget.actions[13].action = (ITUActionType)this.Action14.Action; widget.actions[13].ev = (ITUEvent)this.Action14.Event; widget.actions[13].target = this.Action14.Target; widget.actions[13].param = this.Action14.Parameter; widget.actions[14].action = (ITUActionType)this.Action15.Action; widget.actions[14].ev = (ITUEvent)this.Action15.Event; widget.actions[14].target = this.Action15.Target; widget.actions[14].param = this.Action15.Parameter; return(widget); }
public ITUWidget CreateITUWidget() { ITUText widget = new ITUText(); widget.name = this.Name; PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this); widget.visible = (bool)properties["Visible"].GetValue(this); widget.active = false; widget.dirty = false; widget.alpha = 255; widget.rect.x = this.Location.X; widget.rect.y = this.Location.Y; widget.rect.width = this.Size.Width; widget.rect.height = this.Size.Height; widget.color.alpha = this.ForeColor.A; widget.color.red = this.ForeColor.R; widget.color.green = this.ForeColor.G; widget.color.blue = this.ForeColor.B; widget.bound.x = 0; widget.bound.y = 0; widget.bound.width = 0; widget.bound.height = 0; widget.bgColor.alpha = this.BackColor.A; widget.bgColor.red = this.BackColor.R; widget.bgColor.green = this.BackColor.G; widget.bgColor.blue = this.BackColor.B; widget.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)); widget.fontHeight = widget.fontWidth; widget.fontIndex = this.FontIndex; if (base.Font.Bold) { widget.textFlags |= ITUText.ITU_TEXT_BOLD; } widget.boldSize = this.BoldSize; switch (this.TextAlign) { case ContentAlignment.BottomLeft: widget.layout = ITULayout.ITU_LAYOUT_BOTTOM_LEFT; break; case ContentAlignment.MiddleLeft: widget.layout = ITULayout.ITU_LAYOUT_MIDDLE_LEFT; break; case ContentAlignment.TopLeft: widget.layout = ITULayout.ITU_LAYOUT_TOP_LEFT; break; case ContentAlignment.BottomCenter: widget.layout = ITULayout.ITU_LAYOUT_BOTTOM_CENTER; break; case ContentAlignment.MiddleCenter: widget.layout = ITULayout.ITU_LAYOUT_MIDDLE_CENTER; break; case ContentAlignment.TopCenter: widget.layout = ITULayout.ITU_LAYOUT_TOP_CENTER; break; case ContentAlignment.BottomRight: widget.layout = ITULayout.ITU_LAYOUT_BOTTOM_RIGHT; break; case ContentAlignment.MiddleRight: widget.layout = ITULayout.ITU_LAYOUT_MIDDLE_RIGHT; break; case ContentAlignment.TopRight: widget.layout = ITULayout.ITU_LAYOUT_TOP_RIGHT; break; default: widget.layout = ITULayout.ITU_LAYOUT_DEFAULT; break; } string[] texts = new string[] { this.Text, this.Text1, this.Text2, this.Text3, this.Text4, this.Text5, this.Text6, this.Text7 }; widget.stringSet = ITU.CreateStringSetNode(texts); return(widget); }