![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
Interesting. Very nice David. I might have some use for this.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.