internal void AppendTo(Gump.IGumpWriter disp)
        {
            switch (Type)
            {
                case ElementType.textentrylimited:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "textentrylimited" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myWidth );
                        disp.AppendLayout( myHeight );
                        disp.AppendLayout( myHue );
                        disp.AppendLayout( myElementID );
                        disp.AppendLayout( ParentGump.Intern( myText ) );
                        disp.AppendLayout( mySize );
                        disp.TextEntries++;
                        break;
                    }
                case ElementType.textentry:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "textentry" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myWidth );
                        disp.AppendLayout( myHeight );
                        disp.AppendLayout( myHue );
                        disp.AppendLayout( myElementID );
                        disp.AppendLayout( ParentGump.Intern( myText ) );
                        disp.TextEntries++;
                        break;
                    }
                case ElementType.radio:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "radio" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myInactiveID );
                        disp.AppendLayout( myActiveID );
                        disp.AppendLayout( myInitialState );
                        disp.AppendLayout( myElementID );
                        disp.Switches++;
                        break;
                    }
                case ElementType.croppedtext:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "croppedtext" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myWidth );
                        disp.AppendLayout( myHeight );
                        disp.AppendLayout( myHue );
                        disp.AppendLayout( ParentGump.Intern( myText ) );
                        break;
                    }
                case ElementType.buttontileart:
                    {
                        disp.AppendLayout( Gump.StringToBuffer("buttontileart") );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myInactiveID );
                        disp.AppendLayout( myActiveID );
                        disp.AppendLayout( myButtonType );
                        disp.AppendLayout( myParam );
                        disp.AppendLayout( myElementID );
                        disp.AppendLayout( myItemID );
                        disp.AppendLayout( myHue );
                        disp.AppendLayout( myWidth );
                        disp.AppendLayout( myHeight );

                        if (myCliloc != -1)
                        {
                            disp.AppendLayout( Gump.StringToBuffer( " }{ tooltip" ));
                            disp.AppendLayout( myCliloc );
                        }
                        break;
                    }
                case ElementType.tilepic:
                case ElementType.tilepichue:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( myHue == 0 ? "tilepic" : "tilepichue" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myItemID );

                        if (myHue != 0)
                            disp.AppendLayout( myHue );
                        break;
                    }
                case ElementType.itemproperty:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "itemproperty" ) );
                        disp.AppendLayout( mySerial );
                        break;
                    }
                case ElementType.gumppictiled:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "gumppictiled" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myWidth );
                        disp.AppendLayout( myHeight );
                        disp.AppendLayout( myElementID );
                        break;
                    }
                case ElementType.gumppic:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "gumppic" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myElementID );

                        if (myHue != 0)
                        {
                            disp.AppendLayout( Gump.StringToBuffer( " hue=" ) );
                            disp.AppendLayoutNS( myHue );
                        }
                        break;
                    }
                case ElementType.xmfhtmlgump:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "xmfhtmlgump" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myWidth );
                        disp.AppendLayout( myHeight );
                        disp.AppendLayout( myCliloc );
                        disp.AppendLayout( myBackground );
                        disp.AppendLayout( myScrollBar );
                        break;
                    }
                case ElementType.xmfhtmlgumpcolor:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "xmfhtmlgumpcolor" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myWidth );
                        disp.AppendLayout( myHeight );
                        disp.AppendLayout( myCliloc );
                        disp.AppendLayout( myBackground );
                        disp.AppendLayout( myScrollBar );
                        disp.AppendLayout( myHue );
                        break;
                    }
                case ElementType.xmfhtmltok:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "xmfhtmltok" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myWidth );
                        disp.AppendLayout( myHeight );
                        disp.AppendLayout( myBackground );
                        disp.AppendLayout( myScrollBar );
                        disp.AppendLayout( myHue );
                        disp.AppendLayout( myCliloc );
                        disp.AppendLayout( myArgs );
                        break;
                    }
                case ElementType.htmlgump:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "htmlgump" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myWidth );
                        disp.AppendLayout( myHeight );
                        disp.AppendLayout( ParentGump.Intern( myText ) );
                        disp.AppendLayout( myBackground );
                        disp.AppendLayout( myScrollBar );
                        break;
                    }
                case ElementType.tooltip:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "tooltip" ) );
                        disp.AppendLayout( myCliloc );
                        break;
                    }
                case ElementType.group:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "group" ) );
                        disp.AppendLayout( myGroup );
                        break;
                    }
                case ElementType.resizepic:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "resizepic" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myElementID );
                        disp.AppendLayout( myWidth );
                        disp.AppendLayout( myHeight );
                        break;
                    }
                case ElementType.checkertrans:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "checkertrans" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myWidth );
                        disp.AppendLayout( myHeight );
                        break;
                    }
                case ElementType.page:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "page" ) );
                        disp.AppendLayout( myPageNumber );
                        break;
                    }
                case ElementType.button:
                    {
                        disp.AppendLayout( Gump.StringToBuffer("button") );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myInactiveID );
                        disp.AppendLayout( myActiveID );
                        disp.AppendLayout( myButtonType );
                        disp.AppendLayout( myParam );
                        disp.AppendLayout( myElementID );
                        break;
                    }
                case ElementType.text:
                    {
                        disp.AppendLayout( Gump.StringToBuffer( "text" ) );
                        disp.AppendLayout( myX );
                        disp.AppendLayout( myY );
                        disp.AppendLayout( myHue );
                        disp.AppendLayout( ParentGump.Intern( myText ) );
                        break;
                    }
                default:
                    break;
            }
        }