Problem to show Vertical record (sample of NAges)

Problem to show Vertical record (sample of NAges)

Postby Silvio.Falconi » Sat Feb 05, 2022 9:18 am

Recompiling a my app I saw there is an error when I try to show a vertical record from a xbrowse

Perhaps there is something changed


Image




this is the original test of Nages

Code: Select all  Expand view  RUN
 
 //----------------------------------------------------------------------------//
    #include "FiveWin.Ch"
    #include "ord.ch"
    #include "xbrowse.ch"

    //----------------------------------------------------------------------------//

    REQUEST DBFCDX

    //----------------------------------------------------------------------------//

    function Test2

       local oDlg, oBrw, oFont

       USE CUSTOMER NEW ALIAS CUST SHARED VIA "DBFCDX"
       GO TOP

       DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
       DEFINE DIALOG oDlg SIZE 600,400 PIXEL FONT oFont
       @ 10,10 XBROWSE oBrw SIZE -10,-30 PIXEL OF oDlg ;
          DATASOURCE "CUST" ;
          COLUMNS "First", "Last", "State", "Salary" ;
          HEADERS "Name", "SurName", "State", "Salary" ;
          CELL LINES FASTEDIT NOBORDER

       oBrw:CreateFromCode()

       @ 180, 10 BUTTON "VertBrw" SIZE 40,12 PIXEL OF oDlg ACTION XbrVert( oBrw )

       ACTIVATE DIALOG oDlg CENTERED
       RELEASE FONT oFont

       CLOSE CUST

    return nil

    //----------------------------------------------------------------------------//

    function XBrVert( oMain )

       local oDlg, oBrw, oFont

       DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
       DEFINE DIALOG oDlg SIZE 600,600 PIXEL FONT oFont

       @ 10, 10 XBROWSE oBrw SIZE 280,280 PIXEL OF oDlg ;
          DATASOURCE oMain:aCols ;
          COLUMNS { || oBrw:aRow:cHeader }, { || oBrw:aRow:Value } ;
          HEADERS  "Column", "ColumnValue" ;
          CELL LINES NOBORDER FASTEDIT UPDATE

       WITH OBJECT oBrw
          :lHScroll       := .f.
          oBrw:aCols[ 1 ]:bClrStd := { || { CLR_BLACK, oBrw:nRecSelColor } }

          WITH OBJECT oBrw:aCols[ 2 ]
             :nEditType     := EDIT_GET
             :bOnPostEdit   := { |o,x,n| If( n != VK_ESCAPE, oBrw:aRow:VarPut( x ), nil ) }
             :bOnChange     := { || oMain:RefreshCurrent() }
          END
          //
          :CreateFromCode()
       END

       ACTIVATE DIALOG oDlg CENTERED ON INIT DlgInit( oBrw )
       RELEASE FONT oFont
       oMain:Refresh()
       oMain:SetFocus()

    return nil

    //----------------------------------------------------------------------------//

    static function DlgInit( oBrw )

       local oDlg     := oBrw:oWnd
       local aDim     := { oBrw:nWidth, oBrw:nHeight }

       // ----- RESIZE DIALOG TO FIT THE CONTENTS OF BROWSE -------//

       oBrw:BrwFitSize( .t. )
       if oBrw:nWidth < 284
          oBrw:nWidth := 284
          oBrw:nStretchCol  := 2
       endif
       oDlg:nWidth    += ( oBrw:nWidth  - aDim[ 1 ] )
       oDlg:nHeight   += ( oBrw:nHeight - aDim[ 2 ] )

       WITH OBJECT oBrw
          :ColStretch()
          :oWnd:Center()
          :SetFocus()
       END

    return .f.

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

Re: Problem to show Vertical record (sample of NAges)

Postby Silvio.Falconi » Sat Feb 05, 2022 10:35 am

TO resolve this problem I made a small test ( but I think Nages can see it why not run)


Image

Code: Select all  Expand view  RUN

Function testsilvio(oBrowse)
   local nLen := Len( oBrowse:aCols )
   local aHeader [ nLen ]
   local aShow [ nlen ]
   local aSizes [ nLen ]
   local aArray [ nLen ]
   local oDlg,oFont,oBrw
   local nHt      := Int( ScreenHeight() * 0.3 )
   local nWd      := 300
   local oExit

   FOR n := 1 TO nLen
       aHeader [ n ] := oBrowse:aCols[ n ]:cHeader
         aShow [ n ] := oBrowse:aCols[ n ]:Value
        aArray [ n ] := {aHeader[n],aShow[n]}
     NEXT

     DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14

   DEFINE DIALOG oDlg ;
   SIZE nWd, nHt PIXEL ;
   FONT oFont

    @ 0,0 XBROWSE  oBrw OF oDlg ;
      SIZE -1,-20 PIXEL  NOBORDER

     oBrw:SetArray(aArray)

     oBrw:aCols[1]:cHeader  := "Campo"
     oBrw:aCols[1]:nWidth   := 120
     oBrw:aCols[2]:cHeader  := "Valore"
     oBrw:aCols[2]:nWidth   := 120

     WITH OBJECT oBrw
      :nMarqueeStyle       := MARQSTYLE_HIGHLWIN7 //MARQSTYLE_HIGHLROW
      :nColDividerStyle    := LINESTYLE_LIGHTGRAY
      :lColDividerComplete := .t.
      :lRecordSelector     := .f.
      :lHScroll            := .f.
      :lVScroll            := .t.
      :nStretchCol         := -1
      :CreateFromCode()
   END


     @  130, 90 BUTTON  oExit  PROMPT "&Exit" OF oDlg  SIZE 45,12 PIXEL  ;
              ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED
 RETUR NIL




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

Re: Problem to show Vertical record (sample of NAges)

Postby nageswaragunupudi » Mon Feb 07, 2022 6:24 pm

In the function XbrVert( oMain ),
please change this line
Code: Select all  Expand view  RUN

      COLUMNS { || oBrw:aRow:cHeader }, { || oBrw:aRow:Value } ;
 

as
Code: Select all  Expand view  RUN

      COLUMNS "cHeader", "Value" ;
 
Regards

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

Re: Problem to show Vertical record (sample of NAges)

Postby Silvio.Falconi » Tue Feb 08, 2022 10:47 am

nageswaragunupudi wrote:In the function XbrVert( oMain ),
please change this line
Code: Select all  Expand view  RUN

      COLUMNS { || oBrw:aRow:cHeader }, { || oBrw:aRow:Value } ;
 

as
Code: Select all  Expand view  RUN

      COLUMNS "cHeader", "Value" ;
 


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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 77 guests