paint xbrowse n a window

Post Reply
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

paint xbrowse n a window

Post by Silvio »

How I can make to paint this xbrowse fill on the window ?

Image


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]
Best Regards, Saludos

Falconi Silvio
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Fit xBrowse to a Window or Dialog

Post 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 :lol:
[/code]
Last edited by ukoenig on Thu Mar 13, 2008 6:02 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Look at the splitter examples in fwh\samples.

James
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Dear ukoenig
have you a sample in a window please?
Best Regards, Saludos

Falconi Silvio
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Post by StefanHaupt »

Hi Silvio,

you can try this

Code: Select all

ACTIVATE WINDOW oWnd ;
     ON RESIZE ( oSplit:AdjControl () ) ;
     ON INIT Eval( oWnd:bResized )
kind regards
Stefan
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Stephan,
The problem is Xbrowse I cannot move this object to height and width of the window

the splitter is ok !!
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post 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
Best Regards, Saludos

Falconi Silvio
Post Reply