Page 1 of 1

DCPUSHBUTTONXP, build 255

Posted: Tue Apr 03, 2012 9:48 am
by Tom
Hi, Roger.

If the pushbutton image is an icon object, DC_XbpPushButtonXP:Draw() runs into an error here (around line 1135):

Code: Select all

  ELSEIF Valtype( cCaption ) == 'O' .AND. (cCaption:isDerivedFrom('XbpBitMap') .OR. cCaption:isDerivedFrom('XbpIcon'))
    oBitmap := cCaption
    aSource := {0,0,oBitmap:xSize,oBitmap:ySize}
    aTarget := { nStartCol, nStartRow, nEndCol, nEndRow }
    oBitmap:draw( oPS, aTarget, aSource, ;
            IIF(lDisabled .AND. ::disabledBmp,GRA_BLT_ROP_PATCOPY,nil), GRA_BLT_BBO_IGNORE )   // abo service
The method "draw" has different parameters for icons. It should be this way:

Code: Select all

ELSEIF Valtype( cCaption ) == 'O' .AND. (cCaption:isDerivedFrom('XbpBitMap') .OR. cCaption:isDerivedFrom('XbpIcon'))
    oBitmap := cCaption
    aSource := {0,0,oBitmap:xSize,oBitmap:ySize}
    aTarget := { nStartCol, nStartRow, nEndCol, nEndRow }
    IF cCaption:isDerivedFrom('XbpIcon') // new
      oBitmap:draw( oPS, aTarget,IIF(lDisabled .AND. ::disabledBmp,XBP_STATE_DISABLED,XBP_STATE_NORMAL) )
      ELSE
      oBitmap:draw( oPS, aTarget, aSource, ;
            IIF(lDisabled .AND. ::disabledBmp,GRA_BLT_ROP_PATCOPY,nil), GRA_BLT_BBO_IGNORE )   // abo service
    ENDIF
Anyway, there seem to be some other cosmetic problems; I'm currently investigating this.

1. If a button has an image and a text caption, the text caption is one pixel higher as it should be.
2. Tooltips and hotkeys seem not to work with the BUTTONS clause of DCGET OPTIONS (items 9 and 10 of the buttons array).

Re: DCPUSHBUTTONXP, build 255

Posted: Tue Apr 03, 2012 10:18 am
by Tom
Damned. Wrong forum. Message belongs to "eXpress++ support". Sorry.

Re: DCPUSHBUTTONXP, build 255

Posted: Tue Apr 03, 2012 10:23 am
by rdonnay
Tom -

This is good timing.
I'm trying to get out a new release this week.
I have samples that use icons with no problem.
Can you reproduce this in a sample?

Roger

Re: DCPUSHBUTTONXP, build 255

Posted: Tue Apr 03, 2012 10:33 am
by Tom
Hi, Roger.
Can you reproduce this in a sample?
What parts? The XbpIcon:Draw-problem (see code) is an error; XbpIcon:Draw() has different parameters to XbpBitmap:Draw().

I'm trying to show the one-pixel-problem in a sample (and/or find the reason). Tooltips and accelerator keys with DCGETOPTIONS ... BUTTONS simply don't work.

Could you please move the thread to "eXpress++ support"?

Re: DCPUSHBUTTONXP, build 255

Posted: Tue Apr 03, 2012 11:21 am
by rdonnay
You are right!! I was looking at my build 256 code.
I fixed this problem and forgot about it.