txbrowse from code

txbrowse from code

Postby Ehab Samir Aziz » Sat Nov 11, 2006 1:49 pm

I am trying to build a dialog of txbrowse and I don't know what is missing ?

Code: Select all  Expand view  RUN
STATIC FUNCTION NewDialog( oWnd )

   local oDlg, oBrw, oCol

   oBrw := TXBrowse():New( oWnd )

   DEFINE DIALOG oDlg FROM 0,0 TO 45,128 TITLE "Customer browse "
   oBrw:CreateFromCode()
   ACTIVATE DIALOG oDlg

RETURN NIL
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby Antonio Linares » Sat Nov 11, 2006 3:17 pm

Code: Select all  Expand view  RUN

STATIC FUNCTION NewDialog( oWnd )

   local oDlg, oBrw, oCol

   DEFINE DIALOG oDlg FROM 0,0 TO 45,128 TITLE "Customer browse "

   ACTIVATE DIALOG oDlg ;
      ON INIT oBrw := BuildBrowse( oDlg )

RETURN NIL

function BuildBrowse( oWnd )
   
   local oBrw := TXBrowse():New( oWnd )

   oBrw:CreateFromCode()

return oBrw
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42120
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Ehab Samir Aziz » Sat Nov 11, 2006 7:20 pm

How can I fill the dialog with the columns of txbrowse ?
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby James Bott » Sat Nov 11, 2006 7:35 pm

Try oDlg:oClient := oBrw

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Ehab Samir Aziz » Sat Nov 11, 2006 8:01 pm

No Not work I tried it before . I think the code should be like this . I mean BuildBrowse does not know nothing about oWnd.

Code: Select all  Expand view  RUN
STATIC FUNCTION NewDialog( oWnd )

   local oDlg, oBrw, oCol

   DEFINE DIALOG oDlg FROM 0,0 TO 45,128 TITLE "Customer browse "

   ACTIVATE DIALOG oDlg ;
      ON INIT oBrw := BuildBrowse( oDlg )

RETURN NIL

function BuildBrowse( oDlg )
   
   local oBrw := TXBrowse():New( oDlg )

   oBrw:CreateFromCode()
   oDlg:oClient:=oBrw

return oBrw



Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby Ehab Samir Aziz » Wed Nov 15, 2006 6:23 am

Adding buttons in such way overlaps the columns of xbrowse .
Code: Select all  Expand view  RUN

STATIC FUNCTION NewDialog( oWnd )

   local oDlg, oBrw, oCol

   DEFINE DIALOG oDlg FROM 0,0 TO 45,128 TITLE "Customer browse "


   ACTIVATE DIALOG oDlg ;
      ON INIT oBrw := BuildBrowse( oDlg )



RETURN NIL

function BuildBrowse( oDlg )
   
   local oBrw := TXBrowse():New( oDlg )

  oBrw:CreateFromCode()
  oDlg:oClient:=oBrw

  oDlg:ReSize()

   @ 17,   1 BUTTON "&New"    OF oDlg SIZE 40, 12 //ACTION Editcust( oLbx, .t. )
   @ 17,  8 BUTTON "&Modify" OF oDlg SIZE 40, 12 //ACTION Editcust( oLbx, .f. )
   @ 17, 15 BUTTON "&Delete" OF oDlg  SIZE 40, 12 //ACTION Delrecord( oLbx )
   @ 17, 22 BUTTON "&Search" OF oDlg SIZE 40, 12 //ACTION SeekCust( oLbx )
   @ 17, 29 BUTTON "&Print"  OF oDlg
      //ACTION oLbx:Report( "Customers  Report", .t. ) ;  // .t. --> wants preview
      //SIZE 40, 12
   @ 17, 36 BUTTON "&Exit"   OF oDlg //ACTION oDlg:End() SIZE 40, 12

   @ 18,  1 BUTTON "&Order"    OF oDlg //ACTION ordercust(oLbx) SIZE 40, 12
   @ 18,  8 BUTTON "&Filter"    OF oDlg //ACTION filtercust(oLbx) SIZE 40, 12
   @ 18,  15 BUTTON "&Unfilter" OF oDlg //ACTION Nonfiltercust(oLbx) SIZE 40, 12

return oBrw
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby Antonio Linares » Wed Nov 15, 2006 8:45 am

Ehab,

Thats because you are using oDlg:oClient:=oBrw and that means to use the entire dialog area.

You may change oDlg:oClient:=oBrw into:

oBrw:nTop = ...
oBrw:nLeft = ...
oBrw:nWidth = ...
oBrw:nHeight = ...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42120
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 69 guests