1. setPrintJobProperty problem

Back to printing problems.
I can open the default printer and print to it with no worries.
I had to declare printerDC to be global in w32Resources.ew, that was OK.
I'm now trying to change the print orientation using:

  setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)

but I get no change in the output.
Can anyone advise me on this? I tried calling the function immediately after
assigning printerDC, and also after calling startDoc & startPage; still no go.
If I still have to go to printer setup to do this then I might as well not be
opening the default printer....

AndyD

new topic     » topic index » view message » categorize

2. Re: setPrintJobProperty problem

Andy Drummond wrote:
> 
> Back to printing problems.
> I can open the default printer and print to it with no worries.
> I had to declare printerDC to be global in w32Resources.ew, that was OK.
> I'm now trying to change the print orientation using:
> 
>   setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> 

This just works for me, using a laser printer under WinXP Home. Strange... Try
calling it before getPrinter() perhaps.

CChris

> but I get no change in the output.
> Can anyone advise me on this? I tried calling the function immediately after
> assigning printerDC, and also after calling startDoc & startPage; still no
> go.
> If I still have to go to printer setup to do this then I might as well not be
> opening the default printer....
> 
> AndyD

new topic     » goto parent     » topic index » view message » categorize

3. Re: setPrintJobProperty problem

CChris wrote:
> 
> Andy Drummond wrote:
> > 
> > Back to printing problems.
> > I can open the default printer and print to it with no worries.
> > I had to declare printerDC to be global in w32Resources.ew, that was OK.
> > I'm now trying to change the print orientation using:
> > 
> >   setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> > 
> 
> This just works for me, using a laser printer under WinXP Home. Strange... Try
> calling it before getPrinter() perhaps.
> 
> CChris
> 
> > but I get no change in the output.
> > Can anyone advise me on this? I tried calling the function immediately after
> > assigning printerDC, and also after calling startDoc & startPage; still no
> > go.
> > If I still have to go to printer setup to do this then I might as well not
> > be
> > opening the default printer....
> > 
> > AndyD

CChris, it would be nice if we didn't have to OK the Print screen as well as the
print setup screen. I'd like to be able to run a program which uses getPrinter
and VOID=setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE) and have the
printer start printing my document in landscape without interaction on my part.

new topic     » goto parent     » topic index » view message » categorize

4. Re: setPrintJobProperty problem

Judith Evans wrote:
> 
> CChris wrote:
> > 
> > Andy Drummond wrote:
> > > 
> > > Back to printing problems.
> > > I can open the default printer and print to it with no worries.
> > > I had to declare printerDC to be global in w32Resources.ew, that was OK.
> > > I'm now trying to change the print orientation using:
> > > 
> > >   setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> > > 
> > 
> > This just works for me, using a laser printer under WinXP Home. Strange...
> > Try
> > calling it before getPrinter() perhaps.
> > 
> > CChris
> > 
> > > but I get no change in the output.
> > > Can anyone advise me on this? I tried calling the function immediately
> > > after
> > > assigning printerDC, and also after calling startDoc & startPage; still no
> > > go.
> > > If I still have to go to printer setup to do this then I might as well not
> > > be
> > > opening the default printer....
> > > 
> > > AndyD
> 
> CChris, it would be nice if we didn't have to OK the Print screen as well as
> the print setup screen. I'd like to be able to run a program which uses
> getPrinter
> and VOID=setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE) and have the
> printer start printing my document in landscape without interaction on my
> part.

See the code I recently posted for a getDefaultPrinter() function; doesn't it do
the job?

CChris

new topic     » goto parent     » topic index » view message » categorize

5. Re: setPrintJobProperty problem

CChris wrote:
> 
> Judith Evans wrote:
> > 
> > CChris wrote:
> > > 
> > > Andy Drummond wrote:
> > > > 
> > > > Back to printing problems.
> > > > I can open the default printer and print to it with no worries.
> > > > I had to declare printerDC to be global in w32Resources.ew, that was OK.
> > > > I'm now trying to change the print orientation using:
> > > > 
> > > >   setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> > > > 
> > > 
> > > This just works for me, using a laser printer under WinXP Home. Strange...
> > > Try
> > > calling it before getPrinter() perhaps.
> > > 
> > > CChris
> > > 
> > > > but I get no change in the output.
> > > > Can anyone advise me on this? I tried calling the function immediately
> > > > after
> > > > assigning printerDC, and also after calling startDoc & startPage; still
> > > > no
> > > > go.
> > > > If I still have to go to printer setup to do this then I might as well
> > > > not be
> > > > opening the default printer....
> > > > 
> > > > AndyD
> > 
> > CChris, it would be nice if we didn't have to OK the Print screen as well as
> > the print setup screen. I'd like to be able to run a program which uses
> > getPrinter
> > and VOID=setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE) and have
> > the
> > printer start printing my document in landscape without interaction on my
> > part.
> 
> See the code I recently posted for a getDefaultPrinter() function; doesn't it
> do the job?
> 
> CChris

CChris,
I think the trouble is that when you use getPrinter() to choose a printer,
the code does more than just get a DC for the printer. I think it must load
up a parameter block for it. So if I call getPrinter() and just click OK, the
orientation control works fine. But if I use getDefaultPrinter() which gets
the DC of the default printer, it does NOT do the same parameter getting &
setting. Then the orientation control does nothing.  

I have replaced getDefaultPrinter() with getPrinter() and just clicked OK,
and it is fine. Remove that and it is not.

I haven't looked at the getPrinter() code (well, I have, but the stuff just
went in one eye and out the other) so I may be talking garbage; it wouldn't
be the first time. But that seems to be the logical conclusion. Is it?

If so, should you add the getDefault Printer() to Win32Lib then I assume it
would set things up exactly the same as getPrinter()+OK does. Then it will
work fine. I can wait; it is not a great pain like the press shift once pain.

Is it possible to call getPrinter() with an argument which tells the routine
the printer name to get or even just to imitate the press of OK for the
default printer? Something like (DOS days) pushing a keypress onto the key
stack before calling a routine which then gets the keypress & returns with
no user input needed. A thought....

I appreciate your work on Win32Lib enormously - as I do Derek's work and
I guess David Cuny's, who started it. You guys all want medals - or money -
but not being Bill Gates's, you will get users complaining their model railway
won't work right under Win32Lib or their printer keeps running out of ink or
something silly like that.  

Tough life, isn't it. You do have many fans, though!

AndyD

new topic     » goto parent     » topic index » view message » categorize

6. Re: setPrintJobProperty problem

CChris wrote:
> 
> Judith Evans wrote:
> > 
> > CChris wrote:
> > > 
> > > Andy Drummond wrote:
> > > > 
> > > > Back to printing problems.
> > > > I can open the default printer and print to it with no worries.
> > > > I had to declare printerDC to be global in w32Resources.ew, that was OK.
> > > > I'm now trying to change the print orientation using:
> > > > 
> > > >   setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> > > > 
> > > 
> > > This just works for me, using a laser printer under WinXP Home. Strange...
> > > Try
> > > calling it before getPrinter() perhaps.
> > > 
> > > CChris
> > > 
> > > > but I get no change in the output.
> > > > Can anyone advise me on this? I tried calling the function immediately
> > > > after
> > > > assigning printerDC, and also after calling startDoc & startPage; still
> > > > no
> > > > go.
> > > > If I still have to go to printer setup to do this then I might as well
> > > > not be
> > > > opening the default printer....
> > > > 
> > > > AndyD
> > 
> > CChris, it would be nice if we didn't have to OK the Print screen as well as
> > the print setup screen. I'd like to be able to run a program which uses
> > getPrinter
> > and VOID=setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE) and have
> > the
> > printer start printing my document in landscape without interaction on my
> > part.
> 
> See the code I recently posted for a getDefaultPrinter() function; doesn't it
> do the job?
> 
> CChris
If you mean Greg's getDefaultPrinter.ew then no because the print setup window
still appears and wants "OK" response.
judith

new topic     » goto parent     » topic index » view message » categorize

7. Re: setPrintJobProperty problem

On 10/27/07, Judith Evans <guest at rapideuphoria.com> wrote:
>
>
> posted by: Judith Evans <camping at c?ewb.?et>
>
> CChris wrote:
> >
> > Judith Evans wrote:
> > >
> > > CChris wrote:
> > > >
> > > > Andy Drummond wrote:
> > > > >
> > > > > Back to printing problems.
> > > > > I can open the default printer and print to it with no worries.
> > > > > I had to declare printerDC to be global in w32Resources.ew, that was
> > > > > OK.
> > > > > I'm now trying to change the print orientation using:
> > > > >
> > > > >   setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> > > > >
> > > >
> > > > This just works for me, using a laser printer under WinXP Home.
> > > > Strange... Try
> > > > calling it before getPrinter() perhaps.
> > > >
> > > > CChris
> > > >
> > > > > but I get no change in the output.
> > > > > Can anyone advise me on this? I tried calling the function immediately
> > > > > after
> > > > > assigning printerDC, and also after calling startDoc & startPage;
> > > > > still no
> > > > > go.
> > > > > If I still have to go to printer setup to do this then I might as well
> > > > > not be
> > > > > opening the default printer....
> > > > >
> > > > > AndyD
> > >
> > > CChris, it would be nice if we didn't have to OK the Print screen as well
> > > as
> > > the print setup screen. I'd like to be able to run a program which uses
> > > getPrinter
> > > and VOID=setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE) and have
> > > the
> > > printer start printing my document in landscape without interaction on my
> > > part.
> >
> > See the code I recently posted for a getDefaultPrinter() function; doesn't
> > it
> > do the job?
> >
> > CChris
>
> If you mean Greg's getDefaultPrinter.ew then no because the print setup window
> still appears and wants "OK" response.
> judith

Chris just modified my code into something more stream-lined for
Win32Lib. I have tested that code time and time again since I wrote it
(mostly with PDF and MODIW virtual printers) and never have I had the
print dialog appear. So unfortunately, I am at a loss.

What type of printer (and driver) are you using?

-Greg

new topic     » goto parent     » topic index » view message » categorize

8. Re: setPrintJobProperty problem

Andy Drummond wrote:
> 
> CChris wrote:
> > 
> > Judith Evans wrote:
> > > 
> > > CChris wrote:
> > > > 
> > > > Andy Drummond wrote:
> > > > > 
> > > > > Back to printing problems.
> > > > > I can open the default printer and print to it with no worries.
> > > > > I had to declare printerDC to be global in w32Resources.ew, that was
> > > > > OK.
> > > > > I'm now trying to change the print orientation using:
> > > > > 
> > > > >   setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> > > > > 
> > > > 
> > > > This just works for me, using a laser printer under WinXP Home.
> > > > Strange...
> Try</font></i>
> > > > calling it before getPrinter() perhaps.
> > > > 
> > > > CChris
> > > > 
> > > > > but I get no change in the output.
> > > > > Can anyone advise me on this? I tried calling the function immediately
> > > > > after
> > > > > assigning printerDC, and also after calling startDoc & startPage;
> > > > > still no
> > > > > go.
> > > > > If I still have to go to printer setup to do this then I might as well
> > > > > not
> be</font></i>
> > > > > opening the default printer....
> > > > > 
> > > > > AndyD
> > > 
> > > CChris, it would be nice if we didn't have to OK the Print screen as well
> > > as
> > > the print setup screen. I'd like to be able to run a program which uses
> > > getPrinter
> > > and VOID=setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE) and have
> > > the
> > > printer start printing my document in landscape without interaction on my
> > > part.
> > 
> > See the code I recently posted for a getDefaultPrinter() function; doesn't
> > it
> > do the job?
> > 
> > CChris
> 
> CChris,
> I think the trouble is that when you use getPrinter() to choose a printer,
> the code does more than just get a DC for the printer. I think it must load
> up a parameter block for it. So if I call getPrinter() and just click OK, the
> orientation control works fine. But if I use getDefaultPrinter() which gets
> the DC of the default printer, it does NOT do the same parameter getting &
> setting. Then the orientation control does nothing.  
> 

The idea indeed was that getDefaultPrinter() would set the default printer with
default attributes; the behaviour you got is what I expected. I didn't try
calling getDefaultPrinter() and then setPrintJobProperties(). If it doesn't work,
it would be worth making it work perhaps.

> I have replaced getDefaultPrinter() with getPrinter() and just clicked OK,
> and it is fine. Remove that and it is not.
> 
> I haven't looked at the getPrinter() code (well, I have, but the stuff just
> went in one eye and out the other) so I may be talking garbage; it wouldn't
> be the first time. But that seems to be the logical conclusion. Is it?
> 

Since getPrinterChoice() displays a dialog box where the user might change
settings, it has to check for these changes and make them effective for the
printer. That's a fair amount of code indeed.

> If so, should you add the getDefault Printer() to Win32Lib then I assume it
> would set things up exactly the same as getPrinter()+OK does. Then it will
> work fine. I can wait; it is not a great pain like the press shift once pain.
> 

The code I had posted was meant to be pasted in w32resources.ew, right after
getPrinterChoice(). It will be in 70.2 anyway, probably with the enhancements
suggested above.

> Is it possible to call getPrinter() with an argument which tells the routine
> the printer name to get or even just to imitate the press of OK for the
> default printer? Something like (DOS days) pushing a keypress onto the key
> stack before calling a routine which then gets the keypress & returns with
> no user input needed. A thought....

I think I'd rather add a selectPrinter(objet printer) procedure. If printer is a
sequence, it is a printer name string, and that will set designated printer as
current printer. If name is unknown, fall back on getPrinterChoice(). How about
that?

> 
> I appreciate your work on Win32Lib enormously - as I do Derek's work and
> I guess David Cuny's, who started it. You guys all want medals - or money -
> but not being Bill Gates's, you will get users complaining their model railway
> won't work right under Win32Lib or their printer keeps running out of ink or
> something silly like that.  
> 
> Tough life, isn't it. You do have many fans, though!
> 
> AndyD


I expect more complaints about printing for the weeks ahead actually. 
The lib had just so many print features that were offered, but didn't work. As
some start to, there will be more voices to ask for everything to work right out
of the box, and I cannot test everything because I have one computer and two
printers only (a laser and AdobePDF). That's why having a good pool of testers to
catch issues before release would tremendously help.

CChris

new topic     » goto parent     » topic index » view message » categorize

9. Re: setPrintJobProperty problem

Greg Haberek wrote:
> 
> On 10/27/07, Judith Evans <guest at rapideuphoria.com> wrote:
> >
> >
> > posted by: Judith Evans <camping at c?ewb.?et>
> >
> > CChris wrote:
> > >
> > > Judith Evans wrote:
> > > >
> > > > CChris wrote:
> > > > >
> > > > > Andy Drummond wrote:
> > > > > >
> > > > > > Back to printing problems.
> > > > > > I can open the default printer and print to it with no worries.
> > > > > > I had to declare printerDC to be global in w32Resources.ew, that was
> > > > > > OK.
> > > > > > I'm now trying to change the print orientation using:
> > > > > >
> > > > > >   setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> > > > > >
> > > > >
> > > > > This just works for me, using a laser printer under WinXP Home.
> > > > > Strange...
> Try</font></i>
> > > > > calling it before getPrinter() perhaps.
> > > > >
> > > > > CChris
> > > > >
> > > > > > but I get no change in the output.
> > > > > > Can anyone advise me on this? I tried calling the function
> > > > > > immediately
> after</font></i>
> > > > > > assigning printerDC, and also after calling startDoc & startPage;
> > > > > > still
> no</font></i>
> > > > > > go.
> > > > > > If I still have to go to printer setup to do this then I might as
> > > > > > well
> not be</font></i>
> > > > > > opening the default printer....
> > > > > >
> > > > > > AndyD
> > > >
> > > > CChris, it would be nice if we didn't have to OK the Print screen as
> > > > well as
> > > > the print setup screen. I'd like to be able to run a program which uses
> > > > getPrinter
> > > > and VOID=setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE) and
> > > > have the
> > > > printer start printing my document in landscape without interaction on
> > > > my part.
> > >
> > > See the code I recently posted for a getDefaultPrinter() function; doesn't
> > > it
> > > do the job?
> > >
> > > CChris
> >
> > If you mean Greg's getDefaultPrinter.ew then no because the print setup
> window still appears and wants "OK" response.</font></i>
> > judith
> 
> Chris just modified my code into something more stream-lined for
> Win32Lib. I have tested that code time and time again since I wrote it
> (mostly with PDF and MODIW virtual printers) and never have I had the
> print dialog appear. So unfortunately, I am at a loss.
> 
> What type of printer (and driver) are you using?
> 
> -Greg

Print Dialog does not appear but the Print Setup screen does. And you must press
"OK" for printing to continue.

I see in later posts there is more discussion so I will hold off testing for the
time being.

judith
> 
>

new topic     » goto parent     » topic index » view message » categorize

10. Re: setPrintJobProperty problem

CChris:

Just wanted to let you know in the latest version of win32lib;

If you use the choosefont() function it does not display all of

the current fonts installed on a system. I was using win98.

I tried using a real old win32lib version 0.55.1 19/Dec/2000 library
   and it worked ok.

Something must of changed in last 2 years of version changes. 





Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

11. Re: setPrintJobProperty problem

CChris wrote:
> 
> 
> Since getPrinterChoice() displays a dialog box where the user might change
> settings,
> it has to check for these changes and make them effective for the printer.
> That's
> a fair amount of code indeed.
> 
> > If so, should you add the getDefault Printer() to Win32Lib then I assume it
> > would set things up exactly the same as getPrinter()+OK does. Then it will
> > work fine. I can wait; it is not a great pain like the press shift once
> > pain.
> > 
> 
> The code I had posted was meant to be pasted in w32resources.ew, right after
> getPrinterChoice(). It will be in 70.2 anyway, probably with the enhancements
> suggested above.
> 
> > Is it possible to call getPrinter() with an argument which tells the routine
> > the printer name to get or even just to imitate the press of OK for the
> > default printer? Something like (DOS days) pushing a keypress onto the key
> > stack before calling a routine which then gets the keypress & returns with
> > no user input needed. A thought....
> 
> I think I'd rather add a selectPrinter(objet printer) procedure. If printer
> is a sequence, it is a printer name string, and that will set designated
> printer
> as current printer. If name is unknown, fall back on getPrinterChoice(). How
> about that?
>

CChris, what you suggest is excellent; it would cover all cases beyond maybe
having a routine which returns a list of the names of the printers available.
Since I only want the default that is not something I'd ask for. Not yet!

I am content to wait for your doing this as and when you get around to it;
it will be a useful upgrade to my code so I can do a Microsoft Word and just 
have a button which prints all by itself. Magic.  I can use
setPrintJobProperty()
to do lots now with just a single click to accept the printer choice.

> > 
> > I appreciate your work on Win32Lib enormously - as I do Derek's work and
> > I guess David Cuny's, who started it. You guys all want medals - or money -
> > but not being Bill Gates's, you will get users complaining their model
> > railway
> > won't work right under Win32Lib or their printer keeps running out of ink or
> > something silly like that.  
> > 
> > Tough life, isn't it. You do have many fans, though!
> > 
> > AndyD
>
May I comment; when I said you guys all want medals etc, I meant DESERVE medals
not want as in desire.... no offence meant.
 
> 
> I expect more complaints about printing for the weeks ahead actually. 
> The lib had just so many print features that were offered, but didn't work.
> As some start to, there will be more voices to ask for everything to work
> right
> out of the box, and I cannot test everything because I have one computer and
> two printers only (a laser and AdobePDF). That's why having a good pool of
> testers
> to catch issues before release would tremendously help.
> 
> CChris

Hopefully not too many complaints - just helpful criticism as we try and do
our job as testers. But it does sound like complaining to me though it is
not meant that way..  

AndyD

new topic     » goto parent     » topic index » view message » categorize

12. Re: setPrintJobProperty problem

Bernie Ryan wrote:
> 
> CChris:
> 
> Just wanted to let you know in the latest version of win32lib;
> 
> If you use the choosefont() function it does not display all of
> 
> the current fonts installed on a system. I was using win98.
> 
> I tried using a real old win32lib version 0.55.1 19/Dec/2000 library
>    and it worked ok.
> 
> Something must of changed in last 2 years of version changes. 
> 
> 
> Bernie
> 
> My files in archive:
> WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>

Point taken. Could you try figuring out anything that might characterise the
missing fonts? (TrueType? not TrueType? vertical? fixed? ...) Even a name that is
no longer there and should would help.

CChris

new topic     » goto parent     » topic index » view message » categorize

13. Re: setPrintJobProperty problem

Bernie Ryan wrote:
> 
> CChris:
> 
> Just wanted to let you know in the latest version of win32lib;
> 
> If you use the choosefont() function it does not display all of
> 
> the current fonts installed on a system. I was using win98.
> 
> I tried using a real old win32lib version 0.55.1 19/Dec/2000 library
>    and it worked ok.
> 
> Something must of changed in last 2 years of version changes. 
> 
> 
> Bernie
> 
> My files in archive:
> WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>

I still need more details about which sort of fonts the newer lib skips over.
In the meantime, you can try the following: locate, in the body of
getFontDialog() in win32lib.ew, the following lines:
w32store( hChooseFont, CF_Flags,
    CF_INITTOLOGFONTSTRUCT+CF_SCRIPTSONLY+CF_SCREENFONTS+CF_EFFECTS+CF_FORCEFONTEXIST)
    w32store( hChooseFont, CF_hLogFont, hLogFont )
w32store( hChooseFont, CF_rgbColors, ctrl_Font[id][w32FontColor])         
    -- added PeteS
w32store( hChooseFont, CF_iPointSize, ctrl_Font[id][w32FontSize] )         
    -- added PeteS
</eucoode>

There are all the changes I could notice from v59.1 - I don't even know where I could find 0.55!- :

  • the CF_FORCEFONTEXIST flag was not there;
  • the two lines added by PeteS were not there.

Try undoing all or part of these changes, and tell us which combination, if any, recovered all the missing fonts. Then I can decide what to do. I don't think PeteS' additions are at stake, but, you know, one can never tell on Win98...

CChris }}}

new topic     » goto parent     » topic index » view message » categorize

14. Re: setPrintJobProperty problem

Andy Drummond wrote:
> 
> CChris wrote:
> > 
> > 
> > Since getPrinterChoice() displays a dialog box where the user might change
> > settings,
> > it has to check for these changes and make them effective for the printer.
> > That's
> > a fair amount of code indeed.
> > 
> > > If so, should you add the getDefault Printer() to Win32Lib then I assume
> > > it
> > > would set things up exactly the same as getPrinter()+OK does. Then it will
> > > work fine. I can wait; it is not a great pain like the press shift once
> > > pain.
> > > 
> > 
> > The code I had posted was meant to be pasted in w32resources.ew, right after
> > getPrinterChoice(). It will be in 70.2 anyway, probably with the
> > enhancements
> > suggested above.
> > 
> > > Is it possible to call getPrinter() with an argument which tells the
> > > routine
> > > the printer name to get or even just to imitate the press of OK for the
> > > default printer? Something like (DOS days) pushing a keypress onto the key
> > > stack before calling a routine which then gets the keypress & returns with
> > > no user input needed. A thought....
> > 
> > I think I'd rather add a selectPrinter(objet printer) procedure. If printer
> > is a sequence, it is a printer name string, and that will set designated
> > printer
> > as current printer. If name is unknown, fall back on getPrinterChoice(). How
> > about that?
> >
> 
> CChris, what you suggest is excellent; it would cover all cases beyond maybe
> having a routine which returns a list of the names of the printers available.
> Since I only want the default that is not something I'd ask for. Not yet!
> 
> I am content to wait for your doing this as and when you get around to it;
> it will be a useful upgrade to my code so I can do a Microsoft Word and just
> 
> have a button which prints all by itself. Magic.  I can use
> setPrintJobProperty()
> to do lots now with just a single click to accept the printer choice.
> 
> > > 
> > > I appreciate your work on Win32Lib enormously - as I do Derek's work and
> > > I guess David Cuny's, who started it. You guys all want medals - or money
> > > -
> > > but not being Bill Gates's, you will get users complaining their model
> > > railway
> > > won't work right under Win32Lib or their printer keeps running out of ink
> > > or
> > > something silly like that.  
> > > 
> > > Tough life, isn't it. You do have many fans, though!
> > > 
> > > AndyD
> >
> May I comment; when I said you guys all want medals etc, I meant DESERVE
> medals
> not want as in desire.... no offence meant.
>  
> > 
> > I expect more complaints about printing for the weeks ahead actually. 
> > The lib had just so many print features that were offered, but didn't work.
> > As some start to, there will be more voices to ask for everything to work
> > right
> > out of the box, and I cannot test everything because I have one computer and
> > two printers only (a laser and AdobePDF). That's why having a good pool of
> > testers
> > to catch issues before release would tremendously help.
> > 
> > CChris
> 
> Hopefully not too many complaints - just helpful criticism as we try and do
> our job as testers. But it does sound like complaining to me though it is
> not meant that way..  
> 
> AndyD

Replace at line 1272 in w32resources.ew the text for getDefaultPrinter() by:
--/topic Printing
--/func getDefaultPrinter()
--/desc Like /getPrinter(), but assumes there is a default printer already
installed
--/ret (ATOM) DC for default printer
global function getDefaultPrinter()
    printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
    setPrinterPointers(1)
    return printerDC
end function


Then, calling setPrintJobProperty() should update everything, but most
importantly the printer itself. Let us know whether this is working better.

CChris

new topic     » goto parent     » topic index » view message » categorize

15. Re: setPrintJobProperty problem

CChris wrote:
> I still need more details about which sort of fonts the newer lib skips over.
> In the meantime, you can try the following: locate, in the body of
> getFontDialog()
> in win32lib.ew, the following lines:
> }}}
<eucode>
>     w32store( hChooseFont, CF_Flags,
>     CF_INITTOLOGFONTSTRUCT+CF_SCRIPTSONLY+CF_SCREENFONTS+CF_EFFECTS+CF_FORCEFONTEXIST)
>     w32store( hChooseFont, CF_hLogFont, hLogFont )
>     w32store( hChooseFont, CF_rgbColors, ctrl_Font[id][w32FontColor])         
>     -- added PeteS
>     w32store( hChooseFont, CF_iPointSize, ctrl_Font[id][w32FontSize] )        
>      -- added PeteS
> </eucoode>
> 
> There are all the changes I could notice from v59.1 - I don't even know where
> I could find 0.55!- :
> * the CF_FORCEFONTEXIST flag was not there;
> * the two lines added by PeteS were not there.
> 
> Try undoing all or part of these changes, and tell
> us which combination, if any, recovered all the missing fonts. Then I can
> decide what to do.
> I don't think PeteS' additions are at stake, but, you know, one can never tell
> on Win98...
> 

CChris:

Here is a way you can try it.

Download the following file from the archive.

http://www.rapideuphoria.com/winfnt2f.zip


Start the program and click on left font button and count the font
names shown in the left listbox.

If you set the file to include the NEW ver. of win32lib it displays 26 fonts.

If you set the file to include the OLD ver. of win32lib it displays 42 fonts.

Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

16. Re: setPrintJobProperty problem

CChris wrote:
> 
> Andy Drummond wrote:
> > 
> > CChris wrote:
> > > 
> > > 
> > > Since getPrinterChoice() displays a dialog box where the user might change
> > > settings,
> > > it has to check for these changes and make them effective for the printer.
> > > That's
> > > a fair amount of code indeed.
> > > 
> > > > If so, should you add the getDefault Printer() to Win32Lib then I assume
> > > > it
> > > > would set things up exactly the same as getPrinter()+OK does. Then it
> > > > will
> > > > work fine. I can wait; it is not a great pain like the press shift once
> > > > pain.
> > > > 
> > > 
> > > The code I had posted was meant to be pasted in w32resources.ew, right
> > > after
> > > getPrinterChoice(). It will be in 70.2 anyway, probably with the
> > > enhancements
> > > suggested above.
> > > 
> > > > Is it possible to call getPrinter() with an argument which tells the
> > > > routine
> > > > the printer name to get or even just to imitate the press of OK for the
> > > > default printer? Something like (DOS days) pushing a keypress onto the
> > > > key
> > > > stack before calling a routine which then gets the keypress & returns
> > > > with
> > > > no user input needed. A thought....
> > > 
> > > I think I'd rather add a selectPrinter(objet printer) procedure. If
> > > printer
> > > is a sequence, it is a printer name string, and that will set designated
> > > printer
> > > as current printer. If name is unknown, fall back on getPrinterChoice().
> > > How
> > > about that?
> > >
> > 
> > CChris, what you suggest is excellent; it would cover all cases beyond maybe
> > having a routine which returns a list of the names of the printers
> > available.
> > Since I only want the default that is not something I'd ask for. Not yet!
> > 
> > I am content to wait for your doing this as and when you get around to it;
> > it will be a useful upgrade to my code so I can do a Microsoft Word and just
> > 
> > have a button which prints all by itself. Magic.  I can use
> > setPrintJobProperty()
> > to do lots now with just a single click to accept the printer choice.
> > 
> > > > 
> > > > I appreciate your work on Win32Lib enormously - as I do Derek's work and
> > > > I guess David Cuny's, who started it. You guys all want medals - or
> > > > money -
> > > > but not being Bill Gates's, you will get users complaining their model
> > > > railway
> > > > won't work right under Win32Lib or their printer keeps running out of
> > > > ink or
> > > > something silly like that.  
> > > > 
> > > > Tough life, isn't it. You do have many fans, though!
> > > > 
> > > > AndyD
> > >
> > May I comment; when I said you guys all want medals etc, I meant DESERVE
> > medals
> > not want as in desire.... no offence meant.
> >  
> > > 
> > > I expect more complaints about printing for the weeks ahead actually. 
> > > The lib had just so many print features that were offered, but didn't
> > > work.
> > > As some start to, there will be more voices to ask for everything to work
> > > right
> > > out of the box, and I cannot test everything because I have one computer
> > > and
> > > two printers only (a laser and AdobePDF). That's why having a good pool of
> > > testers
> > > to catch issues before release would tremendously help.
> > > 
> > > CChris
> > 
> > Hopefully not too many complaints - just helpful criticism as we try and do
> > our job as testers. But it does sound like complaining to me though it is
> > not meant that way..  
> > 
> > AndyD
> 
> Replace at line 1272 in w32resources.ew the text for getDefaultPrinter() by:
> }}}
<eucode>
> --/topic Printing
> --/func getDefaultPrinter()
> --/desc Like /getPrinter(), but assumes there is a default printer already
> installed
> --/ret (ATOM) DC for default printer
> global function getDefaultPrinter()
>     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
>     setPrinterPointers(1)
>     return printerDC
> end function
> </eucode>
{{{

> 
> Then, calling setPrintJobProperty() should update everything, but most
> importantly
> the printer itself. Let us know whether this is working better.
> 
> CChris

Line 1212 seems better - 1272 is in the middle of startPage(). I have put in
the new version of getDefaultPrinter() code and I'll try it ASAP. Maybe it is
just the testing version of Win32Lib I have now got.

AndyD

new topic     » goto parent     » topic index » view message » categorize

17. Re: setPrintJobProperty problem

Andy Drummond wrote:
> 
> CChris wrote:
> > 
> > Andy Drummond wrote:
> > > 
> > > CChris wrote:
> > > > 
> > > > 
> > > > Since getPrinterChoice() displays a dialog box where the user might
> > > > change
> settings,</font></i>
> > > > it has to check for these changes and make them effective for the
> > > > printer.
> That's</font></i>
> > > > a fair amount of code indeed.
> > > > 
> > > > > If so, should you add the getDefault Printer() to Win32Lib then I
> > > > > assume
> it</font></i>
> > > > > would set things up exactly the same as getPrinter()+OK does. Then it
> > > > > will
> > > > > work fine. I can wait; it is not a great pain like the press shift
> > > > > once
> pain.</font></i>
> > > > > 
> > > > 
> > > > The code I had posted was meant to be pasted in w32resources.ew, right
> > > > after
> > > > getPrinterChoice(). It will be in 70.2 anyway, probably with the
> > > > enhancements
> > > > suggested above.
> > > > 
> > > > > Is it possible to call getPrinter() with an argument which tells the
> > > > > routine
> > > > > the printer name to get or even just to imitate the press of OK for
> > > > > the
> > > > > default printer? Something like (DOS days) pushing a keypress onto the
> > > > > key
> > > > > stack before calling a routine which then gets the keypress & returns
> > > > > with
> > > > > no user input needed. A thought....
> > > > 
> > > > I think I'd rather add a selectPrinter(objet printer) procedure. If
> > > > printer
> > > > is a sequence, it is a printer name string, and that will set designated
> > > > printer
> > > > as current printer. If name is unknown, fall back on getPrinterChoice().
> > > > How
> > > > about that?
> > > >
> > > 
> > > CChris, what you suggest is excellent; it would cover all cases beyond
> > > maybe
> > > having a routine which returns a list of the names of the printers
> > > available.
> > > Since I only want the default that is not something I'd ask for. Not yet!
> > > 
> > > I am content to wait for your doing this as and when you get around to it;
> > > it will be a useful upgrade to my code so I can do a Microsoft Word and
> > > just
> > > 
> > > have a button which prints all by itself. Magic.  I can use
> > > setPrintJobProperty()
> > > to do lots now with just a single click to accept the printer choice.
> > > 
> > > > > 
> > > > > I appreciate your work on Win32Lib enormously - as I do Derek's work
> > > > > and
> > > > > I guess David Cuny's, who started it. You guys all want medals - or
> > > > > money
> -</font></i>
> > > > > but not being Bill Gates's, you will get users complaining their model
> > > > > railway
> > > > > won't work right under Win32Lib or their printer keeps running out of
> > > > > ink
> or</font></i>
> > > > > something silly like that.  
> > > > > 
> > > > > Tough life, isn't it. You do have many fans, though!
> > > > > 
> > > > > AndyD
> > > >
> > > May I comment; when I said you guys all want medals etc, I meant DESERVE
> > > medals
> > > not want as in desire.... no offence meant.
> > >  
> > > > 
> > > > I expect more complaints about printing for the weeks ahead actually. 
> > > > The lib had just so many print features that were offered, but didn't
> > > > work.
> > > > As some start to, there will be more voices to ask for everything to
> > > > work right
> > > > out of the box, and I cannot test everything because I have one computer
> > > > and
> > > > two printers only (a laser and AdobePDF). That's why having a good pool
> > > > of
> testers</font></i>
> > > > to catch issues before release would tremendously help.
> > > > 
> > > > CChris
> > > 
> > > Hopefully not too many complaints - just helpful criticism as we try and
> > > do
> > > our job as testers. But it does sound like complaining to me though it is
> > > not meant that way..  
> > > 
> > > AndyD
> > 
> > Replace at line 1272 in w32resources.ew the text for getDefaultPrinter() by:
> > }}}
<eucode>
> > --/topic Printing
> > --/func getDefaultPrinter()
> > --/desc Like /getPrinter(), but assumes there is a default printer already
> > installed
> > --/ret (ATOM) DC for default printer
> > global function getDefaultPrinter()
> >     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
> >     setPrinterPointers(1)
> >     return printerDC
> > end function
> > </eucode>
{{{

> > 
> > Then, calling setPrintJobProperty() should update everything, but most
> > importantly
> > the printer itself. Let us know whether this is working better.
> > 
> > CChris
> 
> Line 1212 seems better - 1272 is in the middle of startPage(). I have put in
> the new version of getDefaultPrinter() code and I'll try it ASAP. Maybe it is
> just the testing version of Win32Lib I have now got.
> 
> AndyD

I just tried this but it seems no better. Here is the code I'm using; it
outputs in portrait mode to the printer.

--  code generated by Win32Lib IDE v1.1.0 Build Oct-07-2007

constant TheProgramType="exw" 
 
include Win32Lib.ew
without warning

--------------------------------------------------------------------------------
--  Window Window1
constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400, 300,
0, 0 )
constant PushButton2 = createEx( PushButton, "Print", Window1, 180, 120, 90, 30,
0, 0 )
---------------------------------------------------------

--------------------------------------------------------------------------------
procedure PushButton2_onClick (integer self, integer event, sequence
params)--params is ()
	VOID = getDefaultPrinter()
--	VOID = setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
	VOID = startDoc("fred")
	VOID = startPage()
	VOID = setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
	wPuts(Printer, "This is output on the default printer!")
	VOID = endPage()
	VOID = endDoc()
	releasePrinter()
	abort(0)
end procedure
setHandler( PushButton2, w32HClick, routine_id("PushButton2_onClick"))


WinMain( Window1,Normal )


Have I done something particularly daft? If not, have we any ideas?
AndyD

new topic     » goto parent     » topic index » view message » categorize

18. Re: setPrintJobProperty problem

Andy Drummond wrote:
> 
> Andy Drummond wrote:
> 
> I just tried this but it seems no better. Here is the code I'm using; it
> outputs in portrait mode to the printer.
> 
> }}}
<eucode>
> --  code generated by Win32Lib IDE v1.1.0 Build Oct-07-2007
> 
> constant TheProgramType="exw" 
>  
> include Win32Lib.ew
> without warning
> 
>
> --------------------------------------------------------------------------------
> --  Window Window1
> constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400, 300,
> 0, 0 )
> constant PushButton2 = createEx( PushButton, "Print", Window1, 180, 120, 90,
> 30, 0, 0 )
> ---------------------------------------------------------
> 
>
> --------------------------------------------------------------------------------
> procedure PushButton2_onClick (integer self, integer event, sequence
> params)--params is ()
> 	VOID = getDefaultPrinter()
> --	VOID = setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> 	VOID = startDoc("fred")
> 	VOID = startPage()
> 	VOID = setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> 	wPuts(Printer, "This is output on the default printer!")
> 	VOID = endPage()
> 	VOID = endDoc()
> 	releasePrinter()
> 	abort(0)
> end procedure
> setHandler( PushButton2, w32HClick, routine_id("PushButton2_onClick"))
> 
> 
> WinMain( Window1,Normal )
> </eucode>
{{{

> 
> Have I done something particularly daft? If not, have we any ideas?


AndyD:

What is JP_Orientation ??


Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

19. Re: setPrintJobProperty problem

Andy Drummond wrote:
> 
> CChris wrote:
> > 
> > Andy Drummond wrote:
> > > 
> > > CChris wrote:
> > > > 
> > > > 
> > > > Since getPrinterChoice() displays a dialog box where the user might
> > > > change
> settings,</font></i>
> > > > it has to check for these changes and make them effective for the
> > > > printer.
> That's</font></i>
> > > > a fair amount of code indeed.
> > > > 
> > > > > If so, should you add the getDefault Printer() to Win32Lib then I
> > > > > assume
> it</font></i>
> > > > > would set things up exactly the same as getPrinter()+OK does. Then it
> > > > > will
> > > > > work fine. I can wait; it is not a great pain like the press shift
> > > > > once
> pain.</font></i>
> > > > > 
> > > > 
> > > > The code I had posted was meant to be pasted in w32resources.ew, right
> > > > after
> > > > getPrinterChoice(). It will be in 70.2 anyway, probably with the
> > > > enhancements
> > > > suggested above.
> > > > 
> > > > > Is it possible to call getPrinter() with an argument which tells the
> > > > > routine
> > > > > the printer name to get or even just to imitate the press of OK for
> > > > > the
> > > > > default printer? Something like (DOS days) pushing a keypress onto the
> > > > > key
> > > > > stack before calling a routine which then gets the keypress & returns
> > > > > with
> > > > > no user input needed. A thought....
> > > > 
> > > > I think I'd rather add a selectPrinter(objet printer) procedure. If
> > > > printer
> > > > is a sequence, it is a printer name string, and that will set designated
> > > > printer
> > > > as current printer. If name is unknown, fall back on getPrinterChoice().
> > > > How
> > > > about that?
> > > >
> > > 
> > > CChris, what you suggest is excellent; it would cover all cases beyond
> > > maybe
> > > having a routine which returns a list of the names of the printers
> > > available.
> > > Since I only want the default that is not something I'd ask for. Not yet!
> > > 
> > > I am content to wait for your doing this as and when you get around to it;
> > > it will be a useful upgrade to my code so I can do a Microsoft Word and
> > > just
> > > 
> > > have a button which prints all by itself. Magic.  I can use
> > > setPrintJobProperty()
> > > to do lots now with just a single click to accept the printer choice.
> > > 
> > > > > 
> > > > > I appreciate your work on Win32Lib enormously - as I do Derek's work
> > > > > and
> > > > > I guess David Cuny's, who started it. You guys all want medals - or
> > > > > money
> -</font></i>
> > > > > but not being Bill Gates's, you will get users complaining their model
> > > > > railway
> > > > > won't work right under Win32Lib or their printer keeps running out of
> > > > > ink
> or</font></i>
> > > > > something silly like that.  
> > > > > 
> > > > > Tough life, isn't it. You do have many fans, though!
> > > > > 
> > > > > AndyD
> > > >
> > > May I comment; when I said you guys all want medals etc, I meant DESERVE
> > > medals
> > > not want as in desire.... no offence meant.
> > >  
> > > > 
> > > > I expect more complaints about printing for the weeks ahead actually. 
> > > > The lib had just so many print features that were offered, but didn't
> > > > work.
> > > > As some start to, there will be more voices to ask for everything to
> > > > work right
> > > > out of the box, and I cannot test everything because I have one computer
> > > > and
> > > > two printers only (a laser and AdobePDF). That's why having a good pool
> > > > of
> testers</font></i>
> > > > to catch issues before release would tremendously help.
> > > > 
> > > > CChris
> > > 
> > > Hopefully not too many complaints - just helpful criticism as we try and
> > > do
> > > our job as testers. But it does sound like complaining to me though it is
> > > not meant that way..  
> > > 
> > > AndyD
> > 
> > Replace at line 1272 in w32resources.ew the text for getDefaultPrinter() by:
> > }}}
<eucode>
> > --/topic Printing
> > --/func getDefaultPrinter()
> > --/desc Like /getPrinter(), but assumes there is a default printer already
> > installed
> > --/ret (ATOM) DC for default printer
> > global function getDefaultPrinter()
> >     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
> >     setPrinterPointers(1)
> >     return printerDC
> > end function
> > </eucode>
{{{

> > 
> > Then, calling setPrintJobProperty() should update everything, but most
> > importantly
> > the printer itself. Let us know whether this is working better.
> > 
> > CChris
> 
> Line 1212 seems better - 1272 is in the middle of startPage(). I have put in
> the new version of getDefaultPrinter() code and I'll try it ASAP. Maybe it is
> just the testing version of Win32Lib I have now got.
> 
> AndyD

No, but it already has the getDefaultPrinter() in w32resources.ew, so you only
need to stick the setPrinterPointers(1) in. Calling setPrintJobProperty() should
work then.

CChris

new topic     » goto parent     » topic index » view message » categorize

20. Re: setPrintJobProperty problem

Andy Drummond wrote:
> 
> Andy Drummond wrote:
> > 
> > CChris wrote:
> > > 
> > > Andy Drummond wrote:
> > > > 
> > > > CChris wrote:
> > > > > 
> > > > > 
> > > > > Since getPrinterChoice() displays a dialog box where the user might
> > > > > change
> > settings,</font></i>
> > > > > it has to check for these changes and make them effective for the
> > > > > printer.
> > That's</font></i>
> > > > > a fair amount of code indeed.
> > > > > 
> > > > > > If so, should you add the getDefault Printer() to Win32Lib then I
> > > > > > assume
> > it</font></i>
> > > > > > would set things up exactly the same as getPrinter()+OK does. Then
> > > > > > it will
> > > > > > work fine. I can wait; it is not a great pain like the press shift
> > > > > > once
> > pain.</font></i>
> > > > > > 
> > > > > 
> > > > > The code I had posted was meant to be pasted in w32resources.ew, right
> > > > > after
> > > > > getPrinterChoice(). It will be in 70.2 anyway, probably with the
> > > > > enhancements
> > > > > suggested above.
> > > > > 
> > > > > > Is it possible to call getPrinter() with an argument which tells the
> routine</font></i>
> > > > > > the printer name to get or even just to imitate the press of OK for
> > > > > > the
> > > > > > default printer? Something like (DOS days) pushing a keypress onto
> > > > > > the
> key</font></i>
> > > > > > stack before calling a routine which then gets the keypress &
> > > > > > returns
> with</font></i>
> > > > > > no user input needed. A thought....
> > > > > 
> > > > > I think I'd rather add a selectPrinter(objet printer) procedure. If
> > > > > printer
> > > > > is a sequence, it is a printer name string, and that will set
> > > > > designated
> printer</font></i>
> > > > > as current printer. If name is unknown, fall back on
> > > > > getPrinterChoice().
> How</font></i>
> > > > > about that?
> > > > >
> > > > 
> > > > CChris, what you suggest is excellent; it would cover all cases beyond
> > > > maybe
> > > > having a routine which returns a list of the names of the printers
> > > > available.
> > > > Since I only want the default that is not something I'd ask for. Not
> > > > yet!
> > > > 
> > > > I am content to wait for your doing this as and when you get around to
> > > > it;
> > > > it will be a useful upgrade to my code so I can do a Microsoft Word and
> > > > just
> > > > 
> > > > have a button which prints all by itself. Magic.  I can use
> > > > setPrintJobProperty()
> > > > to do lots now with just a single click to accept the printer choice.
> > > > 
> > > > > > 
> > > > > > I appreciate your work on Win32Lib enormously - as I do Derek's work
> > > > > > and
> > > > > > I guess David Cuny's, who started it. You guys all want medals - or
> > > > > > money
> > -</font></i>
> > > > > > but not being Bill Gates's, you will get users complaining their
> > > > > > model
> railway</font></i>
> > > > > > won't work right under Win32Lib or their printer keeps running out
> > > > > > of ink
> > or</font></i>
> > > > > > something silly like that.  
> > > > > > 
> > > > > > Tough life, isn't it. You do have many fans, though!
> > > > > > 
> > > > > > AndyD
> > > > >
> > > > May I comment; when I said you guys all want medals etc, I meant DESERVE
> > > > medals
> > > > not want as in desire.... no offence meant.
> > > >  
> > > > > 
> > > > > I expect more complaints about printing for the weeks ahead actually. 
> > > > > The lib had just so many print features that were offered, but didn't
> > > > > work.
> > > > > As some start to, there will be more voices to ask for everything to
> > > > > work
> right</font></i>
> > > > > out of the box, and I cannot test everything because I have one
> > > > > computer
> and</font></i>
> > > > > two printers only (a laser and AdobePDF). That's why having a good
> > > > > pool of
> > testers</font></i>
> > > > > to catch issues before release would tremendously help.
> > > > > 
> > > > > CChris
> > > > 
> > > > Hopefully not too many complaints - just helpful criticism as we try and
> > > > do
> > > > our job as testers. But it does sound like complaining to me though it
> > > > is
> > > > not meant that way..  
> > > > 
> > > > AndyD
> > > 
> > > Replace at line 1272 in w32resources.ew the text for getDefaultPrinter()
> > > by:
> > > }}}
<eucode>
> > > --/topic Printing
> > > --/func getDefaultPrinter()
> > > --/desc Like /getPrinter(), but assumes there is a default printer already
> > > installed
> > > --/ret (ATOM) DC for default printer
> > > global function getDefaultPrinter()
> > >     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
> > >     setPrinterPointers(1)
> > >     return printerDC
> > > end function
> > > </eucode>
{{{

> > > 
> > > Then, calling setPrintJobProperty() should update everything, but most
> > > importantly
> > > the printer itself. Let us know whether this is working better.
> > > 
> > > CChris
> > 
> > Line 1212 seems better - 1272 is in the middle of startPage(). I have put in
> > the new version of getDefaultPrinter() code and I'll try it ASAP. Maybe it
> > is
> > just the testing version of Win32Lib I have now got.
> > 
> > AndyD
> 
> I just tried this but it seems no better. Here is the code I'm using; it
> outputs in portrait mode to the printer.
> 
> }}}
<eucode>
> --  code generated by Win32Lib IDE v1.1.0 Build Oct-07-2007
> 
> constant TheProgramType="exw" 
>  
> include Win32Lib.ew
> without warning
> 
>
> --------------------------------------------------------------------------------
> --  Window Window1
> constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400, 300,
> 0, 0 )
> constant PushButton2 = createEx( PushButton, "Print", Window1, 180, 120, 90,
> 30, 0, 0 )
> ---------------------------------------------------------
> 
>
> --------------------------------------------------------------------------------
> procedure PushButton2_onClick (integer self, integer event, sequence
> params)--params is ()
> 	VOID = getDefaultPrinter()
> --	VOID = setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> 	VOID = startDoc("fred")
> 	VOID = startPage()
> 	VOID = setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> 	wPuts(Printer, "This is output on the default printer!")
> 	VOID = endPage()
> 	VOID = endDoc()
> 	releasePrinter()
> 	abort(0)
> end procedure
> setHandler( PushButton2, w32HClick, routine_id("PushButton2_onClick"))
> 
> 
> WinMain( Window1,Normal )
> </eucode>
{{{

> 
> Have I done something particularly daft? If not, have we any ideas?
> AndyD

Expected. Add the setPrinterPointers(1) call in getDefaultPrinter() and try it
again.

CChris

new topic     » goto parent     » topic index » view message » categorize

21. Re: setPrintJobProperty problem

CChris wrote:
> 
> Andy Drummond wrote:
> > 
> > Andy Drummond wrote:
> > > 
> > > CChris wrote:
> > > > 
> > > > Andy Drummond wrote:
> > > > > 
> > > > > CChris wrote:
> > > > > > 
> > > > > > 
> > > > > > Since getPrinterChoice() displays a dialog box where the user might
> > > > > > change
> > > settings,</font></i>
> > > > > > it has to check for these changes and make them effective for the
> > > > > > printer.
> > > That's</font></i>
> > > > > > a fair amount of code indeed.
> > > > > > 
> > > > > > > If so, should you add the getDefault Printer() to Win32Lib then I
> > > > > > > assume
> > > it</font></i>
> > > > > > > would set things up exactly the same as getPrinter()+OK does. Then
> it will</font></i>
> > > > > > > work fine. I can wait; it is not a great pain like the press shift
> > > > > > > once
> > > pain.</font></i>
> > > > > > > 
> > > > > > 
> > > > > > The code I had posted was meant to be pasted in w32resources.ew,
> > > > > > right
> after</font></i>
> > > > > > getPrinterChoice(). It will be in 70.2 anyway, probably with the
> > > > > > enhancements
> > > > > > suggested above.
> > > > > > 
> > > > > > > Is it possible to call getPrinter() with an argument which tells
> > > > > > > the
> > routine</font></i>
> > > > > > > the printer name to get or even just to imitate the press of OK
> > > > > > > for the
> > > > > > > default printer? Something like (DOS days) pushing a keypress onto
> > > > > > > the
> > key</font></i>
> > > > > > > stack before calling a routine which then gets the keypress &
> > > > > > > returns
> > with</font></i>
> > > > > > > no user input needed. A thought....
> > > > > > 
> > > > > > I think I'd rather add a selectPrinter(objet printer) procedure. If
> > > > > > printer
> > > > > > is a sequence, it is a printer name string, and that will set
> > > > > > designated
> > printer</font></i>
> > > > > > as current printer. If name is unknown, fall back on
> > > > > > getPrinterChoice().
> > How</font></i>
> > > > > > about that?
> > > > > >
> > > > > 
> > > > > CChris, what you suggest is excellent; it would cover all cases beyond
> > > > > maybe
> > > > > having a routine which returns a list of the names of the printers
> > > > > available.
> > > > > Since I only want the default that is not something I'd ask for. Not
> > > > > yet!
> > > > > 
> > > > > I am content to wait for your doing this as and when you get around to
> > > > > it;
> > > > > it will be a useful upgrade to my code so I can do a Microsoft Word
> > > > > and just
> > > > > 
> > > > > have a button which prints all by itself. Magic.  I can use
> > > > > setPrintJobProperty()
> > > > > to do lots now with just a single click to accept the printer choice.
> > > > > 
> > > > > > > 
> > > > > > > I appreciate your work on Win32Lib enormously - as I do Derek's
> > > > > > > work
> and</font></i>
> > > > > > > I guess David Cuny's, who started it. You guys all want medals -
> > > > > > > or
> money</font></i>
> > > -</font></i>
> > > > > > > but not being Bill Gates's, you will get users complaining their
> > > > > > > model
> > railway</font></i>
> > > > > > > won't work right under Win32Lib or their printer keeps running out
> > > > > > > of
> ink</font></i>
> > > or</font></i>
> > > > > > > something silly like that.  
> > > > > > > 
> > > > > > > Tough life, isn't it. You do have many fans, though!
> > > > > > > 
> > > > > > > AndyD
> > > > > >
> > > > > May I comment; when I said you guys all want medals etc, I meant
> > > > > DESERVE
> medals</font></i>
> > > > > not want as in desire.... no offence meant.
> > > > >  
> > > > > > 
> > > > > > I expect more complaints about printing for the weeks ahead
> > > > > > actually.
> > > > > > The lib had just so many print features that were offered, but
> > > > > > didn't
> work.</font></i>
> > > > > > As some start to, there will be more voices to ask for everything to
> > > > > > work
> > right</font></i>
> > > > > > out of the box, and I cannot test everything because I have one
> > > > > > computer
> > and</font></i>
> > > > > > two printers only (a laser and AdobePDF). That's why having a good
> > > > > > pool
> of</font></i>
> > > testers</font></i>
> > > > > > to catch issues before release would tremendously help.
> > > > > > 
> > > > > > CChris
> > > > > 
> > > > > Hopefully not too many complaints - just helpful criticism as we try
> > > > > and
> do</font></i>
> > > > > our job as testers. But it does sound like complaining to me though it
> > > > > is
> > > > > not meant that way..  
> > > > > 
> > > > > AndyD
> > > > 
> > > > Replace at line 1272 in w32resources.ew the text for getDefaultPrinter()
> > > > by:
> > > > }}}
<eucode>
> > > > --/topic Printing
> > > > --/func getDefaultPrinter()
> > > > --/desc Like /getPrinter(), but assumes there is a default printer
> > > > already installed
> > > > --/ret (ATOM) DC for default printer
> > > > global function getDefaultPrinter()
> > > >     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
> > > >     setPrinterPointers(1)
> > > >     return printerDC
> > > > end function
> > > > </eucode>
{{{

> > > > 
> > > > Then, calling setPrintJobProperty() should update everything, but most
> > > > importantly
> > > > the printer itself. Let us know whether this is working better.
> > > > 
> > > > CChris
> > > 
> > > Line 1212 seems better - 1272 is in the middle of startPage(). I have put
> > > in
> > > the new version of getDefaultPrinter() code and I'll try it ASAP. Maybe it
> > > is
> > > just the testing version of Win32Lib I have now got.
> > > 
> > > AndyD
> > 
> > I just tried this but it seems no better. Here is the code I'm using; it
> > outputs in portrait mode to the printer.
> > 
> > }}}
<eucode>
> > --  code generated by Win32Lib IDE v1.1.0 Build Oct-07-2007
> > 
> > constant TheProgramType="exw" 
> >  
> > include Win32Lib.ew
> > without warning
> > 
> >
> > --------------------------------------------------------------------------------
> > --  Window Window1
> > constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400,
> > 300, 0, 0 )
> > constant PushButton2 = createEx( PushButton, "Print", Window1, 180, 120, 90,
> > 30, 0, 0 )
> > ---------------------------------------------------------
> > 
> >
> > --------------------------------------------------------------------------------
> > procedure PushButton2_onClick (integer self, integer event, sequence
> > params)--params is ()
> > 	VOID = getDefaultPrinter()
> > --	VOID = setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> > 	VOID = startDoc("fred")
> > 	VOID = startPage()
> > 	VOID = setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE)
> > 	wPuts(Printer, "This is output on the default printer!")
> > 	VOID = endPage()
> > 	VOID = endDoc()
> > 	releasePrinter()
> > 	abort(0)
> > end procedure
> > setHandler( PushButton2, w32HClick, routine_id("PushButton2_onClick"))
> > 
> > 
> > WinMain( Window1,Normal )
> > </eucode>
{{{

> > 
> > Have I done something particularly daft? If not, have we any ideas?
> > AndyD
> 
> Expected. Add the setPrinterPointers(1) call in getDefaultPrinter() and try
> it again.
> 
> CChris

CChris, I *had* modified w32Resources.ew as you said. The actual code is:

global function getDefaultPrinter()
    printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
    setPrinterPointers(1)
    return printerDC
end function


That was copied direct from C:\Euphoria\Win32Lib\include\w32Resources.ew
I did say that I had put it into Win32Lib - about line 1212 in w32Resources.
So .... I carry on wondering what is going on! Or what I have done!!

AndyD

new topic     » goto parent     » topic index » view message » categorize

22. Re: setPrintJobProperty problem

<big snip/>

> CChris, I *had* modified w32Resources.ew as you said. The actual code is:
> 
> }}}
<eucode>
> global function getDefaultPrinter()
>     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
>     setPrinterPointers(1)
>     return printerDC
> end function
> </eucode>
{{{

> 
> That was copied direct from C:\Euphoria\Win32Lib\include\w32Resources.ew
> I did say that I had put it into Win32Lib - about line 1212 in w32Resources.
> So .... I carry on wondering what is going on! Or what I have done!!
> 
> AndyD

Ok, then I'll have to look at this more thoroughly. Tere's a long weekend ahead
for Nov. 1st, so I'll probably find some time to set that right.
Does the keyboard handler faultlessly work now?

CChris

new topic     » goto parent     » topic index » view message » categorize

23. Re: setPrintJobProperty problem

CChris wrote:
> 
> <big snip/>
> 
> > CChris, I *had* modified w32Resources.ew as you said. The actual code is:
> > 
> > }}}
<eucode>
> > global function getDefaultPrinter()
> >     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
> >     setPrinterPointers(1)
> >     return printerDC
> > end function
> > </eucode>
{{{

> > 
> > That was copied direct from C:\Euphoria\Win32Lib\include\w32Resources.ew
> > I did say that I had put it into Win32Lib - about line 1212 in w32Resources.
> > So .... I carry on wondering what is going on! Or what I have done!!
> > 
> > AndyD
> 
> Ok, then I'll have to look at this more thoroughly. Tere's a long weekend
> ahead
> for Nov. 1st, so I'll probably find some time to set that right.
> Does the keyboard handler faultlessly work now?
> 
> CChris

CChris,  I hardly dare say this - I was about to say the keyboard handler
seems fine now, but I just bound the IDE into an executable, and though it
seemed OK at first, I did manage to get the shift key effectively latched
down as far as the arrow keys are concerned. I also managed to get out of
that state, and I can't manage to do it again having been pretty unkind to
the system; randomly hitting the shift and the arrow keys and with the odd
enter key or delete key - I manage to wreck to text but the shift is still OK.

I think you had better call it OK until such time as I can really find a bug
and not just a one-off oddity. Good work.

AndyD

new topic     » goto parent     » topic index » view message » categorize

24. Re: setPrintJobProperty problem

CChris wrote:
> 
> <big snip/>
> 
> > CChris, I *had* modified w32Resources.ew as you said. The actual code is:
> > 
> > }}}
<eucode>
> > global function getDefaultPrinter()
> >     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
> >     setPrinterPointers(1)
> >     return printerDC
> > end function
> > </eucode>
{{{

> > 
> > That was copied direct from C:\Euphoria\Win32Lib\include\w32Resources.ew
> > I did say that I had put it into Win32Lib - about line 1212 in w32Resources.
> > So .... I carry on wondering what is going on! Or what I have done!!
> > 
> > AndyD
> 
> Ok, then I'll have to look at this more thoroughly. Tere's a long weekend
> ahead
> for Nov. 1st, so I'll probably find some time to set that right.
> Does the keyboard handler faultlessly work now?
> 
> CChris

I'm using the 70.2 file you sent and changed Generic.exw in the demos to use
VOID=getDefaultPrinter() instead of getPrinter(). I also added
VOID=setPrintJobProperty(JP_Orientation, DMORIENT_LANDSCAPE) right after
getDefaultPrinter(). I needed to click "OK" in one popped up Window but printing
shows the text in landscape as desired. I'm using a HP 5500 series All-In-One
printer. I have no idea what driver it uses.

judith

new topic     » goto parent     » topic index » view message » categorize

25. Re: setPrintJobProperty problem

Andy Drummond wrote:
> 
> CChris wrote:
> > 
> > <big snip/>
> > 
> > > CChris, I *had* modified w32Resources.ew as you said. The actual code is:
> > > 
> > > }}}
<eucode>
> > > global function getDefaultPrinter()
> > >     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
> > >     setPrinterPointers(1)
> > >     return printerDC
> > > end function
> > > </eucode>
{{{

> > > 
> > > That was copied direct from C:\Euphoria\Win32Lib\include\w32Resources.ew
> > > I did say that I had put it into Win32Lib - about line 1212 in
> > > w32Resources.
> > > So .... I carry on wondering what is going on! Or what I have done!!
> > > 
> > > AndyD
> > 
> > Ok, then I'll have to look at this more thoroughly. Tere's a long weekend
> > ahead
> > for Nov. 1st, so I'll probably find some time to set that right.
> > Does the keyboard handler faultlessly work now?
> > 
> > CChris
> 
> CChris,  I hardly dare say this - I was about to say the keyboard handler
> seems fine now, but I just bound the IDE into an executable, and though it
> seemed OK at first, I did manage to get the shift key effectively latched
> down as far as the arrow keys are concerned. I also managed to get out of
> that state, and I can't manage to do it again having been pretty unkind to
> the system; randomly hitting the shift and the arrow keys and with the odd
> enter key or delete key - I manage to wreck to text but the shift is still OK.
> 
> I think you had better call it OK until such time as I can really find a bug
> and not just a one-off oddity. Good work.
> 
> AndyD

Could you email me the bound IDE and the .prj file you were working on?
I assume you carefully checked that the bound executable included the right lib
version. Send this to cchris005 hat fastmail doubt fm ; I'll see whether I can
reproduce the oddity or not.

Since I have to consider including (part of) GrPrint.ew, and understand the
issue Bernie reported about getFontDialog(), the official next release isn't for
this weekend, so I can call it OK with a glimpse of a hideously elusive bug that
might still be lurking in the darkest alleys of the keyboard.

CChris

new topic     » goto parent     » topic index » view message » categorize

26. Re: setPrintJobProperty problem

Judith Evans wrote:
> 
> CChris wrote:
> > 
> > <big snip/>
> > 
> > > CChris, I *had* modified w32Resources.ew as you said. The actual code is:
> > > 
> > > }}}
<eucode>
> > > global function getDefaultPrinter()
> > >     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
> > >     setPrinterPointers(1)
> > >     return printerDC
> > > end function
> > > </eucode>
{{{

> > > 
> > > That was copied direct from C:\Euphoria\Win32Lib\include\w32Resources.ew
> > > I did say that I had put it into Win32Lib - about line 1212 in
> > > w32Resources.
> > > So .... I carry on wondering what is going on! Or what I have done!!
> > > 
> > > AndyD
> > 
> > Ok, then I'll have to look at this more thoroughly. Tere's a long weekend
> > ahead
> > for Nov. 1st, so I'll probably find some time to set that right.
> > Does the keyboard handler faultlessly work now?
> > 
> > CChris
> 
> I'm using the 70.2 file you sent and changed Generic.exw in the demos to use
> VOID=getDefaultPrinter() instead of getPrinter(). I also added
> VOID=setPrintJobProperty(JP_Orientation,
> DMORIENT_LANDSCAPE) right after getDefaultPrinter(). I needed to click "OK"
> in one popped up Window but printing shows the text in landscape as desired.
> I'm using a HP 5500 series All-In-One printer. I have no idea what driver it
> uses.
> 
> judith

Good news. Or bad news if the routine orks unreliably, depending to the printer.

If I remember correctly, in an earlier email long ago, you mentioned that your
print setup dialog box had some fields that weren't in mine.
I'm afraid that the superfluous dialog box is something some drivers dumbly
display even when obviously not needed. If someone knows better, I'll appreciate
the input. Otherwise, I'm simply afraid that the extra box may not be avoided
always, depending on the driver.

I may have an idea, involving a custom template for an invisible dialog box that
would close on open. Not for next version if this is the way to go.

CChris
btw can you determine which statement causes the dialog box to pop up, tracing
into w32resources.ew? I cannot test this atm.

new topic     » goto parent     » topic index » view message » categorize

27. Re: setPrintJobProperty problem

Andy Drummond wrote:
> 
> CChris wrote:
> > 
> > <big snip/>
> > 
> > > CChris, I *had* modified w32Resources.ew as you said. The actual code is:
> > > 
> > > }}}
<eucode>
> > > global function getDefaultPrinter()
> > >     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
> > >     setPrinterPointers(1)
> > >     return printerDC
> > > end function
> > > </eucode>
{{{

> > > 
> > > That was copied direct from C:\Euphoria\Win32Lib\include\w32Resources.ew
> > > I did say that I had put it into Win32Lib - about line 1212 in
> > > w32Resources.
> > > So .... I carry on wondering what is going on! Or what I have done!!
> > > 
> > > AndyD
> > 
> > Ok, then I'll have to look at this more thoroughly. Tere's a long weekend
> > ahead
> > for Nov. 1st, so I'll probably find some time to set that right.
> > Does the keyboard handler faultlessly work now?
> > 
> > CChris
> 
> CChris,  I hardly dare say this - I was about to say the keyboard handler
> seems fine now, but I just bound the IDE into an executable, and though it
> seemed OK at first, I did manage to get the shift key effectively latched
> down as far as the arrow keys are concerned. I also managed to get out of
> that state, and I can't manage to do it again having been pretty unkind to
> the system; randomly hitting the shift and the arrow keys and with the odd
> enter key or delete key - I manage to wreck to text but the shift is still OK.
> 
> I think you had better call it OK until such time as I can really find a bug
> and not just a one-off oddity. Good work.
> 
> AndyD

It just occurred to me that I had noticed strange things occurring with the
shift key at some point, and that I use Shift as the hotkey for AllChars.
Shutting the program down removed the problem.
Perhaps could you try shutting it down and run IDE again?

CChris

new topic     » goto parent     » topic index » view message » categorize

28. Re: setPrintJobProperty problem

CChris wrote:
> 
> It just occurred to me that I had noticed strange things occurring with the
> shift key at some point, and that I use Shift as the hotkey for AllChars.
> Shutting
> the program down removed the problem.
> Perhaps could you try shutting it down and run IDE again?

I think I filed a bug report somewhere for IDE, but if I open it up and go
to the editor, then press and release the Shift key, it stays on as though
locked. This also happens for the Ctrl key. Very aggravating! :)

new topic     » goto parent     » topic index » view message » categorize

29. Re: setPrintJobProperty problem

CChris wrote:
> 
> It just occurred to me that I had noticed strange things occurring with the
> shift key at some point, and that I use Shift as the hotkey for AllChars.
> Shutting
> the program down removed the problem.
> Perhaps could you try shutting it down and run IDE again?
> 
> CChris

Still it seems fine - shutting down AllChars still kept it fine.
Looks like the keyboard "funny" has been trodden on hard.
Shame about the print orientation, though...

AndyD

new topic     » goto parent     » topic index » view message » categorize

30. Re: setPrintJobProperty problem

c.k.lester wrote:
> 
> CChris wrote:
> > 
> > It just occurred to me that I had noticed strange things occurring with the
> > shift key at some point, and that I use Shift as the hotkey for AllChars.
> > Shutting
> > the program down removed the problem.
> > Perhaps could you try shutting it down and run IDE again?
> 
> I think I filed a bug report somewhere for IDE, but if I open it up and go
> to the editor, then press and release the Shift key, it stays on as though
> locked. This also happens for the Ctrl key. Very aggravating! :)

I think we will find CChris has squashed that bug - I guess it will be appearing
pretty soon. It was, as you say, very aggravating!!

AndyD

new topic     » goto parent     » topic index » view message » categorize

31. Re: setPrintJobProperty problem

CChris wrote:
> snip
> > I'm using the 70.2 file you sent and changed Generic.exw in the demos to use
> > VOID=getDefaultPrinter() instead of getPrinter(). I also added
> > VOID=setPrintJobProperty(JP_Orientation,
> > DMORIENT_LANDSCAPE) right after getDefaultPrinter(). I needed to click "OK"
> > in one popped up Window but printing shows the text in landscape as desired.
> > I'm using a HP 5500 series All-In-One printer. I have no idea what driver it
> > uses.
> > 
> > judith
> 
> Good news. Or bad news if the routine orks unreliably, depending to the
> printer.
> 
> If I remember correctly, in an earlier email long ago, you mentioned that your
> print setup dialog box had some fields that weren't in mine. 
> I'm afraid that the superfluous dialog box is something some drivers dumbly
> display even when obviously not needed. If someone knows better, I'll
> appreciate
> the input. Otherwise, I'm simply afraid that the extra box may not be avoided
> always, depending on the driver.
> 
> I may have an idea, involving a custom template for an invisible dialog box
> that would close on open. Not for next version if this is the way to go.
> 
> CChris
> btw can you determine which statement causes the dialog box to pop up, tracing
> into w32resources.ew? I cannot test this atm.

I'm drawing a complete blank about extra fields in dialop box. I'll sleep on it
and maybe remember tomorrow.
I'll see if I can find where the dialog bog pops up.

judith

new topic     » goto parent     » topic index » view message » categorize

32. Re: setPrintJobProperty problem

CChris wrote:
> 
> Judith Evans wrote:
> > 
> > CChris wrote:
> > > 
> > > <big snip/>
> > > 
> > > > CChris, I *had* modified w32Resources.ew as you said. The actual code
> > > > is:
> > > > 
> > > > }}}
<eucode>
> > > > global function getDefaultPrinter()
> > > >     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
> > > >     setPrinterPointers(1)
> > > >     return printerDC
> > > > end function
> > > > </eucode>
{{{

> > > > 
> > > > That was copied direct from C:\Euphoria\Win32Lib\include\w32Resources.ew
> > > > I did say that I had put it into Win32Lib - about line 1212 in
> > > > w32Resources.
> > > > So .... I carry on wondering what is going on! Or what I have done!!
> > > > 
> > > > AndyD
> > > 
> > > Ok, then I'll have to look at this more thoroughly. Tere's a long weekend
> > > ahead
> > > for Nov. 1st, so I'll probably find some time to set that right.
> > > Does the keyboard handler faultlessly work now?
> > > 
> > > CChris
> > 
> > I'm using the 70.2 file you sent and changed Generic.exw in the demos to use
> > VOID=getDefaultPrinter() instead of getPrinter(). I also added
> > VOID=setPrintJobProperty(JP_Orientation,
> > DMORIENT_LANDSCAPE) right after getDefaultPrinter(). I needed to click "OK"
> > in one popped up Window but printing shows the text in landscape as desired.
> > I'm using a HP 5500 series All-In-One printer. I have no idea what driver it
> > uses.
> > 
> > judith
> 
> Good news. Or bad news if the routine orks unreliably, depending to the
> printer.
> 
> If I remember correctly, in an earlier email long ago, you mentioned that your
> print setup dialog box had some fields that weren't in mine. 
> I'm afraid that the superfluous dialog box is something some drivers dumbly
> display even when obviously not needed. If someone knows better, I'll
> appreciate
> the input. Otherwise, I'm simply afraid that the extra box may not be avoided
> always, depending on the driver.
> 
> I may have an idea, involving a custom template for an invisible dialog box
> that would close on open. Not for next version if this is the way to go.
> 
> CChris
> btw can you determine which statement causes the dialog box to pop up, tracing
> into w32resources.ew? I cannot test this atm.

I missed that after the printer is assigned in generic.exw in printdoc routine
there is a getPageSetup(). If I comment that then the text is in Portrait just as
Andy said he experienced. My tests using Generic.exw opened the getPageSetup
dialog where landscape radio button is checked so naturally I got Landscape
print.

Sorry for the confusion.

judith

new topic     » goto parent     » topic index » view message » categorize

33. Re: setPrintJobProperty problem

Judith Evans wrote:
> 
> CChris wrote:
> > 
> > Judith Evans wrote:
> > > 
> > > CChris wrote:
> > > > 
> > > > <big snip/>
> > > > 
> > > > > CChris, I *had* modified w32Resources.ew as you said. The actual code
> > > > > is:
> > > > > 
> > > > > }}}
<eucode>
> > > > > global function getDefaultPrinter()
> > > > >     printerDC = w32Func(xCreateDC,{wsp,pname,0,0})
> > > > >     setPrinterPointers(1)
> > > > >     return printerDC
> > > > > end function
> > > > > </eucode>
{{{

> > > > > 
> > > > > That was copied direct from
> > > > > C:\Euphoria\Win32Lib\include\w32Resources.ew
> > > > > I did say that I had put it into Win32Lib - about line 1212 in
> > > > > w32Resources.
> > > > > So .... I carry on wondering what is going on! Or what I have done!!
> > > > > 
> > > > > AndyD
> > > > 
> > > > Ok, then I'll have to look at this more thoroughly. Tere's a long
> > > > weekend ahead
> > > > for Nov. 1st, so I'll probably find some time to set that right.
> > > > Does the keyboard handler faultlessly work now?
> > > > 
> > > > CChris
> > > 
> > > I'm using the 70.2 file you sent and changed Generic.exw in the demos to
> > > use
> > > VOID=getDefaultPrinter() instead of getPrinter(). I also added
> > > VOID=setPrintJobProperty(JP_Orientation,
> > > DMORIENT_LANDSCAPE) right after getDefaultPrinter(). I needed to click
> > > "OK"
> > > in one popped up Window but printing shows the text in landscape as
> > > desired.
> > > I'm using a HP 5500 series All-In-One printer. I have no idea what driver
> > > it
> > > uses.
> > > 
> > > judith
> > 
> > Good news. Or bad news if the routine orks unreliably, depending to the
> > printer.
> > 
> > If I remember correctly, in an earlier email long ago, you mentioned that
> > your
> > print setup dialog box had some fields that weren't in mine. 
> > I'm afraid that the superfluous dialog box is something some drivers dumbly
> > display even when obviously not needed. If someone knows better, I'll
> > appreciate
> > the input. Otherwise, I'm simply afraid that the extra box may not be
> > avoided
> > always, depending on the driver.
> > 
> > I may have an idea, involving a custom template for an invisible dialog box
> > that would close on open. Not for next version if this is the way to go.
> > 
> > CChris
> > btw can you determine which statement causes the dialog box to pop up,
> > tracing
> > into w32resources.ew? I cannot test this atm.
> 
> I missed that after the printer is assigned in generic.exw in printdoc routine
> there is a getPageSetup(). If I comment that then the text is in Portrait just
> as Andy said he experienced. My tests using Generic.exw opened the
> getPageSetup
> dialog where landscape radio button is checked so naturally I got Landscape
> print.
> 
> Sorry for the confusion.
> 
> judith

Ok, so the issue is: how to alter the page setup without the dialog box? I'll
check this week, not sure there is an easy way that works everywhere.

CChris

new topic     » goto parent     » topic index » view message » categorize

34. Re: setPrintJobProperty problem

Judith Evans wrote:
> 
> CChris wrote:
> > snip
> > > I'm using the 70.2 file you sent and changed Generic.exw in the demos to
> > > use
> > > VOID=getDefaultPrinter() instead of getPrinter(). I also added
> > > VOID=setPrintJobProperty(JP_Orientation,
> > > DMORIENT_LANDSCAPE) right after getDefaultPrinter(). I needed to click
> > > "OK"
> > > in one popped up Window but printing shows the text in landscape as
> > > desired.
> > > I'm using a HP 5500 series All-In-One printer. I have no idea what driver
> > > it
> > > uses.
> > > 
> > > judith
> > 
> > Good news. Or bad news if the routine orks unreliably, depending to the
> > printer.
> > 
> > If I remember correctly, in an earlier email long ago, you mentioned that
> > your
> > print setup dialog box had some fields that weren't in mine. 
> > I'm afraid that the superfluous dialog box is something some drivers dumbly
> > display even when obviously not needed. If someone knows better, I'll
> > appreciate
> > the input. Otherwise, I'm simply afraid that the extra box may not be
> > avoided
> > always, depending on the driver.
> > 
> > I may have an idea, involving a custom template for an invisible dialog box
> > that would close on open. Not for next version if this is the way to go.
> > 
> > CChris
> > btw can you determine which statement causes the dialog box to pop up,
> > tracing
> > into w32resources.ew? I cannot test this atm.
> 
> I'm drawing a complete blank about extra fields in dialop box. I'll sleep on
> it and maybe remember tomorrow.
> I'll see if I can find where the dialog bog pops up.
> 
> judith

On Jun 25, 2007, I sent you an email with a screenshot of the print dialog I get
(ps.bmp), which doesn't have the orientation field displayed, while apparently
yours does. And I wrote:
| On my home system at least (and here in office as well - see attachment), the
| Print Setup page does not show page orientation, even when there is an
"option"
| tab. 

CChris

new topic     » goto parent     » topic index » view message » categorize

35. Re: setPrintJobProperty problem

Judith Evans wrote:
> 
> 
> I missed that after the printer is assigned in generic.exw in printdoc routine
> there is a getPageSetup(). If I comment that then the text is in Portrait just
> as Andy said he experienced. My tests using Generic.exw opened the
> getPageSetup
> dialog where landscape radio button is checked so naturally I got Landscape
> print.
> 
> Sorry for the confusion.
> 
> judith

Interestingly, if you call setPrinterJobProperty() and set the orientation
to lanscape in there, and then call getPageSetup(), that latter routine
shows the orientation as landscape. Pressing OK makes it print landscape.

If you hit cancel instead, even though it showed landscape, it prints portrait.
It looks as if setting the orientation has set the input to getPageSetup() but
that the result of that routine still defaults to the default page setup, i.e.
portrait. It is very strange.

AndyD

new topic     » goto parent     » topic index » view message » categorize

36. Re: setPrintJobProperty problem

Andy Drummond wrote:

> Interestingly, if you call setPrinterJobProperty() and set the orientation
> to lanscape in there, and then call getPageSetup(), that latter routine
> shows the orientation as landscape. Pressing OK makes it print landscape.
> 
> If you hit cancel instead, even though it showed landscape, it prints
> portrait.
> It looks as if setting the orientation has set the input to getPageSetup() but
> that the result of that routine still defaults to the default page setup, i.e.
> portrait. It is very strange.
> 

AndyD:

It seems to me that is the way it should work; if you cancel the

page setup then it should return to the previous page setting.


Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

37. Re: setPrintJobProperty problem

Andy and Judith:

Using win98; if you goto the control panel.

Right click on the installed printer.

Select properties and on the property dialog select paper.

There is a radio button that selects if the default paper orientation

is landscape or portrait.

If you change it you will find that whatever this is set to

will be what the printer is defaulting to in page setup.

So it looks like the only way to change it by page setup box.

Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

38. Re: setPrintJobProperty problem

Bernie Ryan wrote:
> 
> 
> Andy and Judith:
> 
> Using win98; if you goto the control panel.
> 
> Right click on the installed printer.
> 
> Select properties and on the property dialog select paper.
> 
> There is a radio button that selects if the default paper orientation
> 
> is landscape or portrait.
> 
> If you change it you will find that whatever this is set to
> 
> will be what the printer is defaulting to in page setup.
> 
> So it looks like the only way to change it by page setup box.
> 
> Bernie
> 

Bernie,

the point is NOT to merely select the default orientation for a printer,
but to be able to make it print in whichever orientation I want under program
control rather than under manual intervention control.

If I use the getPefaultPrinter() call, then setPrinterJobPriority() to set the
orientation to landscape - i.e. different from the default orientation - then
print, it still prints in portrait. But if I use the pageSetup() call, THAT
shows the orientation is in landscape (as requested) but hitting cancel still
causes the print to be in portrait. So although the apparent orientation had
been set, as shown by setPageSetup(), it wasn't changed as far as actual
printing is concerned.

What I want to be able to do is click a button to print to the default printer
and then for the program to decide whether it wants portrait or landscape 
orientation according to the data to be printed.  This is particularly
relevant to unmanned programs which just print as required with no-one there
to look at the data and decide which way round the paper ought to be.

Apart from which, it should be possible, even fairly straightforward, to be
able to make things do what you want in Windows. In reality it is an absolute
pain - as colored buttons turned out to be. Why on Earth can't you simply set
the color of a button in Windows? Why must it be BTNFACE for all buttons?
Same for printing - I need to print to the default printer (and later to be
able to choose the printer under software control) and then print to it the
way I want. I don't like being forced to jump through Bill Gates' hoops!

Trouble is, I need wonderful prople like Judith and CChris to get around these
problems, I am totally incapable of this kind of chicanery.

Andy

new topic     » goto parent     » topic index » view message » categorize

39. Re: setPrintJobProperty problem

Andy Drummond wrote:
> 
> 
> the point is NOT to merely select the default orientation for a printer,
> but to be able to make it print in whichever orientation I want under program
> control rather than under manual intervention control.
> 
> If I use the getPefaultPrinter() call, then setPrinterJobPriority() to set the
> orientation to landscape - i.e. different from the default orientation - then
> print, it still prints in portrait. But if I use the pageSetup() call, THAT
> shows the orientation is in landscape (as requested) but hitting cancel still
> causes the print to be in portrait. So although the apparent orientation had
> been set, as shown by setPageSetup(), it wasn't changed as far as actual
> printing is concerned.
> 
> What I want to be able to do is click a button to print to the default printer
> and then for the program to decide whether it wants portrait or landscape 
> orientation according to the data to be printed.  This is particularly
> relevant to unmanned programs which just print as required with no-one there
> to look at the data and decide which way round the paper ought to be.
> 
> Apart from which, it should be possible, even fairly straightforward, to be
> able to make things do what you want in Windows. In reality it is an absolute
> pain - as colored buttons turned out to be. Why on Earth can't you simply set
> the color of a button in Windows? Why must it be BTNFACE for all buttons?
> Same for printing - I need to print to the default printer (and later to be
> able to choose the printer under software control) and then print to it the
> way I want. I don't like being forced to jump through Bill Gates' hoops!
> 
> Trouble is, I need wonderful prople like Judith and CChris to get around these
> problems, I am totally incapable of this kind of chicanery.
> 

Andy:

Why can't you just install two different printers  in the CONTROL PANEL

using the SAME printer.

Call one my_portrait_printer and the other my_landscape_printer.

Then setup each for the defaults that you want.

Then you can decide which orientation you need and send it to the

correct installed printer.

Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

40. Re: setPrintJobProperty problem

Bernie Ryan wrote:
> 
> Andy Drummond wrote:
> > 
> > 
> > the point is NOT to merely select the default orientation for a printer,
> > but to be able to make it print in whichever orientation I want under
> > program
> > control rather than under manual intervention control.
> > 
> > If I use the getPefaultPrinter() call, then setPrinterJobPriority() to set
> > the
> > orientation to landscape - i.e. different from the default orientation -
> > then
> > print, it still prints in portrait. But if I use the pageSetup() call, THAT
> > shows the orientation is in landscape (as requested) but hitting cancel
> > still
> > causes the print to be in portrait. So although the apparent orientation had
> > been set, as shown by setPageSetup(), it wasn't changed as far as actual
> > printing is concerned.
> > 
> > What I want to be able to do is click a button to print to the default
> > printer
> > and then for the program to decide whether it wants portrait or landscape 
> > orientation according to the data to be printed.  This is particularly
> > relevant to unmanned programs which just print as required with no-one there
> > to look at the data and decide which way round the paper ought to be.
> > 
> > Apart from which, it should be possible, even fairly straightforward, to be
> > able to make things do what you want in Windows. In reality it is an
> > absolute
> > pain - as colored buttons turned out to be. Why on Earth can't you simply
> > set
> > the color of a button in Windows? Why must it be BTNFACE for all buttons?
> > Same for printing - I need to print to the default printer (and later to be
> > able to choose the printer under software control) and then print to it the
> > way I want. I don't like being forced to jump through Bill Gates' hoops!
> > 
> > Trouble is, I need wonderful prople like Judith and CChris to get around
> > these
> > problems, I am totally incapable of this kind of chicanery.
> > 
> 
> Andy:
> 
> Why can't you just install two different printers  in the CONTROL PANEL
> 
> using the SAME printer.
> 
> Call one my_portrait_printer and the other my_landscape_printer.
> 
> Then setup each for the defaults that you want.
> 
> Then you can decide which orientation you need and send it to the
> 
> correct installed printer.
> 
> Bernie
> 
> My files in archive:
> WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>

  Yes,yes 

 This is exactly what I was going to post before I read Bernie's.

Don Cole

new topic     » goto parent     » topic index » view message » categorize

41. Re: setPrintJobProperty problem

> 
> Andy:
> 
> Why can't you just install two different printers  in the CONTROL PANEL
> 
> using the SAME printer.
> 
> Call one my_portrait_printer and the other my_landscape_printer.
> 
> Then setup each for the defaults that you want.
> 
> Then you can decide which orientation you need and send it to the
> 
> correct installed printer.
> 
> Bernie
> 
> My files in archive:
> WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 
> 
> Can be downloaded here:
> <a
> href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan</a>

Now I hate to say it, but that is quite a sensible idea. It does mean I have
to be able to select a printer using its name, which is something I can't do
yet either, since I can't have both being "the default printer". It is worth
a coat of looking-at, as my boss says.
I'm not sure it is a nice solution because if I can't change orientation under
software control then I can't change anything else either - and I can't have
a printer setup for every variant I may want. Yes, I only want orientation
now, but it has the feeling of being an aspirin not a cure!

Andy

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu