FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xbrowse and Select clause problem
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Xbrowse and Select clause problem
Posted: Sat May 05, 2018 07: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 01: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
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 01:21 AM

Dear Rao, thank you. I started doing that to resolve the issue.

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 01: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
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 01: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
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 01: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 01: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
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 02: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
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 05:09 PM
Darrell

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

Code (fw): Select all Collapse
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 (fw): Select all Collapse
// 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 05: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
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 05: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 06: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
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 07: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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 07:06 PM
Code (fw): Select all Collapse
if __ObjHasMethod( oLbx, "UPSTABLE" )
   oLbx:Upstable()
endif
Regards



G. N. Rao.

Hyderabad, India
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Xbrowse and Select clause problem
Posted: Sun May 06, 2018 07: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

Continue the discussion