Xbrowse and Select clause problem

Xbrowse and Select clause problem

Postby cdmmaui » Sat May 05, 2018 7:51 pm

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
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Xbrowse and Select clause problem

Postby nageswaragunupudi » Sun May 06, 2018 1:05 am

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse and Select clause problem

Postby cdmmaui » Sun May 06, 2018 1:21 am

Dear Rao, thank you. I started doing that to resolve the issue.
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Xbrowse and Select clause problem

Postby nageswaragunupudi » Sun May 06, 2018 1:28 am

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse and Select clause problem

Postby cdmmaui » Sun May 06, 2018 1:39 am

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!!!
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Xbrowse and Select clause problem

Postby cdmmaui » Sun May 06, 2018 1:50 pm

Dear Rao,

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

Thank you!
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Xbrowse and Select clause problem

Postby nageswaragunupudi » Sun May 06, 2018 1:53 pm

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse and Select clause problem

Postby cdmmaui » Sun May 06, 2018 2:08 pm

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. )
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Xbrowse and Select clause problem

Postby Rick Lipkin » Sun May 06, 2018 5:09 pm

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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Xbrowse and Select clause problem

Postby nageswaragunupudi » Sun May 06, 2018 5:15 pm

He asked if he can make WBrowse look like XBrowse.
It is the other way. Can you help making WBrowse look like XBrowse?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse and Select clause problem

Postby cdmmaui » Sun May 06, 2018 5:24 pm

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!
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Xbrowse and Select clause problem

Postby nageswaragunupudi » Sun May 06, 2018 6:14 pm

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse and Select clause problem

Postby cdmmaui » Sun May 06, 2018 7:03 pm

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.
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Xbrowse and Select clause problem

Postby nageswaragunupudi » Sun May 06, 2018 7:06 pm

Code: Select all  Expand view
if __ObjHasMethod( oLbx, "UPSTABLE" )
   oLbx:Upstable()
endif
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse and Select clause problem

Postby cdmmaui » Sun May 06, 2018 7:25 pm

Dear Rao,

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

I appreciate your help and patience.
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong


Return to FiveWin for Harbour/xHarbour

Who is online

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