Esta modificación del método DelItem, me genera errores.
Adjunto ejemplo, prueba a crear pestañas nuevas con el botón, y después eliminarlas con la x de la pesataña.
- Code: Select all Expand view
#include "FiveWin.ch"
STATIC oWnd, oFld
function main()
DEFINE WINDOW oWnd TITLE "TFolderex - Testing -"
@ 1, 1 FOLDEREX oFld OF oWnd PIXEL ADJUST ;
PROMPT "vACIO";
ACTION( ::DelItem( nOption ) );
TAB HEIGHT 30 ROUND 3
ACTIVATE WINDOW oWnd ON INIT CrtBtn( oFld:aDialogs[1] )
RETURN NIL
//-------------------------------------
STATIC FUNCTION CrtBtn( oDlg )
@ 01,05 BUTTON oBtn PROMPT "New Tab" OF oDlg SIZE 64, 20 ACTION NewTab()
RETURN NIL
//------------------------------------
STATIC FUNCTION NewTab()
LOCAL nFld
oFld:AddItem( ' New Tab')
nFld:=Len(oFld:aDialogs)
oFld:SetBitMap("exit.bmp",nFld)
oFld:SetBrightBmp( "exit2.bmp", nFld)
oFld:aAlign[nFld]:=1 //Right
RETURN NIL
Error occurred at: 02/23/15, 09:46:09
Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... } length: 1
[ 2] = N 2
Stack Calls
===========
Called from: Source\tfoldex.prg => TFOLDEREX:PAINTTB( 1543 )
Called from: Source\tfoldex.prg => TFOLDEREX:PAINT( 1168 )
Called from: Source\tfoldex.prg => (b)TFOLDEREX( 117 )
Called from: Source\tfoldex.prg => TFOLDEREX:DISPLAY( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1699 )
Called from: Source\tfoldex.prg => TFOLDEREX:HANDLEEVENT( 963 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3450 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 286 )
Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG( 420 )
Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS( 23 )
Called from: Source\tfoldex.prg => TFOLDEREX:PAINTTB( 1543 )
Called from: Source\tfoldex.prg => TFOLDEREX:PAINT( 1168 )
Called from: Source\tfoldex.prg => (b)TFOLDEREX( 117 )
Called from: Source\tfoldex.prg => TFOLDEREX:DISPLAY( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1699 )
Called from: Source\tfoldex.prg => TFOLDEREX:HANDLEEVENT( 963 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3450 )
Called from: => SYSREFRESH( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:END( 526 )
Called from: Source\tfoldex.prg => TFOLDEREX:DELITEM( 753 )
Called from: Source\Folderex.prg => (b)MAIN( 10 )
Called from: Source\tfoldex.prg => TFOLDEREX:LBUTTONDOWN( 1033 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1720 )
Called from: Source\tfoldex.prg => TFOLDEREX:HANDLEEVENT( 963 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3450 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1152 )
Called from: Source\Folderex.prg => MAIN( 12 )