regardless screen resolution

regardless screen resolution

Postby Ehab Samir Aziz » Thu Dec 20, 2007 11:56 pm

I am suffering from porting side defects of my application from diferrent resolutions . I need the optimim (best) to avoid modifying my screen size for each resolution I face.
What make my application compatible with all sizes and sreen resolutions
Thanks
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby ShumingWang » Fri Dec 21, 2007 12:47 am

Ehab,
This is my simple modify sample:

dialog.prg

METHOD Autoresize(ntop,nleft)
local i,rsl0,rsl1,oCtrol,aRect
DEFAULT ntop:=0
DEFAULT nleft:=0



rsl0:=getsysmetrics(0)/800
if rsl0<=1; return ; end //<=800*600, not needed
rsl1:=getsysmetrics(1)/600
for i:=1 TO LEN(::acontrols)
oCtrol = ::aControls[i]
aRect = GetCoors( oCtrol:hWnd )
do case
case oCtrol:classname()=="TCOMBOBOX"
oCtrol:Move( aRect[1]*rsl0, aRect[2]*rsl1)
// case oCtrol:classname()=="TGET"
// oCtrol:Move( aRect[1]*rsl0, aRect[2]*rsl1,,(aRect[3] - aRect[1])*rsl0, .t. )
otherwise
oCtrol:Move( aRect[1]*rsl0, aRect[2]*rsl1, (aRect[4] - aRect[2])*rsl1, (aRect[3] - aRect[1])*rsl0, .t. )
// ntop,nleft,nbottom,nright
end case
next

aRect = GetWndRect( ::hWnd )

::Move( ntop,nleft,::nWidth*rsl0, ::nHeight*rsl1, .T. )

if ::lCentered
WndCenter( ::hWnd )
else
if Empty( ::cResName )
::Move( ::nTop, ::nLeft )
endif
endif


return

Shuming Wang
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby kokookao2007 » Mon Dec 24, 2007 3:46 am

Hi ShumingWang ,good job .

This is the solution what my customers ask me .

Did you finish all the objects of Dialog ?

I test what you paste , but not work , (1027x768 Chinese big5 font ).

Would you share it to me ?


--
Best Regards
kokoo
User avatar
kokookao2007
 
Posts: 59
Joined: Thu May 17, 2007 8:27 am

Postby ShumingWang » Mon Dec 24, 2007 4:50 am

kokoo,
In your app.prg

activate dialog odlg on int (odlg:autoresize())

Notice, child dialog not work.

Regards!
Shuming Wang
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Postby kokookao2007 » Mon Dec 24, 2007 11:11 am

hi ShumingWang :

modifying my screen size for each resolution I face.


include font size ?

Any passable for a resource Dialog , there is some objects not define only display.

kokoo
User avatar
kokookao2007
 
Posts: 59
Joined: Thu May 17, 2007 8:27 am

Postby ShumingWang » Tue Dec 25, 2007 12:41 am

kokoo,
I do not change font size,so if at high resolution,browse could show more columns and rows.
-1 id in resource ,must rewrite with >0 an redefine in your prg .

Regards.
Shuming Wang
ShumingWang
 
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 101 guests