and I wish insert a taskpanel after the first taskpanel on line ( I wish the final user can add the second Panel on line)
I not Found a Solution
I created a test where at init I build the oExbar from an array aData and if the 4th paramter is false it not create the taskPanel
the final use when click the link "Create Second Panel" the procedure must destroy all panels and recreate all
to destroy Panel I tried with destroy(9 and end() method but it seem not Know these commands and I cannot destroy the previous panels before to create all
this is the small test
- Code: Select all Expand view
- #include "FiveWin.ch"
//----------------------------------------------------------------------------//
//
function Main()
local oWnd, oExBar
// name,Bitmap,Len,active
local adata:={ {"One", "..\bitmaps\32x32\case.bmp",100,.t. } ,;
{"two", "..\bitmaps\32x32\case.bmp",100,.f. } ,;
{"Three", "..\bitmaps\32x32\case.bmp",100,.t.} ,;
{"Four", "..\bitmaps\32x32\case.bmp",100,.t. } }
local aPanels:= array(4)
// xbrowser adata
DEFINE WINDOW oWnd TITLE "FWH Class TExplorerBar"
oWnd:SetSize( 350, 600 )
oExBar = TExplorerBar():New()
// create the taskpanels
Crea_Panels(oExBar,aData,aPanels)
oWnd:oClient = oExBar
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
// Set and create the second taskPanel
Function Crea_Second_Panel(oExBar,aData,aPanels)
aData[2][4]:=.t. //change the value
Refresh_oExbar(oExBar,aData,aPanels)
return nil
//----------------------------------------------------------------------------//
// create the taskPanels
Function Crea_Panels(oExBar,aData,aPanels)
local bClick := { | o | MsgInfo( o:GetText() ) }
local bCreateSecond := { ||Crea_Second_Panel(oExBar,aData,aPanels) }
For n= 1 to Len(adata)
IF aData[n][4]
aPanels[n]:= oExBar:AddPanel( aData[n][1], aData[n][2],aData[n][3] )
Endif
Next
aPanels[1]:AddLink( "First item", bClick, "..\bitmaps\16x16\additem.bmp" )
aPanels[1]:AddLink( "Create Second Panel", bCreateSecond, "..\bitmaps\16x16\copy.bmp" )
return nil
//refresh the explorerbat
Function Refresh_oExbar(oExBar,aData,aPanels)
For n= 2 to Len(adata)
aPanels[n]:=NIL //end() destroy()
Next
oExBar:refresh()
Crea_Panels(oExBar,aData,aPanels)
return nil
If I tried with Destroy I have this error
For n= 2 to Len(adata)
aPanels[n]:destroy()
Next
- Code: Select all Expand view
- Error occurred at: 02/25/24, 18:05:43
Error description: Error BASE/1004 No exported method: DESTROY
Args:
[ 1] = U
IF I make
oExBar:CloseAll()
and then
aPanels[3]:end()
aPanels[4]:end()
I have this result
as you can see the third and fourth panels are not destroyed