Problem with xBrowse multiheaders

Problem with xBrowse multiheaders

Postby fraxzi » Tue Jan 27, 2009 5:57 am

Hello!

Can I use REDEFINE XBROWSE method in defining for multi-header xBrowse or only in TXBrowse():New( oWnd )...oBrw:CreateFromCode() construct?

Problem is when I include this line after REDEFINE XBROWSE (with 3 RDD column)
Code: Select all  Expand view  RUN
...
                              oDBMaint:nHeader          :=  1
                              oDBMaint:aHeaderTop    := {'Test'}
                              oDBMaint:nHeaderHeight  := 38

                              oDBMaint:aCols[1]:nHeaderType   := 3
                              oDBMaint:aCols[2]:nHeaderType   := 1
                              oDBMaint:aCols[3]:nHeaderType   := 1
...


receiving "Bound error: array access"


Regards,
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: Problem with xBrowse multiheaders

Postby Silvio » Tue Jan 27, 2009 11:04 am

can you make a minimal sample pls ?

you want include one menu in 3 column ?

Image
TO FIRST COLUMN YOU MUST USE nHeaderType := 2 it create this |-

if there is anopther column you must insert nHeaderType := 1 it create this ___

then you must close the multiheader with nHeaderType := 1 it create this -|

I hope you understand now
this is a test sample
Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "XBrowse.ch"


Stati oMain


function main()
   local oBar
   local oBrush
   local oPopup

   DEFINE BRUSH oBrush COLOR nRGB( 12, 129, 87 )

   DEFINE WINDOW oMain MDI FROM 1, 10 TO 20, 60 ;
      TITLE "Testing Header xBrowse" ;
      BRUSH oBrush

   DEFINE BUTTONBAR oBar OF oMain _3D

   DEFINE BUTTON OF oBar FILE "..\bitmaps\16x16\exit.bmp" ACTION ( oMain:End() )
   DEFINE BUTTON OF oBar FILE "..\bitmaps\16x16\New.bmp"  ACTION ( TestHeader() )

   ACTIVATE WINDOW oMain

Retu Nil


func TestHeader
   local oWnd, oBrw
   Local oCol, xColBrw:=Array(10,11), K:=0, cCustomer


   USE CUSTOMER ALIAS cCustomer NEW

   DEFINE WINDOW oWnd MDICHILD OF oMain


   oBrw := TXBrowse():New( oWnd )


   oBrw:nMarqueeStyle       := MARQSTYLE_HIGHLCELL
   oBrw:nColDividerStyle    := LINESTYLE_LIGHTGRAY // LINESTYLE_BLACK
   oBrw:nRowDividerStyle    := LINESTYLE_LIGHTGRAY // LINESTYLE_NOLINES

   oBrw:nHeader             :=  1
   oBrw:aHeaderTop          := {"D A T A  G E N E R A L "}
   oBrw:nHeaderHeight       := 38
   oBrw:bClrHeader          := { || { nRGB( 0, 0, 0 ), nRGB( 203, 225, 252 ), nRGB( 255, 255, 220 ), nRGB( 247, 192, 91 ) } }

   oBrw:cAlias              := cCustomer

   oBrw:lAllowColSwapping   := .f.
   oBrw:lColDividerComplete := .t.
   oBrw:lHScroll            := .f.

   oBrw:lFastEdit           := .t.
   oBrw:nFreeze             :=  3

   xColBrw[01] := { "First",      AL_CENTER, .T.,  50,  AL_LEFT,   "@30",            0,  { |o| (oBrw:cAlias)->FIRST },                    { || (oBrw:cAlias)->FIRST },     2,  AL_LEFT  }
   xColBrw[02] := { "Last",       AL_CENTER, .T.,  60,  AL_LEFT,   "@30",            1,  { |o| (oBrw:cAlias)->LAST },                     { || (oBrw:cAlias)->LAST },      1,  AL_RIGHT }
   xColBrw[03] := { "Street",     AL_CENTER, .T.,  70,  AL_LEFT,   "@30",            1,  { |o| (oBrw:cAlias)->STREET },                   { || (oBrw:cAlias)->STREET },    1,  AL_RIGHT }



For K:=1 To 3
     oCol := oBrw:AddCol()
     oCol:AddBmpfile( "CLIP.bmp" )
     oCol:cHeader        := xColBrw[K,01]
     oCol:nHeaderType    := xColBrw[K,10]
     oCol:nHeadStrAlign  := xColBrw[K,02]
     oCol:nFootStrAlign  := xColBrw[K,11]
     oCol:lAllowSizing   := xColBrw[K,03]
     oCol:nWidth         := xColBrw[K,04]
     oCol:nDataStrAlign  := xColBrw[K,05]
     oCol:cEditPicture   := xColBrw[K,06]
     oCol:nEditType      := xColBrw[K,07]
     oCol:bStrData       := xColBrw[K,08]
     oCol:bEditValue     := xColBrw[K,09]
     oCol:nHeadBmpNo    := 1
  Next K


  oBrw:nColSel := 2
  oBrw:SetRDD()
  oBrw:CreateFromCode()
  oWnd:SetControl( oBrw )
  ACTIVATE WINDOW oWnd



Retu ( Nil )
Best Regards, Saludos

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

Re: Problem with xBrowse multiheaders

Postby fraxzi » Wed Jan 28, 2009 3:22 am

Hi there Silvio!

I replaced
Code: Select all  Expand view  RUN
oBrw:bClrHeader   := { || { nRGB( 0, 0, 0 ), nRGB( 203, 225, 252 )} }


with this (to eliminate bound array error)
Code: Select all  Expand view  RUN
oBrw:bClrHeader   := { || { nRGB( 0, 0, 0 ), nRGB( 203, 225, 252 ), nRGB( 255, 255, 220 ), nRGB( 247, 192, 91 ) } }


I followed the nHeaderType := 2 ... 1 but I can't get the exact results of your sample or with testhead.prg.. My headers are clickable or has autosort when headers are clicked.
The results display different.

Code: Select all  Expand view  RUN
                                       oCBSList:nHeader        :=  1
                                       oCBSList:aHeaderTop     := {'Test'}
                                       oCBSList:nHeaderHeight  := 42

                                       oCBSList:aCols[ 1]:nHeaderType   := 2
                                       oCBSList:aCols[ 2]:nHeaderType   := 1
                                       oCBSList:aCols[ 3]:nHeaderType   := 1


Result
Image

what is nHeaderType := 3
what is nHeaderType := 4

Any suggestions :?:



Regards,
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: Problem with xBrowse headers

Postby Silvio » Wed Jan 28, 2009 8:39 am

I saw you not understand How create it : it is easy

if U want create a superheader xbrowse you must understand this:

1. how many super header you want

2. How column U want inser into first header , second header ,ecc.

If you send me a sample what and howMany header you want I can help YOU




to create the superheader you must define these parameters :

oBrw:nHeader := 1
oBrw:aHeaderTop := {"title1", "title2 "}

and assign to each columns the type of header

oCol:nHeaderType := nHeaderType

Info :
nHeaderType 0 = Normal ( if you not want the superhader)
'' 1 = of type + ( plus you must sum of the last column )
'' 2 = INIT |- ( for open the superheader )
'' 3 = END -| ( to close the superheader )


I hope you understand now but if you send me an minimal sample How I can help U ?
Best Regards, Saludos

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

Re: Problem with xBrowse multiheaders

Postby fraxzi » Wed Jan 28, 2009 9:11 am

I got it :oops: Thanks :lol:

Code: Select all  Expand view  RUN
...
             oCBSList:aCols[ 1]:nHeaderType   := 2
             oCBSList:aCols[ 2]:nHeaderType   := 1
             oCBSList:aCols[ 3]:nHeaderType   := 1
             oCBSList:aCols[ 4]:nHeaderType   := 3
...


Thanks for the explanations.

Regards,
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

Another with xBrowse multiheaders

Postby Silvio » Fri Jan 30, 2009 11:58 am

Ing. Stephan ask another problem

> have a problem with the MultiHeaders.
>I have 5 columns and I want 2 MultiHeaders beginning at the second column, every Multiheader over 2 columns.
>The first Multiheader over Last and Street and the second over Counry and State. The first column has a normal header.
>So I set :
>nHeaderType of Column 1 to 0 - no Multiheader
>nHeaderType of Column 2 to 2 - Start of the first Multiheader
>nHeaderType of Column 3 to 3 - End of the first Multiheader
>nHeaderType of Column 4 to 2- Start of the second Multiheader
>nHeaderType of Column 5 to 3- End of the second Multiheader
> What am I doing wrong ?


Solution :

0
2
1
4
1

Image

the code :

Code: Select all  Expand view  RUN
   
#include "FiveWin.ch"
    #include "XBrowse.ch"



    Stati oMain


    function main()
       local oBar
       local oBrush
       local oPopup

       DEFINE BRUSH oBrush COLOR nRGB( 12, 129, 87 )

       DEFINE WINDOW oMain MDI FROM 1, 10 TO 20, 60 ;
          TITLE "Testing Header xBrowse" ;
          BRUSH oBrush

       DEFINE BUTTONBAR oBar OF oMain _3D

       DEFINE BUTTON OF oBar FILE "..\bitmaps\16x16\exit.bmp" ACTION ( oMain:End() )
       DEFINE BUTTON OF oBar FILE "..\bitmaps\16x16\New.bmp"  ACTION ( TestHeader() )

       ACTIVATE WINDOW oMain

    Retu Nil


    func TestHeader
       local oWnd, oBrw
       Local oCol, xColBrw:=Array(10,11), K:=0, cCustomer

       USE CUSTOMER ALIAS cCustomer NEW

       DEFINE WINDOW oWnd MDICHILD OF oMain


       oBrw := TXBrowse():New( oWnd )


       oBrw:nMarqueeStyle       := MARQSTYLE_HIGHLCELL
       oBrw:nColDividerStyle    := LINESTYLE_LIGHTGRAY // LINESTYLE_BLACK
       oBrw:nRowDividerStyle    := LINESTYLE_LIGHTGRAY // LINESTYLE_NOLINES

       oBrw:nHeader             := 1
       oBrw:aHeaderTop          := {"D A T A  G E N E R A L ","Country"}
       oBrw:nHeaderHeight       := 38
       oBrw:bClrHeader          := { || { nRGB( 0, 0, 0 ), nRGB( 203, 225, 252 ), nRGB( 255, 255, 220 ) } }
       oBrw:cAlias              := cCustomer

       oBrw:lAllowColSwapping   := .f.
       oBrw:lColDividerComplete := .t.
       oBrw:lHScroll            := .f.

       oBrw:lFastEdit           := .t.
       oBrw:nFreeze             :=  3

       xColBrw[01] := { "First", AL_CENTER, .T.,  50,  AL_LEFT,   "@30", 0,  { |o| (oBrw:cAlias)->FIRST }, { || (oBrw:cAlias)->FIRST }, 0,  AL_LEFT  }
       xColBrw[02] := { "Last",  AL_CENTER, .T.,  60,  AL_LEFT,   "@30", 1,  { |o| (oBrw:cAlias)->LAST },  { || (oBrw:cAlias)->LAST },  2,  AL_RIGHT }
       xColBrw[03] := { "Street",AL_CENTER, .T.,  70,  AL_LEFT,   "@30", 1,  { |o| (oBrw:cAlias)->STREET },{ || (oBrw:cAlias)->STREET },1,  AL_RIGHT }
       xColBrw[04] := { "City",  AL_CENTER, .T.,  70,  AL_LEFT,   "@30", 1,  { |o| (oBrw:cAlias)->CITY }, { || (oBrw:cAlias)->CITY },   4,  AL_RIGHT }
       xColBrw[05] := { "State", AL_CENTER, .T.,  70,  AL_LEFT,   "@30", 1,  { |o| (oBrw:cAlias)->STATE },{ || (oBrw:cAlias)->STATE },  1,  AL_RIGHT }


    For K:=1 To 5
         oCol := oBrw:AddCol()
         oCol:AddBmpfile( "CLIP.bmp" )
         oCol:cHeader        := xColBrw[K,01]
         oCol:nHeaderType    := xColBrw[K,10]
         oCol:nHeadStrAlign  := xColBrw[K,02]
         oCol:nFootStrAlign  := xColBrw[K,11]
         oCol:lAllowSizing   := xColBrw[K,03]
         oCol:nWidth         := xColBrw[K,04]
         oCol:nDataStrAlign  := xColBrw[K,05]
         oCol:cEditPicture   := xColBrw[K,06]
         oCol:nEditType      := xColBrw[K,07]
         oCol:bStrData       := xColBrw[K,08]
         oCol:bEditValue     := xColBrw[K,09]
         oCol:nHeadBmpNo    := 1
      Next K


      oBrw:nColSel := 2
      oBrw:SetRDD()
      oBrw:CreateFromCode()
      oWnd:SetControl( oBrw )

      ACTIVATE WINDOW oWnd maximized



    Retu ( Nil )
Best Regards, Saludos

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

Re: Problem with xBrowse multiheaders

Postby fraxzi » Sat Jan 31, 2009 3:36 am

How to center the superheader?
Image

Regards,
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: Problem with xBrowse multiheaders

Postby ukoenig » Sat Jan 31, 2009 5:22 pm

Position of Header-String :
( I cannot test it with Multiheader, but I think, it will be the same )

Centered Header-Text in Column 2
------------------------------------------
oBrw:aCols[2]:nHeadStrAlign := AL_CENTER

Regards
Uwe :lol:
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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Problem with xBrowse multiheaders

Postby Silvio » Sun Feb 01, 2009 2:21 am

yes it is the same
Why not you show your test sample here , we can correct it ...
Best Regards, Saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

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