TO Antonio BUG ON the codeblock ?

TO Antonio BUG ON the codeblock ?

Postby Silvio » Mon Mar 02, 2009 12:52 pm

Please compile this test

Code: Select all  Expand view

#Include "FiveWin.Ch"

#define OMB   "OMBRELLONE"

#define TRUE  .T.
#define FALSE .F.

#define TOTX          10
#define TOTY          10

Static oDlg, luscita, lInizio, nItem, aData

 REQUEST DBFCDX, DBFFPT
external ordkeyno, ordkeycount,ordcreate

FUNCTION Editor()

  Local oIco
  Local aBmps, aData
  Local nID := 100
  Local nX, nY
  Local oBtn, oFile
  Local cPass := Space(4)
  Local cFile := Space(8)
  Local oBrush

  Local oItems
  Local aBitmaps := { "OMBRELLONE","PASSERELLA","HAWAYANO","CABINA", "CANCELLA" }
  Local aItems   := { "Normale","Passerella","Hawayano","Cabina", "Cancella" }

  Local aBtnsMia[4]

  luscita := FALSE
  lInizio := FALSE
  nItem   := 1



  aBmps := ARRAY( TOTY, TOTX )
  aData := ARRAY( TOTY, TOTX )

  RddSetDefault( "DBFCDX" )

   DEFINE BRUSH oBrush FILENAME "MARE.BMP"


  DEFINE DIALOG oDlg  from 10,5 to 70,150  Title "test bitmaps"

 

@ 2, 2 COMBOBOX oItems VAR nItem ITEMS aItems BITMAPS aBitmaps  SIZE 100, 100

  oDlg:lHelpIcon := FALSE

  For nY := 1 to TOTY
    For nX := 1 To TOTX
        aData[nY,nX] := "X"
    NExt nX
  Next nY

  AssegnaBitmaps_NEW( aBmps, aData, oDlg )


Return NIL




 FUNCTION SettaBmp( aBmps, aData,  nY, nX, lFlag )

//test

  ? nX,nY,aData[1,1], valtoprg (aBmps[1,1]:bLClicked)




  IF nItem == 5
     IF aData[nY,nX] == "I"
        lInizio := FALSE
     EndIF
     IF aData[nY,nX] == "S"
        luscita := FALSE
     EndIF
     aBmps[nY,nX]:SetBmp( "VACIO" )
     aData[nY,nX] := "X"
  EndIF
 






 IF aData[nY,nX] # "X"
     MsgStop( "Questa casella è già occupata!","Verificare" )
     Return NIL
  EndIF

  IF nItem == 1

     aBmps[nY,nX]:SetBmp( OMB )
     aData[nY,nX] := "I"
     lInizio := TRUE
     Return NIL
  EndIF

  IF nItem == 2
     aBmps[nY,nX]:SetBmp( "PASSERELLA" )
     aData[nY,nX] := "M"
     Return NIL
  EndIF

  IF nItem == 3
     aBmps[nY,nX]:SetBmp( "HAWAYANO" )
     aData[nY,nX] := "E"
     Return NIL
  EndIF

  IF nItem == 4

     aBmps[nY,nX]:SetBmp( "CABINA" )
     aData[nY,nX] := "S"
     luscita := TRUE
  EndIF

Return NIL




FUNCTION AssegnaBitmaps_NEW ( aBmps, aData, oDlg )
   Local nY, nX
   lOCAL nRow:=100
   Local nCol:=5
 For nY := 1 to TOTY
    For nX := 1 To TOTX
    @ nrow, ncol  BITMAP aBmps[nY,nX ] RESOURCE "Vacio" OF oDlg ;
                  SIZE  20,20     PIXEL
               
    ncol:=ncol+20
  Next nX
 nCol := 5
 nrow:=nRow+20
Next nY


     nY:=0
     nX:=0



    For nY := 1 to TOTY
    For nX := 1 To TOTX
       aBmps[nY,nX]:lTransparent := TRUE
       aBmps[nY,nX]:bLClicked := {|nx,ny| SettaBmp( aBmps, aData,  nY, nX, TRUE )}
    NExt nX
 Next nY



 Return NIL

 



abd click into a bitmaps on the mouse




to control the code blok I add a command on settabmp function

? nX,nY,aData[1,1], valtoprg (aBmps[1,1]:bLClicked)


it show me this :

25
18
X
{|| Alert( 'Non Persistentable Block.' ) }


what's mean 'Non Persistentable Block ?????
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 61 guests