Exemple #1
0
 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;
         }
     }
 }
Exemple #2
0
 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());
         }
     }
 }
Exemple #3
0
 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;
         }
     }
 }
Exemple #4
0
 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;
         }
     }
 }
Exemple #5
0
            private void UpdateListItem(bool isMod)
            {
                int num  = this.ScrollAreaFirstLine - (int)this.cacheLineCount;
                int num2 = this.ScrollAreaFirstLine + (int)this.scrollAreaLineNum + (int)this.cacheLineCount + 1;

                if (!this.IsLoop)
                {
                    if (num < 0)
                    {
                        num = 0;
                    }
                    if (num2 > this.listItemNum)
                    {
                        num2 = this.listItemNum;
                    }
                }
                bool flag = isMod;

                InternalSpinBox.SpinList.ListContainer listContainer = new InternalSpinBox.SpinList.ListContainer();
                if (this.cacheEndIndex - 1 >= num)
                {
                    if (num2 - 1 >= this.cacheStartIndex)
                    {
                        if (this.cacheStartIndex == num && this.cacheEndIndex == num2)
                        {
                            goto IL_1F5;
                        }
                        if (this.cacheStartIndex < num)
                        {
                            for (int i = num - 1; i >= this.cacheStartIndex; i--)
                            {
                                listContainer = this.listItem[0];
                                this.listItem.RemoveAt(0);
                                this.PoolContainer(ref listContainer);
                                flag = true;
                            }
                        }
                        if (this.cacheEndIndex > num2)
                        {
                            for (int j = num2; j < this.cacheEndIndex; j++)
                            {
                                listContainer = this.listItem[this.listItem.Count - 1];
                                this.listItem.RemoveAt(this.listItem.Count - 1);
                                this.PoolContainer(ref listContainer);
                                flag = true;
                            }
                        }
                        if (this.cacheStartIndex > num)
                        {
                            for (int k = this.cacheStartIndex - 1; k >= num; k--)
                            {
                                listContainer = this.GetContainer();
                                this.CreateListItem(ref listContainer, k);
                                this.listItem.Insert(0, listContainer);
                                flag = true;
                            }
                        }
                        if (this.cacheEndIndex < num2)
                        {
                            for (int l = this.cacheEndIndex; l < num2; l++)
                            {
                                listContainer = this.GetContainer();
                                this.CreateListItem(ref listContainer, l);
                                this.listItem.Add(listContainer);
                                flag = true;
                            }
                            goto IL_1F5;
                        }
                        goto IL_1F5;
                    }
                }
                while (this.listItem.Count != 0)
                {
                    listContainer = this.listItem[0];
                    this.listItem.RemoveAt(0);
                    this.PoolContainer(ref listContainer);
                    flag = true;
                }
                for (int m = num; m < num2; m++)
                {
                    listContainer = this.GetContainer();
                    this.CreateListItem(ref listContainer, m);
                    this.listItem.Add(listContainer);
                    flag = true;
                }
IL_1F5:
                this.cacheStartIndex = num;
                this.cacheEndIndex   = num2;
                if (flag)
                {
                    for (int n = 0; n < this.listItem.Count; n++)
                    {
                        int totalId = this.listItem[n].totalId;
                        this.listItem[n].listItem.X = this.CalcItemPosOnScrollNodeX(totalId);
                        this.listItem[n].listItem.Y = this.CalcItemPosOnScrollNodeY(totalId);
                        if (this.listItem[n].updateFlag && this.ItemRequestAction != null)
                        {
                            InternalSpinBox.SpinItemRequestEventArgs spinItemRequestEventArgs = new InternalSpinBox.SpinItemRequestEventArgs();
                            spinItemRequestEventArgs.Index = this.listItem[n].totalId;
                            this.ItemRequestAction.Invoke(this, spinItemRequestEventArgs);
                            this.listItem[n].updateFlag = false;
                        }
                    }
                }
                for (int num3 = 0; num3 < this.listItem.Count; num3++)
                {
                    float num4 = this.listItem[num3].listItem.Y + this.listItem[num3].listItem.Height + this.basePanel.Y;
                    int   num5 = this.ScrollAreaLineNum / 2 + 1;
                    if (num4 <= this.listItem[num3].listItem.Height * (float)num5)
                    {
                        this.listItem[num3].listItem.Alpha = num4 / (this.listItem[num3].listItem.Height * (float)num5);
                    }
                    else
                    {
                        this.listItem[num3].listItem.Alpha = 2f - num4 / (this.listItem[num3].listItem.Height * (float)num5);
                    }
                }
            }