Page 1 of 1
DCPUSHBUTTONXP
Posted: Tue Aug 04, 2015 12:44 am
by unixkd
Hi all
I got the bolow error with this code.
1,1 DCPUSHBUTTONXP ACTION {|| ::ScanningDevice(SCANNER_FUTRONIC_FS )} SIZE 9,3 CAPTIONARRAY {{DC_GetBitMap(JPEG_FUTRONIC_TECH ),, 5,5,90,97}} GRADIENT 1

- DC_PushButtonXP.jpg (110.84 KiB) Viewed 11008 times
Re: DCPUSHBUTTONXP
Posted: Tue Aug 04, 2015 2:58 am
by unixkd
Hi Roger,
In dclipx\_dcxbutt.prg you have
METHOD DC_XbpPushButtonXP:Resize( aOldSize, aNewSize )
LOCAL nYRatio, nXRatio, i, bResize, lResize, ;
lScaleFont, nX, nY, aPos, aSize, nCurrentCol, nCurrentRow, ;
nCurrentWidth, nCurrentHeight
nX := (aNewSize[1]-aOldSize[1])
nY := (aNewSize[2]-aOldSize[2])
IF nX = 0 .AND. nY = 0 // .AND. ::mouseMode # 1
RETURN nil
ENDIF
::isResizing := .t.
nXRatio := aNewSize[1]/aOldsize[1]
nYRatio := aNewSize[2]/aOldSize[2]
bResize := {|x,y,x1,y1,x2,y2|{x1*x2,y1*y2}}
FOR i := 1 TO Len(::captionArray)
lResize := ::captionArray[i,11]
DEFAULT lResize := .t.
IF lResize .AND. Valtype(::captionArray[i,1]) == 'O'
nCurrentCol := ::captionArray[i,11]
nCurrentRow := ::captionArray[i,12]
nCurrentWidth := ::captionArray[i,13]
nCurrentHeight := ::captionArray[i,14]
::captionArray[i,11] := nCurrentCol * nXRatio
::captionArray[i,12] := nCurrentRow * nYRatio
::captionArray[i,13] := Round(Max(nCurrentWidth * nXRatio,1),6)
::captionArray[i,14] := Round(Max(nCurrentHeight * nYRatio,1),6)
aPos := Eval( bResize, nX, nY, nCurrentCol, nCurrentRow, nXRatio, nYRatio )
::captionArray[i,3] := aPos[2]
::captionArray[i,4] := aPos[1]
aSize := Eval( bReSize, nX, nY, nCurrentWidth, nCurrentHeight, nXRatio, nYRatio )
::captionArray[i,5] := ::captionArray[i,3] + aSize[2]
::captionArray[i,6] := ::captionArray[i,4] + aSize[1]
ENDIF
NEXT
::invalidateRect()
::isResizing := .f.
RETURN nil
*
Note that you have ::captionArray subarray having up to 14 elements. I guess this is where the problem is coming from.
The express documentation stated that each subarray of CAPTIONARRAY has 8 elements.
From the sample buttonxp.prg, you defined captionarray thus:
aCaptions := { ;
{ DC_GetBitMap(BITMAP_BUG_M),, 20,10,120,100,,,}, ;
{ 'This is a', GRA_CLR_BLACK, 50, 120,,,,'24.Lucida Console',,}, ;
{ 'Really Big', GRA_CLR_RED, 140, 120,,,,'32.Arial Bold',,}, ;
{ 'Bug', COLOR_LTORANGE, 230, 120,,,,'32.Helv Bold',,} }
Thanks.
Joe.
Re: DCPUSHBUTTONXP
Posted: Tue Aug 04, 2015 3:57 am
by unixkd
Hi Roger
Add AUTORESIZE to DCGETOPTIONS of the buttonxp.prg sample program and resize the dialog, you get the same error.
Thanks.
Joe.
Re: DCPUSHBUTTONXP
Posted: Tue Aug 04, 2015 11:59 am
by rdonnay
You are correct. The resize code looks all wrong. I will need to check older versions to see why.
Re: DCPUSHBUTTONXP
Posted: Thu Aug 06, 2015 11:18 pm
by unixkd
Roger
Thanks
Waiting for your Fix.
Joe
Re: DCPUSHBUTTONXP
Posted: Fri Aug 07, 2015 7:10 am
by rdonnay
This is going to take awhile. I have been very busy.
Why are you the only person who needs this fix?
What is it that is unique about your application?
Re: DCPUSHBUTTONXP
Posted: Mon Aug 10, 2015 10:41 am
by rdonnay
Add AUTORESIZE to DCGETOPTIONS of the buttonxp.prg sample program and resize the dialog, you get the same error.
Here is an updated _DCXBUTT.PRG.
Copy it to your \exp20\source\dclipx folder and run BUILD19_SL1.BAT or BUILD20.BAT to rebuild DCLIPX.DLL.
Re: DCPUSHBUTTONXP
Posted: Tue Aug 11, 2015 12:50 am
by unixkd
Roger
Thanks.
Joe
Re: DCPUSHBUTTONXP
Posted: Wed Aug 12, 2015 12:25 am
by unixkd
Dear Roger
I notice that when I resize, the error no longer show BUT the bitmap Caption disappear. You can confirm it also on BUTTONXP sample. The BIG BUG caption bitmap also disappear.
Thanks.
Joe.
Re: DCPUSHBUTTONXP
Posted: Wed Aug 12, 2015 12:55 pm
by rdonnay
I will get to this when I can.
I am overloaded right now with other problems.
For now, I suggest that you add ..RESIZE DCGUI_RESIZE_NONE to your pushbuttons.