FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper Change size to dialog during execution program
Posts: 46
Joined: Fri Mar 09, 2007 01:31 PM
Change size to dialog during execution program
Posted: Fri Apr 13, 2007 12:02 PM

Hello,

I have a browse and four buttoms inside of a dialog and I need to expand the dialog and browse to adjust to screen resolution and move the buttons to other position.

Does somebody know as doing it?

Regards,

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Change size to dialog during execution program
Posted: Sat Apr 14, 2007 05:53 AM

oDialog:nWidth = ...
oDialog:nHeight = ...

<oControl>:nTop = ...
<oControl>:nLeft ...
<oControl>:nWidth = ...
<oControl>:nHeight = ...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Change size to dialog during execution program
Posted: Tue Apr 17, 2007 06:36 AM
Hi,
CLASS TDialog FROM TWindow


METHOD Autoresize(ntop,nleft)

METHOD Autoresize(ntop,nleft)
local i,rsl0,rsl1
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


In you app

define dialog odlg
redefine controls ...
...
activate dialog odlg on init odlg:autoresize()

Regards,
Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 46
Joined: Fri Mar 09, 2007 01:31 PM
Change size to dialog during execution program
Posted: Tue Apr 17, 2007 09:14 AM

Thanks for your reply.
But I have a problem, the fix text or literals in a dialog are not resized. Do you know how can I manage it to resize it?
Thanks in advance,
Jose Alfonso

Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Change size to dialog during execution program
Posted: Wed Apr 18, 2007 01:26 AM

So far,-1 Id not support yet.
You could change like this:
redefine say prompt ' ... ...' of odlg id 111
Regards
Shuming Wang

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

Continue the discussion