SomeOne can help me ?

SomeOne can help me ?

Postby Silvio » Sat Jun 07, 2008 8:52 am

Someone can help me ?


I want build it

Image


I try this source
why it not run ?

Code: Select all  Expand view
#INCLUDE "FIVEWIN.CH"

Function Main()
Local odlg
Local olbx
LOCAL nLargo
Local aMat   := {}
LOCAL aJus := {}
LOCAL aTit := {}
LOCAL i
LOCAL k

AADD( aMat, { "Lunedi" } )
AADD( aMat, { "Martedi" } )
AADD( aMat, { "Mercoledi" } )
AADD( aMat, { "Giovedi" } )
AADD( aMat, { "Venerdì" } )
AADD( aMat, { "Sabato" } )

nLargo := LEN( aMat )

FOR k := 1 TO 8
         AADD( aMat[ nLargo ], SPACE( 10 ) )
NEXT


FOR i := 1 TO 8
      AADD( aJus, 2 )
      AADD( aTit, i )
   NEXT



DEFINE DIALOG oDlg NAME "AGENDA" ;
TITLE "Desiderata"

REDEFINE LISTBOX oLbx FIELDS ""       ;
      HEADERS  ""                          ;
      ID 201 OF oDlg  UPDATE

oLbx:aHeaders  := aTit


oLbx:nAt       := 1
oLbx:bLine     := { || { aMat[ oLbx:nAt, 01 ]        , ;
                         aMat[ oLbx:nAt, 02 ]        , ;
                         aMat[ oLbx:nAt, 03 ]        , ;
                         aMat[ oLbx:nAt, 04 ]        , ;
                         aMat[ oLbx:nAt, 05 ]        , ;
                         aMat[ oLbx:nAt, 06 ]        , ;
                         aMat[ oLbx:nAt, 07 ]        , ;
                         aMat[ oLbx:nAt, 08 ]          ;
                            } }

   oLbx:bGoTop      := { || oLbx:nAt := 1 }
   oLbx:bGoBottom   := { || oLbx:nAt := EVAL( oLbx:bLogicLen ) }
   oLbx:bSkip       := { | nWant, nOld | nOld := oLbx:nAt, oLbx:nAt += nWant,;
                           oLbx:nAt := MAX( 1, MIN( oLbx:nAt, EVAL( oLbx:bLogicLen ) ) ),oLbx:nAt - nOld }
   oLbx:bLogicLen   := { || LEN( aMat ) }
   oLbx:SetArray( aMat )


   oLbx:lCellStyle  := .T.

ACTIVATE DIALOG oDlg CENTERED

return nil






resource file

Code: Select all  Expand view
AGENDA DIALOG 39, 25, 378, 199
STYLE DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION ""
FONT 8, "Tahoma"
{
CONTROL "", 201, "TWBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 4, 4, 368, 170
}
Best Regards, Saludos

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

Postby quique » Sat Jun 07, 2008 10:25 pm

No estoy seguro si entendí lo que necesitas, pero prueba cambiando
Code: Select all  Expand view
FOR k := 1 TO 8
         AADD( aMat[ nLargo ], SPACE( 10 ) )
NEXT

por
Code: Select all  Expand view
FOR i := 1 TO nLargo
   FOR k := 1 TO 8
         AADD( aMat[ i ], SPACE( 10 ) )
   NEXT
NEXT

y
Code: Select all  Expand view
oLbx:bLine     := { || { aMat[ oLbx:nAt, 01 ]        , ;
                         aMat[ oLbx:nAt, 02 ]        , ;
                         aMat[ oLbx:nAt, 03 ]        , ;
                         aMat[ oLbx:nAt, 04 ]        , ;
                         aMat[ oLbx:nAt, 05 ]        , ;
                         aMat[ oLbx:nAt, 06 ]        , ;
                         aMat[ oLbx:nAt, 07 ]        , ;
                         aMat[ oLbx:nAt, 08 ]          ;
                            } }

por
Code: Select all  Expand view
oLbx:bLine     := { || { aMat[ oLbx:nAt, 01 ]        , ;
                         aMat[ oLbx:nAt, 02 ]        , ;
                         aMat[ oLbx:nAt, 03 ]        , ;
                         aMat[ oLbx:nAt, 04 ]        , ;
                         aMat[ oLbx:nAt, 05 ]        , ;
                         aMat[ oLbx:nAt, 06 ]        , ;
                         aMat[ oLbx:nAt, 07 ]        , ;
                         aMat[ oLbx:nAt, 08 ]        , ;
                         aMat[ oLbx:nAt, 09 ]          ;
                            } }
Saludos
Quique
User avatar
quique
 
Posts: 408
Joined: Sun Aug 13, 2006 5:38 am

Postby Silvio » Sun Jun 08, 2008 5:44 pm

thanks now run
but I want insert the possibility to edit logic value in each record
Yes or No
and for yes show bitmap "yes.bmp" and for no show bitmaps "no.bmp"
the use must select it with the mouse

this is the source code now run

Code: Select all  Expand view
#INCLUDE "FIVEWIN.CH"

Function Main()
Local odlg
Local olbx
LOCAL nLargo
Local aMat   := {}
LOCAL aJus := {}
LOCAL aTit := {}
LOCAL i
LOCAL k

AADD( aMat, { "Lunedi" } )
AADD( aMat, { "Martedi" } )
AADD( aMat, { "Mercoledi" } )
AADD( aMat, { "Giovedi" } )
AADD( aMat, { "Venerdì" } )
AADD( aMat, { "Sabato" } )

nLargo := LEN( aMat )

FOR i := 1 TO nLargo
   FOR k := 1 TO 8
         AADD( aMat[ i ], SPACE( 5 ) )
   NEXT
NEXT


   AADD( aTit, "  " )
   AADD( aJus, 2 )

   FOR i := 1 TO 8
      AADD( aJus, 2 )
      AADD( aTit, str(i))
   NEXT







DEFINE DIALOG oDlg NAME "AGENDA" ;
TITLE "Desiderata"

REDEFINE LISTBOX oLbx FIELDS ""       ;
      HEADERS  ""                          ;
      ID 201 OF oDlg  UPDATE

oLbx:aHeaders  := aTit
oLbx:nAt       := 1



oLbx:bLine     := { || { aMat[ oLbx:nAt, 01 ]        , ;
                         aMat[ oLbx:nAt, 02 ]        , ;
                         aMat[ oLbx:nAt, 03 ]        , ;
                         aMat[ oLbx:nAt, 04 ]        , ;
                         aMat[ oLbx:nAt, 05 ]        , ;
                         aMat[ oLbx:nAt, 06 ]        , ;
                         aMat[ oLbx:nAt, 07 ]        , ;
                         aMat[ oLbx:nAt, 08 ]        , ;
                         aMat[ oLbx:nAt, 09 ]          ;
                            } }



   oLbx:bGoTop      := { || oLbx:nAt := 1 }
   oLbx:bGoBottom   := { || oLbx:nAt := EVAL( oLbx:bLogicLen ) }
   oLbx:bSkip       := { | nWant, nOld | nOld := oLbx:nAt, oLbx:nAt += nWant,;
                           oLbx:nAt := MAX( 1, MIN( oLbx:nAt, EVAL( oLbx:bLogicLen ) ) ),oLbx:nAt - nOld }
   oLbx:bLogicLen   := { || LEN( aMat ) }

   oLbx:

   oLbx:SetArray( aMat )
   oLbx:lCellStyle  := .T.


ACTIVATE DIALOG oDlg CENTERED

return nil


Best Regards, Saludos

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

Postby Silvio » Sun Jun 08, 2008 5:53 pm

thanks now run
but I want insert the possibility to edit logic value in each record
Yes or No
and for yes show bitmap "yes.bmp" and for no show bitmaps "no.bmp"
the use must select it with the mouse

this is the source code now run

Code: Select all  Expand view
#INCLUDE "FIVEWIN.CH"

Function Main()
Local odlg
Local olbx
LOCAL nLargo
Local aMat   := {}
LOCAL aJus := {}
LOCAL aTit := {}
LOCAL i
LOCAL k

AADD( aMat, { "Lunedi" } )
AADD( aMat, { "Martedi" } )
AADD( aMat, { "Mercoledi" } )
AADD( aMat, { "Giovedi" } )
AADD( aMat, { "Venerdì" } )
AADD( aMat, { "Sabato" } )

nLargo := LEN( aMat )

FOR i := 1 TO nLargo
   FOR k := 1 TO 8
         AADD( aMat[ i ], SPACE( 5 ) )
   NEXT
NEXT


   AADD( aTit, "  " )
   AADD( aJus, 2 )

   FOR i := 1 TO 8
      AADD( aJus, 2 )
      AADD( aTit, str(i))
   NEXT







DEFINE DIALOG oDlg NAME "AGENDA" ;
TITLE "Desiderata"

REDEFINE LISTBOX oLbx FIELDS ""       ;
      HEADERS  ""                          ;
      ID 201 OF oDlg  UPDATE

oLbx:aHeaders  := aTit
oLbx:nAt       := 1



oLbx:bLine     := { || { aMat[ oLbx:nAt, 01 ]        , ;
                         aMat[ oLbx:nAt, 02 ]        , ;
                         aMat[ oLbx:nAt, 03 ]        , ;
                         aMat[ oLbx:nAt, 04 ]        , ;
                         aMat[ oLbx:nAt, 05 ]        , ;
                         aMat[ oLbx:nAt, 06 ]        , ;
                         aMat[ oLbx:nAt, 07 ]        , ;
                         aMat[ oLbx:nAt, 08 ]        , ;
                         aMat[ oLbx:nAt, 09 ]          ;
                            } }



   oLbx:bGoTop      := { || oLbx:nAt := 1 }
   oLbx:bGoBottom   := { || oLbx:nAt := EVAL( oLbx:bLogicLen ) }
   oLbx:bSkip       := { | nWant, nOld | nOld := oLbx:nAt, oLbx:nAt += nWant,;
                           oLbx:nAt := MAX( 1, MIN( oLbx:nAt, EVAL( oLbx:bLogicLen ) ) ),oLbx:nAt - nOld }
   oLbx:bLogicLen   := { || LEN( aMat ) }

   oLbx:

   oLbx:SetArray( aMat )
   oLbx:lCellStyle  := .T.


ACTIVATE DIALOG oDlg CENTERED

return nil







I thinked to insert
oLbx:bEdit := { || Editar() }



Function Editar( oLbx, aMat )
LOCAL xVar
LOCAL lSeguir

IF oLbx:nColAct == 1
RETURN .F.
ENDIF

xVar := aMat[ oLbx:nAt, oLbx:nColAct ]

lSeguir := oLbx:lEditCol( oLbx:nColAct, @xVar, "@!" )

IF lSeguir
aMat[ oLbx:nAt, oLbx:nColAct ] := xVar
IF !EMPTY( xVar )
Save( oLbx:nAt, oLbx:nColAct )
ENDIF
ENDIF

RETURN lSeguir


Function Save( i, k )
LOCAL cCodigo

cCodigo := DTOC( ( k - 1 ) ) + aMat[ i, 1 ]

Use OreD
DbSeek( cCodigo )

IF found()

oreD->Mensaje := aMat[ i, k ]

ELSE
Appe Blank
oreD->Codigo := cCodigo
oreD->Mensaje := aMat[ i, k ]

ENDIF

RETURN NIL
Best Regards, Saludos

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

Postby Silvio » Sun Jun 08, 2008 5:55 pm

but it make error

Application
===========
Path and name: C:\lbx2\test.Exe (32 bits)
Size: 1,376,256 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 06/09/08, 19:54:33
Error description: Error BASE/1005 Message not found: TWBROWSE:_BEDIT
Best Regards, Saludos

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

Postby quique » Sun Jun 08, 2008 6:02 pm

Al final de tu código tienes un error
Code: Select all  Expand view
   oLbx:bLogicLen   := { || LEN( aMat ) }

   oLbx:    <<<<<<<<<<<<<<<<<<< ERROR 

   oLbx:SetArray( aMat )
   oLbx:lCellStyle  := .T.


ACTIVATE DIALOG oDlg CENTERED

return nil
Saludos
Quique
User avatar
quique
 
Posts: 408
Joined: Sun Aug 13, 2006 5:38 am

Postby Silvio » Sun Jun 08, 2008 7:04 pm

No it not is the error I rem it!!!

but there is another error


If use wbrowse of Linares

Image


If I use wbrowse of hernan

Image

if I want use xbrowse How I must modify it ?


BUT it is much far FRom that I wanted on first message
Best Regards, Saludos

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


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests

cron