TBtnBmp problem

Post Reply
User avatar
claudio.driussi
Posts: 18
Joined: Fri Nov 11, 2005 4:46 pm

TBtnBmp problem

Post 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<---------
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: TBtnBmp problem

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
claudio.driussi
Posts: 18
Joined: Fri Nov 11, 2005 4:46 pm

Post 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
User avatar
claudio.driussi
Posts: 18
Joined: Fri Nov 11, 2005 4:46 pm

Post 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
Post Reply