RE: [PATCH] implementation of determine_screen_width() for Window s

2004-01-28 Thread Herold Heiko
Works fine for me on Winnt 4.0 sp6a (cmd windows with column sizes != 80 now
use the whole line for the progress bar), compiled with MSVC.
A binary with that patch is available from
http://xoomer.virgilio.it/hherold/ 
In order to test just open a command window with a buffer column size !=80,
the progress bar now should use the whole line.
Anyone who can test this on different platfroms (windows 95/98/ME/2000/XP)
should please report to the list.
Anyone who can compile this with different compilers (watcom, cygwin, mingw,
borland) should please report to the list.
If no problems arise I'd vote for inclusion in cvs.

Note: for a complete look-and-feel similar to the unix version we still need
a detection when the size changes (on unix this is done with
received_sigwinch in bar_create and bar_update), if this is possible.
Currently if the cmd window is resized on the fly (as a matter of fact the
window buffer size, not the real window) the progress bar continues to use
the old size.
Still from a usability point of view this patch is already a lot better than
the old behaviour (DEFAULT_SCREEN_WIDTH).

Heiko 

-- 
-- PREVINET S.p.A. www.previnet.it
-- Heiko Herold [EMAIL PROTECTED]
-- +39-041-5907073 ph
-- +39-041-5907472 fax

 -Original Message-
 From: David Fritz [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 28, 2004 4:33 AM
 To: [EMAIL PROTECTED]
 Subject: [PATCH] implementation of determine_screen_width() 
 for Windows
 
 
 Attached is a small patch that implements 
 determine_screen_width() for 
 the Windows build.
 
 Cheers
 
 


Re: [PATCH] implementation of determine_screen_width() for Window s

2004-01-28 Thread Hrvoje Niksic
[ This discussion is about a patch that determines the screen width on
  Windows console. ]

Herold Heiko [EMAIL PROTECTED] writes:

 Note: for a complete look-and-feel similar to the unix version we
 still need a detection when the size changes (on unix this is done
 with received_sigwinch in bar_create and bar_update), if this is
 possible.

Yes.  Specifically, Unix's SIGWINCH simply sets a flag that means
window size might have changed, please check it out.  That is
because checking window size on each refresh would perform an
unnecessary ioctl.

One thing we could do for Windows is check for window size every
second or so.


RE: [PATCH] implementation of determine_screen_width() for Window s

2004-01-28 Thread Herold Heiko
 From: Hrvoje Niksic [mailto:[EMAIL PROTECTED]
..
 Yes.  Specifically, Unix's SIGWINCH simply sets a flag that means
 window size might have changed, please check it out.  That is
 because checking window size on each refresh would perform an
 unnecessary ioctl.
 
 One thing we could do for Windows is check for window size every
 second or so.

I agree, but I have no idea how taxing those GetStdHandle() and
GetConsoleScreenBufferInfo() are.
Maybe David can shed more light on this, or even profile a bit.
Possibly the handle could be cached, saving at least the GetStdHandle() bit.

Heiko

-- 
-- PREVINET S.p.A. www.previnet.it
-- Heiko Herold [EMAIL PROTECTED]
-- +39-041-5907073 ph
-- +39-041-5907472 fax