Page 1 of 1

xBrowse bLClickHeader

Posted: Wed Mar 16, 2022 10:29 pm
by Detlef
Hi all,
I have an issue when double clicking an xBrowse header.
If I run the program below the codeblock bLClickHeader is executeted on start of the dialog. ( no click at all )
But when I click the header the codeblock is not fired.

What could be wrong?
regards, Detlef

Code: Select all | Expand

#include "FiveWin.ch"
#include "xbrowse.ch"

FUNCTION Main()
//-------------
LOCAL oBrw, oDlg
LOCAL aData := {;
                  { "line 1-1", "line 1-2", "line 1-3" },;
                  { "line 2-1", "line 2-2", "line 2-3" },;
                  { "line 3-1", "line 3-2", "line 3-3" },;
                  { "line 4-1", "line 4-2", "line 4-3" },;
                  { "line 5-1", "line 5-2", "line 5-3" },;
                  { "line 6-1", "line 6-2", "line 6-3" },;
                  { "line 7-1", "line 7-2", "line 7-3" },;
                  { "line 8-1", "line 8-2", "line 8-3" },;
                  { "line 9-1", "line 9-2", "line 9-3" } ;
               }

   DEFINE DIALOG oDlg FROM 2,2 TO 18, 62 TITLE "Dialog for Test"

   @ 1, 1 XBROWSE oBrw OF oDlg             ;
      HEADERS "Elem 1", "Elem 2", "Elem 3" ;
      SIZE 220, 100                        ;
      COLSIZES 100, 100, 100               ;
      ARRAY aData AUTOCOLS

   oBrw:CreateFromCode()

   WITH OBJECT oBrw:aCols[ 1 ]
      :cSortOrder    := NIL
      :cOrder        := NIL
      :bLClickHeader := msginfo( oBrw:nArrayAt )
   END

   ACTIVATE DIALOG oDlg ON INIT( oDlg:center() )
RETURN NIL
 

Re: xBrowse bLClickHeader

Posted: Thu Mar 17, 2022 12:15 am
by FranciscoA
Try

Code: Select all | Expand

:bLClickHeader := { || msginfo( oBrw:nArrayAt ) }

Re: xBrowse bLClickHeader

Posted: Thu Mar 17, 2022 7:55 am
by Detlef
Yes, Francisco... that's working fine now!
Many thanks.
After so many years without FWH coding I make a lot of silly mistakes, sorry.
Detlef

Re: xBrowse bLClickHeader

Posted: Thu Mar 17, 2022 1:54 pm
by FranciscoA
Do not worry.
We are here to help each other.
Regards.