//-----------------------------------------------------------------------------
// wx.NET/Utils - WxNotebookObject.cs
//
// wx.NET "WxNotebookObject".
//
// Written by Alexander Olk (xenomorph2@onlinehome.de)
// (C) 2004 Alexander Olk
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
// $Id: WxNotebookObject.cs,v 1.3 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 WxNotebookObject : 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( ", wxDefaultPosition, wxDefaultSize, " );
ctorline.Append( style.Length > 0 ? style : "0" );
ctorline.Append( " );" );
ctorlines.Add( ctorline.ToString() );
AddProperties( propertylines );
StringBuilder layoutline = new StringBuilder();
if ( generateFromSource == 1 ) //wxg
{
foreach( WxNotebookTabObject nto in tabs )
{
layoutline = new StringBuilder();
layoutline.Append( "\t\t\t" + name + ".AddPage( " + nto.window + ", \"" + nto.label + "\" );" );
layoutlines.Add( layoutline.ToString() );
}
}
else // XRC
{
foreach ( WxNotebookPageObject npo in objects )
{
layoutline = new StringBuilder();
WxObjectBase wob = (WxObjectBase) npo.objects[0];
layoutline.Append( "\t\t\t" + name + ".AddPage( " + wob.name + ", \"" + npo.label + "\" );" );
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( ", wxDefaultPosition, wxDefaultSize, " );
ctorline.Append( style.Length > 0 ? style : "0" );
ctorline.Append( " )" );
ctorlines.Add( ctorline.ToString() );
AddProperties( propertylines );
StringBuilder layoutline = new StringBuilder();
if ( generateFromSource == 1 ) //wxg
{
foreach( WxNotebookTabObject nto in tabs )
{
layoutline = new StringBuilder();
layoutline.Append( "\t\t\t" + name + ".AddPage( " + nto.window + ", \"" + nto.label + "\" )" );
layoutlines.Add( layoutline.ToString() );
}
}
else // XRC
{
foreach ( WxNotebookPageObject npo in objects )
{
layoutline = new StringBuilder();
WxObjectBase wob = (WxObjectBase) npo.objects[0];
layoutline.Append( "\t\t\t" + name + ".AddPage( " + wob.name + ", \"" + npo.label + "\" )" );
layoutlines.Add( layoutline.ToString() );
}
}
}
}
//---------------------------------------------------------------------
public class WxNotebookTabObject : WxObjectBase
{
public string window = "";
}
//---------------------------------------------------------------------
public class WxNotebookPageObject : WxObjectBase
{
}
}
|