Application development in the component age
skip to the main content area of this page
Registration is not required!
Welcome Guest Search | Active Topics | Log In | Register

New Topic Post Reply
How to position dialog using x, y coordinates? Options
Guest
#1 Posted : Wednesday, April 14, 2010 11:26:17 AM Edit Delete Quote
Rank: Guest

Groups:

Joined: 10/23/2009
Posts: 6
I'm looking at v2 of the VCL components under D7 & D2010 and am looking for a solution to position an open (or save) dialog properly on a multi-monitor system.

Setting the ApOpenDialog1.CustDlgParams.Position := dpOwnerFormCenter works pretty closely to what I need. However, if the owner form is located near the left side (Screen.Monitors[x].Left) if the 2nd or subsequent monitors & the owner form is narrower than the ApOpenDialog, the ApOpendialog "bleeds" onto the the adjacent monitor.

I was looking for X, Y (Top, Left) coordinates for the ApOpenDialog but can only find references to the ShiftX, ShiftY properties, which would be helpful if I knew what the actual Left & Top coordinates of the created ApOpenDialog are.

Can you provide a hint on how to accomplish this?

BTW, the downloaded trial version demo program that launches right after installation of the components AV's on XP (from the trial downloaded today 4/14/2010).

Thanks!
componentage
#2 Posted : Wednesday, April 14, 2010 11:58:16 PM Quote
Rank: Administration

Groups: Administrators

Joined: 10/23/2009
Posts: 8
Hi,

Regarding crash under XP - we are inverstigating this issue. Please check if it's version 2.0.1. Version 2.0 did have some problems under XP.

About positioing of the dialog: I do feel that specifying absolute position is what many users want to have. We work in this direction. In this version, please try to set CustDlgParams.PosParams.FitToScreen property to True. It's designed and tested for single-monitor configuration but I suppose it can be useful for multi-monitor configurations as well.

Next update will contain necessary functionality to implement custom positioning. You will be able to specify absolute screen coordinates like here:

Code:

ApOpenDialog1.CustDlgParams.Position := dpCustom;
ApOpenDialog1.CustDlgParams.PosParams.X := 10;
ApOpenDialog1.CustDlgParams.PosParams.Y := 10;


This update is under construction and I hope it will be available in next few days.

Alex
Guest
#3 Posted : Thursday, April 15, 2010 4:06:45 AM Edit Delete Quote
Rank: Guest

Groups:

Joined: 10/23/2009
Posts: 6
Thanks for the info. Regarding the "FitToScreen" property, I tried that and when the host (owner) form is located on the 2nd monitor, the open dialog appears on the 1st monitor (Screen.Monitors[0]) aligned to its right edge. So unless the dialogs are redone to account for multiple monitors, that property won't help.

I'll look for the update that adds the user-defined position possibility - however, my preference would be that the Position := dpOwnerFormCenter would account for the original problem I mentioned and "slide" the dialog as necessary to keep it on whichever monitor it is launched from.

Regards,

Rich Habedank
componentage
#4 Posted : Friday, April 16, 2010 6:58:41 AM Quote
Rank: Administration

Groups: Administrators

Joined: 10/23/2009
Posts: 8
Rich,

Version 2.0.2 contains the changes described above (dpCustom) so you can try it. Regarding the described behaviour of OwnerFormCenter flag, it will be available later (FitToScreen will work in this case) and I can not say ETA now.

Alex
Quick Reply Show Quick Reply
Users browsing this topic
Guest (3)
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.