private void GridListItemRequestActionYear(object sender, InternalSpinBox.SpinItemRequestEventArgs e) { if (sender is InternalSpinBox.SpinList) { InternalSpinBox.SpinList spinList = (InternalSpinBox.SpinList)sender; InternalSpinBox.SpinItem listItem = spinList.GetListItem(e.Index); if (listItem != null && 0 <= e.Index && e.Index < spinList.ListItemNum) { string text; if (e.Index < InternalSpinBox.visibleCount / 2 || e.Index >= spinList.ListItemNum - InternalSpinBox.visibleCount / 2) { text = ""; } else { text = (e.Index + this.MinYear - InternalSpinBox.visibleCount / 2).ToString("0000"); } if (listItem.ImageAsset != null) { listItem.ImageAsset.Dispose(); } listItem.ImageAsset = this.textRenderer.DrawText(ref text, 128, 40); listItem.ShaderType = ShaderType.TextTexture; listItem.Width = spinList.ItemGapStep; listItem.Height = spinList.ItemGapLine; } } }
private void GridListItemRequestActionDate(object sender, InternalSpinBox.SpinItemRequestEventArgs e) { if (sender is InternalSpinBox.SpinList) { InternalSpinBox.SpinList spinList = (InternalSpinBox.SpinList)sender; int num = e.Index % spinList.ListItemNum; if (num < 0) { num += spinList.ListItemNum; } InternalSpinBox.SpinItem listItem = spinList.GetListItem(num); if (listItem != null) { string text = (num + 1).ToString("00"); if (listItem.ImageAsset != null) { listItem.ImageAsset.Dispose(); } listItem.ImageAsset = this.textRenderer.DrawText(ref text, 80, 40); listItem.ShaderType = ShaderType.TextTexture; listItem.Width = spinList.ItemGapStep; listItem.Height = spinList.ItemGapLine; listItem.Enabled = (listItem.ItemId + 1 <= this.GetDaysInMonth()); } } }
private void SetSelectStatus(int index, bool isSelect) { InternalSpinBox.SpinItem spinItem = this.GetListItem(index); if (spinItem != null) { spinItem.IsSelected = isSelect; } }
public ListContainer() { this.next = null; this.prev = null; this.listItem = null; this.totalId = 0; this.updateFlag = false; }
private void ToggleSelectItemID(int itemId) { if (itemId != InternalSpinBox.SpinList.itemIdNoSelect) { InternalSpinBox.SpinItem spinItem = this.GetListItem(itemId); if (spinItem != null) { this.SetSelect(itemId, !spinItem.IsSelected); this.ScrollTo(itemId - InternalSpinBox.visibleCount / 2, 0f, true); } } }
public bool IsSelect(int itemId) { if (itemId != InternalSpinBox.SpinList.itemIdNoSelect) { InternalSpinBox.SpinItem spinItem = this.GetListItem(itemId); if (spinItem != null) { return(spinItem.IsSelected); } } return(false); }
private void CreateListItem(ref InternalSpinBox.SpinList.ListContainer listContainer, int index) { InternalSpinBox.SpinItem spinItem; if (listContainer.listItem == null) { spinItem = new InternalSpinBox.SpinItem(); } else { spinItem = listContainer.listItem; } listContainer.listItem = spinItem; listContainer.totalId = index; listContainer.updateFlag = true; spinItem.ItemId = this.CalcItemIndex(index); this.basePanel.AddChildLast(spinItem); spinItem.ProtectedSelectAction += new InternalSpinBox.SpinItem.ProtectedSelectActionHandler(this.OnSelectHandler); spinItem.IsFocused = (this.focusIndex == this.CalcItemIndex(index)); }
private void GridListItemRequestAction1Origin(object sender, InternalSpinBox.SpinItemRequestEventArgs e) { if (sender is InternalSpinBox.SpinList) { InternalSpinBox.SpinList spinList = (InternalSpinBox.SpinList)sender; int num = e.Index % spinList.ListItemNum; if (num < 0) { num += spinList.ListItemNum; } InternalSpinBox.SpinItem listItem = spinList.GetListItem(num); if (listItem != null) { string text = (num + 1).ToString("00"); listItem.ImageAsset = this.textRenderer.DrawText(ref text, (int)this.unitWidth, (int)this.unitHeight); listItem.ShaderType = ShaderType.TextTexture; listItem.Width = spinList.ItemGapStep; listItem.Height = spinList.ItemGapLine; } } }
private void GridListItemRequestActionAmPm(object sender, InternalSpinBox.SpinItemRequestEventArgs e) { if (sender is InternalSpinBox.SpinList) { InternalSpinBox.SpinList spinList = (InternalSpinBox.SpinList)sender; InternalSpinBox.SpinItem listItem = spinList.GetListItem(e.Index); if (listItem != null && 0 <= e.Index && e.Index < spinList.ListItemNum) { string text; if (e.Index < SpinBox.visibleCount / 2 || e.Index >= spinList.ListItemNum - SpinBox.visibleCount / 2) { text = ""; } else { text = SpinBox.noonText[e.Index - SpinBox.visibleCount / 2]; } listItem.ImageAsset = this.textRenderer.DrawText(ref text, (int)this.unitWidth, (int)this.unitHeight); listItem.ShaderType = ShaderType.TextTexture; listItem.Width = spinList.ItemGapStep; listItem.Height = spinList.ItemGapLine; } } }