RE: XRC Sub-Classing Questions

"Michael S. Muegel" <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.wxnet
Message-ID <[email protected]>
Thanks for getting back to me Bryan. 

> > I trapped the EVT_UPDATE_UI event and made changes in there. This 
> > worked. I had to ensure I only made the change once. If my problem 
> > with (1) is just how things are, we'll need to have an event or 
> > virtual method which is called once after sub-class 
> construction when 
> > it is safe to make changes to the instance.
> 
> This would be handled from Create.

Having to do something like this:

	public override bool Create(Window parent, int id, string label,
Point pos, Size size, long style, Validator validator, string name)
	{
		bool res = base.Create(parent, id, label, pos, size, style,
validator, name);
		... Do custom things ...
		return res;
	}

is pretty cumbersome IMHO when all you might want to do is change a font or
somesuch. I'd prefer a way to be able to make sub-class changes in the
constructor or a separate event ("Created"?) or simple virtual method
("PostCreate"?) with no arguments.

> > 2) What is the easiest way of ensuring everything resizes correctly 
> > after I make my changes? In this case the button needs to 
> grow a bit.
> 
> If it's in a wx.Sizer, usually just calling Fit() on the 
> enclosing window, or the sizer should do it.  Or am I 
> miss-interpreting?

I tried this.Parent.Fit() within my Xbutton but it had no effect. Could you
experiment with http://www.muegel.org/xfer/TestXRCSubclassing.zip when you
have time? 

Good luck on the run.

Thanks,
-Mike

--
Michael S. Muegel
Dallas, TX 



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.