AutoHotkey Community

It is currently May 27th, 2012, 12:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 

usefull?
yes
no
You may select 1 option

View results
Author Message
PostPosted: October 12th, 2009, 10:05 pm 
Offline

Joined: March 13th, 2008, 6:37 pm
Posts: 155
Location: Trøndelag, Norway
this is more like a client for the tec-it barcode generator

it needs internett

Code:
;this is a client for:
;http://www.tec-it.com/online-demos/tbarcode/barcode-generator.aspx

gui, add, edit,vbc r1 w100,
gui, add, button, x+5 w50, go
gui, 2:add, text,vtext cblue w200,
gui, 2:add, pic,vbarcode w200 h200 xm+5,
gui, 2:add, text, w200,This barcode was generated with Barcode Software by TEC-IT.
gui, show, y300
nr1 = 0
OnExit,
return

buttongo:
GuiControlGet, bc
gg = gg
if gg = g%bc%g
bc = error
StringReplace, bctext, bc, %A_SPACE%, +, All
UrlDownloadToFile, http://www.tec-it.com/online-demos/tbarcode/barcode.aspx?code=QRCode&data=%bctext%&dpi=96&rotation=0&modulewidth=fit, %A_ScriptDir%\bc.gif
if nr1 = 0
guicontrol, 2:, barcode, %A_ScriptDir%\bc.gif
guicontrol, 2:, text, %bc%
gui, 2:show, y400
FileDelete, %A_ScriptDir%\bc.gif
return


|::
guiclose:
exitapp

_________________
-._.-¨¯¨-._.-IM@PΩW-._.-¨¯¨-._.-


Last edited by imapow on October 13th, 2009, 9:31 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2009, 4:27 am 
Offline

Joined: June 24th, 2009, 5:40 am
Posts: 16
I don't use QD codes myself but pointing out this resource and a method to implement it's use certainly is useful.

You might consider adding

This barcode was generated with Barcode Software by TEC-IT.

to your code atleast in a comment if not in an about on your gui.

I'm definitely going to use your code as a starting point for an app for the office, Thanks!

Nom


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2009, 9:31 am 
Offline

Joined: March 13th, 2008, 6:37 pm
Posts: 155
Location: Trøndelag, Norway
uppdate added:
credits to tec-it

_________________
-._.-¨¯¨-._.-IM@PΩW-._.-¨¯¨-._.-


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2009, 2:04 pm 
Nom wrote:
I don't use QD codes myself


you can modify it to use meny types of barcodes

Code:
http://www.tec-it.com/online-demos/tbarcode/barcode.aspx?code=QRCode&data=your+text&dpi=96&rotation=0&modulewidth=fit


this is just one of meny barcodes. you can find more at:
http://www.tec-it.com/online-demos/tbar ... rator.aspx

find you type and copy the url from the html code feald at the buttom


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2009, 7:00 pm 
Offline

Joined: March 27th, 2008, 2:14 pm
Posts: 700
oh. my. god.

wtf kind of obfuscation is this!?!
Code:
gg = gg
if gg = g%bc%g
    bc = error


There is a problem with your code (besides the gag-inducing IF statement above). If the user typed any url characters into the text box then your code fails.

I added uriEncode() that fixes this problem:
Code:
;this is a client for: http://www.tec-it.com/online-demos/tbarcode/barcode-generator.aspx
#SingleInstance, Force
#NoEnv

    gui, add  , edit  , vbc r1 w400, http://www.tec-it.com/online-demos/tbarcode/barcode-generator.aspx
    gui, add  , ddl   , vtype y+5 w345 +AltSubmit gTypeChg, % types("", 2)
    gui, add  , button, x+5 w50 default, Go
    gui, add  , text  , y+5 xm w400 vDescr r2 +Wrap
    gui, 2:add, edit  , vtext cblue w400 +ReadOnly
    gui, 2:add, pic   , vbarcode h200 w400 xm+5
    gui, 2:add, text  , w400 gTecIT, This barcode was generated with Barcode Software by TEC-IT.`nClick to visit their website.
    gui, show, y300, Create Barcode
   gosub typechg
return

TypeChg:
   GuiControlGet, type
   guicontrol, , descr, % types(type, 3)
return

ButtonGo:
    GuiControlGet, bc
    GuiControlGet, type
    type := types(type, 1)
    if (bc = "")
        bc = error
    bctext := uriEncode(bc)
    UrlDownloadToFile, http://www.tec-it.com/online-demos/tbarcode/barcode.aspx?code=%type%&data=%bctext%&dpi=96&rotation=0&modulewidth=fit, %A_ScriptDir%\bc.gif
    guicontrol, 2:, barcode, *h0 *w0 %A_ScriptDir%\bc.gif
    guicontrol, 2:, text, %bc%
    gui, 2:show, y400, Barcode
return

tecit:
    run http://www.tec-it.com
return

guiclose:
   exitapp


uriEncode(str) {
; by Titan: http://www.autohotkey.com/forum/viewtopic.php?p=119507#119507
; modified by infogulch for this specific application
   f = %A_FormatInteger%
   SetFormat, Integer, Hex
   StringReplace, str, str, `%, `%25, All
   StringReplace, str, str, +, `%2B, All
   StringReplace, str, str, %A_Space%, +, All
   Loop
      If RegExMatch(str, "i)[^\w\.~%+]", char)
         StringReplace, str, str, %char%, % "%" . substr( "0" . substr(Asc(char)+0,3) , -1), All
      Else Break
   SetFormat, Integer, %f%
   Return, str
}

Types( row = "", col = "", join = "|" ) {
    static types
    if (types = "")
        gosub settypes
    if (row + 0 && col + 0)
    {
        loop, parse, types, `n, %A_Space%%A_Tab%
            if (A_Index = row)
                loop, parse, A_LoopField, @, %A_Space%%A_Tab%
                    if (A_Index = col)
                        return A_LoopField
    }
    else if (col + 0)
    {
        loop, parse, types, `n, %A_Space%%A_Tab%
            loop, parse, A_LoopField, @, %A_Space%%A_Tab%
                if (A_Index = col)
                    ret .= A_LoopField join
        return substr(ret, 1, -1)
    }
return "", ErrorLevel := "Invalid row/col"

SetTypes:
    types := "
    ( LTrim Join`n
        Aztec                 @Aztec                               @Encodes alphanumeric data (ISO8859-1) and Bytes
        CodablockF            @Codablock-F                         @Encodes ASCII [0..127] + ISO8854-1
        DataMatrix            @DataMatrix                          @Encodes alphanumeric characters (Latin-1) and Bytes
        MaxiCode              @MaxiCode                            @Encodes alphanumeric data (USPS specific)
        MicroPDF417           @MicroPDF417                         @Encodes alphanum. and / or bytes
        PDF417                @PDF417                              @Encodes alphanumeric data (ASCII/Ext.ASCII) and Bytes
        QRCode                @QRCode|                             @Encodes alphanumeric data (Latin-1, Kanji) and Bytes
        MicroQR               @MicroQRCode                         @Encodes alphanumeric data (Latin-1, Kanji)
        MobileQRPhone         @QRCodePhonenumber                   @Encodes alphanumeric data (Latin-1, Kanji) and Bytes
        MobileQRSMS           @QRCodeSMS                           @Encodes alphanumeric data (Latin-1, Kanji) and Bytes. Enter the phone number and the desired text sperated by a colon ':'
        MobileQRUrl           @QRCodeUrl                           @Encodes alphanumeric data (Latin-1, Kanji) and Bytes
        MobileSemaPhone       @SemacodePhonenumber                 @Encodes alphanumeric characters (Latin-1) and Bytes
        MobileSemaSMS         @SemacodeSMS                         @Encodes alphanumeric characters (Latin-1) and Bytes. Enter the phone number and the desired text sperated by a colon ':'
        MobileSemaUrl         @SemacodeUrl                         @Encodes alphanumeric characters (Latin-1) and Bytes
        Code11                @Code-11                             @Encodes numeric data [0..9] and [-]
        Code128               @Code-128                            @Encodes the full ASCII set [0..127]
        Code25IL              @Code-2of5Interleaved                @Encodes numeric data (alias ITF)
        Code39                @Code-39                             @Encodes [0..9 A..Z -.$/+% Space]
        Code39FullASCII       @Code-39FullASCII                    @Encodes the full ASCII set [0..127]
        Code93                @Code-93                             @Encodes [0..9 A..Z -.$/+% Space]
        EAN8                  @EAN-8                               @Enter 7 or 8 digits
        EAN13                 @EAN-13                              @Enter 12 or 13 digits
        Flattermarken         @Flattermarken                       @Encodes numeric data [0..9]
        EANUCC128             @GS1-128(UCC/EAN-128)                @Enter digits and AIs (FNC1 = \F)
        ISBN                  @ISBN                                @Enter 12 + 5 digits
        MSI                   @MSI                                 @Encodes numeric data [0..9]
        OneTrackPharmacode    @PharmacodeOne-Track                 @Encodes numeric [0..9] and generic data
        TwoTrackPharmacode    @PharmacodeTwo-Track                 @Encodes numeric [0..9] and generic data
        TelepenAlpha          @TelepenAlpha                        @Encodes the full ASCII set [0..127]
        UPCA                  @UPC-A                               @Enter 11 or 12 digits
        UPCE                  @UPC-E                               @Enter 7 or 8 digits
        AustralianPost        @AustralianPostStandardCustomer      @Enter 8 digits
        DAFT                  @DAFT                                @Generic code for generating 4-state bar codes (enter D, A, F or T) for US-Postal
        DPD                   @DPDBarcode(DPDParcelLabel)          @Enter data in the following form: (I)PPPPPPPTTTTTTTTTTTTTTSSSCCC I...X or E, P...alphanumeric, T...alphanumeric, S...numeric, C...numeric
        JapanesePostal        @JapanesePostal(Customer)Code        @Enter 7 digits (ZIP) + address code [0..9 A..Z -]
        KIX                   @KIX(TNTPostNetherlands)             @Encodes the full ASCII set [0..127]
        KoreanPostal          @KoreanPostalAuthorityCode           @Enter 6 digits
        PlanetCode12          @PlanetCode12                        @Enter 11 digits
        RoyalMail             @RoyalMail4State                     @Enter [0..9 A..Z]
        PostNet5              @USPSPostNet5                        @Enter 5 digits (ZIP)
        PostNet9              @USPSPostNet9                        @Enter 5 (ZIP) + 4 digits
        PostNet11             @USPSPostNet11                       @Enter 5 (ZIP) + 4 + 2 digits
        USPSOneCode           @USPSOneCode4-StateCustomerBarcode   @Enter 20 digits + 0, 5, 9 or 11 digits (ZIP)
        RSS14                 @GS1-DataBar                         @Enter 13 or 14 digits (GTIN)
        RSS14Stacked          @GS1-DataBarStacked                  @Enter 13 or 14 digits (GTIN)
        RSS14StackedOmni      @GS1-DataBarStackedOmni              @Enter 13 or 14 digits (GTIN)
        RSSLimited            @GS1-DataBarLimited                  @Enter 13 or 14 digits (GTIN)
        RSSExpanded           @GS1-DataBarExpanded                 @Encodes [0..9 A..Z a..z] + ISO646
        RSSExpandedStacked    @GS1-DataBarExpandedStacked          @Encodes [0..9 A..Z a..z] + ISO646
        EAN8CCA               @EAN-8CompositeSymbology             @Enter 7 or 8 digits + | + 2D data
        EAN13CCA              @EAN-13CompositeSymbology            @Enter 12 or 13 digits + | + 2D data
        GS1-128CCA            @GS1-128CompositeSymbology           @Enter digits (with AIs) + | + 2D data
        RSS14CCA              @GS1-DataBarComposite                @Enter 13 or 14 digits (GTIN) + | + 2D data (ISO646)
        RSS14StackedCCA       @GS1-DataBarStackedComposite         @Enter 13 or 14 digits (GTIN) + | + 2D data (ISO646)
        RSS14StackedOmniCCA   @GS1-DataBarStackedOmniComposite     @Enter 13 or 14 digits (GTIN) + | + 2D data (ISO646)
        RSSLimitedCCA         @GS1-DataBarLimitedComposite         @Enter 13 or 14 digits (GTIN) + | + 2D data (ISO646)
        RSSExpandedCCA        @GS1-DataBarExpandedComposite        @Enter alphanumeric data (ISO646) + | + 2D data
        RSSExpandedStackedCCA @GS1-DataBarExpandedStackedComposite @Enter alphanumeric data (ISO646) + | + 2D data
        UPCACCA               @UPC-ACompositeSymbology             @Enter 11 or 12 digits + | + 2D data
        UPCECCA               @UPC-ECompositeSymbology             @Enter 7 or 8 digits + | + 2D data
    )"
return
}

Edit: also added: Can now create all barcodes. More descriptive dropdown list. Description of valid characters for each barcode when selected.

_________________
Scripts - License


Last edited by infogulch on October 13th, 2009, 9:47 pm, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2009, 9:32 pm 
Offline

Joined: March 13th, 2008, 6:37 pm
Posts: 155
Location: Trøndelag, Norway
infogulch wrote:
oh. my. god.
wtf kind of obfuscation is this!?!
Code:
gg = gg
if gg = g%bc%g
    bc = error



im not so good at ahk. just made this one fast to transport smal text to my cellphone

nice uppdate infogulch.

i detected a problem with this new program
Image
WTF?

im not so good at ahk so if enyone have eny idea of wot is wrong...

but thanks infogulch. help is always welcome.

_________________
-._.-¨¯¨-._.-IM@PΩW-._.-¨¯¨-._.-


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2009, 9:34 pm 
Offline

Joined: March 27th, 2008, 2:14 pm
Posts: 700
Sorry about that. I just updated it. Look at my post above to see the changes.

_________________
Scripts - License


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2009, 9:45 pm 
Offline

Joined: March 13th, 2008, 6:37 pm
Posts: 155
Location: Trøndelag, Norway
nice. ty.

_________________
-._.-¨¯¨-._.-IM@PΩW-._.-¨¯¨-._.-


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2009, 9:47 pm 
Offline

Joined: March 27th, 2008, 2:14 pm
Posts: 700
Little fix to encoding, plz redownload.

_________________
Scripts - License


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, Rajat and 54 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group