Page 1 of 1

Xbrowse and Select clause problem

PostPosted: Sat May 05, 2018 7:51 pm
by cdmmaui
Hello Everyone,

I am converting LISTBOX to XBROWSE and on certain XBROWSE the data is not displayed properly and the SELECT is not working as it did with LISTBOX

When I use the XBROWSE below, all the data is the same even though they actually have different values, I was able to add the ALIAS clause to resolve.

However, when the user clicks the vertical scrollbar up or down, this display goes beyond the scope of the SELECT.

Also, I reviewed sample RC used the same details, however Pelles C changes the properties when I save to RC and RES

CONTROL "", 5000, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, 232, 62, 450, 57

saves (changes) to

CONTROL "", 5000, "TXBrowse", WS_TABSTOP|0x00300000, 232, 62, 450, 57

How do I resolve this issue?

cAlias1 := "qtedim"

SELECT qtedim
GO TOP
SEEK cSerial
REDEFINE LISTBOX oLbx1 FIELDS STR( qtedim->pcs, 9 ) , ;
qtedim->type , ;
qtedim->desc , ;
STR( qtedim->len, 5 ) , ;
STR( qtedim->wid, 5 ) , ;
STR( qtedim->hgt, 5 ) , ;
STR( qtedim->lbs, 9, 2 ) ;
ID 5000 ;
HEADERS "Qty", "Pkg", "Commodity", "(L)", "(W)", "(H)", "LBS" ;
FIELDSIZES 75 , 100 , 200 , 75 , 75 , 75 , 75 ;
ALIAS (cAlias1) ;
ON DBLCLICK ( _QtyLine( oLbx1, .F., @nPcs, @cPkg, @nLbs, @nKgs, @nCft, @nCm ), _GetRef( aGet ) ) ;
SELECT qtedim->serial FOR cSerial ;
OF oFld:aDialogs[1]

// Xbrowse
oLbx1:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbx1:nRowDividerStyle := LINESTYLE_BLACK

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 1:05 am
by nageswaragunupudi
SELECT clause in XBrowse is dummy and does not work. It was provided only for quick conversion from listbox to xbrowse.

Instead, Scope or Filter needs to be set on the Alias() in the application program.

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 1:21 am
by cdmmaui
Dear Rao, thank you. I started doing that to resolve the issue.

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 1:28 am
by nageswaragunupudi
Also, one more suggestion.
Unless there is a need to use some exclusive features of xbrowse, it may not be worth converting from listbox (wbrowse) to xbrowse. WBrowse is the fastest browse.

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 1:39 am
by cdmmaui
Dear Rao,

Customers like the look of xBrowse, is it possible to get Listbox to look like xBrowse? If so, can you provide a property list for listbox?

Thanks again for your support!!!

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 1:50 pm
by cdmmaui
Dear Rao,

Thanks again for your help! By the way, is :upstable still required for Listboxes?

Thank you!

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 1:53 pm
by nageswaragunupudi
cdmmaui wrote:Dear Rao,

Thanks again for your help! By the way, is :upstable still required for Listboxes?

Thank you!

Please retain upstable for listboxes.
Nothing of the sort is required for xbrowse.

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 2:08 pm
by cdmmaui
Dear Rao,

I have a function that is called to handle upstable, refresh and setfocus listed below. Is there a property I check to determine if upstable is required or not?

FUNC _Lbx( oLbx )

oLbx:Upstable() // CAN I CHECK IF THIS REQUIRED OR NOT?
oLbx:Refresh()
oLbx:Setfocus()
Sysrefresh()

RETURN( .T. )

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 5:09 pm
by Rick Lipkin
Darrell

If you want xBrowse to look more like Listbox ... turn off the left site Record Selector:

Code: Select all  Expand view

oLbx:lRecordSelector := .f.
 


If you want to control the color of the Header and footer you can control the color regardless whether you use the 2007 or 2010 Clause:

Code: Select all  Expand view


// light grey

oLbx:bClrGrad := { | lInvert | If( ! lInvert, ;
                    { { 0.50, 15790320, 15790320 }, ;
                    { 0.50,   15790320, 15790320 } }, ;
                    { { 0.50, 15790320, 15790320 }, ;
                    { 0.50,   15790320, 15790320 } } ) }

 


Rick Lipkin

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 5:15 pm
by nageswaragunupudi
He asked if he can make WBrowse look like XBrowse.
It is the other way. Can you help making WBrowse look like XBrowse?

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 5:24 pm
by cdmmaui
Hello,

When I call :upstable() within XBrowse, I get an error (invalid method). I would like to have code that allows me check if :upstable() method is valid, if valid then call :upstable(), otherwise do not call method.

Thanks!

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 6:14 pm
by nageswaragunupudi
cdmmaui wrote:Hello,

When I call :upstable() within XBrowse, I get an error (invalid method). I would like to have code that allows me check if :upstable() method is valid, if valid then call :upstable(), otherwise do not call method.

Thanks!

There is no upstable method in XBrowse.
In fact, there is no need for it.
XBrowse internally handles everything for you.
Just forget about upstable, when you use XBrowse.

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 7:03 pm
by cdmmaui
Dear Rao,

I understand that, however, I have over 300 PRG that call function _Lbx( oLbx ) which does what I mentioned in previous e-mails. Now that I have part XBROWSE and part LISTBOX calling that function after user completes data entry, I do not want to have to go each and update each _Lbx( oLbx ), I would like to save the amount of time and leave code as is and simply check oLbx and determine if oLbx:Upstable() is a defined method or not, similar to checking variables, i.e. VALTYPE or TYPE, if return value is "U" (undefined), I simply won't call that method and avoid the runtime error.

If that is not possible, then I need to change all code back to LISTBOX or leave with XBROWSE and add the SET FILTER TO.

I hope that was a better explanation of what I am trying to do.

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 7:06 pm
by nageswaragunupudi
Code: Select all  Expand view
if __ObjHasMethod( oLbx, "UPSTABLE" )
   oLbx:Upstable()
endif

Re: Xbrowse and Select clause problem

PostPosted: Sun May 06, 2018 7:25 pm
by cdmmaui
Dear Rao,

Thank you!!!!! That is what I was looking for!

I appreciate your help and patience.