Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Position and size DB relative to screen resolution
Topic Summary:
Created On: 10-Jun-2008 21:25
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 10-Jun-2008 21:25
User is offline View Users Profile Print this message


David Jakad

Posts: 94
Joined: 20-Jul-2007

Here's a function I created which will size and position a dialog box, relative to the user's screen resolution. You must call it after realize(db) but before show(db).

Sytnax:
void fnPosDB(DB xDB,int point,real pctX,real pctY,real pctW,real pctH)

Where:
xDB: is the dialog box you want to size and position
point: is the point of the DB to be positioned (0=Center; 1=Upper left; 2=Upper right; 3=Lower left; 4=Lower right)
pctX & pctY: are the x- and y-points on the screen to put the DB, in %
pctW & pctH: are the width and height of the DB, in % of screen size

Examples:

fnPosDB(xDB,0,50.0,50.0,30.0,40.0)
will position the DB in the center of the screen and sized to be 30% of screen width and 40% of screen height.

fnPosDB(xDB,1,0.0,0.0,50.0,50.0)
will position the DB in the upper left corner, and will sized to be 50% of screen width and 50% of screen height.

fnPosDB(xDB,4,100.0,100.0,20.0,30.0)
will position the DB in the lower left corner of the screen, and will be sized to 20% width and 30% height.

It works by generating a test DB, which is always centered and the same size. Then, by getting the postion and size of the test DB, you can calculate the screen resolution. The code near the end ensurs that the DB cannot be positioned off screen.
Report this to a Moderator Report this to a Moderator
 11-Jun-2008 20:03
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Interesting. Very nice David. I might have some use for this.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.