Rao
I posted a question on how to get the control array for window and dialog objects because I selectively resize major controls in my programs .. I took your sample solution on how to generically resize your controls and noticed when I compiled the program .. the resize was very 'choppy' .. here is your sample and link to my thread:
viewtopic.php?f=3&t=35739Code: Select all | Expand
#include "fivewin.ch"
function Main()
local oWnd, oBar
DEFINE WINDOW oWnd MDI
DEFINE BUTTONBAR oBar OF oWnd SIZE 100,32 2007
DEFINE BUTTON OF oBar PROMPT "Child Browse" CENTER ACTION ChildBrowse()
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
//----------------------------------------------------------------------------//
static function ChildBrowse()
local oWnd, oFld, oBar, oBrw, cAlias, oFont
USE CUSTOMER NEW SHARED ALIAS ( cAlias := cGetNewAlias( "CUST" ) )
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,14
DEFINE WINDOW oWnd MDICHILD OF WndMain() TITLE "Title"
oWnd:SetFont( oFont )
DEFINE BUTTONBAR oBar OF oWnd 2007
SET MESSAGE OF oWnd TO "" 2007
@ 0,0 FOLDEREX oFld SIZE 1000,900 PIXEL OF oWnd PROMPTS "Personal", "Second" BOTTOM ADJUST OPTION 1
@ 20, 60 XBROWSE oBrw SIZE -28,-300 PIXEL OF oFld:aDialogs[ 1 ] ;
DATASOURCE cAlias AUTOCOLS CELL LINES NOBORDER
oBrw:CreateFromCode()
oWnd:aMinMaxInfo := { nil, nil, nil, nil, 200, 500, nil, nil }
oWnd:bPostEnd := { || ( cAlias )->( DBCLOSEAREA() ), ;
oFont:End() }
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
I finally figured out the control object in my thread .. and as I resize my ( selective ) controls .. the movement of the controls are smooth and seamless .. here is where I am resizing a mdichild with tfolderx and a dialog with xBrowse ..
Code: Select all | Expand
BlueGreenGrad()
....
....
ACTIVATE DIALOG oPersonal NOWAIT ;
ON INIT( oPersonal:Move(0,0));
VALID(!GETKEYSTATE( 27 ))
ACTIVATE WINDOW oWndChildA ;
ON PAINT ( If( nSCR1 < 1280, _ResMessage(nSCR1, nSCR2, @nTimes, oLbxA, oLbxB, oLbxC, oFld ), ));
ON INIT (oWndChildA:bResized := {|| _ReSizeUm( oPersonal,oWndChildA,oLbxA,oFld ) }, ;
oPersonal:refresh(.t.),oLbxA:SetFocus());
VALID ( IIF( !lOK, _CloseRes(.T.,oFontB, oRsPort, oLbxA, @lOk, oWndChildA ),.F. ))
//-----------------------------------
Static Func _ReSizeUm( oPersonal, oWndChildA,oLbxA,oFld )
oPersonal:SetSize( oWndChildA:nWidth, oWndChildA:nHeight, .t. ) // frame and dialog link
// dialog controls
oPersonal:bResized = { | nSizeType, nWidth, nHeight | _ResizeControls( nSizeType, nWidth, nHeight, oPersonal,oFld ) }
Return(nil)
//-------------------------
Static Func _ResizeControls( nSizeType, nWidth, nHeight, oPersonal, oFld )
*xbrowse( oPersonal:aControls )
*xbrowse( oFld:aDialogs[1]:aControls )
if nSizeType = 0 //SIZE_MAXIMIZED
oPersonal:aControls[ 1 ]:SetSize( nWidth - 20, nHeight - 50 ) // folder
oFld:aDialogs[1]:aControls[1]:SetSize( nWidth - 100 , nHeight - 100 ) // xbrowse
oFld:aDialogs[1]:SetSize( nWidth - 5, nHeight - 80 ) // dialog frame
endif
Return(nil)
Don't know if the flicker has anything to do with the PIXEL clause ? .. one last thing about transparent .. I do use the SetDlgGradient() that forces transparency system wide.
Code: Select all | Expand
//---------------------------
Func BlueGreenGrad()
Local xGrad4 := {{ 1.00,14671839, 7419904 }, { 1.00,7419904, 14671839 }} // med blue
SetDlgGradient( xGrad4 )
Return(nil)
Rick Lipkin