FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC TBtnBmp problem
Posts: 18
Joined: Fri Nov 11, 2005 04:46 PM
TBtnBmp problem
Posted: Fri Nov 11, 2005 05:04 PM
There are problems with BtnBmp when i use them in nested forms.
try the following program:

in the nested form if i use Tbutton all works fine, but if i use
BtnBmp the program exits immediatly.

Best regards
Claudio

8<---------8<---------8<---------8<---------8<---------8<---------8<---------

#include "Fwce.ch"
#include "common.ch"

REQUEST DBFCDX

function Main()
local oWnd, oBrw

USE "Storage card\Customer" VIA "DBFCDX"

DEFINE WINDOW oWnd TITLE "test"

@ 1, 1 LISTBOX oBrw FIELDS SIZE 220, 167

a := {}
aadd(a,{"open.bmp", {|o|nested()}})
aadd(a,{"print.bmp", {|o|oWnd:End()}})
aadd(a,{"search.bmp", {|o|oWnd:End()}})
aadd(a,{"setup.bmp", {|o|oWnd:End()}})
aadd(a,{"star.bmp", {|o|oWnd:End()}})
aadd(a,{"test.bmp", {|o|oWnd:End()}})
aadd(a,{"users.bmp", {|o|oWnd:End()}})
a := aHorBtnBmp(a)

ACTIVATE WINDOW oWnd ;
ON CLICK MsgInfo( "Click!" )

return nil

function nested()
local oWnd,oBrw
local a,as

a := {{"NAME", "C",10,0},;
{"TYPE", "C", 1,0} }

DbCreate( CURDIR()+"\STRUCT.DBF",a)

select customer
a := {}
for i := 1 to fCount()
aadd(a,{fieldname(i),valtype(fieldget(i))})
next i

use ( CURDIR()+"\STRUCT.DBF") alias STRU new exclusive
for i := 1 to len(a)
append blank
STRU->NAME := a[i,1]
STRU->TYPE := a[i,2]
next i

go top

DEFINE WINDOW oWnd TITLE "test"

@ 1, 1 LISTBOX oBrw FIELDS SIZE 220, 167

//#define WORKS
#ifdef WORKS
@ 12, 2 BUTTON "Done" SIZE 80, 30 ;
ACTION oWnd:End()
#else
a := {}
aadd(a,{"open.bmp", {|o|oWnd:End()}})
aadd(a,{"print.bmp", {|o|oWnd:End()}})
aadd(a,{"search.bmp", {|o|oWnd:End()}})
aadd(a,{"setup.bmp", {|o|oWnd:End()}})
aadd(a,{"star.bmp", {|o|oWnd:End()}})
aadd(a,{"test.bmp", {|o|oWnd:End()}})
aadd(a,{"users.bmp", {|o|oWnd:End()}})
a := aHorBtnBmp(a)
#endif

ACTIVATE WINDOW oWnd

close stru
return nil

// ----------------------------- aHorBtnBmp -------------------------------
//
//
function aHorBtnBmp(aBtn,nSkip,nRow,nCol,nSize,nGap,cDir)
local aObj := array(len(aBtn))
default nSkip to 0
default nRow to 234
default nCol to 2
default nSize to 32
default nGap to 2
default cDir to curdir()+"\"
nCol += nSkip*(nSize+nGap)
aeval(aObj,{|x,i|aObj[i] := TBtnBmp():New(nRow,nCol,nSize,nSize,,,cDir+aBtn[i,1],,aBtn[i,2]), nCol += nSize+nGap})
return aObj

8<---------8<---------8<---------8<---------8<---------8<---------8<---------
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: TBtnBmp problem
Posted: Fri Nov 11, 2005 09:07 PM

This is a known problem. Try to reduce the number of bitmaps. Antonio, did you find the time to look at it?

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TBtnBmp problem
Posted: Sat Nov 12, 2005 08:51 AM

Claudio, Enrico,

Already fixed. Please download a new FWPPC build.

Please Claudio, try your code and let me know if it works ok. Thanks,

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TBtnBmp problem
Posted: Sat Nov 12, 2005 09:58 AM

Antonio, you are the man! :-)

EMG

Posts: 18
Joined: Fri Nov 11, 2005 04:46 PM
TBtnBmp problem
Posted: Sun Nov 13, 2005 04:28 PM
Antonio Linares wrote:Claudio, Enrico,

Already fixed. Please download a new FWPPC build.

Please Claudio, try your code and let me know if it works ok. Thanks,


Excellent! i try tomorrow morning.
Thanks very much.
Claudio
Posts: 18
Joined: Fri Nov 11, 2005 04:46 PM
TBtnBmp problem
Posted: Mon Nov 14, 2005 10:12 AM
Antonio Linares wrote:Claudio, Enrico,

Already fixed. Please download a new FWPPC build.

Please Claudio, try your code and let me know if it works ok. Thanks,


Unfortunatly not, try two or three times the open button and you
will be pushed out of program.

Claudio

Continue the discussion