//-----------------------------------------------------------------------------
// wx.NET/Utils - WxBitmapButtonObject.cs
//
// wx.NET "WxBitmapButtonObject".
//
// Written by Alexander Olk (xenomorph2@onlinehome.de)
// (C) 2004 Alexander Olk
// Licensed under the wxWidgets license, see LICENSE.txt for details.
//
// $Id: WxBitmapButtonObject.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 WxBitmapButtonObject : 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( ", new wx.Bitmap( \"" + bitmap + "\", BitmapType.wxBITMAP_TYPE_ANY ) );" );
ctorlines.Add( ctorline.ToString() );
AddProperties( propertylines );
StringBuilder propertyline = new StringBuilder();
if ( disabled_bitmap.Length > 0 )
{
propertyline.Append( "\t\t\t" + name + ".BitmapDisabled = new wx.Bitmap( \"" + disabled_bitmap + "\", BitmapType.wxBITMAP_TYPE_ANY );" );
propertylines.Add( propertyline.ToString() );
}
if ( size.Length == 0 )
{
propertyline = new StringBuilder();
propertyline.Append( "\t\t\t" + name + ".SetSize( " + name + ".BestSize );" );
propertylines.Add( propertyline.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( ", new wx.Bitmap( \"" + bitmap + "\", BitmapType.wxBITMAP_TYPE_ANY ) )" );
ctorlines.Add( ctorline.ToString() );
AddProperties( propertylines );
StringBuilder propertyline = new StringBuilder();
if ( disabled_bitmap.Length > 0 )
{
propertyline.Append( "\t\t\t" + name + ".BitmapDisabled = new wx.Bitmap( \"" + disabled_bitmap + "\", BitmapType.wxBITMAP_TYPE_ANY )" );
propertylines.Add( propertyline.ToString() );
}
if ( size.Length == 0 )
{
propertyline = new StringBuilder();
propertyline.Append( "\t\t\t" + name + ".SetSize( " + name + ".BestSize )" );
propertylines.Add( propertyline.ToString() );
}
}
}
}
|