compiling problem

This forum is for general support of Xbase++
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: compiling problem

#11 Post by rdonnay »

This takes a bit of finagling to get it to work exactly as you want.

This should help move you in the right direction:

Code: Select all

#include "dcdialog.ch"
#INCLUDE "appevent.CH"

FUNCTION main()

LOCAL GetList := {}, GetOptions,  nNum := 0, cString := Space(30)
nNum:=45.30

nResDll1 := DllLoad('TOUCH.DLL') // load my custom bitmaps
 DC_BitmapResourceFile( { nResDll1} )

Test()

return ''
* -----------

FUNCTION Test()

LOCAL GetList := {}, GetOptions,  nNum := 0, cString := Space(30), oString

@ 0,0 DCGET nNum

@ 1,1 DCSAY 'Enter a Number' GET nNum GETFONT '18.Courier' ;
      PICTURE '999999.99' POPUP {|n|n := PopNumPad(n), {n,oString}} ;
      GETCARGO 0 ;
      GOTFOCUS {|a,b,o|IIF(DC_GetCargo(o)==0,PostAppEvent(xbeP_Activate,,,o:popupButton),nil),DC_GetCargo(o,1)}

@ 3,1 DCSAY 'Enter a String' GET cString GETFONT '18.Courier' POPUP {|n|PopKeyPad(n)} ;
      GETOBJECT oString

DCGETOPTIONS HILITEGETS GRA_CLR_YELLOW

DCREAD GUI FIT ADDBUTTONS TO lOk SETAPPWINDOW ;
   OPTIONS GetOptions TITLE 'Touch Screen Demo'

PROC AppSys()
RETURN
The eXpress train is coming - and it has more cars.

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: compiling problem

#12 Post by BruceN »

I have everything working EXACTLY the way I want it... only one wierd problem. When I run the app thru the debuger (VX) everything works fine. When I take my compiled EXE and run it standalone, the calculator buttons on popnumpad() don't show, all I get is the background and entry field at the top. ???
There are only 10 kinds of people - those who understand binary and those who don't :)

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

Re: compiling problem

#13 Post by rdonnay »

I will need a sample again.
The eXpress train is coming - and it has more cars.

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: compiling problem

#14 Post by BruceN »

My small test program works fine. My whole app doesn't. I can either zip up everything for you or you can log in (I have teamviewer) and 'fly' my computer to see what the problem is.

Whatever is easiest for you...

thanks
There are only 10 kinds of people - those who understand binary and those who don't :)

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: compiling problem

#15 Post by BruceN »

Figured it out... dll I created from REs file wasn't in right place.

thanks anyway...
There are only 10 kinds of people - those who understand binary and those who don't :)

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: compiling problem

#16 Post by BruceN »

Roger:

Hate to be a pain, but there's another small issue with PopNumPad (same with PopKeyPad). If you enter in '123' on the number pad then click (or touch) the [enter] button on the number pad all is well. However, if you use the [enter] on a keyboard it repeats the last digit so what gets returned is '1233'.

You should get that behavior on the sample I uploaded related to this earlier

thanks
There are only 10 kinds of people - those who understand binary and those who don't :)

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

Re: compiling problem

#17 Post by rdonnay »

This sounded familiar. I remember fixing it for a customer several years ago but forgot to put the fix in the sample program.

Add a line of code at the end of the Accum() function. See below.

Code: Select all

STATIC FUNCTION Accum ( nKey, cValue, GetList )

IF lFirstTime
  cValue := ''
ELSE
  cValue := Alltrim(cValue)
ENDIF

lFirstTime := .f.

IF nKey >= 0 .AND. nKey <= 9

  cValue += Alltrim(Str(nKey))

ELSEIF nKey == 10 // Decimal key

  cValue := StrTran(cValue,'.','')
  cValue += '.'

ELSEIF nKey == 11 // Minus Key

  IF Left(cValue,1) == '-'
    cValue := Substr(cValue,2)
  ELSE
    cValue := '-' + cValue
  ENDIF

ELSEIF nKey == 12 // Clear

  cValue := ''

ELSEIF nKey == 13 // Backspace

  cValue := Substr(cValue,1,Len(cValue)-1)

ENDIF

cValue := PadL(cValue,16)

DC_GetRefresh(GetList,'ACCUM')
SetAppFocus(DC_GetObject(GetList,'ACCUM'))   // <<<<<<<<<<< add this

RETURN nil
The eXpress train is coming - and it has more cars.

Post Reply