DCPUSHBUTTONXP

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

DCPUSHBUTTONXP

#1 Post 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
DC_PushButtonXP.jpg (110.84 KiB) Viewed 10994 times

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: DCPUSHBUTTONXP

#2 Post 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.

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: DCPUSHBUTTONXP

#3 Post 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.

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

Re: DCPUSHBUTTONXP

#4 Post by rdonnay »

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.

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: DCPUSHBUTTONXP

#5 Post by unixkd »

Roger

Thanks

Waiting for your Fix.

Joe

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

Re: DCPUSHBUTTONXP

#6 Post 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?
The eXpress train is coming - and it has more cars.

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

Re: DCPUSHBUTTONXP

#7 Post 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.
Attachments
_dcxbutt.zip
(21.81 KiB) Downloaded 584 times
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: DCPUSHBUTTONXP

#8 Post by unixkd »

Roger

Thanks.

Joe

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: DCPUSHBUTTONXP

#9 Post 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.

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

Re: DCPUSHBUTTONXP

#10 Post 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.
The eXpress train is coming - and it has more cars.

Post Reply