I tried fwbrowse sample into fwppc but it not run ok
I not see any bitmaps
I want show bitmaps for level as fwbrowse.prg ( clients functions)
hBmpCheckOn := LoadBitmap( GetResources(), "checkon" )
hBmpCheckOff:= LoadBitmap( GetResources(), "checkoff" )
REDEFINE LISTBOX aoLbx[LBX_GRUPOPR] ;
FIELDS if( PasGrpPr->OK=" ", hBmpCheckOff, hBmpCheckOn ),;
PasGrpPr->DESCRIPCIO,;
PasGrpPr->(TRANSFORM(CANTIDAD,"99999.9")),;
PasGrpPr->(TRANSFORM(PRECIO,"99,999.99")),;
PasGrpPr->(transform(existencia,"99999")) ;
HEADERS "Ok", "Descripcion", "Cant", "Precio", "Existencia" ;
FONT oFont ;
ID 901 OF aoDlgs[DLG_GRUPOPR] ALIAS cAlias2
function Clients()
local oDlg
local oLbx
local cVar
local aHBitMaps:= { ReadBitmap( 0, "..\bitmaps\Level1.bmp" ), ; // BitMaps de 14 x 32
ReadBitmap( 0, "..\bitmaps\Level2.bmp" ), ;
ReadBitmap( 0, "..\bitmaps\Level3.bmp" ), ;
ReadBitmap( 0, "..\bitmaps\Level4.bmp" ),;
ReadBitmap( 0, "..\bitmaps\Level5.bmp" ) }
local n
if ! File( "clientes.dbf" )
DbCreate( "Clientes.dbf", { { "Nombre", "C", 40, 0 },;
{ "Direccion", "C", 50, 0 },;
{ "Telefono", "C", 12, 0 },;
{ "Edad", "N", 2, 0 },;
{ "Productos", "C", 10, 0 },;
{ "Nivel", "N", 2, 0 } } )
endif
USE Clientes
if RecCount() == 0
APPEND BLANK
endif
INDEX ON Clientes->Nombre TO CliName
SET INDEX TO CliName
GO TOP
DEFINE DIALOG oDlg FROM 3, 3 TO 26, 79 TITLE "Clients Management"
@ 0, 1 SAY " &Clients List" OF oDlg
@ 1, 1 LISTBOX oLbx FIELDS aHBitmaps[ Max( 1, Clientes->Nivel ) ],;
Clientes->Nombre, AllTrim( Clientes->Direccion ),;
Clientes->Telefono,;
Str( Clientes->Edad, 3 ) ;
HEADERS "L", "Name", "Address", "Phone", "Age" ;
FIELDSIZES 16, 222, 213, 58, 24 ;
SIZE 284, 137 OF oDlg
// Lets use different row colors
oLbx:nClrText = { || SelColor( Clientes->Nivel ) }
oLbx:nClrForeFocus = { || SelColor( Clientes->Nivel ) }
oLbx:bRClicked = { | nRow, nCol | ShowPopup( nRow, nCol, oLbx ) }
// Try different line styles !!!
oLbx:nLineStyle = 1
oLbx:bKeyChar := {|nKey| if( nKey == VK_RETURN , EditRecord( oLbx ) , )}
oLbx:aJustify = { .f., .f., .t., .f., .t. }
// Uncomment this to quickly calculate the desired columns width
// Right click with the mouse over the browse and you will
// see the columns sizes!
// oLbx:bRClicked = { || oLbx:ShowSizes() }
@ 8.7, 1.4 BUTTON "&New" OF oDlg ACTION EditClient( oLbx, .t. ) ;
SIZE 40, 12
@ 8.7, 9.4 BUTTON "&Modify" OF oDlg ACTION EditClient( oLbx, .f. ) ;
SIZE 40, 12
@ 8.7, 17.4 BUTTON "&Delete" OF oDlg ACTION DelClient( oLbx ) SIZE 40, 12
@ 8.7, 25.4 BUTTON "&Search" OF oDlg ACTION SeekClient( oLbx ) SIZE 40, 12
@ 8.7, 33.4 BUTTON "&Print" OF oDlg ;
ACTION oLbx:Report( "clients Report", .t. ) ; // .t. --> wants preview
SIZE 40, 12
@ 8.7, 42 BUTTON "&Exit" OF oDlg ACTION oDlg:End() SIZE 40, 12
ACTIVATE DIALOG oDlg
USE
AEval( aHBitmaps, { | hBmp | DeleteObject( hBmp ) } )
return nil
Silvio wrote:I tried fwbrowse sample into fwppc but it not run ok
I not see any bitmaps
I want show bitmaps for level as fwbrowse.prg ( clients functions)
#include "FWCE.ch"
//----------------------------------------------------------------------------//
Function Main()
Local oWnd, oLbx, ;
aHBitMaps:= { LoadBitmap( GetResources(), "Level1" ), ;
LoadBitmap( GetResources(), "Level3" ), ;
LoadBitmap( GetResources(), "Level2" ), ;
LoadBitmap( GetResources(), "Level4" ), ;
LoadBitmap( GetResources(), "Level5" ) }
USE ( CurDir() + "\Clientes" ) EXCLUSIVE NEW
INDEX ON Clientes->Nombre TO CliName
SET INDEX TO CliName
GO TOP
DEFINE WINDOW oWnd TITLE "Clients Management"
@ 0, 0 LISTBOX oLbx ;
FIELDS aHBitmaps[ Max( 1, Clientes->Nivel ) ], ;
Clientes->Nombre, AllTrim( Clientes->Direccion ), ;
Clientes->Telefono, ;
Str( Clientes->Edad, 3 ) ;
HEADERS "L", "Name", "Address", "Phone", "Age" ;
FIELDSIZES 16, 112, 112, 58, 24 ;
SIZE 234, 263 PIXEL OF oWnd
// Lets use different row colors
oLbx:nClrText = { || SelColor( Clientes->Nivel ) }
oLbx:nClrForeFocus = { || SelColor( Clientes->Nivel ) }
// Try different line styles !!!
oLbx:nLineStyle = 1
oLbx:aJustify = { .F., .F., .F., .F., .T. }
ACTIVATE WINDOW oWnd ON CLICK MsgInfo( "Click!" )
DbCloseAll()
Return Nil
//----------------------------------------------------------------------------//
Static Function SelColor( nNivel )
Local nColor := CLR_BLACK
Do Case
Case nNivel == 1
nColor = CLR_HRED
Case nNivel == 2
nColor = CLR_HGREEN
Case nNivel == 3
nColor = CLR_HBLUE
EndCase
Return nColor
Level1 BITMAP "..\Bitmaps\Level1.bmp"
Level2 BITMAP "..\Bitmaps\Level2.bmp"
Level3 BITMAP "..\Bitmaps\Level3.bmp"
Level4 BITMAP "..\Bitmaps\Level4.bmp"
Level5 BITMAP "..\Bitmaps\Level5.bmp"
Not such a bug, it was just an advice for portability.Silvio wrote:but why we cannot use bitmap at folder and we must use resources?
Perhaps there is a bug on xharbour ce?
?????Silvio wrote:I sad this because i try to use pp4 hand basic last year before to purchase fwppc and with it can use all in source , the last one you cannot use are dbf files instead of pdb files.
No problem with TSBrowse, TSButton have problems with transparency and some non supported GDI functions.Silvio wrote:Manuel, when we can use your sbrowse and your sbutton in fwppc?
Are you?Silvio wrote:I am sure U're working for us...
Return to FiveWin for Pocket PC
Users browsing this forum: No registered users and 20 guests