Board index » delphi » PrinterSetupDialog Isn't Modal

PrinterSetupDialog Isn't Modal

Howdy all,

  I have trouble with 'Cancel' being hit on PrinterSetupDialog since it
(according to the source but not Help) isn't actually modal.  I use it
to initiate a print but I can't tell if 'Cancel' has been hit!
  I tried modifying the source but I get a 'version' error compiling
it.  Is there any way to detect the 'Cancel' result without creating my
own Dialog?  I imagine I might be able to create an inherited component
but I don't know how.  Or is there a fix I haven't heard about?

TIA,
--
=scott&chris

 

Re:PrinterSetupDialog Isn't Modal


I thought that PrinterSetupDialog was a procedure and didn't return
a result... the <Cancel> does cancel any changes to the INI file.

I ran into the same problem where I wanted to initiate a
preview but needed to start with the setup Dialog.  My,
less than satisfactory solution, used an additional dialog
after the SetupDialog... I hope there's a more elegant solution

Jon

-------------------------------------------------------------------------
J.L.Duerdoth                                jon.duerd...@sheridanc.on.ca
Sheridan College                            Voice: 905.845.9430 x2514
Telecommunications Technology               Fax:   905.815.4035
   & Computer Studies
1430 Trafalgar Road
Oakville, ON, Canada L6H 2L1

Scott n Chris Stewart (smsn...@IX.NETCOM.COM) wrote:
: Howdy all,

:   I have trouble with 'Cancel' being hit on PrinterSetupDialog since it
: (according to the source but not Help) isn't actually modal.  I use it
: to initiate a print but I can't tell if 'Cancel' has been hit!
:   I tried modifying the source but I get a 'version' error compiling
: it.  Is there any way to detect the 'Cancel' result without creating my
: own Dialog?  I imagine I might be able to create an inherited component
: but I don't know how.  Or is there a fix I haven't heard about?

: TIA,
: --
: =scott&chris

Re:PrinterSetupDialog Isn't Modal


Scott n Chris Stewart <smsn...@IX.NETCOM.COM> wrote in article
<338554D7.7...@IX.NETCOM.COM>...

Quote
> Howdy all,

>   I have trouble with 'Cancel' being hit on

PrinterSetupDialog since it
Quote
> (according to the source but not Help) isn't actually modal.
I use it
> to initiate a print but I can't tell if 'Cancel' has been
hit!
>   I tried modifying the source but I get a 'version' error
compiling
> it.  Is there any way to detect the 'Cancel' result without
creating my
> own Dialog?  I imagine I might be able to create an inherited
component
> but I don't know how.  Or is there a fix I haven't heard
about?

I take it that by it being "not modal" you mean that it doesn't
return a result.  I was able to modify and compile the source
just fine to make it do this, and don't know why you got a
version error.  What version of Delphi are you using, etc.?  I
can send you a DCU if you really need one.  (This is legal,
isn't it, guys?)

(I wonder why in the world Borland made this dialog's Execute a
procedure when the others are Boolean functions?  They actually
had to go out of their way to do this!).

You should question yourself about whether you really want to
do things this way.  It's not typical in a Windows application
to have the Printer Setup dialog initiate/cancel the print;
usually it's the Printer dialog.  Maybe that's why Borland
figured you'd never need to check that value, though it's
stupid of them to handcuff us!

Other Threads