Compile Q
[email protected] (Robert Roebling)
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <[email protected]> |
Hi yet again,
I would like to fill dialogs (and panels) up
with controls and sizers in a separate function.
The code will look about like this:
public ...
{
Dialog dialog = new Dialog( "Test dialog", new Point(10,10), ...
);
testWdrClass.MyDialogFunc( dialog );
dialog.ShowModal( true );
}
where the second line calls the function shown below.
Sadly, the compiler MCS 0.19 doesn't seem to agree with
my plan giving an error message in the line with the
Checkbox: "Can not cast from source to destination type"
but I cannot find what exactly is the offending code.
Casting the flags to (int) didn't help either. Do you
have any idea or is this a compiler bug?
Robert
//-----------------------------------------------------------------------------
// C# source generated by wxDesigner from file: test.wdr
// Do not modify this file, all changes will be lost!
//-----------------------------------------------------------------------------
using System;
using System.Drawing;
using wx;
public class testWdrClass
{
// Window functions
const int ID_CHECKBOX = 10000;
const int ID_RADIOBUTTON = 10001;
const int ID_BUTTON = 10002;
const int ID_TEXT = 10003;
public static Sizer MyDialogFunc( Window parent )
{ return MyDialogFunc( parent, false, true ); }
public static Sizer MyDialogFunc( Window parent, bool call_fit )
{ return MyDialogFunc( parent, call_fit, true ); }
public static Sizer MyDialogFunc( Window parent, bool call_fit,
bool set_sizer )
{
BoxSizer item0 = new BoxSizer( Orient.Vertical );
CheckBox item1 = new CheckBox( parent, ID_CHECKBOX, "Check" );
item0.Add( item1, 0, Alignment.Center|Direction.All, 5 );
Button item2 = new Button( parent, ID_RADIOBUTTON, "Button" );
item0.Add( item2, 0, Alignment.Center|Direction.All, 5 );
Button item3 = new Button( parent, ID_BUTTON, "OK" );
item0.Add( item3, 0, Alignment.Center|Direction.All, 5 );
StaticText item4 = new StaticText( parent, ID_TEXT, "Text." );
item0.Add( item4, 0, Alignment.Center|Direction.All, 5 );
if (set_sizer)
{
parent.SetSizer( item0 );
if (call_fit)
item0.Fit( parent );
}
return item0;
}
}
// End of generated file
--
Robert Roebling, MD <[email protected]>
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en