Board index » cppbuilder » Dialogs and templates
JD
![]() CBuilder Developer |
JD
![]() CBuilder Developer |
Dialogs and templates |
Bob Gonder
![]() CBuilder Developer |
2007-06-14 10:16:35 PM
Re:Dialogs and templates
JD wrote:
QuoteHas any one used a template with a dialog? Or are you thinking of CreateDialogIndirect() and the help topic "Templates in Memory" and creating the template from user input? |
JD
![]() CBuilder Developer |
2007-06-15 01:40:09 AM
Re:Dialogs and templates
Bob Gonder < XXXX@XXXXX.COM >wrote:
QuoteJD wrote: Dialog Box", I located dlgs.h which defines constants for the templates and PrnSetup.dlg which has some actual templates. QuoteOr are you thinking of CreateDialogIndirect() Quoteand the help topic "Templates in Memory" My objective is to combine 2 dialogs - PageSetupDlg and a TPrintDialog. I can live with them being seperate but there's a bug with TPrintDialog where the Collate property always returns false. It may very well be that none of my printers support Collate and that's why it's always false but I can still print in a collated fashion and want to use that feature. I haven't built the template yet (I feel confident that that won't be a problem) but what to do after I get it displayed? 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. Then what do I do when it closes or do I need to keep track of the fields as they change? ~ JD {smallsort} |
Bob Gonder
![]() CBuilder Developer |
2007-06-15 05:46:45 AM
Re:Dialogs and templates
JD wrote:
Quotethere's a bug with TPrintDialog where the Collate property fancy. QuoteI haven't built the template yet (I feel confident that 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. QuoteThe PAGESETUPDLG struct used with PageSetupDlg() has a 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. QuoteThen what do I do when it closes or do I need to keep track of 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. |