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() { ITUScrollMediaFileListBox smflistbox = new ITUScrollMediaFileListBox(); smflistbox.type = ITUWidgetType.ITU_SCROLLMEDIAFILELISTBOX; smflistbox.name = this.Name; smflistbox.flags |= this.TabStop ? ITU.ITU_TAPSTOP : 0; PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this); smflistbox.visible = (bool)properties["Visible"].GetValue(this); smflistbox.active = false; smflistbox.dirty = false; smflistbox.alpha = 255; smflistbox.tabIndex = this.TabIndex; smflistbox.rect.x = this.Location.X; smflistbox.rect.y = this.Location.Y; smflistbox.rect.width = this.Size.Width; smflistbox.rect.height = this.Size.Height; smflistbox.color.alpha = this.BackAlpha; smflistbox.color.red = this.BackColor.R; smflistbox.color.green = this.BackColor.G; smflistbox.color.blue = this.BackColor.B; smflistbox.bound.x = 0; smflistbox.bound.y = 0; smflistbox.bound.width = 0; smflistbox.bound.height = 0; for (int i = 0; i < 3; i++) { foreach (object item in this.Items) { 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 = base.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; text.width = this.Size.Width; if (base.Font.Bold) { text.textFlags |= ITUText.ITU_TEXT_BOLD; } text.boldSize = this.BoldSize; 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; smflistbox.items.Add(node); } } smflistbox.pageIndexName = this.PageIndexTarget; smflistbox.pageCountName = this.PageCountTarget; smflistbox.focusColor.alpha = this.FocusColor.A; smflistbox.focusColor.red = this.FocusColor.R; smflistbox.focusColor.green = this.FocusColor.G; smflistbox.focusColor.blue = this.FocusColor.B; smflistbox.focusFontColor.alpha = this.FocusFontColor.A; smflistbox.focusFontColor.red = this.FocusFontColor.R; smflistbox.focusFontColor.green = this.FocusFontColor.G; smflistbox.focusFontColor.blue = this.FocusFontColor.B; smflistbox.orgFontColor.alpha = this.ForeColor.A; smflistbox.orgFontColor.red = this.ForeColor.R; smflistbox.orgFontColor.green = this.ForeColor.G; smflistbox.orgFontColor.blue = this.ForeColor.B; smflistbox.readFontColor.alpha = this.ReadFontColor.A; smflistbox.readFontColor.red = this.ReadFontColor.R; smflistbox.readFontColor.green = this.ReadFontColor.G; smflistbox.readFontColor.blue = this.ReadFontColor.B; smflistbox.scrollDelay = this.ScrollDelay; smflistbox.stopDelay = this.StopDelay; smflistbox.path = this.Path; smflistbox.extensions = this.Extensions; smflistbox.totalframe = this.TotalFrame; if (this.Draggable) { smflistbox.flags |= ITU.ITU_DRAGGABLE; } smflistbox.actions[0].action = (ITUActionType)this.Action01.Action; smflistbox.actions[0].ev = (ITUEvent)this.Action01.Event; smflistbox.actions[0].target = this.Action01.Target; smflistbox.actions[0].param = this.Action01.Parameter; smflistbox.actions[1].action = (ITUActionType)this.Action02.Action; smflistbox.actions[1].ev = (ITUEvent)this.Action02.Event; smflistbox.actions[1].target = this.Action02.Target; smflistbox.actions[1].param = this.Action02.Parameter; smflistbox.actions[2].action = (ITUActionType)this.Action03.Action; smflistbox.actions[2].ev = (ITUEvent)this.Action03.Event; smflistbox.actions[2].target = this.Action03.Target; smflistbox.actions[2].param = this.Action03.Parameter; smflistbox.actions[3].action = (ITUActionType)this.Action04.Action; smflistbox.actions[3].ev = (ITUEvent)this.Action04.Event; smflistbox.actions[3].target = this.Action04.Target; smflistbox.actions[3].param = this.Action04.Parameter; smflistbox.actions[4].action = (ITUActionType)this.Action05.Action; smflistbox.actions[4].ev = (ITUEvent)this.Action05.Event; smflistbox.actions[4].target = this.Action05.Target; smflistbox.actions[4].param = this.Action05.Parameter; smflistbox.actions[5].action = (ITUActionType)this.Action06.Action; smflistbox.actions[5].ev = (ITUEvent)this.Action06.Event; smflistbox.actions[5].target = this.Action06.Target; smflistbox.actions[5].param = this.Action06.Parameter; smflistbox.actions[6].action = (ITUActionType)this.Action07.Action; smflistbox.actions[6].ev = (ITUEvent)this.Action07.Event; smflistbox.actions[6].target = this.Action07.Target; smflistbox.actions[6].param = this.Action07.Parameter; smflistbox.actions[7].action = (ITUActionType)this.Action08.Action; smflistbox.actions[7].ev = (ITUEvent)this.Action08.Event; smflistbox.actions[7].target = this.Action08.Target; smflistbox.actions[7].param = this.Action08.Parameter; smflistbox.actions[8].action = (ITUActionType)this.Action09.Action; smflistbox.actions[8].ev = (ITUEvent)this.Action09.Event; smflistbox.actions[8].target = this.Action09.Target; smflistbox.actions[8].param = this.Action09.Parameter; smflistbox.actions[9].action = (ITUActionType)this.Action10.Action; smflistbox.actions[9].ev = (ITUEvent)this.Action10.Event; smflistbox.actions[9].target = this.Action10.Target; smflistbox.actions[9].param = this.Action10.Parameter; smflistbox.actions[10].action = (ITUActionType)this.Action11.Action; smflistbox.actions[10].ev = (ITUEvent)this.Action11.Event; smflistbox.actions[10].target = this.Action11.Target; smflistbox.actions[10].param = this.Action11.Parameter; smflistbox.actions[11].action = (ITUActionType)this.Action12.Action; smflistbox.actions[11].ev = (ITUEvent)this.Action12.Event; smflistbox.actions[11].target = this.Action12.Target; smflistbox.actions[11].param = this.Action12.Parameter; smflistbox.actions[12].action = (ITUActionType)this.Action13.Action; smflistbox.actions[12].ev = (ITUEvent)this.Action13.Event; smflistbox.actions[12].target = this.Action13.Target; smflistbox.actions[12].param = this.Action13.Parameter; smflistbox.actions[13].action = (ITUActionType)this.Action14.Action; smflistbox.actions[13].ev = (ITUEvent)this.Action14.Event; smflistbox.actions[13].target = this.Action14.Target; smflistbox.actions[13].param = this.Action14.Parameter; smflistbox.actions[14].action = (ITUActionType)this.Action15.Action; smflistbox.actions[14].ev = (ITUEvent)this.Action15.Event; smflistbox.actions[14].target = this.Action15.Target; smflistbox.actions[14].param = this.Action15.Parameter; return(smflistbox); }
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); }