//-----------------------------------------------------------------------------
// wx.NET/Utils - WxMenuBarObject.cs
//
// wx.NET "WxMenuBarObject".
//
// Written by Alexander Olk (xenomorph2@onlinehome.de)
// (C) 2004 Alexander Olk
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
// $Id: WxMenuBarObject.cs,v 1.2 2004/06/08 05:10:01 t9mike Exp $
//-----------------------------------------------------------------------------
using System;
using System.Xml;
using System.Collections;
using System.Collections.Specialized;
using System.Text;
namespace wx.ToWxNet{
public class WxMenuBarObject : WxObjectBase
{
public override void GenerateCSharpCode()
{
StringBuilder ctorline = new StringBuilder();
ctorline.Append( "\t\t\t" + name + " = new " + classname + "();" );
ctorlines.Add( ctorline.ToString() );
ctorline = new StringBuilder();
ctorline.Append( "\t\t\t" + "MenuBar = " + name + ";" );
ctorlines.Add( ctorline.ToString() );
foreach ( WxMenuObject mo in objects )
{
foreach ( string line in mo.ctorlines )
ctorlines.Add( line );
ctorline = new StringBuilder();
ctorline.Append( "\t\t\t" + name + ".Append( " + mo.name + ", \"" + mo.label + "\" );" );
ctorlines.Add( ctorline.ToString() );
}
}
//---------------------------------------------------------------------
public override void GenerateBasicCode()
{
StringBuilder ctorline = new StringBuilder();
ctorline.Append( "\t\t\t" + name + " = New " + classname + "()" );
ctorlines.Add( ctorline.ToString() );
ctorline = new StringBuilder();
ctorline.Append( "\t\t\t" + "MenuBar = " + name );
ctorlines.Add( ctorline.ToString() );
foreach ( WxMenuObject mo in objects )
{
foreach ( string line in mo.ctorlines )
ctorlines.Add( line );
ctorline = new StringBuilder();
ctorline.Append( "\t\t\t" + name + ".Append( " + mo.name + ", \"" + mo.label + "\" )" );
ctorlines.Add( ctorline.ToString() );
}
}
}
}
|