🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1763

Re: Dialogs and templates

#1763
From: Bob Gonder
Date: Thu, 14 Jun 2007 21:46
61 lines
3220 bytes
JD wrote:

>there's a bug with TPrintDialog where the Collate property
>always returns false

Ok, for this you might intercept the WM_COMMAND for the Collate
control and "remember" it for yourself. That wouldn't take anything
fancy.

>I haven't built the template yet (I feel confident that
>that won't be a problem)

This
lpPageSetupTemplateName
would indicate that you could just use an RC dialog to drive it.
You would want to use the predefined IDs for the standard items and
unique IDs for your specialized controls.

>The PAGESETUPDLG struct used with PageSetupDlg() has a
>lpfnPageSetupHook so that I can recieve notifications
>but I can't find anything on what messages to expect
>except for WM_INITDIALOG and help.

The normal suspects in a window or dialog proc
The one you use most would be
	case WM_COMMAND:
		switch (wParam)
		{
		    case IDOFYOURCONTROL:
		/* your control did something */

You can just process your stuff, and allow the default handler to do
the rest, or you can add more code and override all the buttons.
You get the WM_COMMAND first, so if you return "processed" (true), the
original dialog ignores the message.

You can also add controls or manipulate the dialog on startup in the
WM_INITDIALOG message as the standard dialog has already been created.

>Then what do I do when it closes or do I need to keep track of
>the fields as they change?

That's one option.
The other is to intercept WM_CLOSE or the Ok button and query all the
controls.

Or WM_COMMAND( IDOK )
From one of my dialogs:
	    case CM_U_OK:
		COPY = IsDlgButtonChecked( hDlg, CM_U_COPY );
		Subdir = IsDlgButtonChecked( hDlg, CM_U_SUBDIR );
		DONOTHING = IsDlgButtonChecked( hDlg, CM_U_DONOTHING);
		OVERWRITE = IsDlgButtonChecked( hDlg, CM_U_OVERWRITE);
		EndDialog( hDlg, TRUE );
		return TRUE;
But you don't want to call EndDialog from a hooked common dialog.

Oh, and the Help nicely mentions:
"The members of the PAGESETUPDLG structure pointed to by the lppsd
parameter indicate the user's selections."
But that would be for the usual suspects, not something new.
Technical Details
Message-ID: <ijb373dmf25260404ojvfbjh6meui02i8b@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <46714248$1@newsgroups.borland.com> <mii273pj867nsl5il8scv41bso6j3rtktg@4ax.com> <46717d79$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,83f881932656eb79
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Dialogs and templates
Date: Thu, 14 Jun 2007 14:46:45 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <ijb373dmf25260404ojvfbjh6meui02i8b@4ax.com>
References: <46714248$1@newsgroups.borland.com> <mii273pj867nsl5il8scv41bso6j3rtktg@4ax.com> <46717d79$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.69.86.80
X-Trace: newsgroups.borland.com 1181857603 69.69.86.80 (14 Jun 2007 14:46:43 -0700)
Lines: 63
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail