Page 1 of 1
paint xbrowse n a window
Posted: Thu Mar 13, 2008 3:57 pm
by Silvio
How I can make to paint this xbrowse fill on the window ?
i made
Code: Select all
DEFINE WINDOW ::oWndMain ....
::nGridBottom := ::oWndMain:nBottom-::oWndMain:nTop
::nGridRight : = ::oWndMain:nRight-::oWndMain:nLeft
::oGrid := TXBrowse():New( ::oWndMain )
::oGrid:nTop := 00
::oGrid:nLeft := 250
::oGrid:nBottom := ::nGridBottom
::oGrid:nRight := ::nGridRight
[/code]
Fit xBrowse to a Window or Dialog
Posted: Thu Mar 13, 2008 5:21 pm
by ukoenig
Hello,
You have to get Top, Bottom, Left, Right of the child or any dialog.
The browser must have the same.
Top, Left of the browser is allways 0 ( belongs to the Dialog ).
Right and Bottom has to be calculated.
Here is the source
Code: Select all
#include "fivewin.ch"
#include "xbrowse.ch"
// ----------------------------------------------
FUNCTION TEST()
LOCAL oDlg
LOCAL aCORS := {}
USE CUSTOMER NEW ALIAS CUST
DEFINE DIALOG oDlg FROM 5, 5 TO 20, 100 TITLE "A Dialog Box"
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( aCORS := GetCoors( oDlg:hWnd ), MakeBrowse( oDlg ) )
RETURN( NIL )
//----------------------------------------------------------------------------//
STATIC FUNCTION MakeBrowse( oDlg )
LOCAL oBrw
aCORS := GetCoors( oDlg:hWnd )
oBrw := TXBrowse():new( oDlg )
WITH OBJECT oBrw
:nTop := 0
:nLeft := 0
:nBottom := aCORS [3]
:nRight := aCORS [4]
:cAlias := "CUST"
:SetRDD()
END
oBrw:CreateFromCode()
RETURN ( oBrw )
That should work.
Regards
Uwe
[/code]
Re: paint xbrowse n a window
Posted: Thu Mar 13, 2008 5:30 pm
by Enrico Maria Giordano
Use Move() method.
EMG
Posted: Thu Mar 13, 2008 5:38 pm
by James Bott
Look at the splitter examples in fwh\samples.
James
Posted: Fri Mar 14, 2008 12:29 am
by Silvio
Dear ukoenig
have you a sample in a window please?
Posted: Fri Mar 14, 2008 8:23 am
by StefanHaupt
Hi Silvio,
you can try this
Code: Select all
ACTIVATE WINDOW oWnd ;
ON RESIZE ( oSplit:AdjControl () ) ;
ON INIT Eval( oWnd:bResized )
Posted: Fri Mar 14, 2008 8:43 am
by Silvio
Stephan,
The problem is Xbrowse I cannot move this object to height and width of the window
the splitter is ok !!
Posted: Fri Mar 14, 2008 8:51 am
by Silvio
this made error :
#include "FiveWin.ch"
function Main()
local oWnd
Local aClient := GetClientRect (oWnd:hWnd )
nBottom = aClient[3] - 1
nRight = aClient[4]
DEFINE WINDOW oWnd ;
TITLE "Xbrowse into a window"
oWnd:SetColor( CLR_WHITE, GetSysColor(15)-RGB(30,30,30) )
// xvtaskbar
// ...
// Xbrowse
USE CUSTOMER ALIAS CU
oGrid := TXBrowse():New( oWnd )
oGrid:nTop := 00
oGrid:nLeft := 242
oGrid:nBottom := nbottom
oGrid:nRight := nRight
ACTIVATE WINDOW oWnd
return nil