Board index » delphi » Re: Benefits of dual monitor system

Re: Benefits of dual monitor system


2005-12-02 01:41:57 AM
delphi133
Quote
Is it possible to make Delphi to start the application on second monitor.
Right now, I have to start the application main form each time, then drag
it to the second monitor.
Hi,
It's really easy to methods into your app's main form to save/restore its
position each time it is run.
This is a nice friendly feature for end users as well.
If you save into an INI file in Documents and Settings\username\...
or into the HKCU section of the registry, then each user keeps his
own settings.
Example methods below (please excuse the blatant use of 'with' blocks -
I'm trying to phase it out honest!
// call this method from main form's OnCreate event handler
procedure TTrDumpForm.LoadWindowPos;
var
R: TRect;
begin
{ load last window size/position from USER.INI }
try
with TIniFile.Create(GetUserIniName) do try
with TStringList.Create do try
// restore main form size/position
CommaText := ReadString(ProgName,USER_POSITION,'');
if Count>0 then begin
R.Left := StrToInt(Strings[0]);
R.Top := StrToInt(Strings[1]);
R.Right := StrToInt(Strings[2]);
R.Bottom := StrToInt(Strings[3]);
BoundsRect := R;
end;
finally
Free; {TStringList}
end;
finally
Free; {TIniFile}
end;
except
{ ignore any exceptions }
end;
end;
// call this method from main form's OnDestroy event handler
procedure TTrDumpForm.SaveWindowPos;
var
wp: TWindowPlacement;
begin
{ save window position to USER.INI }
wp.length := SizeOf(TWindowPlacement);
GetWindowPlacement(Self.Handle,@wp);
{ if window is maximised or minimised, this gets normal position }
try
with TIniFile.Create(GetUserIniName) do try
with TStringList.Create do try
Add(IntToStr(wp.rcNormalPosition.Left));
Add(IntToStr(wp.rcNormalPosition.Top));
Add(IntToStr(wp.rcNormalPosition.Right));
Add(IntToStr(wp.rcNormalPosition.Bottom));
WriteString(ProgName,USER_POSITION,CommaText);
finally
Free; {TStringList}
end;
finally
Free; {TIniFile}
end;
except
{ignore exceptions}
end;
end;
The implementation of GetUserIniName is left as an exercise!
The only potential issue is when using roaming profiles on
PCs with different screen sizes. Before setting BoundsRect in
LoadwindowPos, you should check that the coords are within the
current screen range.
Cheers,
Chris
 
 

Re: Benefits of dual monitor system

Quote
Wouldn't it help if you put the Delphi IDE on the second monitor and
keep the application on the primary instead?
That's the easiest way!
Tiger
 

Re: Benefits of dual monitor system

Mike Swaim writes:
Quote
As far as single displays go, nothing
beats a 60" flat panel.
What's the resolution on it?
--
John Kaster blogs.borland.com/johnk
Features and bugs: qc.borland.com
Get source: cc.borland.com
If it is not here, it is not happening: ec.borland.com
 

Re: Benefits of dual monitor system

John Kaster (Borland) writes:
Quote
Mike Swaim writes:

>As far as single displays go, nothing
>beats a 60" flat panel.

What's the resolution on it?
I'm not sure. However, everything was legible from 8 feet away.
--
Mike Swaim XXXX@XXXXX.COM at home | Quote: "Boingie"^4 Y,W & D
MD Anderson Dept. of Biostatistics & Applied Mathematics
XXXX@XXXXX.COM or XXXX@XXXXX.COM at work
ICBM: 29.763N 95.363W|Disclaimer: Yeah, like I speak for MD Anderson.
 

Re: Benefits of dual monitor system

Chris Morgan writes:
Quote
(please excuse the blatant use of 'with' blocks
- I am trying to phase it out honest!

except
{ ignore any exceptions }
end;
Ahem! Are you trying to phase this out as well?
Quote
The only potential issue is when using roaming profiles on
PCs with different screen sizes. Before setting BoundsRect in
LoadwindowPos, you should check that the coords are within the
current screen range.
Yes, please! My main development machine is a laptop. At the office,
I have two desktops. But when I go home, I don't use a second monitor.
You would *not* believe the number of applications that load themselves
in the second desktop, even when the second desktop is disabled. Ok,
maybe you would. Outlook is the only application I use regularly that
will load on the main monitor when the second desktop is disabled.
--
Jon Robertson
Borland Certified Advanced Delphi 7 Developer
MedEvolve, Inc
www.medevolve.com
 

Re: Benefits of dual monitor system

"Tiger" <XXXX@XXXXX.COM>skrev i meddelandet
Quote
Is it possible to make Delphi to start the application on second monitor.
Right now, I have to start the application main form each time, then drag it
to the second monitor.

Tiger

One easy way is to hardcode its position in the ObjectInspector like:
Position = poDefault
Left = -700
top = 200
It also depend of right/left position of the secondary monitor of course.
/ia
 

Re: Benefits of dual monitor system

"Ingvar Anderberg" <XXXX@XXXXX.COM>skrev i meddelandet news:438f5f52$XXXX@XXXXX.COM...
Quote

Position = poDefault
Left = -700
top = 200

It also depend of right/left position of the secondary monitor of course.
Position = poDesigned
....
it should be
 

Re: Benefits of dual monitor system

Hannes Danzl[NDD] writes:
Quote
I'm wondering about the prices...
Probably about 1.2 to 1.5 times the price of each monitor as a
stand-alone ...
--
John Kaster blogs.borland.com/johnk
Features and bugs: qc.borland.com
Get source: cc.borland.com
If it is not here, it is not happening: ec.borland.com
 

Re: Benefits of dual monitor system

mamcx writes:
Quote
Michael Kelley writes:
>Or if desk space is a bit short (and you have a really big desk)
>www.go-l.com/monitors/athens/features/index.htm

Hey, this is real? i wonder for some time if the products in this
page a are a real thing...
Looks like an elaborate hoax, but the monitors look nice anyway.
--
Jan Nordén
Senior Software Architect
MDA products group
 

Re: Benefits of dual monitor system

Quote
>except
>{ ignore any exceptions }
>end;

Ahem! Are you trying to phase this out as well?
It is a bit extreme yes, but I am deliberately ignoring
exceptions here as occassionally our software is run from
a CD-ROM or other read-only medium. Maybe I should catch
explicit exceptions here, but hey, life's too short!
Quote

>The only potential issue is when using roaming profiles on
>PCs with different screen sizes. Before setting BoundsRect in
>LoadwindowPos, you should check that the coords are within the
>current screen range.

Yes, please! My main development machine is a laptop. At the office,
I have two desktops. But when I go home, I don't use a second monitor.

You would *not* believe the number of applications that load themselves
in the second desktop, even when the second desktop is disabled. Ok,
maybe you would. Outlook is the only application I use regularly that
will load on the main monitor when the second desktop is disabled.
I know - Internet Explorer is one of the worst offenders!
I've got another version of the LoadWindowPos somewhere
which calls the Windows API SetWindowPlacement. This API
actually automatically adjusts the supplied coords if the window is
not visible, which is very handy.
Cheers,
Chris
 

Re: Benefits of dual monitor system

Well, AFAIK that named company folded long time ago and always also had a
bad reputation for offering/selling a lot of vapoware. The only thing they
always did perfectly, was to present the vapoware in a nice (from Apple
stolen) manner on their website. The way they presented things attracted a
lot of people, but those who tried to deal with them can tell you bad horror
stories.
In other words, web content -as printed paper too- is often so called very
patient, but also very often it is content doesn't reflect the truth reality!
"Jan Nordén [Borland]" <XXXX@XXXXX.COM>schrieb im Newsbeitrag
Quote
mamcx writes:

>Michael Kelley writes:
>>Or if desk space is a bit short (and you have a really big desk)
>>www.go-l.com/monitors/athens/features/index.htm
>
>Hey, this is real? i wonder for some time if the products in this
>page a are a real thing...

Looks like an elaborate hoax, but the monitors look nice anyway.



--
Jan Nordén
Senior Software Architect
MDA products group
 

Re: Benefits of dual monitor system

John Kaster (Borland) writes:
Quote
Mike Swaim writes:

>As far as single displays go, nothing
>beats a 60" flat panel.

What's the resolution on it?
You're probably not going to see much beyond 1366x768. You can get as
high as 1920x1080, but you pay a premium and have to be careful as some
manufacturers cheat on this a little. Impressive sounding size, but
not much in the way of real estate. Better for public displays than a
computer monitor.
That 30" LCD that runs at 2560x1600 is pretty impressive. Prices are
coming down, but it is still a little costly and needs a special video
card. The 20" and 23"/24" wide screen LCDs are getting pretty
reasonable now. Besides, You pretty much have to go beyond 19" to get
a higher resolution than 1280x1024.
It's a good time to keep an eye on these. The sizes and resolutions
are going up and the prices are coming down. I had a couple of 46" LCD
TVs in my office a little while ago (much easier to carry than the
plasmas). Sometimes this job really doesn't suck. :)
--
Regards,
Bruce McGee
Glooscap Software
 

Re: Benefits of dual monitor system

Bruce McGee writes:
Quote
It's a good time to keep an eye on these. The sizes and resolutions
are going up and the prices are coming down.
Thanks for the info. You've anticipated my need: i want bigger w/
higher res. Not bigger w/ the same or lower res than I have got now.
I've got modeling, coding, designing, debugging, im, newsgroup ... I
want a{*word*19}pit that allows me to monitor things w/o fiddling w/ screen
displays every time.
--
John Kaster blogs.borland.com/johnk
Features and bugs: qc.borland.com
Get source: cc.borland.com
If it is not here, it is not happening: ec.borland.com
 

Re: Benefits of dual monitor system

John Kaster (Borland) writes:
Quote
Thanks for the info. You've anticipated my need: i want bigger w/
higher res. Not bigger w/ the same or lower res than I have got now.
If you like the same as I do, you probably like high pixel density.
Having bought 3 monitors, 19" with 1200x1024, I was lucky to get rid of
them all without losing too much money, and bought two gems:
www.eizo.com/products/lcd/l887/index.asp
These monitors are so much better than anything else I have seen, it is
unbelievable. But - you have to pay for it..
I am considering buying a third.
And - guess what, I run them in portrait mode, both of them!!
Amazing how much code I can see without scrolling at all. I run both
VS.Net and D6/D7 in portrait mode and only turn one of the monitors when
I fire up Photoshop.
When I have tidied up my desktop, I might post a picture :)
Quote
I've got modeling, coding, designing, debugging, im, newsgroup ... I
want a{*word*19}pit that allows me to monitor things w/o fiddling w/ screen
displays every time.
That is what I have got now. Only question is, how did I manage before?
If you haven't tried it, try coding with a vertical resolution of 1600
pixles!
--
Ingvar Nilsen
www.ingvarius.com
 

Re: Benefits of dual monitor system

Yup, very nice.
But I am looking for more. My primary display (20" Mitsubishi CRT) is
set to 1800x1350 now. I am keeping an eye on the 24" LCDs for a primary
display and one of the 20" LCDs for a secondary. More screen real
estate and I will reclaim a lot of desk space, too. :)
Here is some information from Dell, but other manufacturers (like LG)
have similar models. And the prices keep dropping.
tinyurl.com/7z4bd
--
Regards,
Bruce McGee
Glooscap Software