To Nages Insert images on xbrowse

To Nages Insert images on xbrowse

Postby Silvio.Falconi » Tue Jul 31, 2018 6:13 pm

Dear Nages, remeber this topic?
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=35687&p=212509#p212509

I wish create a Xbrowse as this

Image
Each row ( one record) must have ;

First Last
phone 444 44 444 4444 phone2 77 777 77777
Address xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
city xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Note aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


with small images on each record /field as you see on picture

Ho I can make it ?
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: 6897
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages Insert images on xbrowse

Postby cnavarro » Wed Aug 01, 2018 7:24 pm

Something like that?

Image
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6522
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: To Nages Insert images on xbrowse

Postby nanoespinoza » Wed Aug 01, 2018 8:21 pm

Dear Cristobal

Very nice and interesting, could you give an example of how it does it?

Cheers
nanoespinoza
 
Posts: 139
Joined: Thu Mar 16, 2017 4:08 pm
Location: Ecuador

Re: To Nages Insert images on xbrowse

Postby cnavarro » Wed Aug 01, 2018 8:35 pm

Dear Fernando
Define your columns normaly, add image for each column
Code: Select all  Expand view


      WITH OBJECT :aCols[ 1 ]
         :bStrImage     := { || "D:\Fwh\FwhTeam\bitmaps\16x16\notes16.bmp" }
         :oDataFont     := oBold
         :nDataStrAlign := AL_CENTER + AL_VCENTER
         :nDataBmpAlign := AL_LEFT
         //:aImgRect      := { 4, 4, 32, 32 }
      END

 


And then, define your SetColsAsRows
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6522
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: To Nages Insert images on xbrowse

Postby fraxzi » Thu Aug 02, 2018 2:35 am

Mr. Navarro,

How to add the 'AGE' along side with the 'NAME?

:?:
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: To Nages Insert images on xbrowse

Postby nanoespinoza » Thu Aug 02, 2018 4:06 am

Perfect, thanks

cnavarro wrote:Dear Fernando
Define your columns normaly, add image for each column
Code: Select all  Expand view


      WITH OBJECT :aCols[ 1 ]
         :bStrImage     := { || "D:\Fwh\FwhTeam\bitmaps\16x16\notes16.bmp" }
         :oDataFont     := oBold
         :nDataStrAlign := AL_CENTER + AL_VCENTER
         :nDataBmpAlign := AL_LEFT
         //:aImgRect      := { 4, 4, 32, 32 }
      END

 


And then, define your SetColsAsRows
nanoespinoza
 
Posts: 139
Joined: Thu Mar 16, 2017 4:08 pm
Location: Ecuador

Re: To Nages Insert images on xbrowse

Postby cnavarro » Thu Aug 02, 2018 10:00 am

fraxzi wrote:Mr. Navarro,

How to add the 'AGE' along side with the 'NAME?

:?:


Age is other column

With new syntax

Code: Select all  Expand view


   @ 0, 0 XBROWSE oBrw OF oWnd ;
      DATASOURCE "Cust" ;
      COLUMNS "TRIM(FIRST)+', '+TRIM(LAST) AS FullName PICTURE @! WIDTH 350 SORT FIRST", ;
      "'Street: ' + TRIM(STREET) AS Street WIDTH 350", ;
      "'City: ' + TRIM(CITY) AS Address WIDTH 350 SORT CITY", ;
      "'Age: ' + StrZero( AGE, 2 ) WIDTH 200" ;
      CELL LINES NOBORDER PIXEL AUTOSORT

   WITH OBJECT oBrw
      :lHeader          := .F.
      :lRecordSelector  := .F.
      :lHScroll         := .F.

       // Important for not separate NAME with AGE
      :nColDividerStyle := LINESTYLE_NOLINES

      :nRowDividerStyle := LINESTYLE_DARKGRAY //LIGHTGRAY //
      :nRowHeight       := 72

.../...
    END
   // Column AGE is not included
   :aCols[ 1 ]:SetColsAsRows( { 1, 2, 3 } )

 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6522
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: To Nages Insert images on xbrowse

Postby Silvio.Falconi » Thu Aug 02, 2018 1:24 pm

Navarro,
I try it but make me error

Image

I have the browse at left and the fields at right on a dialog

I use my archive and not run also bchange
I sent you mt small test
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: 6897
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages Insert images on xbrowse

Postby cnavarro » Thu Aug 02, 2018 1:32 pm

You need last version of Fw for new syntax definition of columns in xbrowse
I have answered your mail
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6522
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: To Nages Insert images on xbrowse

Postby Silvio.Falconi » Thu Aug 02, 2018 1:53 pm

I try this :
Code: Select all  Expand view
@ 30,0 XBROWSE oBrowse OF oDlg DATASOURCE "CL" ;
          COLUMNS "CLNombre","CLDirecc","CLlocali","CLCap","CLProv","CLTELEFONO","CLMOVIL" ;
          HEADERS "Ragione Sociale", "Indirizzo", nil, nil, "Dettagli" ;
          CELL LINES NOBORDER


        WITH OBJECT oBrowse
         WITH OBJECT :aCols[ 1 ]
         :bStrImage     := { || "phone.bmp" }
        * :oDataFont     := oBold
         :nDataStrAlign := AL_CENTER + AL_VCENTER
         :nDataBmpAlign := AL_LEFT
         //:aImgRect      := { 4, 4, 32, 32 }
      END

       *  WITH OBJECT oBrw
          :aCols[ 1 ]:SetColsAsRows( 1,6,2,3 )
          :aCols[ 2 ]:SetColsAsRows( 2, 3, 4 )
          :aCols[ 5 ]:SetColsAsRows( 5, 6, 7 )
          //
      :lHeader          := .F.
      :lRecordSelector  := .F.
      :lHScroll         := .F.

       // Important for not separate NAME with AGE
      :nColDividerStyle := LINESTYLE_NOLINES

      :nRowDividerStyle := LINESTYLE_DARKGRAY //LIGHTGRAY //
      :nRowHeight       := 72
          :CreateFromCode()
       END


 


the result is

Image



But I wish this
Image

any solution ?
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: 6897
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages Insert images on xbrowse

Postby Silvio.Falconi » Thu Aug 02, 2018 3:37 pm

Now I found another sample of Nages Compatible with my release of fivewin.

the source test

Code: Select all  Expand view
#include "fivewin.ch"

function colsasrows2()

   local oWnd, oBrw, oFont, aCols
   local nLine    := 0

   USE CUSTOMER ALIAS CUST

 //  xbrowse()

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE WINDOW oWnd
   oWnd:SetFont( oFont )

   aCols := { ;
      { { || If( nLine == 0, STR(CUST->ID,4), "" ) }, "ID" }, ;
      { { || If( nLine == 0, CUST->FIRST+" "+CUST->LAST, If( nLine == 1,  CUST->ZIP, CUST->ZIP ) ) }, "CustName" }, ;
      { { || If( nLine == 0, CUST->STREET, If( nLine == 1, CUST->CITY, CUST->ZIP ) ) }, "Address" }, ;
      { { || If( nLine == 0, DTOC(CUST->HIREDATE), If( nLine == 1, Str( CUST->AGE, 2 ), TRANSFORM( CUST->SALARY,"9,999,999.99") ) ) }, "Details" } }



   @ 0,0 XBROWSE oBrw OF oWnd DATASOURCE "CUST" ;
      COLUMNS aCols ;
      CELL LINES NOBORDER

   // Navigation blocks
   oBrw:bGoTop    := { || nLine := 0, ( oBrw:cAlias )->( DBGOTOP()    ) }
   oBrw:bGoBottom := { || nLine := 2, ( oBrw:cAlias )->( DBGOBOTTOM() ) }
   oBrw:bKeyCount := { || ( oBrw:cAlias )->( OrdKeyCount() ) * 3 }
   oBrw:bKeyNo    := { || ( ( oBrw:cAlias )->( OrdKeyNo() - 1 ) * 3 ) + 1 + nLine  }
   oBrw:bSkip     := { |nSkip| ( oBrw:cAlias )->( MySkipper( nSkip, @nLine ) ) }
   oBrw:bKeyNo := { |n| If( n != nil, ( n--, ( oBrw:cAlias )->( OrdKeyGoTo( Int( n / 3 ) + 1 ) ), nLine := n % 3 ), nil ), ;
                        ( ( oBrw:cAlias )->( OrdKeyNo() - 1 ) * 3 ) + 1 + nLine }
   oBrw:bBookMark := { |n| If( n != nil, ( n--, ( oBrw:cAlias )->( DbGoTo( Int( n / 3 ) + 1 ) ), nLine := n % 3 ), nil ), ;
                        ( ( oBrw:cAlias )->( RecNo() - 1 ) * 3 ) + 1 + nLine }


   WITH OBJECT oBrw
      :aCols[ 1 ]:nDataStrAlign := AL_RIGHT


      :aCols[ 2 ]:bLeftText   := { || If( nLine == 0, "", If( nLine == 1, "Phone1", "Phone2:" ) ) }
      :aCols[ 2 ]:bStrImage     :=  { || If( nLine == 0, "", If( nLine == 1, "phone.bmp", "phone2.bmp" ) ) }
      :aCols[ 2 ]:nDataBmpAlign := AL_RIGHT

      :aCols[ 3 ]:bStrImage     :=  { || If( nLine == 0, "address.bmp", If( nLine == 1, "city.bmp", "note.bmp" ) ) }
      :aCols[ 3 ]:nDataBmpAlign := AL_RIGHT
      :aCols[ 3 ]:nWidth      := 340
      :aCols[ 3 ]:bLeftText   := { || If( nLine == 0, "Address:", If( nLine == 1, "City:", "Cap:" ) ) }

      :aCols[ 4 ]:nWidth      := 140
      :aCols[ 4 ]:nDataStrAlign := AL_RIGHT
      :aCols[ 4 ]:bLeftText   := { || If( nLine == 0, "Date:", If( nLine == 1, "Age:", "Sal:" ) ) }



      :bClrStd    := { || { CLR_BLACK, If( nLine == 0, CLR_HGRAY, CLR_WHITE ) } }
      //
      :CreateFromCode()
   END
   oWnd:oClient   := oBrw

   ACTIVATE WINDOW oWnd CENTERED
   RELEASE FONT oFont

return nil

static function MySkipper( nSkip, nLine )

   local nSkipped := 0

   DEFAULT nSkip := 1

   if nSkip == 0
      return 0
   endif
   if nSkip > 0
      do while nSkipped < nSkip
         if nLine < 2
            nLine++
            nSkipped++
         else
            DBSKIP( 1 )
            if Eof()
               DBGOBOTTOM()
               EXIT
            endif
            nLine := 0
            nSkipped++
         endif
      enddo
   else
      do while nSkipped > nSkip
         if nLine > 0
            nLine--
            nSkipped--
         else
            DBSKIP( -1 )
            if BOF()
               EXIT
            endif
            nLine    := 2
            nSkipped--
         endif
      enddo
   endif

return nSkipped
 

this is the result :

Image

Questions
1 . Can I set the font of each bLefttext ?
2. Can I move the images on Left before of bLefttext ?
3. When I select a record can have one record as one Row ? ( with a box arround)

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: 6897
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages Insert images on xbrowse

Postby Silvio.Falconi » Sun Aug 05, 2018 3:06 pm

This is the last my release

Image

I can Add, edit and delete record, also scroll ( prev/next) record.


I wish to have on xbrowse the record with two columns and 5 lines on white backgroung and a line box to determine a record
as this picture

Image


How I can make it
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: 6897
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 49 guests