Problem with xbrowse with tdatabase - Resolved

Problem with xbrowse with tdatabase - Resolved

Postby Silvio.Falconi » Sat May 04, 2019 8:32 am

on oldest application to show records with xbrowse I used
1.) create the xbrowse with coordinates
2.) an array aBrowse where I inserted all fields, titles,pictures and sizes
3) then createfromsource comand

I make a small test

Code: Select all  Expand view

#include "FiveWin.ch"
#include "xBrowse.ch"

static oElementi

REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO

Function test()
Local oDlg,oGrid
Local cDir:= ".\data\"

      RddSetDefault( "
DBFCDX" )


     oElementi:=TDatabase():Open( , cDir+"
Elementi", "DBFCDX", .T. )
     oElementi:setorder(2)
     oElementi:gotop()


define dialog oDlg size 600,400

     oGrid := TXBrowse():New(oDlg )
     oGrid:nTop    := 00
     oGrid:nLeft   := 10
     oGrid:nBottom := 200
     oGrid:nRight  := 400

 aBrowse   := {  { { || oElementi:ELATTIVO   }, i18n("
Attivo"),80, },;
                  { { || oElementi:ELNOME }, i18n("
Descrizione elemento"),80, },;
                  { { || "
"  }, i18n("Colore "),80, },;
                  { { || oElementi:ELCOLORE }, i18n("
Descr. Colore"),80, },;
                  { { || oElementi:ELORDINE }, i18n("
Ordine"),80, },;
                  { { || oElementi:ELLOCK }, i18n("
Bloccato"),200, }}


   FOR i := 1 TO Len(aBrowse)
      oCol := oGrid:AddCol()
      oCol:bEditValue := aBrowse[ i, 1 ]
      oCol:cHeader  := aBrowse[ i, 2 ]
      oCol:nWidth   := aBrowse[ i, 3 ]
       if !Empty(aBrowse[ i, 4 ])
            oCol:cEditPicture:=aBrowse[ i, 4 ]
         Endif
      NEXT


 WITH OBJECT  oGrid
     :CreateFromCode()
   END

activate dialog oDlg
return nil



I convert EL-> into oElementi why now not run ok ? How I can to have the same ?


now I resolved with
Code: Select all  Expand view
@0,nSplit+2 XBROWSE oApp:oGrid SIZE oApp():oDlg:nGridBottom,oApp():oDlg:nGridRight PIXEL OF oApp():oDlg ;
           COLUMNS "ELATTIVO","ELNOME","","ELCOLORE","ELORDINE","ELLOCK";
           HEADERS "Attivo","Descrizione elemento","Colore ", "Descr. Colore","Ordine","Bloccato";
      COLSIZES 80,80,80,80,80,80 ;
      CELL LINES NOBORDER ;
      DATASOURCE oElementi


I'd like to have the same schema also because I build the Xbrowse from an external class (tfsdi) with oApp():oDlg:NewGrid( nSplit )

thanks
Last edited by Silvio.Falconi on Sun May 05, 2019 8:39 am, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7054
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with xbrowse with tdatabase

Postby Silvio.Falconi » Sat May 04, 2019 9:11 am

on six column I have
WITH OBJECT oApp():oGrid:aCols[6]
:AddResource("BTN_PNG_LOCKSI")
* :AddResource("BTN_PNG_LOCKNO")
:bBmpData := { || IIF( oElementi:ELLOCK,1,) }
:bEditValue := ""
END

but now I see also the value as you can see here
Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7054
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with xbrowse with tdatabase

Postby nageswaragunupudi » Sat May 04, 2019 2:26 pm

We advise you NOT to use your old syntax.
Please use it this way.
Code: Select all  Expand view
#include "FiveWin.ch"

static oElementi

REQUEST DBFCDX

Function test()
Local oDlg,oGrid
Local cDir:= ".\data\"

   RddSetDefault( "
DBFCDX" )

   oElementi:=TDatabase():Open( , cDir+"
Elementi", "DBFCDX", .T. )
   oElementi:setorder(2)
   oElementi:gotop()

   DEFINE DIALOG oDlg SIZE 600,400

   aBrowse   := { { "
ELATTIVO",  i18n("Attivo"), ,              80, },;
                  { "
ELNOME",    i18n("Descrizione elemento"),, 80, },;
                  { "
",          i18n("Colore "),,              80, },;
                  { "
ELCOLORE",  i18n("Descr. Colore"),,        80, },;
                  { "
ELORDINE",  i18n("Ordine"),,               80, },;
                  { "
ELLOCK",    i18n("Bloccato"),,             200,} }

   @ 00,10 XBROWSE oGrid SIZE -10,00 PIXEL OF oDlg ;
      DATASOURCE oElementi COLUMNS aBrowse

   WITH OBJECT  oGrid
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg

return nil
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Problem with xbrowse with tdatabase

Postby Silvio.Falconi » Sat May 04, 2019 3:35 pm

THANKS
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7054
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with xbrowse with tdatabase

Postby Silvio.Falconi » Sat May 04, 2019 3:47 pm

Sorry ,
I made as your code
Code: Select all  Expand view

aBrowse   := { { "ELATTIVO",  i18n("Attivo"),               80, },;
                  { "ELNOME",    i18n("Descrizione elemento"), 80, },;
                  { "",          i18n("Colore "),              80, },;
                  { "ELCOLORE",  i18n("Descr. Colore"),        80, },;
                  { "ELORDINE",  i18n("Ordine"),               80, },;
                  { "ELLOCK",    i18n("Bloccato"),             200,} }


       @0,nSplit+2 XBROWSE oApp:oGrid  ;
           SIZE oApp():oDlg:nGridBottom,oApp():oDlg:nGridRight PIXEL;
           OF oApp():oDlg ;
           DATASOURCE oElementi COLUMNS aBrowse
 


and it make an error ( the same your test corrected)


Code: Select all  Expand view
Application
===========
   Path and name: C:\Work\Prg\Bikini_scuola\Bikini\main.Exe (32 bits)
   Size: 5,054,464 bytes
   Compiler version: Harbour 3.2.0dev (r1703231115)
   FiveWin  version: FWH 19.03
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200

   Time from start: 0 hours 2 mins 59 secs
   Error occurred at: 04-05-2019, 17:44:06
   Error description: Error BASE/1070  Argument error: ==
   Args:
     [   1] = N   80
     [   2] = C   @T

Stack Calls
===========
   Called from: .\source\function\VALTOSTR.PRG => CVALTOSTR( 133 )
   Called from: .\source\classes\XBROWSE.PRG => (b)TXBRWCOLUMN_ADJUST( 11995 )
   Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:ADJUST( 12072 )
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:ADJUST( 1431 )
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:INITIATE( 1275 )
   Called from:  => __OBJSENDMSG( 0 )
   Called from: .\source\function\HARBOUR.PRG => OSEND( 291 )
   Called from: .\source\function\HARBOUR.PRG => ASEND( 259 )
   Called from: .\source\classes\DIALOG.PRG => TFSDI:INITIATE( 805 )
   Called from: .\source\classes\DIALOG.PRG => TFSDI:ACTIVATE( 330 )
   Called from: source\PElementi.prg => ELEMENTI( 200 )
   Called from: source\main.prg => (b)TAPPLICATION_BUILDRIBBONBAR( 844 )
   Called from: .\source\classes\TRBTN.PRG => TRBTN:CLICK( 717 )
   Called from: .\source\classes\TRBTN.PRG => TRBTN:LBUTTONUP( 917 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1791 )
   Called from: .\source\classes\TRBTN.PRG => TRBTN:HANDLEEVENT( 1575 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3546 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1078 )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7054
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with xbrowse with tdatabase

Postby nageswaragunupudi » Sat May 04, 2019 10:02 pm

Mr. Silivio
Sorry.
I revised it and made a minor correction.
Please use the corrected program.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Problem with xbrowse with tdatabase

Postby Silvio.Falconi » Sun May 05, 2019 7:40 am

ok wich is the variables on ?

{ field, header, ? , size, ? },;
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7054
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with xbrowse with tdatabase

Postby nageswaragunupudi » Sun May 05, 2019 7:56 am

{ field, header, picture, size, justify, sortorder }
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Problem with xbrowse with tdatabase

Postby Silvio.Falconi » Sun May 05, 2019 8:39 am

thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7054
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 68 guests