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
DCPUSHBUTTONXP
Re: DCPUSHBUTTONXP
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.
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
Hi Roger
Add AUTORESIZE to DCGETOPTIONS of the buttonxp.prg sample program and resize the dialog, you get the same error.
Thanks.
Joe.
Add AUTORESIZE to DCGETOPTIONS of the buttonxp.prg sample program and resize the dialog, you get the same error.
Thanks.
Joe.
Re: DCPUSHBUTTONXP
You are correct. The resize code looks all wrong. I will need to check older versions to see why.
The eXpress train is coming - and it has more cars.
Re: DCPUSHBUTTONXP
Roger
Thanks
Waiting for your Fix.
Joe
Thanks
Waiting for your Fix.
Joe
Re: DCPUSHBUTTONXP
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?
Why are you the only person who needs this fix?
What is it that is unique about your application?
The eXpress train is coming - and it has more cars.
Re: DCPUSHBUTTONXP
Here is an updated _DCXBUTT.PRG.Add AUTORESIZE to DCGETOPTIONS of the buttonxp.prg sample program and resize the dialog, you get the same error.
Copy it to your \exp20\source\dclipx folder and run BUILD19_SL1.BAT or BUILD20.BAT to rebuild DCLIPX.DLL.
- Attachments
-
- _dcxbutt.zip
- (21.81 KiB) Downloaded 584 times
The eXpress train is coming - and it has more cars.
Re: DCPUSHBUTTONXP
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.
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
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.
I am overloaded right now with other problems.
For now, I suggest that you add ..RESIZE DCGUI_RESIZE_NONE to your pushbuttons.
The eXpress train is coming - and it has more cars.