destroy a xbrowse

destroy a xbrowse

Postby Silvio.Falconi » Wed Jun 09, 2021 4: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: destroy a xbrowse

Postby ukoenig » Wed Jun 09, 2021 5:54 pm

Silvio,

just use

oBrw:Move( 0, 0 )

that will not harm any data

regards
Uwe :D
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: destroy a xbrowse

Postby Silvio.Falconi » Thu Jun 10, 2021 7:59 am

ukoenig wrote:Silvio,

just use

oBrw:Move( 0, 0 )

that will not harm any data

regards
Uwe :D



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

Image

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

Image

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


Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: destroy a xbrowse

Postby Marc Venken » Fri Jun 11, 2021 7: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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1434
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: destroy a xbrowse

Postby Silvio.Falconi » Mon Jun 14, 2021 7: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: destroy a xbrowse

Postby nageswaragunupudi » Mon Jun 14, 2021 8: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: Select all  Expand view

oBrw:Disable()
oBrw:Hide()
 


Show again
Code: Select all  Expand view
oBrw:Show()
oBrw:Enable()
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests