[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [TSVN] Another refactoring opportunity?

From: Will Dean <svn_at_indcomp.co.uk>
Date: 2005-01-04 19:16:45 CET

At 18:55 04/01/2005 +0100, you wrote:

>I've checked your template code and it looks very good. The only thing I'm
>not sure about is the double BEGIN_MESSAGE_MAP(): Since CResizableDialog
>is inherited from CDialog, won't that cause confusion about which message
>map is used? I'm not very good with templates, so forgive me if I don't
>quite understand that.

Ignore the template for a moment, as it's not really relevant - the new
class is just another Dialog-ish class sitting in the derivation chain (is
that a proper C++ term?) This could either be something like CWnd ->
CDialog -> CStandAloneDialog -> CAddDlg (or whatever) or CWnd -> CDialog ->
CResizableDialog -> CStandAlongDialog -> CAddDlg

There's no problem any and/or all of these CWnd-derived classes having
their own message maps (for example CResizableDialog has its own message
map, which doesn't clash with the message maps in the TSVN dialogs.

All that the templating does is allow me to have one set of code which
implements:

CStandAloneDialogDerivedDirectlyFromCDialog

and

CStandAloneDialogDerivedFromCResizableDialog

without having to have to write the code twice. (The compiler probably
generates it twice)

I did have to have create the two sets of message maps, one for each of
those two classes - if we used this template on any more
dialog-base-classes, we'd need to create message maps for each of them.

I'll have a go at extending it's scope a bit more. What's particularly
annoying about this 'boring code' is that the 'IsIconic' case (the majority
of the code) seems to never be actually used on an Explorer-shell style
machine (unless you kill the shell and *then* minimise the app.) WinNT
3.51 support, anybody? (Win9x might be different, too.)

Cheers,

Will

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Tue Jan 4 19:19:25 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.