Page 1 of 1

TBtnBmp problem

Posted: Fri Nov 11, 2005 5:04 pm
by claudio.driussi
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 := 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<---------

Re: TBtnBmp problem

Posted: Fri Nov 11, 2005 9:07 pm
by Enrico Maria Giordano
This is a known problem. Try to reduce the number of bitmaps. Antonio, did you find the time to look at it?

EMG

Posted: Sat Nov 12, 2005 8:51 am
by Antonio Linares
Claudio, Enrico,

Already fixed. Please download a new FWPPC build.

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

Posted: Sat Nov 12, 2005 9:58 am
by Enrico Maria Giordano
Antonio, you are the man! :-)

EMG

Posted: Sun Nov 13, 2005 4:28 pm
by claudio.driussi
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

Posted: Mon Nov 14, 2005 10:12 am
by claudio.driussi
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