FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Catering for Different User Screen Resolutions
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Catering for Different User Screen Resolutions
Posted: Tue Jun 26, 2007 02:13 PM

How does one cater for different screen resolutions?

I have designed my screens for 800x600, assuming that it would suite most people, even those with large screens and finer resolutions. Typical data input screens e.g.:
Company: XXX Acc no. XXXX
Surname: XXXX Firstname: XXXX etc.

Some users that run 1024 x 768 and better have asked if the screen can be made large for them. How does one cater for this?

Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Catering for Different User Screen Resolutions
Posted: Wed Jun 27, 2007 01:14 AM
Hi,
1.Modify dialog.prg:

add

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 )
if oCtrol:classname()=="TCOMBOBOX"
oCtrol:Move( aRect[1]*rsl0, aRect[2]*rsl1)
else
oCtrol:Move( aRect[1]*rsl0, aRect[2]*rsl1, (aRect[4] - aRect[2])*rsl0, (aRect[3] - aRect[1])*rsl1, .t. )
end
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

2. on app

activate dialog mydialog on init mydialog:autoresize()

3. need enhance , on 1280*800 wider screen , it's not work fine,it must set to normail, like 1280*1024, 1024*768, 800*600.

Regards

Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 107
Joined: Tue Apr 11, 2006 04:36 PM
Catering for Different User Screen Resolutions
Posted: Wed Jun 27, 2007 01:37 AM

hi, works in windows (mdi) too?? thanks

Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Catering for Different User Screen Resolutions
Posted: Thu Jun 28, 2007 01:06 AM

Not yet.

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651

Continue the discussion