Page 1 of 1

oBarGet on xbrowse header

PostPosted: Thu Dec 07, 2017 12:57 am
by reinaldocrespo
Hello everyone!

1. Is it possible to have a button or a series of buttons on the header of an xbrowse column?

2. I tried to add a button to the get object on the header of an xbrowse but I get a runtime error. I'm guessing the get object hasn't been instantiated until :CreateFromCode() is executed.

Code: Select all  Expand view

...
      :nHeaderHeight := 40
      :lGetBar       := .t.
      :oCol:oBarGet:bAction   := {|| MsgInfo( "clicked ") }
      :oCol:oBarGet:cBmpName  := "SEARCH16"
      :oCol:oBarGet:cCueText  := "Filtered ManagerID"
 


Error occurred at: 12/06/2017, 19:45:21
Error description: Error BASE/1005 No exported variable: BACTION
Args:
[ 1] = U
[ 2] = B {|| ... }


Any Ideas?


Reinaldo.

Re: oBarGet on xbrowse header

PostPosted: Thu Dec 07, 2017 8:26 am
by AntoninoP
Hello,
I think you need to call
Code: Select all  Expand view
:oCol:CreateBarGet()
before access it...

Re: oBarGet on xbrowse header

PostPosted: Thu Dec 07, 2017 4:07 pm
by nageswaragunupudi
Mr Reinaldo

As of now, this is not possible.

2. I tried to add a button to the get object on the header of an xbrowse but I get a runtime error. I'm guessing the get object hasn't been instantiated until :CreateFromCode() is executed.


oBarGets are created during execution of oBrw:Adjust() by calling an "internal" method oCol:CreateBarGet(). WIKI clearly lists this as one of the internal methods.

oBrw:Adjust() method is executed in oBrw:CreateFromCode() in case of browses on windows and ON INIT in case of browses on Dialogs.

After oBrw:Adjust() is executed, oBarGets of the specified columns are created but now it is too late to add button and bAction, because we need to do this at the time of creation of Get.

Re: oBarGet on xbrowse header

PostPosted: Thu Dec 07, 2017 4:22 pm
by AntoninoP
nageswaragunupudi wrote:oBarGets are created during execution of oBrw:Adjust() by calling an "internal" method oCol:CreateBarGet(). WIKI clearly lists this as one of the internal methods.


Just for curiosity, why is it not declared as hidden ?

Re: oBarGet on xbrowse header

PostPosted: Thu Dec 07, 2017 4:51 pm
by nageswaragunupudi
Yes, we could have declared this method as protected.

Re: oBarGet on xbrowse header

PostPosted: Fri Dec 08, 2017 5:45 pm
by reinaldocrespo
nageswaragunupudi wrote:Mr Reinaldo

After oBrw:Adjust() is executed, oBarGets of the specified columns are created but now it is too late to add button and bAction, because we need to do this at the time of creation of Get.


I suppose it wouldn't be too complicated to add a couple of new DATA to the column object so that bAction and cbitmap to be used with the TGet object be declared before it is created. I will do it on my end while it gets added to xbrowse.

Reinaldo.

Re: oBarGet on xbrowse header

PostPosted: Fri Dec 08, 2017 5:46 pm
by nageswaragunupudi
yes

Re: oBarGet on xbrowse header

PostPosted: Fri Dec 15, 2017 3:31 pm
by nageswaragunupudi
Provided in 17.12.