FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour destroy a xbrowse
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
destroy a xbrowse
Posted: Wed Jun 09, 2021 04:08 PM

for the reservations program I show the list of services in an xbrowse, if I change my reservation and it doesn't have the services I must not show the xbrowse
I tried with

               IF oBrw != NIL
                   oBrw:Destroy()  //end()
                 Endif

but nothing happens the oBrw is allway there

any solution pls ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: destroy a xbrowse
Posted: Wed Jun 09, 2021 05:54 PM
Silvio,

just use

oBrw:Move( 0, 0 )

that will not harm any data

regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: destroy a xbrowse
Posted: Thu Jun 10, 2021 07:59 AM
ukoenig wrote:Silvio,

just use

oBrw:Move( 0, 0 )

that will not harm any data

regards
Uwe :-)



Uwe,
I explain YOU

I have the browse on a Vtaskbar as you can see here

I need this xbrowse to view the services for each order but it is also possible that an order may not have the services

this is activated when I press on an umbrella, obviously in this figure it is not there because since it doesn't work I have removed it



but I think it's clear to give you the idea

when I change umbrella I go to load the data from an archive by making a scope on the order number and I create an array aItems to show it on a xbrowse

local nInvoice:=alltrim(cNumPre)
IF Empty( nInvoice)

aItems:={}
// Close the vtaskbar I make a switch but the user could b reopen it manually with the mouse
oVMenu5:Refresh()
oVMenu5:lOpened :=.T.
oVMenu5:Switch()
// I wish delete the oBrw but it is possible that the oBrw was not built previously because there are also orders without the services included
// if Make oBrw:Move(0,0) give me error also if I made oBrw:end() or oBrw:destroy()
IF oBrw !=NIL
oBrw:Move(0,0) // Not run !!!
Endif
RETURN NIL
ELSE
oVMenu5:lOpened :=.F.
oVMenu5:Switch()
oRighe:= TRigheReserva():New()
oRighe:OrdScope( TOPSCOPE, nInvoice )
oRighe:OrdScope( BOTTOMSCOPE, nInvoice )
oRighe:gotop()
DO while !oRighe:eof()
aadd(aItems,{oRighe:ico,oRighe:Desc,oRighe:Qta,oRighe:dataini,oRighe:datafin} )
oRighe:Skip()
ENDDO
nInvoice:=""
oRighe:OrdScope( TOPSCOPE, NIL )
oRighe:OrdScope( BOTTOMSCOPE, NIL )
oRighe:close()
ENDIF

IF len(aItems)>0


@30,2 XBROWSE oBrw OF oVMenu5 ;
COLUMNS 1, 2, 3 , 4 , 5 ;
HEADERS "ico","desc","qta", "dal", "al" ;
COLSIZES 20, 40,20,60,60 ;
ARRAY aItems ;
SIZE -5,-10 PIXEL NOBORDER

.....

Endif

return nil



when I change umbrella I do the same operation obviously changes the order number

but it happens that I always see the same xbrowse with the same content how do I delete the array and the xbrowse every time?


to make yourself understood follow the video
umbrella 83 does not have services because it does not even have order


Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: destroy a xbrowse
Posted: Fri Jun 11, 2021 07:42 AM

Silvio,

Maybe you can consider to Hide the xbrowse in stead of destroy it. If the data has no services, you could hide the colums ?

static function ReArrangeCols( oBrw, aCols )

AEval( oBrw:aCols, { |o| o:lHide := .f. } )
oBrw:ReArrangeCols( aCols )
AEval( oBrw:aCols, { |o| o:lHide := .t. }, Len( aCols ) + 1 )
oBrw:Refresh()

return nil

Showing a empty browse when there are no services is what i would do... but that is your choise !!

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: destroy a xbrowse
Posted: Mon Jun 14, 2021 07:35 AM

Not Run, I erase all
I insert services on a box on msgbar

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: destroy a xbrowse
Posted: Mon Jun 14, 2021 08:02 PM
I am not sure if I understood what you want correctly.

If you want to hide and unhide xbrowse, you can use:

Hide
Code (fw): Select all Collapse
oBrw:Disable()
oBrw:Hide()


Show again
Code (fw): Select all Collapse
oBrw:Show()
oBrw:Enable()
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion