diff --git a/backend_qt4/qzint.cpp b/backend_qt4/qzint.cpp index 47b73cb1..bb9a620a 100644 --- a/backend_qt4/qzint.cpp +++ b/backend_qt4/qzint.cpp @@ -33,8 +33,8 @@ QZint::QZint() m_fgColor=Qt::black; m_bgColor=Qt::white; m_zintSymbol=0; - m_excode39SymbologyNumber=m_code39SymbologyNumber=m_msiSymbologyNumber=0; m_error=0; + m_input_mode = UNICODE_MODE; } QZint::~QZint() @@ -57,24 +57,8 @@ void QZint::encode() m_zintSymbol->whitespace_width=0; m_zintSymbol->border_width=m_boderWidth; m_zintSymbol->option_1=m_securityLevel; - switch (m_symbol) - { - case BARCODE_MSI_PLESSEY: - m_zintSymbol->option_2=m_msiSymbologyNumber; - break; - - case BARCODE_CODE39: - m_zintSymbol->option_2=m_code39SymbologyNumber; - break; - - case BARCODE_EXCODE39: - m_zintSymbol->option_2=m_excode39SymbologyNumber; - break; - - default: - m_zintSymbol->option_2=m_width; - break; - } + m_zintSymbol->input_mode = m_input_mode; + m_zintSymbol->option_2=m_width; m_zintSymbol->option_3=m_pdf417CodeWords; QByteArray bstr=m_text.toAscii(); QByteArray pstr=m_primaryMessage.left(99).toAscii(); @@ -96,6 +80,11 @@ void QZint::setSymbol(int symbol) m_symbol=symbol; } +void QZint::setInputMode(int input_mode) +{ + m_input_mode = input_mode; +} + QString QZint::text() { return m_text; @@ -201,33 +190,6 @@ void QZint::setMode(int securityLevel) m_securityLevel=securityLevel; } -int QZint::msiExtraSymbology() -{ - return m_msiSymbologyNumber; -} -void QZint::setMsiExtraSymbology(int msiSymbologyNumber) -{ - m_msiSymbologyNumber=msiSymbologyNumber; -} - -int QZint::code39ExtraSymbology() -{ - return m_code39SymbologyNumber; -} -void QZint::setCode39ExtraSymbology(int m_code39SymbologyNumber) -{ - m_code39SymbologyNumber=m_code39SymbologyNumber; -} - -int QZint::excode39ExtraSymbology() -{ - return m_excode39SymbologyNumber; -} -void QZint::setExcode39ExtraSymbology(int excode39SymbologyNumber) -{ - m_excode39SymbologyNumber=excode39SymbologyNumber; -} - void QZint::render(QPainter & painter, const QRectF & paintRect, AspectRatioMode mode) { encode(); diff --git a/backend_qt4/qzint.h b/backend_qt4/qzint.h index 18ebf676..17b58c7f 100644 --- a/backend_qt4/qzint.h +++ b/backend_qt4/qzint.h @@ -72,14 +72,7 @@ public: int mode(); void setMode(int securityLevel); - int msiExtraSymbology(); - void setMsiExtraSymbology(int msiSymbologyNumber); - - int code39ExtraSymbology(); - void setCode39ExtraSymbology(int m_code39SymbologyNumber); - - int excode39ExtraSymbology(); - void setExcode39ExtraSymbology(int excode39SymbologyNumber); + void setInputMode(int input_mode); void render(QPainter & painter, const QRectF & paintRect, AspectRatioMode mode=IgnoreAspectRatio); @@ -98,9 +91,7 @@ private: int m_width; int m_securityLevel; int m_pdf417CodeWords; - int m_msiSymbologyNumber; - int m_code39SymbologyNumber; - int m_excode39SymbologyNumber; + int m_input_mode; QColor m_fgColor; QColor m_bgColor; QString m_lastError; diff --git a/frontend_qt4/barcodeitem.cpp b/frontend_qt4/barcodeitem.cpp index 090f17ff..3639c2f5 100644 --- a/frontend_qt4/barcodeitem.cpp +++ b/frontend_qt4/barcodeitem.cpp @@ -20,8 +20,8 @@ BarcodeItem::BarcodeItem() : QGraphicsItem() { - w=400; - h=400; + w=550; + h=230; } diff --git a/frontend_qt4/mainWindow.ui b/frontend_qt4/mainWindow.ui index 64c46530..5e920e37 100644 --- a/frontend_qt4/mainWindow.ui +++ b/frontend_qt4/mainWindow.ui @@ -5,574 +5,2434 @@ 0 0 - 873 - 748 + 619 + 559 - Zint Qt fontend + Zint Barcode Studio - - - - - Ctrl++ + + + + 92 + 299 + 511 + 22 + + + + + + + 4 + 300 + 72 + 22 + + + + &Symbology: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + bstyle + + + + + true + + + + 12 + 331 + 595 + 217 + + + + 0 + + + + + 0 + 0 + 591 + 191 + + + + General + + + + + 9 + 3 + 574 + 55 + - - Zoom in - - - Ctrl++ + + Data to Encode + + + + 13 + 21 + 548 + 22 + + + + Your Data Here! + + - - - - - Ctrl+- + + + true - - Zoom out + + + 9 + 67 + 575 + 115 + - - Ctrl+- + + Composite Code - - - - - - Qt::Horizontal - - - - 85 - 20 - - - - - - - - Ctrl+0 - - - Reset - - - Ctrl+0 - - - - - - - Qt::Horizontal - - - - 76 - 20 - - - - - - - - Ctrl+Left - - - Rotate anticlockwise - - - Ctrl+Left - - - - - - - Ctrl+Right - - - Rotate clockwise - - - Ctrl+Right - - - - - - - - - - - - Type: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - Aspect ratio: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - Ignore aspect ratio - - - - - Keep aspect ratio - - - - - Center (no scalling) - - - - - - - - - - - - Height: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 300 - - - 50 - - - - - - - - - - - Item Width: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 10 - - - 1000 - - - 5 - - - 400 - - - - - - - - - - - Width (pdf471): - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 300 - - - 0 - - - - - - - - - - - Item Height: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 10 - - - 1000 - - - 5 - - - 400 - - - - - - - - - - - Security level/mode: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - -1 - - - 9 - - - -1 - - - - - - - - - - - Primary - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - Border width: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 0 - - - 16 - - - 0 - - - - - - - - - - - Data - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + false + + + + 12 + 67 + 552 + 40 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">123456</p></body></html> - - - false - - - - - - - - - +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Your Data Here!</p></body></html> + + + false + + + + + false + + + + 13 + 45 + 121 + 20 + + + + &2D Component Data: + + + txtComposite + + + + + + 10 + 15 + 552 + 24 + + + + + + + &Add 2D Component + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + Component T&ype: + + + cmbCompType + + + + + + + false + + + + Automatic + + + + + CC-A + + + + + CC-B + + + + + CC-C + + + + + + + txtComposite + lblComposite + layoutWidget + grpMaxiCode + + + + + 9 + 67 + 575 + 73 + + + + Maxicode + + + + + 9 + 21 + 96 + 16 + + + + Encoding Mode: + + + + + + 108 + 16 + 260 + 22 + + + + 1 + + - Border type: + Structured Carrier Message (Mode 2 or 3) - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - No border - - - - - Bind - - - - - Box - - - - - - - - - - + + - PDF417 CODEWORDS: + Standard Symbol, SEC (Mode 4) - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 928 - - - 1800 - - - 928 - - - - - - - - - + + - MSI PLESSEY: + Full ECC Symbol (Mode 5) - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - MSI_PLESSEY - - - - - MSI_10 - - - - - MSI_10_10 - - - - - MSI_11 - - - - - MSI_11_10 - - - - - - - - - - + + - (Ex)CODE39: + Reader Program, SEC (Mode 6) - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 9 + 46 + 89 + 16 + + + + Primary Data: + + + + + + 107 + 44 + 457 + 22 + + + + + + + + + 0 + 0 + 591 + 191 + + + + Options + + + + + 114 + 39 + 315 + 109 + + + + Code 128 + + + + + 48 + 65 + 216 + 37 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Note: Composite symbols require a</p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">GS1-128 linear component.</p></body></html> + + + + + + 12 + 19 + 74 + 22 + + + + S&tandard + + + true + + + + + + 12 + 42 + 74 + 22 + + + + &GS1-128 + + + + + + 160 + 19 + 142 + 22 + + + + Subset &C Supression + + + + + + 160 + 42 + 142 + 22 + + + + &HIBC 128 + + + + + + + 104 + 19 + 332 + 149 + + + + PDF417 + + + + + 13 + 69 + 158 + 21 + + + + Ma&ximum Codeword Lengh: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + codewords + + + + + + 13 + 18 + 146 + 21 + + + + Number of Data Columns: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 13 + 45 + 142 + 21 + + + + Error Correction Capacity: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 189 + 72 + 105 + 21 + + + + 928 + + + 1800 + + + 928 + + + + + + 190 + 44 + 105 + 22 + + + + + Automatic + + + + + 2 words + + + + + 4 words + + + + + 8 words + + + + + 16 words + + + + + 32 words + + + + + 64 words + + + + + 128 words + + + + + 256 words + + + + + 512 words + + + + + + + 191 + 16 + 104 + 22 + + + + + Automatic + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 11 + + + + + 12 + + + + + 13 + + + + + 14 + + + + + 15 + + + + + 16 + + + + + 17 + + + + + 18 + + + + + 19 + + + + + 20 + + + + + + + 25 + 99 + 92 + 22 + + + + Standard + + + true + + + + + + 25 + 121 + 92 + 22 + + + + Truncated + + + + + + 176 + 99 + 105 + 22 + + + + HIBC PDF417 + + + + + + + 95 + 20 + 346 + 144 + + + + Aztec Code + + + + + 8 + 18 + 128 + 22 + + + + Automatic Resizing + + + true + + + + + + 8 + 39 + 146 + 22 + + + + Adjust Size To: + + + + + + 7 + 61 + 192 + 22 + + + + Add Minimum Error Correction: + + + + + false + + + + 218 + 63 + 113 + 22 + + + + + 10% + 3 words + + + + + 23% + 3 words + + + + + 36% + 3 words + + + + + 50% + 3 words + + + + + + false + + + + 220 + 36 + 112 + 22 + + + + + 15 x 15* + + + + + 19 x 19* + + + + + 23 x 23* + + + + + 27 x 27* + + + + + 19 x 19 + + + + + 23 x 23 + + + + + 27 x 27 + + + + + 31 x 31 + + + + + 37 x 37 + + + + + 41 x 41 + + + + + 45 x 45 + + + + + 49 x 49 + + + + + 53 x 53 + + + + + 57 x 57 + + + + + 61 x 61 + + + + + 67 x 67 + + + + + 71 x 71 + + + + + 75 x 75 + + + + + 79 x 79 + + + + + 83 x 83 + + + + + 87 x 87 + + + + + 91 x 91 + + + + + 95 x 95 + + + + + 101 x 101 + + + + + 105 x 105 + + + + + 109 x 109 + + + + + 113 x 113 + + + + + 117 x 117 + + + + + 121 x 121 + + + + + 125 x 125 + + + + + 131 x 131 + + + + + 135 x 135 + + + + + 139 x 139 + + + + + 143 x 143 + + + + + 147 x 147 + + + + + 151 x 151 + + + + + + + 7 + 84 + 167 + 21 + + + + Encode as GS-1 Data + + + + + + 51 + 104 + 255 + 33 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">* An asterisk indicates a "compact" symbol;</p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">the rest are "full range" symbols.</p></body></html> + + + + + + + 145 + 85 + 277 + 16 + + + + No additional settings required for this symbology. + + + + + + 158 + 64 + 238 + 57 + + + + MSI Plessey + + + + + 14 + 25 + 74 + 16 + + + + Check Digit: + + + + + + 97 + 20 + 125 + 22 + + + + + None + + + + + Mod-10 + + + + + Mod-10 & Mod-10 + + + + + Mod-11 + + + + + Mod-11 & Mod-10 + + + + + + + + 192 + 39 + 181 + 107 + + + + Code 39 + + + + + 13 + 20 + 115 + 22 + + + + No Check Digit + + + true + + + + + + 13 + 45 + 138 + 22 + + + + Mod-43 Check Digit + + + + + + 13 + 72 + 92 + 22 + + + + HIBC 39 + + + + + + + 132 + 49 + 287 + 87 + + + + MicroPDF417 + + + + + 10 + 23 + 146 + 21 + + + + Number of Data Columns: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 172 + 21 + 104 + 22 + + + + + Automatic + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + + + 14 + 49 + 92 + 22 + + + + Standard + + + true + + + + + + 145 + 52 + 133 + 22 + + + + HIBC MicroPDF417 + + + + + + + 202 + 55 + 137 + 75 + + + + Code 16K + + + + + 12 + 18 + 106 + 22 + + + + Standard Mode + + + true + + + + + + 12 + 43 + 115 + 22 + + + + GS-1 Data Mode + + + + + + + 193 + 42 + 155 + 101 + + + + Codablock-F + + + + + 12 + 18 + 106 + 22 + + + + Standard Mode + + + true + + + + + + 12 + 43 + 115 + 22 + + + + GS-1 Data Mode + + + + + + 12 + 68 + 131 + 22 + + + + HIBC Codablock-F + + + + + + + 116 + 21 + 311 + 145 + + + + Data Matrix + + + + + 119 + 16 + 181 + 22 + + + + + ECC 200 (Recommended) + + + + + ECC 000 + + + + + ECC 050 + + + + + ECC 080 + + + + + ECC 100 + + + + + ECC 140 + + + + + + + 15 + 21 + 96 + 16 + + + + Encoding Mode: + + + cmbDMMode + + + + + + 14 + 45 + 287 + 91 + + + + ECC 200 Options + + + + + 12 + 14 + 92 + 22 + + + + Standard + + + true - - - + + + + 12 + 35 + 122 + 22 + + + + GS-1 Data Mode + + + + + + 154 + 14 + 121 + 22 + + + + HIBC Data Matrix + + + + + + 107 + 59 + 124 + 22 + + - (EX)CODE39 + Automatic - (EX)CODE39_43 + 10 x 10 + + + + + 12 x 12 + + + + + 14 x 14 + + + + + 16 x 16 + + + + + 18 x 18 + + + + + 20 x 20 + + + + + 22 x 22 + + + + + 24 x 24 + + + + + 26 x 26 + + + + + 32 x 32 + + + + + 36 x 36 + + + + + 40 x 40 + + + + + 44 x 44 + + + + + 48 x 48 + + + + + 52 x 52 + + + + + 64 x 64 + + + + + 72 x 72 + + + + + 80 x 80 + + + + + 88 x 88 + + + + + 96 x 96 + + + + + 104 x 104 + + + + + 120 x 120 + + + + + 132 x 132 + + + + + 144 x 144 + + + + + 8 x 18 + + + + + 8 x 32 + + + + + 12 x 26 + + + + + 12 x 36 + + + + + 16 x 36 + + + + + 16 x 48 - - - - - - - + + + + 57 + 64 + 38 + 16 + + - Foreground color + Size: - - - + + + + + 66 + 45 + 187 + 49 + + + + Non ECC 200 Options + + + + + 11 + 20 + 38 + 16 + + - Backgound color + Size: - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - &Generate + + + + 63 + 18 + 116 + 22 + + + + Automatic + + + + + 7 x 7 + + + + + 9 x 9 + + + + + 11 x 11 + + + + + 13 x 13 + + + + + 15 x 15 + + + + + 17 x 17 + + + + + 19 x 19 + + + + + 21 x 21 + + + + + 23 x 23 + + + + + 25 x 25 + + + + + 27 x 27 + + + + + 29 x 29 + + + + + 31 x 31 + + + + + 33 x 33 + + + + + 35 x 35 + + + + + 37 x 37 + + + + + 39 x 39 + + + + + 41 x 41 + + + + + 43 x 43 + + + + + 45 x 45 + + + + + 47 x 47 + + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + + + + + 108 + 30 + 328 + 124 + + + + QR Code + + + + + 9 + 21 + 135 + 22 + + + + Automatic Resizing + + + true + + + + + + 10 + 44 + 134 + 22 + + + + Adjust Size To: + + + + + + 10 + 67 + 141 + 22 + + + + Add Error Correction: + + + + + + 11 + 91 + 116 + 21 + + + + HIBC QR Code + + + + + false + + + + 158 + 43 + 156 + 22 + + + - Close + 21 x 21 (Version 1) - - - - - + + + + 25 x 25 (Version 2) + + + + + 29 x 29 (Version 3) + + + + + 33 x 33 (Version 4) + + + + + 37 x 37 (Version 5) + + + + + 41 x 41 (Version 6) + + + + + 45 x 45 (Version 7) + + + + + 49 x 49 (Version 8) + + + + + 53 x 53 (Version 9) + + + + + 57 x 57 (Version 10) + + + + + 61 x 61 (Version 11) + + + + + 65 x 65 (Version 12) + + + + + 69 x 69 (Version 13) + + + + + 73 x 73 (Version 14) + + + + + 77 x 77 (Version 15) + + + + + 81 x 81 (Version 16) + + + + + 85 x 85 (Version 17) + + + + + 89 x 89 (Version 18) + + + + + 93 x 93 (Version 19) + + + + + 97 x 97 (Version 20) + + + + + 101 x 101 (Version 21) + + + + + 105 x 105 (Version 22) + + + + + 109 x 109 (Version 23) + + + + + 113 x 113 (Version 24) + + + + + 117 x 117 (Version 25) + + + + + 121 x 121 (Version 26) + + + + + 125 x 125 (Version 27) + + + + + 129 x 129 (Version 28) + + + + + 133 x 133 (Version 29) + + + + + 137 x 137 (Version 30) + + + + + 141 x 141 (Version 31) + + + + + 145 x 145 (Version 32) + + + + + 149 x 149 (Version 33) + + + + + 153 x 153 (Version 34) + + + + + 157 x 157 (Version 35) + + + + + 161x 161 (Version 36) + + + + + 165 x 165 (Version 37) + + + + + 169 x 169 (Version 38) + + + + + 173 x 173 (Version 39) + + + + + 177 x 177 (Version 40) + + + + + + false + + + + 157 + 69 + 157 + 22 + + + + + ~20% (Level L) + + + + + ~37% (Level M) + + + + + ~55% (Level Q) + + + + + ~65% (Level H) + + + + + + + + 105 + 42 + 328 + 102 + + + + MicroQR Code + + + + + 9 + 21 + 135 + 22 + + + + Automatic Resizing + + + true + + + + + + 10 + 44 + 134 + 22 + + + + Adjust Size To: + + + + + + 10 + 67 + 141 + 22 + + + + Add Error Correction: + + + + + false + + + + 158 + 43 + 156 + 22 + + + + + 11 x 11 (Version M1) + + + + + 13 x 13 (Version M2) + + + + + 15 x 15 (Version M3) + + + + + 17 x 17 (Version M4) + + + + + + false + + + + 157 + 69 + 157 + 22 + + + + + ~20% (Level L) + + + + + ~37% (Level M) + + + + + ~55% (Level Q) + + + + + + + + + 0 + 0 + 591 + 191 + + + + Appearance + + + + + 10 + 6 + 572 + 92 + + + + Appearance + + + + + 14 + 19 + 91 + 21 + + + + Height: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 117 + 17 + 122 + 21 + + + + 300 + + + 50 + + + + + + -3 + 43 + 109 + 29 + + + + Border width: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 114 + 46 + 124 + 21 + + + + 0 + + + 16 + + + 0 + + + + + + 268 + 12 + 115 + 29 + + + + Border type: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 429 + 18 + 132 + 22 + + + + + No border + + + + + Bind + + + + + Box + + + + + + + 273 + 51 + 145 + 26 + + + + Foreground Colour + + + + + + 427 + 51 + 133 + 26 + + + + Backgound Colour + + + + + + + + + 0 + 0 + 2 + 2 + + + + + + + + 15 + 5 + 593 + 284 + + + + Preview + + + + + 9 + 21 + 575 + 251 + + + + + + bstyle + tabMain + txtData + chkComposite + cmbCompType + txtComposite + radC128Stand + radC128CSup + radC128EAN + radC128HIBC + heightb + btype + bwidth + fgcolor + bgcolor + view + - - - pushButton_2 - clicked() - mainWindow - close() - - - 585 - 544 - - - 554 - 310 - - - - + diff --git a/frontend_qt4/mainwindow.cpp b/frontend_qt4/mainwindow.cpp index b2e595d4..5543f97e 100644 --- a/frontend_qt4/mainwindow.cpp +++ b/frontend_qt4/mainwindow.cpp @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2008 by BogDan Vatra * - * bogdan@licentia.eu * + * Copyright (C) 2008 by BogDan Vatra * + * Copyright (C) 2009 by Robin Stuart * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -21,30 +21,70 @@ #include "mainwindow.h" +#include MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl) : QWidget(parent, fl) { - char bstyle_text[][40] = { - "Code 11", "Code 2 of 5 Matrix", "Code 2 of 5 Interleaved", "IATA Code 2 of 5", - "Code 2 of 5 Data Logic", "Code 2 of 5 Industrial", "Code 39", "Extended Code 39", - "EAN", "EAN-128", "Codabar", "Code 128", "DP Leitcode", "DP Identcode", - "Code 16k", "Code 93", "Flattermarken", "Databar", - "Databar Limited", "Databar Expanded", "Telepen", "UPC-A", "UPC-E", - "Postnet", "MSI Plessey", "FIM", "LOGMARS", "Pharmacode", "PZN", - "Pharmacode 2-track", "PDF417", "PDF417 Truncated", "Maxicode", - "QR Code", "Code 128 Subset B", "Auspost Standard", "Auspost Reply", - "Auspost Route", "Auspost Redirect", "ISBN", "Royal Mail 4-state", - "Data Matrix", "EAN-14", "Codablock-F", "NVE-18", "Korea Post", "Databar Stacked", - "Databar Stacked Omni", "Databar Expanded Stacked", "PLANET", - "MicroPDF417", "USPS One Code", "UK Plessey", "Telepen Numeric", - "ITF-14", "Dutch Post KIX", "Aztec Code", "Micro QR Code", - "HIBC Code 128", "HIBC Code 39", "HIBC Data Matrix", "HIBC QR Code", - "HIBC PDF417", "HIBC MicroPDF417", "HIBC Codablock-F", "Aztec Runes", - "Code 32", "Composite EAN", "Composite EAN-128", "Composite Databar", - "Composite Databar Limited", "Composite Databar Expanded", - "Composite UPC-A", "Composite UPC-E", "Composite Databar Stacked", - "Composite Databar Stacked Omni", "Composite Databar Expanded Stacked" + char bstyle_text[][50] = { + "Australia Post Standard Customer", + "Australia Post Reply-Paid", + "Australia Post Routing Code", + "Australia Post Redirect Code", + "Aztec Code", + "Aztec Runes", + "Code 11", + "Code 128", + "Code 16k", + "Code 2 of 5 Data Logic", + "Code 2 of 5 IATA", + "Code 2 of 5 Industrial", + "Code 2 of 5 Interleaved", + "Code 2 of 5 Matrix", + "Code 32 (Italian Pharmacode)", + "Code 39", + "Code 39 Extended", + "Code 93", + "Codabar", + "Codablock-F", + "Databar", + "Databar Expanded", + "Databar Expanded Stacked", + "Databar Limited", + "Databar Stacked", + "Databar Stacked Omnidirectional", + "Data Matrix", + "Deutsche Post Identcode", + "Deutsche Post Leitcode", + "Dutch Post KIX", + "EAN-14", + "European Article Number (EAN)", + "FIM", + "Flattermarken", + "ITF-14", + "International Standard Book Number (ISBN)", + "Japanese Postal Barcode", + "Korean Postal Barcode", + "LOGMARS", + "Maxicode", + "MicroPDF417", + "Micro QR Code", + "MSI Plessey", + "NVE-18", + "PDF417", + "Pharmacode", + "Pharmacode 2-track", + "Pharma Zentralnummer (PZN)", + "PLANET", + "Postnet", + "QR Code", + "Royal Mail 4-state Barcode", + "Telepen", + "Telepen Numeric", + "UK Plessey", + "UPC-A", + "UPC-E", + "USPS One Code" }; setupUi(this); view->setScene(new QGraphicsScene); @@ -54,22 +94,74 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl) bstyle->addItem(metaObject()->enumerator(0).key(i)); bstyle->setItemText(i,bstyle_text[i]); } - bstyle->setCurrentIndex(11); - on_generate_clicked(); + bstyle->setCurrentIndex(7); + change_options(); + update_preview(); view->scene()->addItem(&m_bc); - connect(bstyle, SIGNAL(currentIndexChanged( int )), SLOT(on_generate_clicked())); - connect(heightb, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked())); - connect(widthb, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked())); - connect(security, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked())); - connect(bwidth, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked())); - connect(codewords, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked())); - connect(iwidth, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked())); - connect(iheight, SIGNAL(valueChanged( int )), SLOT(on_generate_clicked())); - connect(btype, SIGNAL(currentIndexChanged( int )), SLOT(on_generate_clicked())); - connect(primary, SIGNAL(textChanged( const QString& )), SLOT(on_generate_clicked())); - connect(text, SIGNAL(textChanged()), SLOT(on_generate_clicked())); - connect(aspectRatio, SIGNAL(currentIndexChanged( int )), SLOT(on_generate_clicked())); - + connect(bstyle, SIGNAL(currentIndexChanged( int )), SLOT(change_options())); + connect(bstyle, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(heightb, SIGNAL(valueChanged( int )), SLOT(update_preview())); + connect(bwidth, SIGNAL(valueChanged( int )), SLOT(update_preview())); + connect(codewords, SIGNAL(valueChanged( int )), SLOT(update_preview())); + connect(btype, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(txtData, SIGNAL(textChanged( const QString& )), SLOT(update_preview())); + connect(txtComposite, SIGNAL(textChanged()), SLOT(update_preview())); + connect(chkComposite, SIGNAL(stateChanged( int )), SLOT(composite_enable())); + connect(chkComposite, SIGNAL(stateChanged( int )), SLOT(update_preview())); + connect(cmbCompType, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(radC128EAN, SIGNAL(toggled( bool )), SLOT(composite_ean_check())); + connect(radC128Stand, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radC128CSup, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radC128EAN, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radC128HIBC, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(cmbPDFECC, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(cmbPDFCols, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(radPDFTruncated, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radPDFStand, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radPDFHIBC, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radAztecSize, SIGNAL(toggled( bool )), SLOT(aztec_size())); + connect(radAztecECC, SIGNAL(toggled( bool )), SLOT(aztec_errorcorrect())); + connect(radAztecAuto, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radAztecSize, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radAztecECC, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(cmbAztecSize, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(cmbAztecECC, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(chkAztecMode, SIGNAL(stateChanged( int )), SLOT(update_preview())); + connect(cmbMSICheck, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(radC39Stand, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radC39Check, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radC39HIBC, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(cmbMPDFCols, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(radMPDFStand, SIGNAL(toggled( bool )), SLOT(update_preview())); + connect(radC16kStand, SIGNAL(toggled( bool )), SLOT(update_preview())); + connect(radCodaStand, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radCodaGS1, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radCodaHIBC, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(cmbDMMode, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(cmbDMMode, SIGNAL(currentIndexChanged( int )), SLOT(datamatrix_options())); + connect(radDM200Stand, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radDM200GS1, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radDM200HIBC, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(cmbDM200Size, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(cmbDMNon200Size, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(radQRAuto, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radQRSize, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radQRECC, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radQRSize, SIGNAL(toggled( bool )), SLOT(qr_size())); + connect(radQRECC, SIGNAL(toggled( bool )), SLOT(qr_errorcorrect())); + connect(cmbQRSize, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(cmbQRECC, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(chkQRHIBC, SIGNAL(stateChanged( int )), SLOT(update_preview())); + connect(radMQRAuto, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radMQRSize, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radMQRECC, SIGNAL(clicked( bool )), SLOT(update_preview())); + connect(radMQRSize, SIGNAL(toggled( bool )), SLOT(mqr_size())); + connect(radMQRECC, SIGNAL(toggled( bool )), SLOT(mqr_errorcorrect())); + connect(cmbMQRSize, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(cmbMQRECC, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(cmbMaxiMode, SIGNAL(currentIndexChanged( int )), SLOT(update_preview())); + connect(cmbMaxiMode, SIGNAL(currentIndexChanged( int )), SLOT(maxi_primary())); + connect(txtMaxiPrimary, SIGNAL(textChanged( const QString& )), SLOT(update_preview())); } MainWindow::~MainWindow() @@ -79,67 +171,491 @@ MainWindow::~MainWindow() void MainWindow::on_fgcolor_clicked() { m_fgcolor=QColorDialog::getColor(m_fgcolor,this); - on_generate_clicked(); + update_preview(); } void MainWindow::on_bgcolor_clicked() { m_bgcolor=QColorDialog::getColor(m_bgcolor,this); - on_generate_clicked(); + update_preview(); } -void MainWindow::on_generate_clicked() +void MainWindow::change_options() +{ + bool options; + + options = false; + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CODE128) + { + options = true; + grpC128->show(); + chkComposite->setText(tr("Add 2D Component (GS1-128 only)")); + } else { + grpC128->hide(); + chkComposite->setText(tr("Add 2D Component")); + } + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_PDF417) + { + options = true; + grpPDF417->show(); + } else { + grpPDF417->hide(); + } + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_MICROPDF417) + { + options = true; + grpMicroPDF->show(); + } else { + grpMicroPDF->hide(); + } + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_AZTEC) + { + options = true; + grpAztec->show(); + } else { + grpAztec->hide(); + } + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_MSI_PLESSEY) + { + options = true; + grpMSICheck->show(); + } else { + grpMSICheck->hide(); + } + + if((metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CODE39) || + (metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_EXCODE39)) + { + options = true; + grpC39->show(); + } else { + grpC39->hide(); + } + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_EXCODE39) { + if(radC39HIBC->isChecked() == true) { + radC39HIBC->setChecked(false); + radC39Stand->setChecked(true); + } + radC39HIBC->setEnabled(false); + } else { + radC39HIBC->setEnabled(true); + } + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CODABLOCKF) + { + options = true; + grpCodablock->show(); + } else { + grpCodablock->hide(); + } + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CODE16K) + { + options = true; + grpC16k->show(); + } else { + grpC16k->hide(); + } + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_DATAMATRIX) + { + options = true; + datamatrix_options(); + grpDM->show(); + } else { + grpDM->hide(); + } + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_QRCODE) + { + options = true; + grpQR->show(); + } else { + grpQR->hide(); + } + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_MICROQR) + { + options = true; + grpMQR->show(); + } else { + grpMQR->hide(); + } + + if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_MAXICODE) + { + grpMaxiCode->show(); + } else { + grpMaxiCode->hide(); + } + + + if(options == true) { + lblNoOption->hide(); + } else { + lblNoOption->show(); + } + + switch(metaObject()->enumerator(0).value(bstyle->currentIndex())) + { + case BARCODE_CODE128: + case BARCODE_EANX: + case BARCODE_UPCA: + case BARCODE_UPCE: + case BARCODE_RSS14: + case BARCODE_RSS_LTD: + case BARCODE_RSS_EXP: + case BARCODE_RSS14STACK: + case BARCODE_RSS14STACK_OMNI: + case BARCODE_RSS_EXPSTACK: + grpComposite->show(); + break; + default: + chkComposite->setChecked(false); + grpComposite->hide(); + break; + } +} + +void MainWindow::composite_enable() +{ + if(chkComposite->isChecked() == true) { + lblCompType->setEnabled(true); + cmbCompType->setEnabled(true); + lblComposite->setEnabled(true); + txtComposite->setEnabled(true); + radC128EAN->setChecked(true); + } else { + lblCompType->setEnabled(false); + cmbCompType->setEnabled(false); + lblComposite->setEnabled(false); + txtComposite->setEnabled(false); + } +} + +void MainWindow::composite_ean_check() +{ + if(radC128EAN->isChecked() == false) { + chkComposite->setChecked(false); + } +} + +void MainWindow::aztec_size() +{ + if(radAztecSize->isChecked() == true) { + cmbAztecSize->setEnabled(true); + } else { + cmbAztecSize->setEnabled(false); + } +} + +void MainWindow::aztec_errorcorrect() +{ + if(radAztecECC->isChecked() == true) { + cmbAztecECC->setEnabled(true); + } else { + cmbAztecECC->setEnabled(false); + } +} + +void MainWindow::qr_size() +{ + if(radQRSize->isChecked() == true) { + cmbQRSize->setEnabled(true); + } else { + cmbQRSize->setEnabled(false); + } +} + +void MainWindow::mqr_errorcorrect() +{ + if(radMQRECC->isChecked() == true) { + cmbMQRECC->setEnabled(true); + } else { + cmbMQRECC->setEnabled(false); + } +} + +void MainWindow::mqr_size() +{ + if(radMQRSize->isChecked() == true) { + cmbMQRSize->setEnabled(true); + } else { + cmbMQRSize->setEnabled(false); + } +} + +void MainWindow::qr_errorcorrect() +{ + if(radQRECC->isChecked() == true) { + cmbQRECC->setEnabled(true); + } else { + cmbQRECC->setEnabled(false); + } +} + +void MainWindow::datamatrix_options() +{ + if(cmbDMMode->currentIndex() == 0) { + grpDMNon200->hide(); + grpDM200->show(); + } else { + grpDM200->hide(); + grpDMNon200->show(); + } +} + +void MainWindow::maxi_primary() +{ + if(cmbMaxiMode->currentIndex() == 0) { + lblMaxiPrimary->setEnabled(true); + txtMaxiPrimary->setEnabled(true); + } else { + lblMaxiPrimary->setEnabled(false); + txtMaxiPrimary->setEnabled(false); + } +} + +void MainWindow::update_preview() { QString error; - m_bc.w=iwidth->value(); - m_bc.h=iheight->value(); - m_bc.ar=(Zint::QZint::AspectRatioMode)aspectRatio->currentIndex(); - m_bc.bc.setText(text->toPlainText()); - m_bc.bc.setPrimaryMessage(primary->text()); - m_bc.bc.setSymbol(metaObject()->enumerator(0).value(bstyle->currentIndex())); - switch(m_bc.bc.symbol()) + m_bc.ar=(Zint::QZint::AspectRatioMode)1; + if(chkComposite->isChecked() == true) { + m_bc.bc.setPrimaryMessage(txtData->text()); + m_bc.bc.setText(txtComposite->toPlainText()); + } else { + m_bc.bc.setText(txtData->text()); + /*m_bc.bc.setPrimaryMessage(txtComposite->text());*/ + } + m_bc.bc.setSecurityLevel(0); + m_bc.bc.setWidth(0); + m_bc.bc.setInputMode(UNICODE_MODE); + switch(metaObject()->enumerator(0).value(bstyle->currentIndex())) { - case BARCODE_MSI_PLESSEY: - m_bc.bc.setMsiExtraSymbology(msiPlessey->currentIndex()); + case BARCODE_CODE128: + if(radC128Stand->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_CODE128); + } + if(radC128CSup->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_CODE128B); + } + if(radC128EAN->isChecked() == true) { + if(chkComposite->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_EAN128_CC); + } else { + m_bc.bc.setSymbol(BARCODE_EAN128); + } + } + if(radC128HIBC->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_HIBC_128); + } break; - case BARCODE_CODE39: - m_bc.bc.setCode39ExtraSymbology(code39->currentIndex()); + case BARCODE_EANX: + if(chkComposite->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_EANX_CC); + } else { + m_bc.bc.setSymbol(BARCODE_EANX); + } break; - case BARCODE_EXCODE39: - m_bc.bc.setExcode39ExtraSymbology(code39->currentIndex()); + case BARCODE_UPCA: + if(chkComposite->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_UPCA_CC); + } else { + m_bc.bc.setSymbol(BARCODE_UPCA); + } break; + case BARCODE_UPCE: + if(chkComposite->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_UPCE_CC); + } else { + m_bc.bc.setSymbol(BARCODE_UPCE); + } + break; + case BARCODE_RSS14: + if(chkComposite->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_RSS14_CC); + } else { + m_bc.bc.setSymbol(BARCODE_RSS14); + } + break; + case BARCODE_RSS_LTD: + if(chkComposite->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_RSS_LTD_CC); + } else { + m_bc.bc.setSymbol(BARCODE_RSS_LTD); + } + break; + case BARCODE_RSS_EXP: + if(chkComposite->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_RSS_EXP_CC); + } else { + m_bc.bc.setSymbol(BARCODE_RSS_EXP); + } + break; + case BARCODE_RSS14STACK: + if(chkComposite->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_RSS14STACK_CC); + } else { + m_bc.bc.setSymbol(BARCODE_RSS14STACK); + } + break; + case BARCODE_RSS14STACK_OMNI: + if(chkComposite->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_RSS14_OMNI_CC); + } else { + m_bc.bc.setSymbol(BARCODE_RSS14STACK_OMNI); + } + break; + case BARCODE_RSS_EXPSTACK: + if(chkComposite->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_RSS_EXPSTACK_CC); + } else { + m_bc.bc.setSymbol(BARCODE_RSS_EXPSTACK); + } + break; + case BARCODE_PDF417: + m_bc.bc.setWidth(cmbPDFCols->currentIndex()); + m_bc.bc.setSecurityLevel(cmbPDFECC->currentIndex() - 1); + m_bc.bc.setPdf417CodeWords(codewords->value()); + if(radPDFStand->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_PDF417); + } + if(radPDFTruncated->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_PDF417TRUNC); + } + if(radPDFHIBC->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_HIBC_PDF); + } + break; + case BARCODE_MICROPDF417: + m_bc.bc.setWidth(cmbMPDFCols->currentIndex()); + if(radMPDFStand->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_MICROPDF417); + } + if(radMPDFHIBC->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_HIBC_MICPDF); + } + break; + case BARCODE_AZTEC: + m_bc.bc.setSymbol(BARCODE_AZTEC); + if(radAztecSize->isChecked() == true) { + m_bc.bc.setWidth(cmbAztecSize->currentIndex() + 1); + } + if(radAztecECC->isChecked() == true) { + m_bc.bc.setSecurityLevel(cmbAztecECC->currentIndex() + 1); + } + if(chkAztecMode->isChecked() == true) { + m_bc.bc.setInputMode(GS1_MODE); + } + break; + case MSI_PLESSEY: + m_bc.bc.setSymbol(BARCODE_MSI_PLESSEY); + m_bc.bc.setWidth(cmbMSICheck->currentIndex()); + break; + case BARCODE_CODE39: + if(radC39HIBC->isChecked() == false) { + m_bc.bc.setSymbol(BARCODE_CODE39); + if(radC39Check->isChecked() == true) { + m_bc.bc.setWidth(1); + } + } else { + m_bc.bc.setSymbol(BARCODE_HIBC_39); + } + break; + case BARCODE_EXCODE39: + m_bc.bc.setSymbol(BARCODE_EXCODE39); + if(radC39Check->isChecked() == true) { + m_bc.bc.setWidth(1); + } + break; + case BARCODE_CODE16K: + m_bc.bc.setSymbol(BARCODE_CODE16K); + if(radC16kStand->isChecked() == true) { + m_bc.bc.setInputMode(UNICODE_MODE); + } else { + m_bc.bc.setInputMode(GS1_MODE); + } + break; + case BARCODE_CODABLOCKF: + if(radCodaGS1->isChecked() == true) { + m_bc.bc.setInputMode(GS1_MODE); + } + if(radCodaHIBC->isChecked() == false) { + m_bc.bc.setSymbol(BARCODE_CODABLOCKF); + } else { + m_bc.bc.setSymbol(BARCODE_HIBC_BLOCKF); + } + break; + case BARCODE_DATAMATRIX: + m_bc.bc.setSecurityLevel(cmbDMMode->currentIndex() + 1); + if(cmbDMMode->currentIndex() == 0) { + /* ECC 200 */ + if(radDM200HIBC->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_HIBC_DM); + } else { + m_bc.bc.setSymbol(BARCODE_DATAMATRIX); + } + if(radDM200GS1->isChecked() == true) { + m_bc.bc.setInputMode(GS1_MODE); + } + m_bc.bc.setWidth(cmbDM200Size->currentIndex()); + } else { + /* Not ECC 200 */ + m_bc.bc.setSymbol(BARCODE_DATAMATRIX); + m_bc.bc.setWidth(cmbDMNon200Size->currentIndex()); + } + break; + case BARCODE_QRCODE: + if(chkQRHIBC->isChecked() == true) { + m_bc.bc.setSymbol(BARCODE_HIBC_QR); + } else { + m_bc.bc.setSymbol(BARCODE_QRCODE); + } + if(radQRSize->isChecked() == true) { + m_bc.bc.setWidth(cmbQRSize->currentIndex() + 1); + } + if(radQRECC->isChecked() == true) { + m_bc.bc.setSecurityLevel(cmbQRECC->currentIndex() + 1); + } + break; + case BARCODE_MICROQR: + m_bc.bc.setSymbol(BARCODE_MICROQR); + if(radMQRSize->isChecked() == true) { + m_bc.bc.setWidth(cmbMQRSize->currentIndex() + 1); + } + if(radMQRECC->isChecked() == true) { + m_bc.bc.setSecurityLevel(cmbMQRECC->currentIndex() + 1); + } + break; + case BARCODE_MAXICODE: + m_bc.bc.setSymbol(BARCODE_MAXICODE); + if(cmbMaxiMode->currentIndex() == 0) { + m_bc.bc.setSecurityLevel(2); + m_bc.bc.setPrimaryMessage(txtMaxiPrimary->text()); + } else { + m_bc.bc.setSecurityLevel(cmbMaxiMode->currentIndex() + 3); + } + break; + default: + m_bc.bc.setSymbol(metaObject()->enumerator(0).value(bstyle->currentIndex())); + break; + } + if(chkComposite->isChecked() == true) { + m_bc.bc.setSecurityLevel(cmbCompType->currentIndex()); } m_bc.bc.setBorderType((Zint::QZint::BorderType)(btype->currentIndex()*2)); m_bc.bc.setBorderWidth(bwidth->value()); m_bc.bc.setHeight(heightb->value()); - m_bc.bc.setWidth(widthb->value()); - m_bc.bc.setSecurityLevel(security->value()); - m_bc.bc.setPdf417CodeWords(codewords->value()); m_bc.bc.setFgColor(m_fgcolor); m_bc.bc.setBgColor(m_bgcolor); m_bc.update(); view->scene()->update(); } -void MainWindow::on_zoomIn_clicked() -{ - view->scale(1.2,1.2); -} -void MainWindow::on_zoomOut_clicked() -{ - view->scale(0.9,0.9); -} - -void MainWindow::on_rotateAc_clicked() -{ - view->rotate(-5); -} -void MainWindow::on_rotateC_clicked() -{ - view->rotate(5); -} -void MainWindow::on_reset_clicked() -{ - view->resetTransform(); -} diff --git a/frontend_qt4/mainwindow.h b/frontend_qt4/mainwindow.h index 6435279e..f721840f 100644 --- a/frontend_qt4/mainwindow.h +++ b/frontend_qt4/mainwindow.h @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2008 by BogDan Vatra * - * bogdan@licentia.eu * + * Copyright (C) 2008 by BogDan Vatra * + * Copyright (C) 2009 by Robin Stuart * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -32,89 +32,64 @@ class MainWindow : public QWidget, private Ui::mainWindow public: enum BarcodeTypes { - CODE11 =1, - C25MATRIX =2, - C25INTER =3, - C25IATA =4, - C25LOGIC =6, - C25IND =7, - CODE39 =8, - EXCODE39 =9, - EANX =13, - EAN128 =16, - CODABAR =18, - CODE128 =20, - DPLEIT =21, - DPIDENT =22, - CODE16K =23, - CODE93 =25, - FLAT =28, - RSS14 =29, - RSS_LTD =30, - RSS_EXP =31, - TELEPEN =32, - UPCA =34, - UPCE =37, - POSTNET =40, - MSI_PLESSEY =47, - FIM =49, - LOGMARS =50, - PHARMA =51, - PZN =52, - PHARMA_TWO =53, - PDF417 =55, - PDF417TRUNC =56, - MAXICODE =57, - QRCODE =58, - CODE128B =60, AUSPOST =63, AUSREPLY =66, AUSROUTE =67, AUSREDIRECT =68, - ISBNX =69, - RM4SCC =70, - DATAMATRIX =71, - EAN14 =72, + AZTEC =92, + AZRUNE =128, + CODE11 =1, + CODE128 =20, + CODE16K =23, + C25LOGIC =6, + C25IATA =4, + C25IND =7, + C25INTER =3, + C25MATRIX =2, + CODE32 =129, + CODE39 =8, + EXCODE39 =9, + CODE93 =25, + CODABAR =18, CODABLOCKF =74, - NVE18 =75, - KOREAPOST =77, + RSS14 =29, + RSS_EXP =31, + RSS_EXPSTACK =81, + RSS_LTD =30, RSS14STACK =79, RSS14STACK_OMNI =80, - RSS_EXPSTACK =81, - PLANET =82, - MICROPDF417 =84, - ONECODE =85, - PLESSEY =86, - - /* Tbarcode 8 codes */ - TELEPEN_NUM =87, - ITF14 =89, + DATAMATRIX =71, + DPIDENT =22, + DPLEIT =21, KIX =90, - AZTEC =92, + EAN14 =72, + EANX =13, + FIM =49, + FLAT =28, + ITF14 =89, + ISBNX =69, + JAPANPOST =76, + KOREAPOST =77, + LOGMARS =50, + MAXICODE =57, + MICROPDF417 =84, MICROQR =97, - - /* Tbarcode 9 codes */ - HIBC_128 =98, - HIBC_39 =99, - HIBC_DM =102, - HIBC_QR =104, - HIBC_PDF =106, - HIBC_MICPDF =108, - HIBC_BLOCKF =110, - - /* Zint specific */ - AZRUNE =128, - CODE32 =129, - EANX_CC =130, - EAN128_CC =131, - RSS14_CC =132, - RSS_LTD_CC =133, - RSS_EXP_CC =134, - UPCA_CC =135, - UPCE_CC =136, - RSS14STACK_CC =137, - RSS14_OMNI_CC =138, - RSS_EXPSTACK_CC =139 + MSI_PLESSEY =47, + NVE18 =75, + PDF417 =55, + PHARMA =51, + PHARMA_TWO =53, + PZN =52, + PLANET =82, + POSTNET =40, + QRCODE =58, + RM4SCC =70, + TELEPEN =32, + TELEPEN_NUM =87, + PLESSEY =86, + UPCA =34, + UPCE =37, + ONECODE =85 }; public: @@ -122,14 +97,20 @@ public: ~MainWindow(); public slots: - void on_generate_clicked(); + void update_preview(); + void change_options(); void on_fgcolor_clicked(); void on_bgcolor_clicked(); - void on_zoomIn_clicked(); - void on_zoomOut_clicked(); - void on_rotateAc_clicked(); - void on_rotateC_clicked(); - void on_reset_clicked(); + void composite_enable(); + void composite_ean_check(); + void aztec_size(); + void aztec_errorcorrect(); + void datamatrix_options(); + void qr_size(); + void qr_errorcorrect(); + void mqr_size(); + void mqr_errorcorrect(); + void maxi_primary(); private: QColor m_fgcolor,m_bgcolor;