//-----------------------------------------------------------------------------
// wx.NET/Utils - WxGridObject.cs
//
// wx.NET "WxGridObject".
//
// Written by Alexander Olk (xenomorph2@onlinehome.de)
// (C) 2004 Alexander Olk
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
// $Id: WxGridObject.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 WxGridObject : 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 propertyline = new StringBuilder();
if ( create_grid.Length > 0 )
{
propertyline.Append( "\t\t\t" + name + ".CreateGrid( " + rows_number + ", " + objects.Count + " );" );
propertylines.Add( propertyline.ToString() );
}
if ( row_label_size.Length > 0 )
{
propertyline = new StringBuilder();
propertyline.Append( "\t\t\t" + name + ".RowLabelSize = " + row_label_size + ";" );
propertylines.Add( propertyline.ToString() );
}
if ( col_label_size.Length > 0 )
{
propertyline = new StringBuilder();
propertyline.Append( "\t\t\t" + name + ".ColLabelSize = " + col_label_size + ";" );
propertylines.Add( propertyline.ToString() );
}
if ( lines_color.Length > 0 )
{
propertyline = new StringBuilder();
propertyline.Append( "\t\t\t" + name + ".GridLineColour = new Colour ( " + ColourString( lines_color ) + " );" );
propertylines.Add( propertyline.ToString() );
}
if ( label_bg_color.Length > 0 )
{
propertyline = new StringBuilder();
propertyline.Append( "\t\t\t" + name + ".LabelBackgroundColour = new Colour ( " + ColourString( label_bg_color ) + " );" );
propertylines.Add( propertyline.ToString() );
}
// TODO: Add missing properties....
}
//---------------------------------------------------------------------
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 propertyline = new StringBuilder();
if ( create_grid.Length > 0 )
{
propertyline.Append( "\t\t\t" + name + ".CreateGrid( " + rows_number + ", " + objects.Count + " )" );
propertylines.Add( propertyline.ToString() );
}
if ( row_label_size.Length > 0 )
{
propertyline = new StringBuilder();
propertyline.Append( "\t\t\t" + name + ".RowLabelSize = " + row_label_size );
propertylines.Add( propertyline.ToString() );
}
if ( col_label_size.Length > 0 )
{
propertyline = new StringBuilder();
propertyline.Append( "\t\t\t" + name + ".ColLabelSize = " + col_label_size );
propertylines.Add( propertyline.ToString() );
}
if ( lines_color.Length > 0 )
{
propertyline = new StringBuilder();
propertyline.Append( "\t\t\t" + name + ".GridLineColour = new Colour ( " + ColourString( lines_color ) + " )" );
propertylines.Add( propertyline.ToString() );
}
if ( label_bg_color.Length > 0 )
{
propertyline = new StringBuilder();
propertyline.Append( "\t\t\t" + name + ".LabelBackgroundColour = new Colour ( " + ColourString( label_bg_color ) + " )" );
propertylines.Add( propertyline.ToString() );
}
// TODO: Add missing properties....
}
}
//---------------------------------------------------------------------
public class WxGridColumnObject : WxObjectBase
{
}
}
|