Expand GUI for sequencing and input from file

This commit is contained in:
hooper114 2009-09-17 08:01:49 +00:00
parent 467433f0d0
commit 0bce27959f
11 changed files with 1375 additions and 642 deletions

View File

@ -4,10 +4,10 @@ project(zint-qt)
include_directories(BEFORE "${CMAKE_SOURCE_DIR}/backend" "${CMAKE_SOURCE_DIR}/backend_qt4")
set(zint-qt_SRCS barcodeitem.cpp main.cpp mainwindow.cpp)
QT4_WRAP_CPP(zint-qt_SRCS mainwindow.h)
set(zint-qt_SRCS barcodeitem.cpp main.cpp mainwindow.cpp datawindow.cpp sequencewindow.cpp)
QT4_WRAP_CPP(zint-qt_SRCS mainwindow.h datawindow.h sequencewindow.h)
QT4_WRAP_UI(zint-qt_SRCS mainWindow.ui )
QT4_WRAP_UI(zint-qt_SRCS mainWindow.ui extData.ui extSequence.ui)
# grpAztec.ui grpC39.ui grpDM.ui grpMSICheck.ui
# grpC128.ui grpChannel.ui grpMicroPDF.ui grpPDF417.ui
# grpC16k.ui grpCodablock.ui grpMQR.ui grpQR.ui

View File

@ -0,0 +1,79 @@
#include <QDebug>
#include <QFileDialog>
#include <QUiLoader>
#include <QStringList>
#include "datawindow.h"
#include <stdio.h>
DataWindow::DataWindow()
{
setupUi(this);
connect(btnCancel, SIGNAL( clicked( bool )), SLOT(quit_now()));
connect(btnReset, SIGNAL( clicked( bool )), SLOT(clear_data()));
connect(btnOK, SIGNAL( clicked( bool )), SLOT(okay()));
}
DataWindow::DataWindow(QString input)
{
setupUi(this);
txtDataInput->setPlainText(input);
txtDataInput->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor);
connect(btnCancel, SIGNAL( clicked( bool )), SLOT(quit_now()));
connect(btnReset, SIGNAL( clicked( bool )), SLOT(clear_data()));
connect(btnOK, SIGNAL( clicked( bool )), SLOT(okay()));
connect(btnFromFile, SIGNAL( clicked( bool )), SLOT(from_file()));
}
DataWindow::~DataWindow()
{
}
void DataWindow::quit_now()
{
Valid = 0;
close();
}
void DataWindow::clear_data()
{
txtDataInput->clear();
}
void DataWindow::okay()
{
Valid = 1;
DataOutput = txtDataInput->toPlainText();
close();
}
void DataWindow::from_file()
{
QString fileName;
QFileDialog fdialog;
QFile file;
char *streamdata;
int streamlen;
QString utfstream;
fdialog.setFileMode(QFileDialog::ExistingFile);
if(fdialog.exec()) {
fileName = fdialog.selectedFiles().at(0);
} else {
return;
}
file.setFileName(fileName);
if(!file.open(QIODevice::ReadOnly)) {
return;
}
QDataStream input(&file);
streamlen = input.readRawData(streamdata, 7095);
utfstream = streamdata; /* FIXME: Does not take account of encoding scheme of input data */
txtDataInput->setPlainText(utfstream);
file.close();
}

24
frontend_qt4/datawindow.h Normal file
View File

@ -0,0 +1,24 @@
#ifndef DATAWINDOW_H
#define DATAWINDOW_H
#include "ui_extData.h"
class DataWindow : public QDialog, private Ui::DataDialog
{
Q_OBJECT
public:
DataWindow();
DataWindow(QString input);
~DataWindow();
int Valid;
QString DataOutput;
private slots:
void quit_now();
void clear_data();
void okay();
void from_file();
};
#endif

98
frontend_qt4/extData.ui Normal file
View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DataDialog</class>
<widget class="QDialog" name="DataDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Input Data</string>
</property>
<property name="modal">
<bool>true</bool>
</property>
<widget class="QPlainTextEdit" name="txtDataInput">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>381</width>
<height>221</height>
</rect>
</property>
</widget>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>250</y>
<width>381</width>
<height>41</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="btnFromFile">
<property name="text">
<string>From File...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnReset">
<property name="text">
<string>Reset</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnOK">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnCancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>0</y>
<width>56</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Data</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

173
frontend_qt4/extExport.ui Normal file
View File

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ExportDialog</class>
<widget class="QDialog" name="ExportDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>450</width>
<height>170</height>
</rect>
</property>
<property name="windowTitle">
<string>Export Barcodes</string>
</property>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>10</x>
<y>130</y>
<width>431</width>
<height>32</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<widget class="QLineEdit" name="linDestPath">
<property name="geometry">
<rect>
<x>140</x>
<y>10</y>
<width>261</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="linPrefix">
<property name="geometry">
<rect>
<x>140</x>
<y>40</y>
<width>301</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QComboBox" name="cmbFileName">
<property name="geometry">
<rect>
<x>140</x>
<y>70</y>
<width>301</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QComboBox" name="cmbFileFormat">
<property name="geometry">
<rect>
<x>140</x>
<y>100</y>
<width>301</width>
<height>22</height>
</rect>
</property>
</widget>
<widget class="QToolButton" name="btnDestPath">
<property name="geometry">
<rect>
<x>410</x>
<y>10</y>
<width>30</width>
<height>25</height>
</rect>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>121</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Destination Path:</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>File Name Prefix:</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>10</x>
<y>80</y>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>File Name:</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>10</x>
<y>110</y>
<width>111</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>File Format:</string>
</property>
</widget>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ExportDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ExportDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

269
frontend_qt4/extSequence.ui Normal file
View File

@ -0,0 +1,269 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SequenceDialog</class>
<widget class="QDialog" name="SequenceDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>530</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Sequence Export</string>
</property>
<property name="modal">
<bool>true</bool>
</property>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>261</width>
<height>241</height>
</rect>
</property>
<property name="title">
<string>Create Sequence</string>
</property>
<widget class="QPushButton" name="btnExport">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>140</x>
<y>200</y>
<width>111</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Export...</string>
</property>
</widget>
<widget class="QPushButton" name="btnCreate">
<property name="geometry">
<rect>
<x>140</x>
<y>140</y>
<width>111</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Create</string>
</property>
</widget>
<widget class="QLineEdit" name="linStartVal">
<property name="geometry">
<rect>
<x>140</x>
<y>20</y>
<width>111</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
<widget class="QSpinBox" name="spnIncrement">
<property name="geometry">
<rect>
<x>139</x>
<y>80</y>
<width>111</width>
<height>20</height>
</rect>
</property>
<property name="minimum">
<number>1</number>
</property>
</widget>
<widget class="QLineEdit" name="linFormat">
<property name="geometry">
<rect>
<x>140</x>
<y>110</y>
<width>111</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>$$$$$$</string>
</property>
</widget>
<widget class="QLineEdit" name="linEndVal">
<property name="geometry">
<rect>
<x>140</x>
<y>50</y>
<width>111</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>10</string>
</property>
</widget>
<widget class="QPushButton" name="btnImport">
<property name="geometry">
<rect>
<x>140</x>
<y>170</y>
<width>111</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Import...</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>151</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Start Value:</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>10</x>
<y>50</y>
<width>171</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>End Value:</string>
</property>
</widget>
<widget class="QLabel" name="lblIncrement">
<property name="geometry">
<rect>
<x>10</x>
<y>80</y>
<width>171</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Increment By:</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>10</x>
<y>110</y>
<width>171</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Format:</string>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>10</x>
<y>140</y>
<width>161</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Sequence:</string>
</property>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>10</x>
<y>170</y>
<width>161</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Sequence File:</string>
</property>
</widget>
<widget class="QLabel" name="label_7">
<property name="geometry">
<rect>
<x>10</x>
<y>200</y>
<width>161</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Generate Bar Codes:</string>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="groupBox_2">
<property name="geometry">
<rect>
<x>280</x>
<y>10</y>
<width>241</width>
<height>241</height>
</rect>
</property>
<property name="title">
<string>Sequence Preview</string>
</property>
<widget class="QPlainTextEdit" name="txtPreview">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>221</width>
<height>171</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="btnReset">
<property name="geometry">
<rect>
<x>150</x>
<y>200</y>
<width>80</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Reset</string>
</property>
</widget>
</widget>
<widget class="QPushButton" name="btnClose">
<property name="geometry">
<rect>
<x>440</x>
<y>260</y>
<width>80</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Close</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,66 +1,73 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>mainWindow</class>
<widget class="QWidget" name="mainWindow" >
<property name="geometry" >
<widget class="QWidget" name="mainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>749</width>
<height>747</height>
<height>650</height>
</rect>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>800</width>
<height>800</height>
</size>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>Zint Barcode Studio</string>
</property>
<property name="windowIcon" >
<iconset resource="resources.qrc" >
<property name="windowIcon">
<iconset resource="resources.qrc">
<normaloff>:/zico.png</normaloff>:/zico.png</iconset>
</property>
<property name="styleSheet" >
<string notr="true" >background-image: url(:/blueback.png);</string>
<property name="styleSheet">
<string notr="true">background-image: url(:/blueback.png);</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5" >
<item>
<widget class="QGroupBox" name="groupPreview" >
<property name="autoFillBackground" >
<widget class="QGroupBox" name="groupPreview">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>731</width>
<height>312</height>
</rect>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="title" >
<property name="title">
<string>Preview</string>
</property>
<layout class="QGridLayout" name="gridLayout_2" >
<item rowspan="3" row="0" column="0" colspan="3" >
<widget class="QGraphicsView" name="view" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>300</height>
</size>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" rowspan="3" colspan="3">
<widget class="QGraphicsView" name="view">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="autoFillBackground" >
<property name="autoFillBackground">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="3" >
<widget class="QToolButton" name="toolButton_5" >
<property name="toolTip" >
<item row="0" column="3">
<widget class="QToolButton" name="toolButton_5">
<property name="toolTip">
<string>Zoom out</string>
</property>
<property name="text" >
<property name="text">
<string>...</string>
</property>
<property name="icon" >
<iconset resource="resources.qrc" >
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/zoomout.png</normaloff>:/zoomout.png</iconset>
</property>
<property name="iconSize" >
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
@ -68,41 +75,41 @@
</property>
</widget>
</item>
<item row="1" column="3" >
<widget class="QSlider" name="scaleSlider" >
<property name="toolTip" >
<item row="1" column="3">
<widget class="QSlider" name="scaleSlider">
<property name="toolTip">
<string>Adjust zoom</string>
</property>
<property name="minimum" >
<property name="minimum">
<number>50</number>
</property>
<property name="maximum" >
<property name="maximum">
<number>400</number>
</property>
<property name="value" >
<property name="value">
<number>100</number>
</property>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="invertedAppearance" >
<property name="invertedAppearance">
<bool>true</bool>
</property>
<property name="invertedControls" >
<property name="invertedControls">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="3" >
<widget class="QToolButton" name="toolButton_4" >
<property name="toolTip" >
<item row="2" column="3">
<widget class="QToolButton" name="toolButton_4">
<property name="toolTip">
<string>Zoom in</string>
</property>
<property name="icon" >
<iconset resource="resources.qrc" >
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/zoomin.png</normaloff>:/zoomin.png</iconset>
</property>
<property name="iconSize" >
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
@ -110,16 +117,16 @@
</property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QToolButton" name="toolButton" >
<property name="toolTip" >
<item row="4" column="0">
<widget class="QToolButton" name="toolButton">
<property name="toolTip">
<string>Rotate anti-clockwise</string>
</property>
<property name="icon" >
<iconset resource="resources.qrc" >
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/rotateleft.png</normaloff>:/rotateleft.png</iconset>
</property>
<property name="iconSize" >
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
@ -127,29 +134,29 @@
</property>
</widget>
</item>
<item row="4" column="1" >
<widget class="QSlider" name="rotateSlider" >
<property name="toolTip" >
<item row="4" column="1">
<widget class="QSlider" name="rotateSlider">
<property name="toolTip">
<string>Adjust Rotation</string>
</property>
<property name="maximum" >
<property name="maximum">
<number>360</number>
</property>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="4" column="2" >
<widget class="QToolButton" name="toolButton_2" >
<property name="toolTip" >
<item row="4" column="2">
<widget class="QToolButton" name="toolButton_2">
<property name="toolTip">
<string>Rotate clockwise</string>
</property>
<property name="icon" >
<iconset resource="resources.qrc" >
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/rotateright.png</normaloff>:/rotateright.png</iconset>
</property>
<property name="iconSize" >
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
@ -159,31 +166,45 @@
</item>
</layout>
</widget>
</item>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>340</y>
<width>731</width>
<height>299</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5" >
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="lblSymbology" >
<property name="text" >
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="lblSymbology">
<property name="text">
<string>S&amp;ymbology:</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy" >
<property name="buddy">
<cstring>bstyle</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="bstyle" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<widget class="QComboBox" name="bstyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<property name="toolTip">
<string>Select type of barcode to generate.</string>
</property>
</widget>
@ -191,111 +212,110 @@
</layout>
</item>
<item>
<widget class="QTabWidget" name="tabMain" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<widget class="QTabWidget" name="tabMain">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>16777215</width>
<height>350</height>
</size>
</property>
<property name="autoFillBackground" >
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet" >
<string notr="true" />
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="currentIndex" >
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabGeneral" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>727</width>
<height>243</height>
</rect>
</property>
<attribute name="title" >
<widget class="QWidget" name="tabGeneral">
<attribute name="title">
<string>General</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3" >
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="grpData" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<widget class="QGroupBox" name="grpData">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<property name="title">
<string>&amp;Data to Encode</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4" >
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLineEdit" name="txtData" >
<property name="toolTip" >
<widget class="QLineEdit" name="txtData">
<property name="toolTip">
<string>Enter data to be encoded.</string>
</property>
<property name="text" >
<property name="text">
<string>Your Data Here!</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnMoreData">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="grpComposite" >
<property name="enabled" >
<widget class="QGroupBox" name="grpComposite">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>16777215</width>
<height>400</height>
</size>
</property>
<property name="title" >
<property name="title">
<string>Composite Code</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="chkComposite" >
<property name="toolTip" >
<widget class="QCheckBox" name="chkComposite">
<property name="toolTip">
<string>Create a composite symbol.</string>
</property>
<property name="text" >
<property name="text">
<string>Add &amp;2D Component</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer" >
<property name="orientation" >
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@ -304,40 +324,40 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="lblCompType" >
<property name="enabled" >
<widget class="QLabel" name="lblCompType">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text" >
<property name="text">
<string>Component &amp;Type:</string>
</property>
<property name="buddy" >
<property name="buddy">
<cstring>cmbCompType</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cmbCompType" >
<property name="enabled" >
<widget class="QComboBox" name="cmbCompType">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text" >
<property name="text">
<string>Automatic</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>CC-A</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>CC-B</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>CC-C</string>
</property>
</item>
@ -346,48 +366,48 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout" >
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="lblComposite" >
<property name="enabled" >
<widget class="QLabel" name="lblComposite">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text" >
<property name="text">
<string>2D Component Data:</string>
</property>
<property name="buddy" >
<property name="buddy">
<cstring>txtComposite</cstring>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="txtComposite" >
<property name="enabled" >
<widget class="QTextEdit" name="txtComposite">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>16777215</width>
<height>60</height>
</size>
</property>
<property name="toolTip" >
<property name="toolTip">
<string/>
</property>
<property name="html" >
<string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:9pt;">&lt;span style=" font-family:'Sans Serif';">Your Data Here!&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Sans Serif';&quot;&gt;Your Data Here!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="acceptRichText" >
<property name="acceptRichText">
<bool>false</bool>
</property>
</widget>
@ -399,144 +419,136 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="tabAppear" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>727</width>
<height>243</height>
</rect>
</property>
<attribute name="title" >
<widget class="QWidget" name="tabAppear">
<attribute name="title">
<string>Appearance</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4" >
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6" >
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<layout class="QGridLayout" name="gridLayout_3" >
<item row="0" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>&amp;Height:</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy" >
<property name="buddy">
<cstring>heightb</cstring>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_8" >
<property name="text" >
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>B&amp;order Width:</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy" >
<property name="buddy">
<cstring>bwidth</cstring>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QSpinBox" name="bwidth" >
<property name="toolTip" >
<item row="1" column="1">
<widget class="QSpinBox" name="bwidth">
<property name="toolTip">
<string>Adjust width of boundary bars or border.</string>
</property>
<property name="suffix" >
<property name="suffix">
<string> X</string>
</property>
<property name="minimum" >
<property name="minimum">
<number>0</number>
</property>
<property name="maximum" >
<property name="maximum">
<number>16</number>
</property>
<property name="value" >
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="lblWhitespace" >
<property name="text" >
<item row="2" column="0">
<widget class="QLabel" name="lblWhitespace">
<property name="text">
<string>&amp;Whitespace:</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy" >
<property name="buddy">
<cstring>spnWhitespace</cstring>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QSpinBox" name="spnWhitespace" >
<property name="toolTip" >
<item row="2" column="1">
<widget class="QSpinBox" name="spnWhitespace">
<property name="toolTip">
<string>Adjust whitespace to left and right of barcode.</string>
</property>
<property name="suffix" >
<property name="suffix">
<string> X</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QLabel" name="lblScale" >
<property name="text" >
<item row="3" column="0">
<widget class="QLabel" name="lblScale">
<property name="text">
<string>&amp;Printing Scale:</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy" >
<property name="buddy">
<cstring>spnScale</cstring>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QDoubleSpinBox" name="spnScale" >
<property name="toolTip" >
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="spnScale">
<property name="toolTip">
<string>Adjust image size when output to file.</string>
</property>
<property name="suffix" >
<property name="suffix">
<string/>
</property>
<property name="decimals" >
<property name="decimals">
<number>2</number>
</property>
<property name="minimum" >
<property name="minimum">
<double>0.500000000000000</double>
</property>
<property name="maximum" >
<property name="maximum">
<double>99.500000000000000</double>
</property>
<property name="singleStep" >
<property name="singleStep">
<double>0.500000000000000</double>
</property>
<property name="value" >
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QSpinBox" name="heightb" >
<property name="toolTip" >
<item row="0" column="1">
<widget class="QSpinBox" name="heightb">
<property name="toolTip">
<string>Adjust overall symbol height.</string>
</property>
<property name="suffix" >
<property name="suffix">
<string> X</string>
</property>
<property name="prefix" >
<property name="prefix">
<string/>
</property>
<property name="maximum" >
<property name="maximum">
<number>300</number>
</property>
<property name="value" >
<property name="value">
<number>50</number>
</property>
</widget>
@ -544,52 +556,52 @@ p, li { white-space: pre-wrap; }
</layout>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_4" >
<item row="0" column="0" >
<widget class="QLabel" name="label_9" >
<property name="text" >
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Border Ty&amp;pe:</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy" >
<property name="buddy">
<cstring>btype</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QComboBox" name="btype" >
<item row="0" column="1">
<widget class="QComboBox" name="btype">
<item>
<property name="text" >
<property name="text">
<string>No border</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Bind</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Box</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0" colspan="2" >
<widget class="QPushButton" name="bgcolor" >
<property name="toolTip" >
<item row="1" column="0" colspan="2">
<widget class="QPushButton" name="bgcolor">
<property name="toolTip">
<string/>
</property>
<property name="text" >
<property name="text">
<string>&amp;Backgound Colour</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2" >
<widget class="QPushButton" name="fgcolor" >
<property name="text" >
<item row="2" column="0" colspan="2">
<widget class="QPushButton" name="fgcolor">
<property name="text">
<string>&amp;Foreground Colour</string>
</property>
</widget>
@ -599,11 +611,11 @@ p, li { white-space: pre-wrap; }
</layout>
</item>
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>228</height>
@ -615,51 +627,60 @@ p, li { white-space: pre-wrap; }
</widget>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QPushButton" name="btnAbout" >
<property name="text" >
<widget class="QPushButton" name="btnAbout">
<property name="text">
<string>&amp;About Zint</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnReset" >
<property name="toolTip" >
<widget class="QPushButton" name="btnReset">
<property name="toolTip">
<string>Reset zoom, rotation and colour.</string>
</property>
<property name="text" >
<property name="text">
<string>&amp;Reset Preview</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>288</width>
<height>20</height>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnSave" >
<property name="toolTip" >
<widget class="QPushButton" name="btnSequence">
<property name="text">
<string>Se&amp;quence</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnSave">
<property name="toolTip">
<string>Save barcode image to file.</string>
</property>
<property name="text" >
<property name="text">
<string>&amp;Save</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnExit" >
<property name="text" >
<widget class="QPushButton" name="btnExit">
<property name="text">
<string>E&amp;xit</string>
</property>
</widget>
@ -668,8 +689,8 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
</widget>
<tabstops>
<tabstop>bstyle</tabstop>
<tabstop>tabMain</tabstop>
<tabstop>txtData</tabstop>
<tabstop>chkComposite</tabstop>
@ -695,7 +716,7 @@ p, li { white-space: pre-wrap; }
<tabstop>toolButton_2</tabstop>
</tabstops>
<resources>
<include location="resources.qrc" />
<include location="resources.qrc"/>
</resources>
<connections>
<connection>
@ -704,11 +725,11 @@ p, li { white-space: pre-wrap; }
<receiver>rotateSlider</receiver>
<slot>subtractStep()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>29</x>
<y>265</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>76</x>
<y>265</y>
</hint>
@ -720,11 +741,11 @@ p, li { white-space: pre-wrap; }
<receiver>rotateSlider</receiver>
<slot>addStep()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>491</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>431</x>
<y>260</y>
</hint>
@ -736,11 +757,11 @@ p, li { white-space: pre-wrap; }
<receiver>scaleSlider</receiver>
<slot>addStep()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>532</x>
<y>231</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>528</x>
<y>191</y>
</hint>
@ -752,11 +773,11 @@ p, li { white-space: pre-wrap; }
<receiver>scaleSlider</receiver>
<slot>subtractStep()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>530</x>
<y>56</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>530</x>
<y>94</y>
</hint>

View File

@ -22,6 +22,8 @@
#include <QFile>
#include "mainwindow.h"
#include "datawindow.h"
#include "sequencewindow.h"
#include <stdio.h>
MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl)
@ -126,6 +128,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags fl)
connect(spnScale, SIGNAL(valueChanged( double )), SLOT(change_print_scale()));
connect(btnExit, SIGNAL(clicked( bool )), SLOT(quit_now()));
connect(btnReset, SIGNAL(clicked( bool )), SLOT(reset_view()));
connect(btnMoreData, SIGNAL(clicked( bool )), SLOT(open_data_dialog()));
connect(btnSequence, SIGNAL(clicked( bool )), SLOT(open_sequence_dialog()));
}
MainWindow::~MainWindow()
@ -181,6 +185,22 @@ void MainWindow::about()
));
}
int MainWindow::open_data_dialog()
{
int retval;
DataWindow dlg(txtData->text());
retval = dlg.exec();
if (dlg.Valid == 1)
txtData->setText(dlg.DataOutput);
return retval;
}
int MainWindow::open_sequence_dialog()
{
SequenceWindow dlg;
return dlg.exec();
}
void MainWindow::on_fgcolor_clicked()
{
m_fgcolor=QColorDialog::getColor(m_fgcolor,this);

View File

@ -123,6 +123,8 @@ private slots:
void about();
void quit_now();
void reset_view();
int open_data_dialog();
int open_sequence_dialog();
private:
/* void createActions();

View File

@ -0,0 +1,28 @@
#include <QDebug>
#include <QFile>
#include <QUiLoader>
#include "sequencewindow.h"
#include <stdio.h>
SequenceWindow::SequenceWindow()
{
setupUi(this);
connect(btnClose, SIGNAL( clicked( bool )), SLOT(quit_now()));
connect(btnReset, SIGNAL( clicked( bool )), SLOT(reset_preview()));
}
SequenceWindow::~SequenceWindow()
{
}
void SequenceWindow::quit_now()
{
close();
}
void SequenceWindow::reset_preview()
{
txtPreview->clear();
}

View File

@ -0,0 +1,19 @@
#ifndef SEQUENCEWINDOW_H
#define SEQUENCEWINDOW_H
#include "ui_extSequence.h"
class SequenceWindow : public QDialog, private Ui::SequenceDialog
{
Q_OBJECT
public:
SequenceWindow();
~SequenceWindow();
private slots:
void quit_now();
void reset_preview();
};
#endif