//-----------------------------------------------------------------------------
// wx.NET/Utils - WxPanelObject.cs
//
// wx.NET "WxPanelObject".
//
// Written by Alexander Olk (xenomorph2@onlinehome.de)
// (C) 2004 Alexander Olk
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
// $Id: WxPanelObject.cs,v 1.4 2004/06/14 19:56:36 t9mike Exp $
//-----------------------------------------------------------------------------
using System;
using System.Xml;
using System.Collections;
using System.Collections.Specialized;
using System.Text;
namespace wx.ToWxNet{
public class WxPanelObject : WxObjectBase
{
public override void GenerateCSharpCode()
{
StringBuilder ctorline = new StringBuilder();
ctorline.Append( "\t\t\t" + name + " = new " + classname + "( " + GetParent( parent ) );
ctorline.Append( ", " + ( id.Length > 0 ? "(int)Cmd." + id : "-1") );
ctorline.Append( " );" );
ctorlines.Add( ctorline.ToString() );
AddProperties( propertylines );
StringBuilder layoutline = new StringBuilder();
if ( objects.Count > 0 )
{
if ( objects[0].GetType() == typeof( WxBoxSizerObject ) ||
objects[0].GetType() == typeof( WxGridSizerObject ) ||
objects[0].GetType() == typeof( WxFlexGridSizerObject ) ||
objects[0].GetType() == typeof( WxStaticBoxSizerObject ) ||
objects[0].GetType() == typeof( WxGridBagSizerObject ) )
{
WxObjectBase so = (WxObjectBase)objects[0];
layoutline = new StringBuilder();
layoutline.Append( "\t\t\t" + name + ".AutoLayout = true;" );
layoutlines.Add( layoutline.ToString() );
layoutline = new StringBuilder();
layoutline.Append( "\t\t\t" + name + ".Sizer = " + so.name + ";" );
layoutlines.Add( layoutline.ToString() );
}
}
}
//---------------------------------------------------------------------
public override void GenerateBasicCode()
{
StringBuilder ctorline = new StringBuilder();
ctorline.Append( "\t\t\t" + name + " = New " + classname + "( " + GetParent( parent ) );
ctorline.Append( ", " + ( id.Length > 0 ? "Cmd." + id : "-1") );
ctorline.Append( " )" );
ctorlines.Add( ctorline.ToString() );
AddProperties( propertylines );
StringBuilder layoutline = new StringBuilder();
if ( objects.Count > 0 )
{
if ( objects[0].GetType() == typeof( WxBoxSizerObject ) ||
objects[0].GetType() == typeof( WxGridSizerObject ) ||
objects[0].GetType() == typeof( WxFlexGridSizerObject ) ||
objects[0].GetType() == typeof( WxStaticBoxSizerObject ) ||
objects[0].GetType() == typeof( WxGridBagSizerObject ) )
{
WxObjectBase so = (WxObjectBase)objects[0];
layoutline = new StringBuilder();
layoutline.Append( "\t\t\t" + name + ".AutoLayout = true" );
layoutlines.Add( layoutline.ToString() );
layoutline = new StringBuilder();
layoutline.Append( "\t\t\t" + name + ".Sizer = " + so.name );
layoutlines.Add( layoutline.ToString() );
}
}
}
}
}
|