Problem 2 txbrowse in 1 dialog

Problem 2 txbrowse in 1 dialog

Postby Marc Vanzegbroeck » Fri Oct 24, 2008 11:46 am

Hi,

I have created 2 txbrowse from resource in 1 dialog.
If I select a row 1 the first one and then select de second txbrowse, the first scroll and another row is seleced. If I then select the first one again, I have the same problem with the second one.

I did't have that problem with twbrowse. Is there something special to do to work with to txbrowse?

Thanks,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

2 Browser inside a Dialog

Postby ukoenig » Fri Oct 24, 2008 12:55 pm

Hello,

A sample :
2 Array-Browsers from resources inside a folder
for Dialog change :
oLbx2 := TXBrowse():New( oFld:aDialogs[1] )
to :
oLbx2 := TXBrowse():New( oDlg )

( The Array < aBRCOLOR > is the same in browser 1 and 2 for Color-selection )

Image

Code: Select all  Expand view

// ---------- The Array --------------

PRIVATE aBRCOLOR[8][2]
aBRCOLOR[1] := { "1", "Black" }
aBRCOLOR[2] := { "2", "White" }
aBRCOLOR[3] := { "3", "Blue" }
aBRCOLOR[4] := { "4", "Green" }
aBRCOLOR[5] := { "5", "Red" }
aBRCOLOR[6] := { "6", "Yellow" }
aBRCOLOR[7] := { "7", "Mag." }
aBRCOLOR[8] := { "8", "SELECT" }

// ------- Browser 1 --------------------

oLbx2 := TXBrowse():New( oFld:aDialogs[1] )
oLbx2:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbx2:nColDividerStyle  := LINESTYLE_BLACK
oLbx2:nRowDividerStyle := LINESTYLE_BLACK
oLbx2:nRecSelColor = 15512898
oLbx2:bClrSelFocus = { || { 16777215, 15512898 } }
oLbx2:bClrSel = { || { 16777215, 15512898 } }

oLbx2:SetArray( aBRCOLOR )
oLbx2:aCols[ 1 ]:cHeader = Padr("No.", 3)
oLbx2:aCols[ 2 ]:cHeader = Padr("Start", 19)
oLbx2:lHScroll := .F.
oLbx2:lVScroll := .F.
oLbx2:lFooter := .T.
oLbx2:bLClicked := { | nRow, nCol | ROW_POS1 := oLbx2:nRowSel, ;
                        Function1() }
oLbx2:aCols[ 2 ]:AddResource("Black")
oLbx2:aCols[ 2 ]:AddResource("White")
oLbx2:aCols[ 2 ]:AddResource("Blue")
oLbx2:aCols[ 2 ]:AddResource("Green")
oLbx2:aCols[ 2 ]:AddResource("Red")
oLbx2:aCols[ 2 ]:AddResource("Yellow")
oLbx2:aCols[ 2 ]:AddResource("Magenta")
oLbx2:aCols[ 2 ]:bBmpData := {|| oLbx2:nArrayAt }
oLbx2:aCols[ 2 ]:bStrData := {|| oLbx2:aRow[2] }   

oLbx2:nArrayAt := ROW_POS1
oLbx2:nRowSel := ROW_POS1

oLbx2:nFooterHeight := 15

oLbx2:CreateFromResource( 110 )


// ----- Browser 2 --------------

oLbx3 := TXBrowse():New( oFld:aDialogs[1] )
oLbx3:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbx3:nColDividerStyle  := LINESTYLE_BLACK
oLbx3:nRowDividerStyle := LINESTYLE_BLACK
oLbx3:nRecSelColor = 15512898
oLbx3:bClrSelFocus = { || { 16777215, 15512898 } }
oLbx3:bClrSel = { || { 16777215, 15512898 } }

oLbx3:SetArray( aBRCOLOR )
oLbx3:aCols[ 1 ]:cHeader = Padr("No.", 3)
oLbx3:aCols[ 2 ]:cHeader = Padr("End", 19)
oLbx3:lHScroll := .F.
oLbx3:lVScroll := .F.
oLbx3:lFooter := .T.
oLbx3:bLClicked := { | nRow, nCol | ROW_POS2 := oLbx3:nRowSel, ;
                          Function2() }
oLbx3:aCols[ 2 ]:AddResource("Black")
oLbx3:aCols[ 2 ]:AddResource("White")
oLbx3:aCols[ 2 ]:AddResource("Blue")
oLbx3:aCols[ 2 ]:AddResource("Green")
oLbx3:aCols[ 2 ]:AddResource("Red")
oLbx3:aCols[ 2 ]:AddResource("Yellow")
oLbx3:aCols[ 2 ]:AddResource("Magenta")
oLbx3:aCols[ 2 ]:bBmpData := {|| oLbx3:nArrayAt }
oLbx3:aCols[ 2 ]:bStrData := {|| oLbx3:aRow[2] }   

oLbx3:nArrayAt := ROW_POS2
oLbx3:nRowSel := ROW_POS2

oLbx3:nFooterHeight := 15

oLbx3:CreateFromResource( 120 )



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

Postby Marc Vanzegbroeck » Fri Oct 24, 2008 1:09 pm

Uwe,

This is how implement it:
Code: Select all  Expand view
   vGetlist[3] := TXBrowse():New( oDlg )
   vGetlist[3]:CreateFromResource( 101 )

   oCol := vGetlist[3]:AddCol()
   oCol:bStrData      := { || dag->mecanic_01}
   oCol:cHeader       := planmec->naam01
   oCol:nWidth        := 100
   oCol:lAllowSizing  := .f.

   oCol := vGetlist[3]:AddCol()
   oCol:bStrData      := { || dag->mecanic_02}
   oCol:cHeader       := planmec->naam02
   oCol:nWidth        := 100
   oCol:lAllowSizing  := .f.

   vGetlist[3]:lAllowRowSizing     := .f.
   vGetlist[3]:nRowHeight          := 20
   vGetlist[3]:nMarqueeStyle       := MARQSTYLE_HIGHLCELL
   vGetlist[3]:nColDividerStyle    := LINESTYLE_LIGHTGRAY
   vGetlist[3]:nRowDividerStyle    := LINESTYLE_LIGHTGRAY

   vGetlist[4] := TXBrowse():New( oDlg )
   vGetlist[4]:CreateFromResource( 102 )

   sele todo

   oCol := vGetlist[4]:AddCol()
   oCol:bStrData      := { || transform(todo->plaatnr,"@R !!!-!!!")}
   oCol:cHeader       := 'Plaat'
   oCol:nWidth        := 60
   oCol:lAllowSizing  := .f.

   oCol := vGetlist[4]:AddCol()
   oCol:bStrData      := { || todo->todo_01}
   oCol:cHeader       := 'Werk'
   oCol:nWidth        := 200
   oCol:lAllowSizing  := .f.

   vGetlist[4]:lAllowRowSizing     := .f.
   vGetlist[4]:nRowHeight          := 20
   vGetlist[4]:nMarqueeStyle       := MARQSTYLE_HIGHLROW
   vGetlist[4]:nColDividerStyle    := LINESTYLE_LIGHTGRAY
   vGetlist[4]:nRowDividerStyle    := LINESTYLE_LIGHTGRAY

   ACTIVATE DIALOG oDlg CENTERED


I don't find the error.

Regards,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

2 Browsers

Postby ukoenig » Fri Oct 24, 2008 1:26 pm

Hello,

I have a copy of your source and will check it.

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

2 Browsers in Dialog

Postby ukoenig » Fri Oct 24, 2008 5:08 pm

Hello,
I think i found whats wrong :

Code: Select all  Expand view
 
   // --------------- 1. browser ------------

   sele dag

   vGetlist[3] := TXBrowse():New( oDlg )
   vGetlist[3]:CreateFromResource( 101 )

   oCol := vGetlist[3]:AddCol()
   oCol:bStrData      := { || dag->mecanic_01}
   oCol:cHeader       := planmec->naam01
   oCol:nWidth        := 100
   oCol:lAllowSizing  := .f.

   oCol := vGetlist[3]:AddCol()
   oCol:bStrData      := { || dag->mecanic_02}
   oCol:cHeader       := planmec->naam02
   oCol:nWidth        := 100
   oCol:lAllowSizing  := .f.

   vGetlist[3]:lAllowRowSizing     := .f.
   vGetlist[3]:nRowHeight          := 20
   vGetlist[3]:nMarqueeStyle       := MARQSTYLE_HIGHLCELL
   vGetlist[3]:nColDividerStyle    := LINESTYLE_LIGHTGRAY
   vGetlist[3]:nRowDividerStyle    := LINESTYLE_LIGHTGRAY

   // --------------  2. Browser ------------------------

   sele todo // !!!!!!!

   vGetlist[4] := TXBrowse():New( oDlg )
   vGetlist[4]:CreateFromResource( 102 )

   // sele todo   !!! Wrong position
   // ---------------------------------

   oCol := vGetlist[4]:AddCol()
   oCol:bStrData      := { || transform(todo->plaatnr,"@R !!!-!!!")}
   oCol:cHeader       := 'Plaat'
   oCol:nWidth        := 60
   oCol:lAllowSizing  := .f.

   oCol := vGetlist[4]:AddCol()
   oCol:bStrData      := { || todo->todo_01}
   oCol:cHeader       := 'Werk'
   oCol:nWidth        := 200
   oCol:lAllowSizing  := .f.

   vGetlist[4]:lAllowRowSizing     := .f.
   vGetlist[4]:nRowHeight          := 20
   vGetlist[4]:nMarqueeStyle       := MARQSTYLE_HIGHLROW
   vGetlist[4]:nColDividerStyle    := LINESTYLE_LIGHTGRAY
   vGetlist[4]:nRowDividerStyle    := LINESTYLE_LIGHTGRAY


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

// Tested  i changed oBrw1 and oBrw2 in oBrw[1] and oBrw[2]  !!!!

DBSELECTAREA(1)

oBrw[1] := TXBrowse():New( oDlg )
oBrw[1]:nMarqueeStyle :=  MARQSTYLE_HIGHLROW
oBrw[1]:nColDividerStyle    := LINESTYLE_BLACK
oBrw[1]:nRowDividerStyle := LINESTYLE_BLACK
oBrw[1]:nColDividerStyle    := LINESTYLE_BLACK
oBrw[1]:nRowDividerStyle := LINESTYLE_BLACK
oBrw[1]:l2007 := .T.
oBrw[1]:bClrGrad := { | lInvert | If( ! lInvert, ;
{ { 0.50,16294002,15263976 }, ;
{ 0.50,15263976,16294002  } }, ;
{ { 0.50,8388608,15263976 }, ;
{ 0.50,15263976,8388608 } } ) }
oBrw[1]:bClrHeader := { || { 0, 0 } }
oBrw[1]:bClrFooter := { || { 0, 0 } }
oBrw[1]:bClrSelFocus = { || { 16777215,16288063 } }
oBrw[1]:nRecSelColor = 15638325
oBrw[1]:bClrSel = { || { 16777215,16288063 } }
oBrw[1]:lHScroll := .T.
oBrw[1]:lVScroll := .T.
oBrw[1]:lFooter := .T.
oBrw[1]:nHeaderHeight := 35
oBrw[1]:nFooterHeight := 35

oCol := oBrw[1]:AddCol()
oCol:AddResource( "CLIP" )
oCol:AddResource( "star" )
oCol:bLClickHeader = { | nMRow, nMCol, nFlags, Self | ;
    If( ::nHeadBmpNo == 2, ::nHeadBmpNo := 1, ;
   ::nHeadBmpNo := 2 ), ::oLbx30:Refresh() }
oCol:cHeader       := "CLIP"
oCol:nHeadBmpNo    := 1
oCol:nHeadBmpAlign := AL_RIGHT

oCol := oBrw[1]:AddCol()
oCol:bStrData  := { || (1)->First}
oCol:cHeader   := "First"
oCol:cFooter  := "First"

oCol := oBrw[1]:AddCol()
oCol:bStrData := { || (1)->Last}
oCol:cHeader  := "Last"
oCol:cFooter  := "Last"

oBrw[1]:oFont := oBrwFont

oBrw[1]:nRowHeight := 30

oBrw[1]:SetRDD()

oBrw[1]:CreateFromResource( 110 )

// ------------- Browser 2 -------------------

DBSELECTAREA(2)

oBrw[2] := TXBrowse():New( oDlg )
oBrw[2]:nMarqueeStyle :=  MARQSTYLE_HIGHLROW
oBrw[2]:nColDividerStyle    := LINESTYLE_BLACK
oBrw[2]:nRowDividerStyle := LINESTYLE_BLACK
oBrw[2]:nColDividerStyle    := LINESTYLE_BLACK
oBrw[2]:nRowDividerStyle := LINESTYLE_BLACK
oBrw[2]:l2007 := .T.
oBrw[2]:bClrGrad := { | lInvert | If( ! lInvert, ;
{ { 0.50,16294002,15263976 }, ;
{ 0.50,15263976,16294002  } }, ;
{ { 0.50,8388608,15263976 }, ;
{ 0.50,15263976,8388608 } } ) }
oBrw[2]:bClrHeader := { || { 0, 0 } }
oBrw[2]:bClrFooter := { || { 0, 0 } }
oBrw[2]:bClrSelFocus = { || { 16777215,16288063 } }
oBrw[2]:nRecSelColor = 15638325
oBrw[2]:bClrSel = { || { 16777215,16288063 } }
oBrw[2]:lHScroll := .T.
oBrw[2]:lVScroll := .T.
oBrw[2]:lFooter := .T.
oBrw[2]:nHeaderHeight := 35
oBrw[2]:nFooterHeight := 35

oCol := oBrw[2]:AddCol()
oCol:bStrData := { || (2)->Concepto}
oCol:cHeader  := "Last"
oCol:cFooter  := "Last"

oCol := oBrw[2]:AddCol()
oCol:bStrData := { || (2)->Codigo}
oCol:cHeader  := "City"
oCol:cFooter  := "City"

oBrw[2]:oFont := oBrwFont

oBrw[2]:nRowHeight := 30

oBrw[2]:SetRDD()

oBrw[2]:CreateFromResource( 120 )

// ----- Brush-Background and Header / Footer-Font ---------

DEFINE BRUSH oBrush RESOURCE "BRICK"   
 
oBrw[1]:SetBackGround( oBrush )
oBrw[2]:SetBackGround( oBrush )
RELEASE BRUSH oBrush
oBrw[1]:Refresh()
oBrw[2]:Refresh()

i := 1
FOR i := 1 TO LEN( oBrw[1]:aCols )
   WITH OBJECT oBrw[1]:aCols[i]
oBrw[1]:aCols[i]:oHeaderFont := oHeadFont
oBrw[1]:aCols[i]:bClrHeader := { || { 0,16294002 } }
oBrw[1]:aCols[i]:oFooterFont := oFootFont
oBrw[1]:aCols[i]:bClrFooter := { || { 0,8388608 } }
   END
NEXT

i := 1
FOR i := 1 TO LEN( oBrw[2]:aCols )
   WITH OBJECT oBrw[2]:aCols[i]
oBrw[2]:aCols[i]:oHeaderFont := oHeadFont
oBrw[2]:aCols[i]:bClrHeader := { || { 0,16294002 } }
oBrw[2]:aCols[i]:oFooterFont := oFootFont
oBrw[2]:aCols[i]:bClrFooter := { || { 0,8388608 } }
   END
NEXT



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

Postby Antonio Linares » Fri Oct 24, 2008 5:46 pm

Marc,

As Uwe explains you, select the other workarea before the second xbrowse:

select todo // !!!!!!!

vGetlist[4] := TXBrowse():New( oDlg )
vGetlist[4]:CreateFromResource( 102 )
regards, saludos

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

Postby Marc Vanzegbroeck » Fri Oct 24, 2008 6:55 pm

Uwe, Antonio,

I changed the position of 'sele todo' but it doesn't make a different.

Regards,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Marc Vanzegbroeck » Fri Oct 24, 2008 8:18 pm

The only difference is that I don't use

Code: Select all  Expand view
vGetlist[3]:setrdd()


Can this be the problem?

Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

2 Browsers

Postby ukoenig » Fri Oct 24, 2008 9:22 pm

Hello Marc,

Here you can download a complete Test-project.
Exe, make-files, bmp's ... is included.
Maybe it helps.

http://www.pflegeplus.com/fw_downloads/brwtest.zip

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

Postby Marc Vanzegbroeck » Sat Oct 25, 2008 7:42 am

Thanks Uwe,

I recompiled your example, and it's working fine.
I will now compare your code and mine to see the problem.

Regards,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Marc Vanzegbroeck » Sat Oct 25, 2008 7:53 am

Uwe,

The only difference I found is that you use
Code: Select all  Expand view
oBrw[2]:SetRDD()


If I use this in my program,I get a runtime error
Code: Select all  Expand view
   Error description: Error BASE/1004  Message not found: TXBROWSE:RDDSETDEFAULT

Stack Calls
===========
   Called from: tobject.prg => TXBROWSE:ERROR(172)
   Called from: tobject.prg => TXBROWSE:MSGNOTFOUND(205)
   Called from: tobject.prg => TXBROWSE:RDDSETDEFAULT(0)


Do you know what I have to do to use SetRDD()?

Thanks,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

2 Dialog-Browser

Postby ukoenig » Sat Oct 25, 2008 9:37 am

Hello Marc,

Did you test with the included make-file ?
In the sample-directory you find 2 files :

Go.bat ( Start-file )
and :
DlgTest.rmk ( the Make-file )

On top of the Make-file just change the first lines
with your install-directorys.
Then call GO to compile.
Maybe in your Make-file something is missing.

HBDIR=d:\xharbour
BCDIR=d:\bcc55
FWDIR=d:\fwh

Otherwise maybe Antonio knows, what could be the reason for the error.

Regards
Uwe :lol:
Last edited by ukoenig on Sat Oct 25, 2008 9:39 am, edited 1 time in total.
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

Postby Antonio Linares » Sat Oct 25, 2008 9:38 am

Marc,

Here you have a simple example that shows how SetRDD() has to be used:
Code: Select all  Expand view
#include "FiveWin.ch"
#include "XBrowse.ch"

function Main()

   local oWnd, oBrw, oCol

   USE Customer

   DEFINE WINDOW oWnd
   
   @ 0, 0 XBROWSE oBrw OF oWnd ALIAS "Customer"
   
   oCol = oBrw:AddCol()
   oCol:bStrData = { || Customer->First }
   oCol:cHeader = "First"
   
   oBrw:SetRdd()
   oBrw:CreateFromCode()
   
   oWnd:oClient = oBrw

   ACTIVATE WINDOW oWnd

return nil
regards, saludos

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

Postby Marc Vanzegbroeck » Sat Oct 25, 2008 9:49 am

Uwe,

I did change that go.bat and the rmk-file, and your program is working fine, the only problem is that mine isn't.

If I put the oBrw:SetRdd() in mine I get the error.

The example testxbrw.prg in the example-directory is also working wine with the oBrw:SetRdd().

I don't know why I get the 'Message not found: TXBROWSE:RDDSETDEFAULT ' error :(

Regards,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Antonio Linares » Sat Oct 25, 2008 9:57 am

Marc,

Please copy here the complete calls stack list:
Code: Select all  Expand view
Stack Calls
===========
   Called from: tobject.prg => TXBROWSE:ERROR(172)
   Called from: tobject.prg => TXBROWSE:MSGNOTFOUND(205)
   Called from: tobject.prg => TXBROWSE:RDDSETDEFAULT(0)
...

Class TXBrowse does not have a Method RddSetDefault() so we need to find where is getting called from.
regards, saludos

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 86 guests