示例#1
0
        //DrawOPClassFont + テキストを書くルーチン
        public static Size DrawOPClassFontAndText(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw)
        {
            if (index < 0 || index >= lb.Items.Count)
            {
                return(new Size(listbounds.X, listbounds.Y));
            }
            string text = lb.Items[index].ToString();

            SolidBrush brush      = new SolidBrush(lb.ForeColor);
            Font       normalFont = lb.Font;
            Rectangle  bounds     = listbounds;

            int textmargineY = (ListBoxEx.OWNER_DRAW_ICON_SIZE - (int)lb.Font.Height) / 2;

            //テキストの先頭にアイコン番号(キャラ番号が入っている. 無駄だが汎用性を考えるとほかに方法がない)
            uint   icon = U.atoh(text);
            Bitmap bitmap;

            if (Program.ROM.RomInfo.version() == 8)
            {
                if (Program.ROM.RomInfo.is_multibyte())
                {
                    bitmap = OPClassFontForm.DrawFontByID(icon);
                }
                else
                {
                    bitmap = OPClassFontFE8UForm.DrawFontByID(icon);
                }
            }
            else if (Program.ROM.RomInfo.version() == 7)
            {
                bitmap = ImageUtil.Blank(8, 8);
            }
            else
            {//ver 6
                bitmap = ImageUtil.Blank(8, 8);
            }

            U.MakeTransparent(bitmap);

            //アイコンを描く.
            Rectangle b = bounds;

            b.Width   = ICON_WIDTH;
            b.Height  = ICON_HEGITH;
            bounds.X += U.DrawPicture(bitmap, g, isWithDraw, b);

            //テキストを描く.
            b         = bounds;
            b.Y      += textmargineY;
            bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, b);

            brush.Dispose();
            bitmap.Dispose();

            bounds.Y += ICON_WIDTH;
            return(new Size(bounds.X, bounds.Y));
        }
示例#2
0
        public static List <U.AddrResult> MakeList()
        {
            if (Program.ROM.RomInfo.version == 8 &&
                !Program.ROM.RomInfo.is_multibyte)
            {//FE8Uは別ルーチン.
                return(OPClassFontFE8UForm.MakeList());
            }
            InputFormRef InputFormRef = Init(null);

            return(InputFormRef.MakeList());
        }