Add Channel Code

This commit is contained in:
hooper114
2009-05-16 14:19:43 +00:00
parent cd614f42f7
commit 0e560805b4
8 changed files with 232 additions and 17 deletions

View File

@ -2227,6 +2227,77 @@ p, li { white-space: pre-wrap; }
</item>
</widget>
</widget>
<widget class="QGroupBox" name="grpChannel" >
<property name="geometry" >
<rect>
<x>160</x>
<y>70</y>
<width>235</width>
<height>44</height>
</rect>
</property>
<property name="title" >
<string>Channel Code</string>
</property>
<widget class="QComboBox" name="cmbChannel" >
<property name="geometry" >
<rect>
<x>134</x>
<y>15</y>
<width>87</width>
<height>22</height>
</rect>
</property>
<item>
<property name="text" >
<string>Automatic</string>
</property>
</item>
<item>
<property name="text" >
<string>3</string>
</property>
</item>
<item>
<property name="text" >
<string>4</string>
</property>
</item>
<item>
<property name="text" >
<string>5</string>
</property>
</item>
<item>
<property name="text" >
<string>6</string>
</property>
</item>
<item>
<property name="text" >
<string>7</string>
</property>
</item>
<item>
<property name="text" >
<string>8</string>
</property>
</item>
</widget>
<widget class="QLabel" name="lblChannel" >
<property name="geometry" >
<rect>
<x>7</x>
<y>20</y>
<width>118</width>
<height>16</height>
</rect>
</property>
<property name="text" >
<string>Number of Channels:</string>
</property>
</widget>
</widget>
</widget>
<widget class="QWidget" name="tabAppear" >
<property name="geometry" >

View File

@ -33,6 +33,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl)
"Australia Post Redirect Code",
"Aztec Code",
"Aztec Runes",
"Channel Code",
"Code 11",
"Code 128",
"Code 16k",
@ -95,7 +96,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl)
bstyle->addItem(metaObject()->enumerator(0).key(i));
bstyle->setItemText(i,bstyle_text[i]);
}
bstyle->setCurrentIndex(7);
bstyle->setCurrentIndex(8);
change_options();
update_preview();
view->scene()->addItem(&m_bc);
@ -164,6 +165,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl)
connect(cmbMaxiMode, SIGNAL(currentIndexChanged( int )), SLOT(maxi_primary()));
connect(txtMaxiPrimary, SIGNAL(textChanged( const QString& )), SLOT(update_preview()));
connect(spnWhitespace, SIGNAL(valueChanged( int )), SLOT(update_preview()));
connect(cmbChannel, SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
}
MainWindow::~MainWindow()
@ -296,6 +298,14 @@ void MainWindow::change_options()
} else {
grpMaxiCode->hide();
}
if(metaObject()->enumerator(0).value(bstyle->currentIndex()) == BARCODE_CHANNEL)
{
options = true;
grpChannel->show();
} else {
grpChannel->hide();
}
if(options == true) {
@ -644,6 +654,14 @@ void MainWindow::update_preview()
m_bc.bc.setSecurityLevel(cmbMaxiMode->currentIndex() + 3);
}
break;
case BARCODE_CHANNEL:
m_bc.bc.setSymbol(BARCODE_CHANNEL);
if(cmbChannel->currentIndex() == 0) {
m_bc.bc.setWidth(0);
} else {
m_bc.bc.setWidth(cmbChannel->currentIndex() + 2);
}
break;
default:
m_bc.bc.setSymbol(metaObject()->enumerator(0).value(bstyle->currentIndex()));
break;

View File

@ -38,6 +38,7 @@ public:
AUSREDIRECT =68,
AZTEC =92,
AZRUNE =128,
CHANNEL =140,
CODE11 =1,
CODE128 =20,
CODE16K =23,