TBtnBmp problem

TBtnBmp problem

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

Re: TBtnBmp problem

Postby Enrico Maria Giordano » Fri Nov 11, 2005 9: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
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Sat Nov 12, 2005 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Sat Nov 12, 2005 9:58 am

Antonio, you are the man! :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

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


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 8 guests