Resize problem with 'PICTURE' masks

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
TWolfe
Posts: 60
Joined: Thu Jan 28, 2010 7:34 am

Resize problem with 'PICTURE' masks

#1 Post by TWolfe »

When resizing a dialog the gets defined with "PICTURE '@S10!'" do not size properly.
Also, HiLites do not seem to redraw properly when resizing

Any ideas on fixes?
Terry

Code: Select all

#include "dcdialog.ch"
#include "appevent.ch"

PROCEDURE MAIN()
LOCAL getList:={}, GetOptions, mLetter:=space(50), lpvPreview:=.F., ;
      lpvSave2Disk:=.F., lOk, oDlg

  @ 2, 6 DCSAY "Enter letter number:" GET mLetter  ;
            PICTURE '@S10!'    ;
            NOCONFIRM   ;
       ; //     GETSIZE 15 ;      // <<-  This parameter is required to properly resize the GET
            SAYRIGHT    ;
            SAYSIZE 30

  @ 4, 4  DCPUSHBUTTON CAPTION "~OK"  SIZE 19,1.5 ;
            ACCELKEY xbeK_CTRL_O ;
            TOOLTIP "Select the indicated letter" ;
            ACTION {|| DC_ReadGuiEvent(DCGUI_EXIT_OK, GetList) } ;
            FONT "10.Arial Bold"

DCGETOPTIONS CHECKGET ;
             HILITEGETS GRA_CLR_RED  ;
             RESIZE RESIZEDEFAULT DCGUI_RESIZE_AUTORESIZE_SCALEFONT

DCREAD GUI ;
    FIT TO lOk                         ;
    PARENT @oDlg                       ;
    ENTEREXIT                          ;
    OPTIONS GetOptions

wtf lOk PAUSE

RETURN

PROCEDURE AppSys()
RETURN

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

Re: Resize problem with 'PICTURE' masks

#2 Post by rdonnay »

Terry -

I believe that the updated code will solve your problem.
It works ok for me with your sample.

Replace the ResizeSetSize() method in _DCXBPGT.PRG with the following:

Code: Select all

METHOD DC_XbpGet:ResizeSetSize( aSize )

LOCAL aArray, nWidth, nHeight, aGetListItem

aGetListItem := ::getList:getListArray[::getListPointer]

nWidth := ::currentSize()[1]
nHeight := ::currentSize()[2]

IF !Empty(::template)
  aArray := GraQueryTextBox( ::lockPS(), Repl(::template,Len(::editBuffer())) )
ELSE
  aArray := GraQueryTextBox( ::lockPS(), ::editBuffer() )
ENDIF

nWidth := aSize[1]
nHeight := (aArray[1,2] - aArray[2,2]) + 4 + DC_XbpGetHeightPadding()

::unlockPS()

RETURN ::xbpSle:setSize( { nWidth, nHeight } )
The eXpress train is coming - and it has more cars.

Post Reply