Page 1 of 1

FOLDER CLASS BUG RESOLVED!!!

Posted: Mon May 11, 2009 11:51 am
by Silvio
IF I CREATE A FOLDER FROM SOURCE



Image

DEFINE DIALOG oDlg TITLE If( lAppend, "New", "Update" )

@ 0, 0 FOLDER oFld PROMPTS "Generale", "Dettagli", "Note" ;
SIZE 119,95


@ 1, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] SIZE 40,10
@ 2, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] SIZE 40,10
@ 3, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] SIZE 40,10
@ 4, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] SIZE 40,10

I SEE ONLY THE FIRST CONTROL SAY ..... WHY ?

Re: FOLDER CLASS BUG

Posted: Mon May 11, 2009 12:11 pm
by Otto
Silvio,

could you provide a small and self contained example to reproduce it ?
Thanks,
best regards,
Otto

Re: FOLDER CLASS BUG

Posted: Mon May 11, 2009 12:25 pm
by Silvio
I have also the problem : I cannot see the bitmaps aHBitMaps

#include "FWCE.ch"


REQUEST DBFCDX

FUNCTION Main()

local oDlgClient , oTabs
local oLbx
local cVar
local aHBitMaps:=Array( 5 )
local n




aHBitMaps:= { ReadBitmap( 0, CurDir() +"Level1.bmp" ), ; // BitMaps de 14 x 32
ReadBitmap( 0, CurDir() +"\Level2.bmp" ), ;
ReadBitmap( 0, CurDir() +"\Level3.bmp" ), ;
ReadBitmap( 0, CurDir() +"\Level4.bmp" ),;
ReadBitmap( 0, CurDir() +"\Level5.bmp" ) }

USE ( CurDir() + "\Clientes" ) VIA "DBFCDX"


if RecCount() == 0
APPEND BLANK
endif

if ! File( CurDir() + "\CliName.CDX" )
INDEX ON Clientes->Nombre TO ( CurDir() + "\CliName" )
endif

Clientes->(DbSetIndex( CurDir() + "\CliName" ))


Clientes->( OrdSetFocus( "\CliName" ) )
Clientes->( DbGoTop() )


DEFINE DIALOG oDlgClient TITLE "Clienti"

@ 0, 0 LISTBOX oLbx FIELDS aHBitmaps[ Max( 1, Clientes->Nivel ) ],;
Clientes->Nombre,;
Clientes->Telefono,;
Str( Clientes->Edad, 3 ) ;
HEADERS "L", "Cognome e nome", "Telefono", "Ombrellone" ;
FIELDSIZES 16, 95, 80, 8 ;
SIZE 119, 140 OF oDlgClient



oLbx:nClrPane := { || If( OrdKeyNo() % 2 == 0, RGB( 230, 230, 230), RGB( 190, 215, 190 ) ) }

oLbx:nClrForeHead:=CLR_BLUE

*oLbx::bKeyDown :={|nKey| Val_nKey(nKey,oDlg)}

oDlgClient:bSettingChange := {|uVal|PocketEvent( uVal,oDlgClient,olbx ) }

ACTIVATE DIALOG oDlgClient;
ON INIT ( SetOKButton( oDlgClient:hWnd ),;
DlgFullScreen( oDlgClient:hWnd ), ;
oDlgClient:SetMenu( DialogBar(oDlgClient,oLbx) ) )



AEval( aHBitmaps, { | hBmp | DeleteObject( hBmp ) } )
Clientes->(DbCloseArea())
RETU NIL


static Function DialogBar(oDlgClient,oLbx)
local oMenu
DEFINE MENU oMenu RESOURCE 103 ;
BITMAPS 11 ; // bitmap resources ID
IMAGES 6 // number of images in the bitmap

REDEFINE MENUITEM ID 113 OF oMenu ACTION EditClient( oLbx, .t. )
REDEFINE MENUITEM ID 114 OF oMenu ACTION EditClient( oLbx, .f. )
REDEFINE MENUITEM ID 115 OF oMenu ACTION DelClient( oLbx )
REDEFINE MENUITEM ID 116 OF oMenu ACTION (SeekClient( oLbx ),oLbx:Refresh())
REDEFINE MENUITEM ID 117 OF oMenu ACTION MsgInfo( "PRINT" )
REDEFINE MENUITEM ID 118 OF oMenu ACTION oDlgClient:End()
return oMenu
function EditClient( oLbx, lAppend )

local oDlg, oFld,oFont, oFont1
Local lSave :=.f.

lFivePro = "F" $ Clientes->Productos
lDialog = "D" $ Clientes->Productos
lObjects = "O" $ Clientes->Productos
nNivel = max( 1, Clientes->Nivel )

cName = Clientes->Nombre
cAddress = Clientes->Direccion
cPhone = Clientes->Telefono
nAge = Clientes->Edad



DEFINE FONT oFont NAME "Arial" SIZE 0, -8
DEFINE FONT oFont1 NAME "Arial" SIZE 0, -68
ShowKeyboard()

DEFINE DIALOG oDlg TITLE If( lAppend, "New", "Update" )

@ 0, 0 FOLDER oFld PROMPTS "Generale", "Dettagli", "Note" ;
SIZE 119,95


@ 1, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] SIZE 40,10
@ 2, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] SIZE 40,10

/*@ 11, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL
@ 12, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] PIXEL
@ 13, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL
@ 14, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] PIXEL
@ 15, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL
@ 16, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] PIXEL
@ 17, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL


/* @ 1, 0 GET cName OF oFld:aDialogs[ 1 ] size 40,10
@ 1, 6 GET cAddress OF oFld:aDialogs[ 1 ] size 40,10




@ 3, 1 TO 7, 8 LABEL "&Products" OF oFld:aDialogs[ 1 ]
@ 4, 2 CHECKBOX lFivePro PROMPT "&FivePro" OF oFld:aDialogs[ 1 ] size 40,10
@ 5, 2 CHECKBOX lDialog PROMPT "&Dialog" OF oFld:aDialogs[ 1 ] size 40,10
@ 6, 2 CHECKBOX lObjects PROMPT "&Objects"OF oFld:aDialogs[ 1 ] size 40,10



* @ 0.5, 1 GET cName1 SIZE 60, 20 OF oFld:aDialogs[ 1 ]
*/

ACTIVATE DIALOG oDlg ;
ON INIT ( DlgFullScreen( oDlg:hWnd ), oDlg:SetMenu( DialogButtons(oDlg) ) )
HideKeyboard()

IF lSave :=.t.
? "I'here"
ELSE
? "I'm not here"
ENDIF



return nil

Re: FOLDER CLASS BUG

Posted: Mon May 11, 2009 1:44 pm
by Otto
Hello Silvio,


This code does not compile
test.c
Creating library test.lib and object test.exp
test.obj : error LNK2001: unresolved external symbol HB_FUN_DIALOGBUTTONS
test.obj : error LNK2001: unresolved external symbol HB_FUN_SEEKCLIENT
test.obj : error LNK2001: unresolved external symbol HB_FUN_DELCLIENT
test.obj : error LNK2001: unresolved external symbol HB_FUN_DLGFULLSCREEN
test.obj : error LNK2001: unresolved external symbol HB_FUN_SETOKBUTTON
test.obj : error LNK2001: unresolved external symbol HB_FUN_POCKETEVENT
test.exe : fatal error LNK1120: 6 unresolved externals
Please put your code always into a code tag .
Also copy the rc-file and if you have a special dbf prepare a download.
Otherwise helping is very difficult.

Best regards,
Otto

Re: FOLDER CLASS BUG

Posted: Mon May 11, 2009 6:19 pm
by Silvio

Code: Select all

static Function DialogBar(oDlgClient,oLbx)
local oMenu
DEFINE MENU oMenu RESOURCE 103 ;
BITMAPS 11 ; // bitmap resources ID
IMAGES 6 // number of images in the bitmap
REDEFINE MENUITEM ID 113 OF oMenu ACTION MsgInfo( "new" )
REDEFINE MENUITEM ID 114 OF oMenu ACTION MsgInfo( "edit" )
REDEFINE MENUITEM ID 115 OF oMenu ACTION MsgInfo( "del" )
REDEFINE MENUITEM ID 116 OF oMenu ACTION MsgInfo( "nseek ")
REDEFINE MENUITEM ID 117 OF oMenu ACTION MsgInfo( "PRINT" )
REDEFINE MENUITEM ID 118 OF oMenu ACTION oDlgClient:End()
return oMenu


STATIC FUNCTION PocketEvent( uVal,oDlg,olbx )
*----------------------------------

   DO CASE
      CASE uVal == EVENT_SIP ; Dimensiona(oDlg,olbx)
   ENDCASE

RETU NIL

*---------------------------
STATIC FUNCTION Dimensiona(oDlg,olbx)
*---------------------------

    IF SipInfo()
       MoveWindow( oDlg:hWnd, 25, 0, 240, 187 )
        if olbx   != NIL
            olbx:nheight:=185
        endif
     ELSE
        DlgFullScreen( oDlg:hWnd )
             if olbx   != NIL
            olbx:nheight:=265
        endif
    ENDIF

    oDlg:Refresh()

RETU NIL







 
DLGFULLSCREEN and SETOKBUTTON are HB Antonio Linares 's function

Code: Select all

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>
HB_FUNC( DLGFULLSCREEN )
{
SHINITDLGINFO shidi;

memset( &shidi, 0, sizeof( SHINITDLGINFO ) );

shidi.dwMask = SHIDIM_FLAGS;
shidi.hDlg = ( HWND ) hb_parnl( 1 );
shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;

SHInitDialog( &shidi );
}
 HB_FUNC( SETOKBUTTON )
{
   SHINITDLGINFO shidi;

   shidi.dwMask  = SHIDIM_FLAGS;
   shidi.hDlg    = ( HWND ) hb_parnl( 1 );
   shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIZEDLGFULLSCREEN;

   SHInitDialog( &shidi );
}


#pragma ENDDUMP