Page 1 of 1

ERROR TO CREATE A FOLDEREX INTO A DIALOG

Posted: Wed Apr 08, 2020 11:29 pm
by Silvio.Falconi
the error

Code: Select all

   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 04/09/20, 01:25:59
   Error description: Error BASE/1132  Bound error: array access
   Args:
     [   1] = A   { ... } length: 0
     [   2] = N   1

Stack Calls
===========
   Called from: .\source\classes\TFOLDEX.PRG => TFOLDEREX:DEFAULT( 825 )
   Called from: .\source\classes\TFOLDEX.PRG => TFOLDEREX:INITIATE( 1047 )
   Called from:  => __OBJSENDMSG( 0 )
   Called from: .\source\function\HARBOUR.PRG => OSEND( 291 )
   Called from: .\source\function\HARBOUR.PRG => ASEND( 259 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE( 805 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 1120 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
   Called from: test.prg => TEST( 58 )


the test

Code: Select all

#include "Fivewin.ch"


Function test()
    local oDlgPre
    local oFolder
    local lGiorno:=.t.
    local oBtnGiorn
    local aImagesGiorno:= {"giornaliero.png","periodico.png"}
    local aBitmaps  := {".\bitmaps\prenota.bmp",".\bitmaps\pag.bmp"}

       DEFINE DIALOG oDlgPre TITLE "TEST" SIZE 400,400;
             PIXEL TRUEPIXEL RESIZABLE

      @ 1, 0 FOLDEREX oFolder ;
                 OF oDlgPre   ;
                 PROMPT "Prenotazioni","Pagamenti" ;
                 BITMAPS aBitmaps  ;
                 PIXEL ;
                  SIZE 100,100

oDlgPre:bResized  := <||
                local oRect    :=  oDlgPre:GetCliRect()
                oFolder:nWidth     := oRect:nRight-2
                oFolder:nHeight    := oRect:nBottom-60
               
    return nil
                 >


 ACTIVATE DIALOG oDlgPre CENTERED  ;
                           ON INIT( EVAL( oDlgPre:bResized) )
RETURN NIL


Now I saw it not run without resources winxp theme ....strange

Re: ERROR TO CREATE A FOLDEREX INTO A DIALOG

Posted: Thu Apr 09, 2020 3:53 am
by karinha

Code: Select all

#Include "FiveWin.ch"  //-> The Best...

FUNCTION Silvio_Folder_New()

   LOCAL oDlg, oFld, oFont, aGrad
   LOCAL aBitmaps := { "..\bitmaps\alphabmp\facebook.bmp", ;
                       "..\bitmaps\alphabmp\windows.bmp" }

   aGrad := { { 0.30, CLR_WHITE, CLR_HBLUE },{ 0.50, CLR_HBLUE, CLR_WHITE } }

   DEFINE FONT oFont   NAME "Ms Sans Serif" SIZE 00, -14 BOLD
                      
   DEFINE DIALOG oDlg TITLE "- TFolderex - Testing -" SIZE 350, 350          ;
      PIXEL TRUEPIXEL RESIZABLE GRADIENT aGrad
     
   @ 1, 0 FOLDEREX oFld PIXEL ADJUST OF oDlg ;
      PROMPT "Prenotazioni", "Pagamenti"     ;
      BITMAPS aBitmaps                       ;
      TAB HEIGHT 26 OPTION 1 ROUND 5 FONT oFont COLOR CLR_HGREEN TOP

   oFld:aEnable = { .T., .T., .F. }

   /*
   // .OR.
   oFld:nSeparator := 5
   oFld:bClrText   := { | o, n | 16711680 }  // 128 - RED // 16711680  HBLUE
   oFld:oFont      := oFont
   */

   // -> Continue Silvio...

   ACTIVATE DIALOG oDlg CENTERED ON INIT oFld:Resize()

   oFont:End()

RETURN NIL