Page 1 of 1

FYI Tablet App

PostPosted: Tue May 12, 2015 3:59 pm
by Gale FORd
I am getting close to completing my first tablet application. I just thought I would share a couple of pictures.
This app is designed for a Container Yard Interchange Clerks. Every container and chassis that comes into and out of the container yard has to be inspected and a signed interchange given to the drivers. Our Houston location has 4 inbound lanes and 2 outbound lanes. There are usually 3 or 4 clerks at a time doing the inspections.

Our Houston inbound gate
Image
Main menu
Image
Signature Capture
Image
Interchange Printed on Portable Wireless Bluetooth Printer
Image

Re: FYI Tablet App

PostPosted: Tue May 12, 2015 4:05 pm
by Armando
Gale:

WOW!!!!!!, nice job, congratulations.

Regards

Re: FYI Tablet App

PostPosted: Tue May 12, 2015 4:41 pm
by Rick Lipkin
Gale

Really Kewl .. it looks like this tablet is running a Windows 8.1 OS ? and your app looks like a Win32 Gui ? Can you share any details on how you wrote this for a tablet interface ?

Thanks
Rick Lipkin

Re: FYI Tablet App

PostPosted: Tue May 12, 2015 4:55 pm
by cnavarro
congratulations
great work

Re: FYI Tablet App

PostPosted: Tue May 12, 2015 6:54 pm
by Gale FORd
Yes, it is running Windows 8.1 Pro. We have a strong WiFi device for network connectivity. Advantage Database Server for our data storage.
I looked at all of the samples related to Metro and Touch to get ideas.
Still have some problems with automatic keyboard display so we decided to keep keyboard on screen all of the time. If it closes I will open it again when changing screens and there is a keyboard button on screen just in case.

Using resource for dialog screens. Had to adjust font size for visibility and touch friendliness. Locked screen orientation so the dialog layout would remain correct.
Instead of spending $2,500 or more for rugged tablet, we bought inexpensive tablet and added tough case for total under $600. We can buy 4 cheaper ones for the price of 1 rugged tablet.
3" wide wireless thermal printer has printer driver so there was no problem there. Had to calculate # lines to print and adjust page size.

Re: FYI Tablet App

PostPosted: Tue May 12, 2015 7:40 pm
by James Bott
Very impressive Gale. You are now the go-to guy for tablet questions!

James

Re: FYI Tablet App

PostPosted: Wed May 13, 2015 6:10 am
by Antonio Linares
Very nice, congratulations! :-)

Re: FYI Tablet App

PostPosted: Wed May 13, 2015 8:00 am
by Otto
Hello Gale,

Thank you for posting these screens.
Respect and congratulations.

May I ask if you are using the CaptureSignature() function from the FiveWin samples.

I started using this functions some days ago but my signature does not paint as nice as yours.
I am testing now with inserting some sysrefresh().
And I planed to use a timer to get more painting coordinates.

I am curious if you have a dll or if you use CaptureSignature()

Thanks in advance
Otto


http://www.atzwanger-software.com/fw/unterschrift2.jpg

Re: FYI Tablet App

PostPosted: Wed May 13, 2015 8:00 am
by Otto
Hello Gale,

Thank you for posting these screens.
Respect and congratulations.

May I ask if you are using the CaptureSignature() function from the FiveWin samples.

I started using this functions some days ago but my signature does not paint as nice as yours.
I am testing now with inserting some sysrefresh().
And I planed to use a timer to get more painting coordinates.

I am curious if you have a dll or if you use CaptureSignature()

Thanks in advance
Otto


Image

Re: FYI Tablet App

PostPosted: Wed May 13, 2015 9:49 am
by pgfdz
Hi Gale
Nice job!!! Congratulations.

;)

Re: FYI Tablet App

PostPosted: Wed May 13, 2015 3:32 pm
by Gale FORd
I used signatur.prg as example. I made some enhancements and fixes to it.
I agree that the quality is not 100% what I would like. It seems the captured mouse movement is not always pixel by pixel.

This is an updated sample from my code, but I have not tested it.
Code: Select all  Expand view
#include "FiveWin.ch"

function CaptureSignature()

   local oDlg, oSig, lPaint := .F., cFile := Lower( "signature.bmp" ), hDC
   local lReset := .f.
   local oBrush
   local nPenWidth := 4, oPenSig
   local nTop := 2, nBottom := 0
   local aCoord
   local nColor := CLR_WHITE

   oBrush := TBrush():New( , nColor )
   DEFINE DIALOG oDlg TITLE "Signature" PIXEL ;
      RESOURCE "DLG_Sign"

   DEFINE PEN oPenSig  WIDTH nPenWidth COLOR CLR_BLACK

   REDEFINE SAY oSig ID 200 PROMPT "" OF oDlg
   oSig:nClrPane := nRgb( 255,255,255 )
   oSig:oBrush  := oBrush

   redefine button prompt 'Save';
      id 100 of oDlg update;
      ACTION ( oSig:SaveToBmp( cFile ), oDlg:End() )

   redefine button prompt 'Cancel';
      id 101 of oDlg ;
      action ( lReturn := .f., oDlg:End() )

   redefine button prompt 'Clear';
      id 102 of oDlg ;
      action ( lPaint := .F., ;
         FillRect( hDC, GetClientRect( oSig:hWnd ), oBrush:hBrush ), ;
         oSig:refresh(.t.) )

   oSig:lWantClick := .T.
   // Fixed row, col to y, x conversion, x/y designation was reversed
   oSig:bLButtonUp := { | y, x, z | DoDraw( hDC, x, y, lPaint := .F.,, oPenSig ) }
   // Added limits to Top and Bottom in case users draw off canvas
   oSig:bMMoved    := { | y, x, z | ( ;
      if( y >= nBottom .or. y <= nTop , lReset := .T., lReset := .f. ), ;
      DoDraw( hDC, x, y , lPaint, lReset, oPenSig )) }
   oSig:bLClicked  := { | y, x, z | DoDraw( hDC, x, y, lPaint := .T., .t., oPenSig  ) }
   // If button released when not on Signature area
   oDlg:bLButtonUp := { || lPaint := .F. }

   ACTIVATE DIALOG oDlg CENTER ;
      ON INIT ( aCoord := GetCoors( oSig:hWnd ), ;
         nBottom := aCoord[3]- aCoord[1]-2, ;
         hDC := GetDC( oSig:hWnd ), oSig:nClrPane := nColor ) ;
      VALID ( ReleaseDC( oSig:hWnd, hDC ), .T. )
   RELEASE PEN oPenSig

return nil

static function DoDraw( hDc, x, y, lPaint, lReset, oPen )
   if ! lPaint .or. ( lReset != nil .and. lReset )
      MoveTo( hDC, x, y )
   else
      LineTo( hDc, x, y, oPen:hPen )
   endIf
return nil


Here is the .rc
Code: Select all  Expand view
DLG_Sign DIALOG -32768, 65, 204, 99
STYLE DS_SYSMODAL | DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "Signature"
FONT 12, "MS Sans Serif"
{
 PUSHBUTTON "Save", 100, 6, 3, 46, 14
 PUSHBUTTON "Cancel", 101, 84, 3, 35, 14
 PUSHBUTTON "Clear", 102, 162, 3, 35, 14
 GROUPBOX "", 104, 4, 17, 198, 68, BS_GROUPBOX
 CONTROL "", 200, "STATIC", SS_WHITERECT | WS_CHILD | WS_VISIBLE, 5, 22, 196, 61
 RTEXT "X", -1, 1, 78, 5, 9
 CTEXT "I agree that this inspection is correct.", -1, 13, 88, 172, 9
}
 

Re: FYI Tablet App

PostPosted: Wed May 13, 2015 5:27 pm
by Otto
Hello Gale,
thank you.
I will study your changes. What I did is to put a sysrefresh()
inside the function.
It seems to me that I get slightly better results.
But I think a timer would be best.
Firing oDlg:bLButtonUp and oDlg:bLClicked .
Best regards,
Otto

static function DoDraw( hDc, x, y, lPaint, lReset, oPen )
if ! lPaint .or. ( lReset != nil .and. lReset )
MoveTo( hDC, x, y )
else
LineTo( hDc, x, y, oPen:hPen )
endIf

sysrefresh()

return nil

Re: FYI Tablet App

PostPosted: Thu May 14, 2015 6:14 pm
by Randal
Gale:

Very nice!

What make/model of tablet are you using and how do you like them?

Thanks,
Randal

Re: FYI Tablet App

PostPosted: Mon May 25, 2015 7:00 am
by HunterEC
Gale:

Great job ! Kudos !!!

Re: FYI Tablet App

PostPosted: Fri Apr 17, 2020 5:05 pm
by leandro
Muchas gracias, Gale :D