DCBROWSECOL type XBPCOL_TYPE_BITMAP with external resources

This forum is for eXpress++ general support.
Message
Author
skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

DCBROWSECOL type XBPCOL_TYPE_BITMAP with external resources

#1 Post by skiman »

Hi Roger,

Is seems as the following isn't working with my external resources DLL?

Code: Select all

DCBROWSECOL DATA ;
{|| stock->(dbseek(bonart->art_nummer)),if(bonart->(deleted()), ABO_MINI_CANCEL,ABO_MINI_EMPTY )} ;
HEADER "Del" ;
PARENT oBrowseart WIDTH 1 ;
TYPE XBPCOL_TYPE_BITMAP
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCBROWSECOL type XBPCOL_TYPE_BITMAP with external resources

#2 Post by rdonnay »

Try this:

Code: Select all

DCBROWSECOL DATA ;
{|| stock->(dbseek(bonart->art_nummer)),DC_GetBitmap(if(bonart->(deleted()), ABO_MINI_CANCEL,ABO_MINI_EMPTY ))} ;
HEADER "Del" ;
PARENT oBrowseart WIDTH 1 ;
TYPE XBPCOL_TYPE_BITMAP
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: DCBROWSECOL type XBPCOL_TYPE_BITMAP with external resources

#3 Post by skiman »

Hi,

I just tested it with the BITMAP_BUG_M and this is working. So it seems as it is nothing in my code this time. ;)

Using a bitmap from my ABORES.DLL isn't working for the dcBrowseCol.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCBROWSECOL type XBPCOL_TYPE_BITMAP with external resources

#4 Post by rdonnay »

Are you saying that the DC_GetBitmap() addition isn't working?

Columns of XBPCOL_TYPE_BITMAP require an XbpBitMap() object and that is the purpose of DC_GetBitmap().
It should always return a bitmap object.

Try this in your code and tell me what it returns:

Code: Select all

wtf DC_GetBitmap(ABO_MINI_CANCEL)
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: DCBROWSECOL type XBPCOL_TYPE_BITMAP with external resources

#5 Post by skiman »

Roger,

This is returning an xbpBitmap object. ActiveImage and Handle are 0?
Bits, XSize, YSize, transparentClr, Type have values in it.

I also tried it with a bitmap I'm using as popupcaption all over in my application, and it is also not working.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCBROWSECOL type XBPCOL_TYPE_BITMAP with external resources

#6 Post by rdonnay »

I can't figure this out unless you send me your resource dll.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: DCBROWSECOL type XBPCOL_TYPE_BITMAP with external resources

#7 Post by skiman »

Roger,

I just mailed my resources DLL to you.

Code: Select all

    DCBROWSECOL DATA {||  DC_GetBitmap(ABO_SEARCH_MINI) } ;
       HEADER "Del" ;
       PARENT oBrowseart WIDTH 1 ;
       TYPE XBPCOL_TYPE_BITMAP
The above also doesn't work.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCBROWSECOL type XBPCOL_TYPE_BITMAP with external resources

#8 Post by rdonnay »

Run the below code:
It works fine for me.

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL GetList[0], oBrowse, aBitmaps[0], nDll, i, oBitmap

nDll := DllLoad('abores.dll')
DC_BitmapResourceFile(nDll)

FOR i := 10000 to 10333
  oBitmap := DC_GetBitmap(i)
  IF Valtype(oBitmap) == 'O' .AND. oBitmap:xSize > 0
    AAdd(aBitmaps,{Alltrim(Str(i)),DC_GetBitmap(i),i})
  ENDIF
NEXT

@ 0,0 DCBROWSE oBrowse DATA aBitmaps SIZE 20,20 FIT

DCBROWSECOL ELEMENT 1 HEADER 'Res[1]' WIDTH 10  PARENT oBrowse

DCBROWSECOL ELEMENT 2 HEADER 'Bitmap[2]' WIDTH 10  PARENT oBrowse ;
   TYPE XBPCOL_TYPE_BITMAP

DCBROWSECOL DATA {||DC_GetColArray(3,oBrowse)} HEADER 'Res[3]' WIDTH 10  ;
   PARENT oBrowse PICTURE '99999'

DCBROWSECOL DATA {||DC_GetBitmap(DC_GetColArray(3,oBrowse))} HEADER 'Bitmap[3]' ;
   WIDTH 10  PARENT oBrowse TYPE XBPCOL_TYPE_BITMAP

DCREAD GUI FIT TITLE 'Browse ABORES.DLL bitmaps'

RETURN nil

PROC appsys ; return
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: DCBROWSECOL type XBPCOL_TYPE_BITMAP with external resources

#9 Post by skiman »

Roger,

I added the following to your sample.

Code: Select all

DCBROWSECOL DATA {|| dc_getbitmap(ABO_SEARCH_MINI)  } HEADER 'dcgetbitmap' WIDTH 10  PARENT oBrowse ;
   TYPE XBPCOL_TYPE_BITMAP

DCBROWSECOL DATA {|| ABO_SEARCH_MINI } HEADER 'ext. res' WIDTH 10  PARENT oBrowse ;
   TYPE XBPCOL_TYPE_BITMAP

DCBROWSECOL DATA {|| BITMAP_BUG_M } HEADER 'int. res' WIDTH 10  PARENT oBrowse ;
   TYPE XBPCOL_TYPE_BITMAP
It is working with the dc_getbitmap in the sample. I have to check why this doesn't work in my application.

The second column isn't working. If it is necesary to add the dc_getbitmap I have to modify it in all my sources. This is not a big problem, if there is no other solution.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCBROWSECOL type XBPCOL_TYPE_BITMAP with external resources

#10 Post by rdonnay »

The second column isn't working. If it is necesary to add the dc_getbitmap I have to modify it in all my sources. This is not a big problem, if there is no other solution.
Yes, it is necessary. Sorry, but I don't know how to get around this.
I could modify the source for DC_XbpBrowse() to have it automatically modify your code block if it is an XBPCOL_TYPE_BITMAP, but I'd rather not do this unless it is absolutely necessary.
The eXpress train is coming - and it has more cars.

Post Reply