This project is read-only.

FoxBarcodeQR - national characters

Feb 18, 2013 at 10:36 AM
I tested FoxBarcodeQR. It works very nicely. I have only one comment. Text containing national characters should be in UTF-8.
Feb 18, 2013 at 10:24 PM
See if this example is valid for your comment. I only changed EditBox control for the ActiveX Microsft Forms Control Text that supports UTF-8:
PUBLIC oform1
oform1 = NEWOBJECT("form1")
oform1.SHOW
RETURN

DEFINE CLASS form1 AS FORM
  HEIGHT = 517
  WIDTH = 698
  AUTOCENTER = .T.
  CAPTION = "FoxBarcodeQR Demo"
  MINHEIGHT = (THIS.HEIGHT)
  MINWIDTH = (THIS.WIDTH)
  NAME = "Form1"

  ADD OBJECT command1 AS COMMANDBUTTON WITH ;
    TOP = 468, LEFT = 396, HEIGHT = 27, WIDTH = 132, ;
    ANCHOR = 12, CAPTION = "\<Generate QR Code", ;
    DEFAULT = .T., TABINDEX = 7, NAME = "Command1"

  ADD OBJECT command2 AS COMMANDBUTTON WITH ;
    TOP = 468, LEFT = 540, HEIGHT = 27, WIDTH = 132, ;
    ANCHOR = 12, CANCEL = .T., CAPTION = "\<Exit", ;
    TABINDEX = 8, NAME = "Command2"

  ADD OBJECT combo1 AS COMBOBOX WITH ;
    ANCHOR = 9, COLUMNCOUNT = 0, COLUMNWIDTHS = "", ;
    ROWSOURCETYPE = 1, ROWSOURCE = "2,3,4,5,6,7,8,9,10,11,12", ;
    FIRSTELEMENT = 1, HEIGHT = 24, LEFT = 504, NUMBEROFELEMENTS = 0, ;
    STYLE = 2, TABINDEX = 4, TOP = 420, WIDTH = 60, NAME = "Combo1"

  ADD OBJECT combo2 AS COMBOBOX WITH ;
    ANCHOR = 9, BOUNDCOLUMN = 2, COLUMNCOUNT = 2, ;
    COLUMNWIDTHS = "60,0", ROWSOURCETYPE = 1, ;
    ROWSOURCE = "BMP,0,JPG,1,PNG,2", FIRSTELEMENT = 1, ;
    HEIGHT = 24, LEFT = 612, NUMBEROFELEMENTS = 0, ;
    STYLE = 2, TABINDEX = 6, TOP = 420, WIDTH = 60, NAME = "Combo2"

  ADD OBJECT label1 AS LABEL WITH ;
    AUTOSIZE = .T., ANCHOR = 9, BACKSTYLE = 0, ;
    CAPTION = "Size", HEIGHT = 17, LEFT = 468, ;
    TOP = 420, WIDTH = 25, TABINDEX = 3, NAME = "Label1"

  ADD OBJECT label2 AS LABEL WITH ;
    AUTOSIZE = .T., ANCHOR = 9, BACKSTYLE = 0, CAPTION = "Type", ;
    HEIGHT = 17, LEFT = 576, TOP = 420, WIDTH = 28, ;
    TABINDEX = 5, NAME = "Label2"


  ADD OBJECT label3 AS LABEL WITH ;
    AUTOSIZE = .T., ANCHOR = 9, BACKSTYLE = 0, ;
    CAPTION = "Text to encode", HEIGHT = 17, LEFT = 468, ;
    TOP = 24, WIDTH = 81, TABINDEX = 1, NAME = "Label3"

  ADD OBJECT shape1 AS SHAPE WITH ;
    TOP = 24, LEFT = 24, HEIGHT = 420, WIDTH = 420, ;
    ANCHOR = 15, BACKCOLOR = RGB(255,255,255), NAME = "Shape1"

  ADD OBJECT image1 AS IMAGE WITH ;
    ANCHOR = 15, STRETCH = 0, HEIGHT = 396, LEFT = 36, ;
    TOP = 36, WIDTH = 396, NAME = "Image1"

  ADD OBJECT edit1 AS OLECONTROL WITH ;
    TOP = 48, LEFT = 468, HEIGHT = 360, WIDTH = 204, ;
    ANCHOR = 9, OLECLASS = "Forms.Textbox.1", NAME = "Edit1"

  PROCEDURE INIT
    SET PROCEDURE TO LOCFILE("FoxBarcodeQR.prg") ADDITIVE
    THIS.ADDPROPERTY("oFbc", NULL)
    THIS.oFbc = CREATEOBJECT("FoxBarcodeQR")

    THISFORM.Edit1.TEXT = "National characters paste here"
    THISFORM.Combo1.LISTINDEX = 5
    THISFORM.Combo2.LISTINDEX = 1

    LOCAL lcText, lnSize, lnType
    m.lcText = ALLTRIM(THISFORM.Edit1.TEXT)
    m.lnSize = VAL(THISFORM.Combo1.VALUE)
    m.lnType = VAL(THISFORM.Combo2.VALUE)
    THISFORM.Image1.PICTURE = THISFORM.oFbc.QRBarcodeImage(m.lcText, , m.lnSize, m.lnType)
  ENDPROC

  PROCEDURE command1.CLICK
    LOCAL lcText, lnSize, lnType
    m.lcText = ALLTRIM(THISFORM.Edit1.TEXT)
    m.lnSize = VAL(THISFORM.Combo1.VALUE)
    m.lnType = VAL(THISFORM.Combo2.VALUE)
    THISFORM.Image1.PICTURE = THISFORM.oFbc.QRBarcodeImage(m.lcText, , m.lnSize, m.lnType)
  ENDPROC

  PROCEDURE command2.CLICK
    THISFORM.RELEASE()
  ENDPROC
ENDDEFINE
Feb 19, 2013 at 8:32 AM
Unfortunately, it did not help.
But just to add to the original solution ...
m.lcText = ALLTRIM(THISFORM.Edit1.VALUE)
* zk 18.2.2013
m.lcText = Strconv(Strconv(m.lcText ,1),9)
*/
Zdenek